1
1

Compare commits

...

5152 Commits

Author SHA1 Message Date
a5b4b0f21c Merge branch '28' into custom-manipulators 2017-10-09 20:49:27 +11:00
abcda06934 Eevee: Fix bad defines for volumetric shadowing 2017-10-08 18:23:45 +02:00
f7db1a4366 Gawain: Make common uniforms become builtins
This improves eevee's cache performance by 13% in my test.
2017-10-08 15:49:25 +02:00
adfbf276a1 Cleanup: style, duplicate includes 2017-10-07 15:57:14 +11:00
37b457221e Cleanup: remove Py3.5 compatible code 2017-10-07 15:14:36 +11:00
Dalai Felinto
8a1d787b89 Initial fix for T53014: Cycles material preview no light
This was introduced on 9ad2c0b615.

Although this still doesn't fix the issue, it updates the preview
system to use COLLECTION_DISABLED as intended.

What is missing now is for the flushing to work effectively.
2017-10-06 18:55:48 -03:00
dfcdec914c Eevee: Shadows: Add Contact Shadows
This add the possibility to add screen space raytraced shadows to fix light leaking cause by shadows maps.

Theses inherit of the same artifacts as other screenspace methods.
2017-10-06 23:44:22 +02:00
9ab18d14f6 Eevee: Modify the raycast function to be more flexible.
Make quality a parameter, and modify the ray end to be premultiplied so that the raytrace is done on a range.

This is in order to add contact shadows.
2017-10-06 23:44:22 +02:00
Dalai Felinto
321f773ca6 Merge remote-tracking branch 'origin/master' into blender2.8 2017-10-06 13:09:24 -03:00
83ce02879f Cycles: Fix possible race condition when generating Beckmann table
Two issues here:

- Checking table size to be non-zero is not a proper way to go here. This is
  because we first resize the table and then fill it in. So it was possible that
  non-initialized table was used.

  Trickery with using temporary memory and then doing table.swap() might work,
  but we can not guarantee that table size will be set after the data pointer.

- Mutex guard was useless, because every thread was using own mutex. Need to
  make mutex guard static so all threads are using same mutex.
2017-10-06 21:06:15 +05:00
Julian Eisel
b0ecd2eaaa Fix crash when deleting workspace active in multiple windows 2017-10-06 18:02:15 +02:00
Dalai Felinto
5ec270c20c Merge remote-tracking branch 'origin/master' into blender2.8 2017-10-06 12:21:57 -03:00
837383ac78 Cycles: Cleanup, indendation 2017-10-06 19:33:59 +05:00
a4a5637d7a Gawain: Reduce shader interface bucket size
Tried 101 but it gives colisions.
I think 257 is enough now that we dont have thousands of uniforms.
This gives some noticeable performance improvement.
Could be refined further.
2017-10-06 16:25:50 +02:00
f94f141f24 Gawain: Add UBOs to shader interface. 2017-10-06 16:25:50 +02:00
a950af8e24 Fix T53012: Shadow catcher creates artifacts on contact area
The issue was caused by light sample being evaluated to nan at some point.
This is root of the cause which is to be fixed, but is very hard to trace down
especially via ssh (the issue only happens on AVX2 release build). Will give it
a closer look when back to my AVX2 machine.

For until then this is a good check to have anyway, it corresponds to what's
happening in regular radiance sum.
2017-10-06 17:27:34 +05:00
0d3c8d0701 Cycles: Cleanup, indentation and wrapping 2017-10-06 16:54:37 +05:00
ea606a7847 Merge branch 'master' into blender28 2017-10-06 21:25:33 +11:00
3df139c530 Cleanup: Math lib naming (use v3 suffix) 2017-10-06 21:06:38 +11:00
70aa33f069 Sequencer: Cleanup, use more BLI utilities where possible 2017-10-06 15:00:22 +05:00
00eac066f3 Sequencer: Use BLI math functions where possible 2017-10-06 14:36:41 +05:00
d56f835bff Sequencer: Avoid re-calculation index offset multiple times 2017-10-06 14:36:41 +05:00
5bbe818aeb Sequencer: Use funciton instead of macr oto avoid argument re-evaluation 2017-10-06 14:36:41 +05:00
c756787694 Fix T52940: VSE Glow Effect Strip on transparent images has no blur 2017-10-06 14:36:41 +05:00
55b7adb9e5 Error in falloff_angle range in last commit 2017-10-06 20:20:15 +11:00
471be7e7f5 Vertex Paint: move normal falloff into the brush
All related settings are already in the brush,
so it's inconvenient to switch panels to change this one option.
2017-10-06 20:15:28 +11:00
6c43490616 Vertex Paint: use view normal w/ 2D falloff
When projecting to the view, cull faces pointing
away from the view normal.
2017-10-06 19:10:33 +11:00
8ef757df3d Vertex Paint: use brush front-face setting
Follow sculpt mode more closely by using the brush front-face option.
2017-10-06 18:57:37 +11:00
082987ec74 Sculpt: use tube falloff when calculating normals
Also apply 2D clamping for other tools when the option is set.
2017-10-06 18:34:05 +11:00
3282218983 Sculpt: clamp normal to plane w/ projected falloff
Allows for editing outlines w/o pushing geometry towards/away from
the view.
2017-10-06 17:38:56 +11:00
327bb6e543 Fix ruler access from search pop-up
D2831 by @1xundoredo
2017-10-06 17:13:44 +11:00
c454d816a9 Cleanup: style 2017-10-06 16:56:41 +11:00
d7d32ad452 Gawain: Simplify / optimize the shader interface.
This changes quite a few things:
- Drops the allocation of inputs as a chunk.
- Merge the linked list system into the Gwn_ShaderInput.
- Put name buffer into another memory block, easily resizable.
- Use offset instead of char* to direct to input name.
- Add only requested uniforms dynamicaly to the Shader Interface.

This drops some minor optimisation and use a bit more memory for small shaders (which are fixed count).
But this saves a lot of memory when using UBOs because the names and the Gwn_ShaderInput were alloc'ed for every UBO variable.
This also reduce the Shader Interface initial generation.
The lookup time is left unchanged.
2017-10-06 01:50:51 +02:00
9ab3db11c7 Revert "Gawain: Optimize out extra level on top of ShaderInput"
This reverts commit 5514d2df1c.
2017-10-06 01:50:16 +02:00
c82efd3276 Fix T52514: don't clear filename when dropping directory path in file browser. 2017-10-06 00:18:57 +02:00
64f8cc3e7d Fix T52998: disabled menu entries responding to key shortcuts. 2017-10-05 19:12:05 +02:00
63482a5f2e Fix T53002: Batch-Generate Previews generate empty or none image for large objects.
Camera clipping was left to default values, which won't work well for
very large (or small) objects. Now recompute valid clipping start/end
based on boundingbox of rendered data, and final location of camera.
2017-10-05 18:13:30 +02:00
4537e85584 Fix T53001: more workarounds for crash in AMD compiler with recent drivers. 2017-10-05 17:57:58 +02:00
fb99ea79f8 Code refactor: split displace/background into separate kernels, remove luma. 2017-10-05 17:57:58 +02:00
d8509b349d Sculpt Mode: 2D falloff option
This makes brush influence into a tube instead of a sphere.
It can be used along the outline of a mesh to adjust it's silhouette.

Note that all this takes advantage of changes from vertex paint,
from testing this seems useful so exposing from the brush options.
2017-10-06 01:20:31 +11:00
5514d2df1c Gawain: Optimize out extra level on top of ShaderInput
This is an internal structure, and we don't put it to a list for anything else
that hash collision resolution. No need to have dedicated entry here, saves us
from extra allocation and pointer dereference.
2017-10-05 18:38:23 +05:00
e1e452c062 Draw manager: Avoid unneeded memory malloc/free when attempting to create missing uniform 2017-10-05 17:16:37 +05:00
0b5bdc4265 Gawain: Make builtin uniform lookup to be O(1) 2017-10-05 16:19:14 +05:00
bb9b8b13e5 Gawain: Lookup uniforms and attributes from buckets
This way we reduce number of loops from look-over-all-inputs to
loop-over-collision, which is expected to be much less CPU ticks.

There is still possible optimization: use memory pool of some sort
to manage memory needed for hash entries, but that will only speedup
shader interface construction / deconstruction time.

There are also some trickery happening to speed up process even more
in the case there is no hash collisions detected when constructing
shader interface.
2017-10-05 15:46:15 +05:00
bda3e14f05 Gawain: Force hashing function to be inlined
Makes sure we don't waste CPU ticks on function call in such a time critical
area.
2017-10-05 15:46:15 +05:00
56a07ba706 Vertex Paint: apply when cursor isn't over faces
This behavior makes more sense for sculpt, less so for painting.
Restores non PBVH behavior, adding `BKE_pbvh_find_nearest_to_ray` -
similar to ray-cast except it finds the closest point on the surface.
2017-10-05 21:21:01 +11:00
0badb6c804 Cleanup: rename dist -> depth
Prepare to add code that stores distance to the ray, avoid confusion.
2017-10-05 21:09:12 +11:00
21d91de8e7 Cleanup: remove unused struct member
Merged with soc-2016-pbvh-painting, no longer needed.
2017-10-05 17:52:05 +11:00
82d6a30015 Disable cursor drawing while navigating
Was performing ray-casts in sculpt mode on every update.
2017-10-05 17:35:46 +11:00
775c773cf4 Fix sculpt secondary color missing some brushes
D2841 by @uvwxyz w/ edits
2017-10-05 12:59:22 +11:00
3c67efbbc5 Cleanup: use bool for brush checks 2017-10-05 12:59:18 +11:00
974053f7e9 Fix brush reset (missing notifier)
D2843 by @uvwxyz
2017-10-05 12:32:24 +11:00
57a93b4678 CMake: use restrict w/ gcc, not clang 2017-10-05 12:10:34 +11:00
96477be3b6 PyAPI: fast keyword parsing for bpy modules
No functional changes.
2017-10-05 10:52:18 +11:00
7cc952ac5d CMake: add -Wrestrict for GCC 2017-10-05 10:50:51 +11:00
d27ca066e7 Fix passing the same argument twice to BLI_strncpy 2017-10-05 10:50:51 +11:00
ffb190244c Fix setting the operator name in Py operator API 2017-10-05 10:50:51 +11:00
49199963bf Fix incorrect CUDA remaining time estimate after previous commit. 2017-10-04 23:25:51 +02:00
6da6f8d33f Cycles: CUDA faster rendering of small tiles, using multiple samples like OpenCL.
The work size is still very conservative, and this doesn't help for progressive
refine. For that we will need to render multiple tiles at the same time. But this
should already help for denoising renders that require too much memory with big
tiles, and just generally soften the performance dropoff with small tiles.

Differential Revision: https://developer.blender.org/D2856
2017-10-04 21:58:47 +02:00
31820d0109 Eevee : Fix T52991 2017-10-04 21:31:47 +02:00
77f300e2a9 Fix use of uninitialized memory in Cycles normal baking. 2017-10-04 21:11:14 +02:00
5bb677e592 Code refactor: zero render buffers outside of kernel.
This was originally done with the first sample in the kernel for better
performance, but it doesn't work anymore with atomics. Any benefit was
very minor anyway, too small to measure it seems.
2017-10-04 21:11:14 +02:00
12f4538205 Code refactor: use split variance calculation for mega kernels too.
There is no significant difference in denoised benchmark scenes and
denoising ctests, so might as well make it all consistent.
2017-10-04 21:11:14 +02:00
e3e16cecc4 Code refactor: remove rng_state buffer and compute hash on the fly.
A little faster on some benchmark scenes, a little slower on others, seems
about performance neutral on average and saves a little memory.
2017-10-04 21:11:14 +02:00
5b7d6ea54b Code refactor: add WorkTile struct for passing work to kernel.
This makes sharing some code between mega/split in following commits a bit
easier, and also paves the way for rendering multiple tiles later.
2017-10-04 21:11:14 +02:00
660e8e59e7 Fix T52645, T52645: AMD OpenCL compiler crash with recent drivers.
Work around the bug by reshuffling code.
2017-10-04 21:00:46 +02:00
754f5d39c5 installdeps: Fix building numpy with newer py system...
Many thanks to Jens Verwiebe for investigating and finding this fix.
2017-10-04 20:16:39 +02:00
57d7e5b6ee Fix T42489 and T52936: Loading blend with minimized window results in crash or empty screen on windows.
Reviewed By: @brecht , @sergey

Differential Revision: http://developer.blender.org/D2866
2017-10-04 11:44:22 -06:00
63c472b4f9 Merge branch 'master' into blender2.8 2017-10-04 22:18:05 +05:00
296757804c Fix error copying smoke modifier uv layer 2017-10-05 02:44:02 +11:00
9609828000 Tssst, we use USA english, not Oxford one... :P 2017-10-04 12:42:33 +02:00
a22af1a84b Fix i18n messages extraction script, and a few more UI messages... 2017-10-04 12:39:06 +02:00
b22b2c783d Fix T52982: Join operator with context override crashes Blender 2.79 2017-10-04 15:00:05 +05:00
d1dfed206b Fix T52923: Circle diameter is in fact radius 2017-10-04 18:01:53 +11:00
08f728a3e9 Cleanup: redundant casts 2017-10-04 16:52:55 +11:00
d3f0fa1277 Docs: remove outdated PyAPI guide 2017-10-04 15:57:43 +11:00
92272f56e6 PyAPI: fast keyword parsing for __import__
No functional changes.
2017-10-04 15:54:41 +11:00
728cffa9ce PyAPI: fast keyword parsing for bpy.props
No functional changes.
2017-10-04 15:13:52 +11:00
ad22d29dac Some UI/messages fixes. 2017-10-03 21:32:46 +02:00
9422db7796 Eevee: Some changes to the Render / Render layers settings panel.
- Separate the Post Processes settings into sub panel.
- Rename "Viewport Anti-Aliasing" to sampling & super-sampling as it also reduce the noise of other effects.
- Remove Temporal Anti-Aliasing toggle and make it always active unless the number of samples is 1.
2017-10-03 18:30:56 +02:00
57c323b5d3 Object Mode : Fix probe paralax display. 2017-10-03 18:30:56 +02:00
f40fa55b58 DRW: Fix Feedbackloop warning. 2017-10-03 18:30:56 +02:00
239b38cd64 CMake: avoid naming collision 2017-10-04 01:35:24 +11:00
cbe07d980c Python: bump minimum version to 3.6 2017-10-03 23:50:34 +11:00
7ae02c2ddb Cleanup: remove unused vpaint projection handle 2017-10-03 23:43:30 +11:00
a4721c0504 Weight Paint: blend smear tool 2017-10-03 23:35:30 +11:00
6a7dc3348a Vertex Paint: fix feedback loop w/ smear tool
Was reading and writing from same array,
this also makes smear thread-safe.
2017-10-03 23:07:13 +11:00
314d93838e Fix bplayer (c) 2017-10-03 12:31:51 +02:00
61d5c5a64f Fix T52981: 2D Curve shapes do not render untill extruded
Regression since 9298c53.
2017-10-03 15:29:39 +05:00
Alexander Gavrilov
7c2d5eaacb Change weigth paint accumulate mechanics to fix problems with mirroring.
Restoring weights is problematic when the stroke overlaps its mirror.
It's better to simply compute the new weight based on the saved data
rather than restoring things, and check that the change is monotonic.

This way is also closer to how things worked before the merge.
2017-10-03 12:41:37 +03:00
975ed05edb Vertex Paint: smear got wrong last-location 2017-10-03 20:19:59 +11:00
7640d5e92a Error in last commit, weight must be set for non-accumulate 2017-10-03 19:24:02 +11:00
f4b1f9b925 Vertex Paint: remove accumulate (soc-2017-vertex_paint)
This secondary accumulation option accumulated brush falloff.
The same option in image painting accumulates color
as vertex paiht 'Spray' does.

Giving this option different behavior for vertex paint seems strange.
Also this is basically increasing falloff over time.

Remove the new code, expose existing 'Spray' as 'Accumulate'
to match other paint modes.
2017-10-03 19:09:28 +11:00
2bfa061a15 Merge branch 'master' into blender2.8
Notes:

- Changes in paint_vertex.c were simple to merge, mainly related on passing
  evaluation context.

- Conflicts in EditDM and drawmesh.c are solved using code from blender2.8
  branch. Those areas are deprecated and not to be used in final release.

  However, it's possible that some reference code from master is lost, so
  keep attention when adding alpha support for vertex painting.
2017-10-03 12:59:06 +05:00
515e69999e Weight Paint: don't set weight w/ average brush
Also use 'const' for brush.
2017-10-03 18:43:18 +11:00
2b3ff61d80 Correct int division in last commit 2017-10-03 17:36:55 +11:00
6092ded127 Weight Paint: add some color blending modes
While these mostly make sense for color,
there is no harm in supporting.
2017-10-03 17:24:29 +11:00
2136942916 Eevee : Fix grid black fill. 2017-10-02 22:17:20 +02:00
2bd36338d3 Gawain : Add workaround to fix bad sync of the program_in_use flag. 2017-10-02 22:16:50 +02:00
c548c76804 Eevee : Fix ghosting from probe data when toggling "only render". 2017-10-02 20:02:21 +02:00
5f7192018e Eevee : SSR : Make sure to not apply Specular Occlusion to SSR.
This makes the metals shine more.

Previous behaviour was not correct.
2017-10-02 19:44:44 +02:00
04e4a0db0d Eevee : Probe Grid : Fix Update tagging. 2017-10-02 18:42:18 +02:00
73ab572c0a Eevee : Probe Cubemap : Fix Broken Display data. 2017-10-02 18:42:18 +02:00
21ec254ae2 Eevee : Light Grid : Init grid to black instead of world color.
This was a mistake to use world color because it introduce light bleeding on indoor environement.
2017-10-02 18:42:18 +02:00
dc327e2793 Eevee : Lamps : Change ESM default exponent.
Users are thinking that ESM are not soft because of the default value.
2017-10-02 18:42:18 +02:00
9f8bb5813b Buildbot: Re-enable cuda binaries, those should work 2017-10-02 20:24:58 +05:00
Alexander Gavrilov
88dd45e1e1 Disable multithreaded weight paint when mirroring is enabled.
Mirroring writes to the mirror vertex within the direct vertex
draw function, which violates assumptions required for processing
vertices in parallel.
2017-10-02 17:33:51 +03:00
64afba0244 Remove brush versioning (again!)
Causes crash, see c133927bb

Merging soc-2017-vertex_paint brought this back by accident.
2017-10-03 00:56:45 +11:00
8b1b7e8d10 Depsgraph: Fix/workarounf when tagging light probe for data update 2017-10-02 18:49:49 +05:00
64c1a48c50 Fix T52927: Compositor wrong scale when scale size input is connected to complex node
The issue here is that we can not read scale from socket when determining
dependent area of interest. This area will depend on current pixel. Now fall
back to more stupid but reliable thing: if scale size input is connected to some
nodes, we use the whole frame as area of interest.
2017-10-02 15:55:52 +05:00
b2a10fa615 Vertex Paint: projection options
This makes vertex paint match image painting more closely.

- Add falloff shape option sphere/circle
  where sphere uses a 3D radius around the cursor and
  circle uses a 2D radius (projected), like previous releases.
- Add normal angle option so you can control the falloff.
- Add Cull option, to paint onto faces pointing away.

Disabling normals, culling and using circle falloff
allows you to paint through the mesh.
2017-10-02 22:07:58 +11:00
9d34ae6048 Sculpt: calculate plane instead of point,normal
No functional changes.
2017-10-02 22:07:57 +11:00
1cfee60419 Cleanup: add 'sphere' to sculpt test function name 2017-10-02 22:07:57 +11:00
2a744a9f2e Cleanup: indentation, whitespace 2017-10-02 22:07:57 +11:00
deb16defd5 Math Lib: distance to AABB
Original code by @mano-wii, modified for general use.
2017-10-02 22:07:39 +11:00
ff0938870f Compositor: Fix strict compilation warnings when debug is enabled 2017-10-02 15:18:10 +05:00
f06a60c25d Compositor: Fix compilation error with debug enabled 2017-10-02 15:12:04 +05:00
04704297d2 Fix T52920: Saving Tiff Files type Blender crashes
Was only happening for 3 and 1 channel sources.
2017-10-02 13:44:13 +05:00
864a53e276 Fix gradient tool crash with recent changes
Having gesture automatic free memory isn't practical if this
has it's own allocations.

Add option not to free userdata.
2017-10-02 01:34:51 +11:00
9a6aba2a94 Vertex Paint: use squared distance test
Avoids sqrt for verts that are later ignored
2017-10-02 00:44:04 +11:00
ba67d94258 Compile fixes for MSVC:
* missing include for uint typedef
* macro syntax error

Reviewers: campbellbarton, fclem

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D2863
2017-10-01 15:34:12 +02:00
f1e7891588 Vertex Paint: respect 'normal' option
Recent changes ignored this option.
2017-10-01 23:53:24 +11:00
f55735e533 CMake: support CUDA 9 toolkit, and automatically disable sm_2x binaries.
Fermi cards (GTX 4xx and 5xx) are no longer supported with this version, so
we can keep supporting both CUDA 8 and 9 for a while.
2017-10-01 14:14:53 +02:00
22ecea9e38 Weight Paint: restore non-spray functionality
When painting with spray disabled - we need to re-apply
on top of the original each time.

Applying the soc-2016-pbvh-painting branch removed this.
While I'd added back a simple previous weight array,
this won't work when multiple groups are painted at once.
2017-10-01 21:21:24 +11:00
9139532dc8 Buildbot: Use latest master config from buildbot 2017-10-01 10:34:04 +02:00
29ed5f301d Buildbot: Extra tweaks to packing rules 2017-10-01 10:01:45 +02:00
ca3f7021de Buildbot: Tweaks to current macOS config
Also disable CUDA binaries for now, those would need some extra work.
2017-10-01 10:00:42 +02:00
88a08ef8ad Fix weight paint Blur, Smear and Average breakage in multi-paint mode.
This is most pronounced in Auto-Normalize + Multi-Paint. Unlike
vertex paint, the weights being painted on in weight paint mode
don't necessarily correspond to the weight actually stored in
any one vertex group, and may instead be a computed aggregate.

This restores original code behavior lost in rB4f616c93f7cb.
2017-10-01 10:00:34 +03:00
3349f25502 Eevee : Add a setting for the number of indirect light bounce.
This is used to tweak the overall spread of the lighting. It is a per renderlayer setting.
2017-10-01 02:19:10 +02:00
b03aa6afce LightProbe : Fix UI : display panels. 2017-10-01 01:23:48 +02:00
e249dfd0f6 Cleanup: Remove some old pre 2.5 IPO code 2017-09-30 16:38:53 -04:00
cc772e4bca Eevee: LightGrid: Fix progressive rendering. 2017-09-30 19:37:40 +02:00
1054f65a29 Object Mode : Add probes data outlines and selectability
This required some small changes to the data display shaders so that they match the way the object mode renders them.
Strangely enough, I had to remove the normal attribute from the display code because it was being not bound as soon as I created another rendering call in object mode. The problem may be deeper but I did not have time for this so I derive the normal from the sphere pos.
2017-09-30 19:37:40 +02:00
8249e1ce5e DRWCache: Add a new regular Quad buffer. 2017-09-30 19:37:40 +02:00
49c81e234a Fix vertex paint w/ subsurf drawing
Only use alpha blending when in vertex paint mode.
2017-09-30 19:24:45 +10:00
18965905d0 Merge branch 'master' into blender2.8 2017-09-30 11:00:29 +10:00
e3546a5097 Vertex Paint minor improvement w/ smear
Note that this tool seems like it might need to be rewritten
since results are quite strange.

Projecting on the view vector gives a small improvement though.
2017-09-30 02:58:37 +10:00
a270e61b82 Fix vertex paint smear tool
Checking surrounding verts wasn't working properly.
2017-09-30 02:56:31 +10:00
41e2dbaea9 Weight Paint: accumulate support
- Clamp accumulate so it doesn't exceed brush strength.
- Was multiplying by brush strength twice.
2017-09-30 01:36:41 +10:00
d4f8e4e30c Cleanup: de-duplicate copied code w/ vertex paint 2017-09-29 23:28:54 +10:00
9298c53e4c Fix T52943: don't export curves objects with no faces to Cycles.
Also skip any objects with zero ray visibility and meshes with
zero faces.
2017-09-29 14:54:34 +02:00
d2bbd41b4e Fix Cycles OpenCL compiler error after recent changes. 2017-09-29 14:54:10 +02:00
5553037be7 Cleanup: split out tools & utils from vertex paint
paint_vertex.c was getting too big, move all code unrelated to
mode switching and modal painting into their own files.

Also replace vertex-color operators region redraw tag /w notifiers.
2017-09-29 22:26:11 +10:00
e3fe8128e4 Merge branch 'master' into blender2.8 2017-09-29 19:55:00 +10:00
5a1954a5cb Drop platform support for Solaris & AIX
These platforms didn't see maintenance in years.
This commit just removes ifdef's & cmake check.
2017-09-29 19:16:34 +10:00
04e8a09662 GNUmakefile: add back 'git pull'
Seems this was removed by accident.
2017-09-29 19:02:20 +10:00
9cba119051 Collada: export vertex-color alpha 2017-09-29 18:12:14 +10:00
823bcf1689 RNA: expose mesh vertex alpha
Note that some import/export scripts will need updating
2017-09-29 18:10:25 +10:00
288b2d0aa6 Vertex Paint: Alpha Support
GSOC 2017 by Darshan Kadu, see: D2859.

This is a partial merge of some of the features from
the soc-2017-vertex_paint branch.

- Alpha painting & drawing.
- 10 new color blending modes.
- Support for vertex select in vertex paint mode.
2017-09-29 18:06:52 +10:00
97eefc1fd9 Code cleanup: remove unnecessary buildbot code after macOS library upgrade. 2017-09-28 23:37:57 +02:00
31be6fccf8 Eevee: Probe Grid: Clear Grid buffers with world diffuse coefs.
This make sure the values displayed by the "show data" sphere are initialized.

Also this make the bounce lighting progress more apparent.
2017-09-28 21:17:57 +02:00
12f650623e Eevee: Probe Grid: Add "progressive rendering"
This gives the user a more rapid preview of what the final result will be.

The grid cells are renderer in a series of powers of two offsets.
2017-09-28 21:16:02 +02:00
c10ac1bb5c macOS: officially upgrade to 10.9 libraries from lib/darwin.
This removes a bunch of code that is no longer needed, and running
"make update" will now automatically download the new libraries.

Differential Revision: https://developer.blender.org/D2861
2017-09-28 20:53:06 +02:00
Kim Christensen
2a36ee16c1 Fix T52574: make Cycles rendered tile counter more clear.
Differential Revision: https://developer.blender.org/D2853
2017-09-28 15:18:53 +02:00
400e6f37b8 Cycles: reduce subsurface stack memory usage.
This is done by storing only a subset of PathRadiance, and by storing
direct light immediately in the main PathRadiance. Saves about 10% of
CUDA stack memory, and simplifies subsurface indirect ray code.
2017-09-28 15:18:43 +02:00
9ddee885ae Fix T52086: Graph editor "normalize" drag errors for integers 2017-09-28 17:08:43 +05:00
f6e71fe727 Merge branch 'master' into blender2.8 2017-09-28 16:19:23 +05:00
3801f76b7b Fix T52932: Driver with target of custom property from scene fails to update
Note that this is only supported in new depsgraph.
2017-09-28 16:13:28 +05:00
7fdb9e168d Merge branch 'master' into blender2.8 2017-09-28 16:13:09 +05:00
75e8e3779b Curves: Fix wrong bitset being checked against CYCLIC bit flag
Based on report from Talos Security Advisory.
2017-09-28 14:33:59 +05:00
0ae1a1ed48 CMake: move MSVC warnings to central location 2017-09-28 13:41:54 +10:00
1f18523edf Cleanup: switch fall-through warning 2017-09-28 13:41:54 +10:00
c133927bb8 Adding paint brushes crashes w/ linked libs
While we could skip this for linked files,
convention so far is to only update startup.
2017-09-28 13:41:53 +10:00
64de8c8f0d Missed in last merge from master
Local changes built, but merge-commit needed amending.
2017-09-28 07:35:06 +10:00
fcdc7acd8b Eevee : TAA : Fix conflict with outlines.
The previous view was incorrectly considered valid even if the persp matrix was different. So the history depth was mismatching.
2017-09-27 21:21:39 +02:00
b24ba9b174 Object Mode Engine: Small cleanup 2017-09-27 21:21:39 +02:00
40f5ac4977 Eevee : TAA : Change post process chain to allow more flexibility
This basically do not use hardware blending and do the blending in the shader.
This will allow neighborhood clamping if we ever implement that.
2017-09-27 21:21:39 +02:00
88a3323a47 Eevee: Use fmod instead of floor. 2017-09-27 21:21:39 +02:00
5c6e3ff497 bgl module: extend gl_buffer_type_from_py_format_char function to work with more string formats
Only basic types of character codes were being used
2017-09-27 16:07:06 -03:00
cc8c064f11 Merge branch 'master' into blender2.8 2017-09-28 03:05:46 +10:00
5d23448290 [build_deps.cmd] Turn down logging verbosity to normal. 2017-09-27 10:54:27 -06:00
58f3f9c246 [msvc] treat C4133 as error instead of a warning to mimic gcc's -Werror=incompatible-pointer-types
as requested by @campbellbarton and @mano-wii
2017-09-27 10:11:00 -06:00
6c98859b77 Cleanup: warning 2017-09-28 02:04:58 +10:00
Dalai Felinto
16edfc516e --debug-gpu-shader: Dump GLSL shaders to disk
This is really convenient for development. Either for profiling the
generated shaders or to check if the generated code is correct.

It writes the shaders to the temporary blender session folder.
2017-09-27 18:03:00 +02:00
4f616c93f7 Vertex/Weight Paint: Use PBVH for painting
2016 GSOC project by @nathanvollmer, see D2150

- Mirrored painting and radial symmetry, like in sculpt mode.
- Volume based splash prevention,
  which avoids painting vertices far away from the 3D brush location.
- Normal based splash prevention,
  which avoids painting vertices with normals opposite the normal
  at the 3D brush location.
- Blur mode now uses a nearest neighbor average.
- Average mode, which averages the color/weight
  of the vertices within the brush
- Smudge mode, which pulls the colors/weights
  along the direction of the brush
- RGB^2 color blending, which gives a more accurate
  blend between two colors
- multithreading support. (PBVH leaves are painted in parallel.)
- Foreground/background color picker in vertex paint
2017-09-28 01:47:37 +10:00
2de5e14f53 bgl module: Interpret a buffer as a bgl.Buffer
Differential Revision: https://developer.blender.org/D2857
2017-09-27 11:20:00 -03:00
88520dd5b6 Code refactor: simplify CUDA context push/pop.
Makes it possible to call a function like mem_alloc() when the context is
already active. Also fixes some missing pops in case of errors.
2017-09-27 13:43:21 +02:00
32e453b495 D2830 - 2.8: Fix crash when creating new action
Patch by: Marcelo Mutzbauer (1xundoredo)
2017-09-27 14:16:27 +13:00
9bd40cbce1 Merge branch 'master' into blender2.8 2017-09-27 11:18:23 +10:00
43b4913051 Math Lib: Add non-clamped round_* functions
Replace iroundf with round_fl_to_int, add other types
2017-09-27 11:13:03 +10:00
a24dd6eaba Eevee: Fix bug with cubemap shadows. 2017-09-26 22:30:48 +02:00
540ef7ee8e Eevee: Fix broken World probe. 2017-09-26 21:43:14 +02:00
c1aca25c3b Eevee: TAA: Remove 32 sample limit. 2017-09-26 21:39:25 +02:00
b96c70f9b2 BLI_rand : Make use of BLI_halton and BLI_hammersley 2017-09-26 21:38:23 +02:00
47e6d53c8a BLI_rand : Add new low-discrepency sequences generator 2017-09-26 20:54:27 +02:00
5c45fe2937 Eevee : Fix regression : Refraction not working 2017-09-26 16:48:07 +02:00
772944a6b4 Merge branch 'master' into blender2.8 2017-09-27 00:24:10 +10:00
870dfb1b5a Cleanup: indentation 2017-09-27 00:17:28 +10:00
51c87bbad0 Cleanup: indentation 2017-09-27 00:05:06 +10:00
7593ac2aff Transform: add manipulator aligned bounds
ifdef'd out for now
2017-09-26 23:16:20 +10:00
d6800c1a81 Merge branch 'master' into blender2.8 2017-09-26 22:45:42 +10:00
482b665e02 Cleanup: remove bounds runtime data from scene 2017-09-26 22:33:25 +10:00
30f9cd710b GPUFramebuffer: Enable multisample when binding a Multisample FBO
For some reason it was not working on intel but was working on Nvidia.
2017-09-26 14:01:50 +02:00
496a354d7f DRW : Fix Compiler Warning 2017-09-26 13:59:31 +02:00
f853e724de Eevee : Fix compilation warning on intel. 2017-09-26 13:58:59 +02:00
1eb49f8a2f GPU_immediate_util: add cube drawing function 2017-09-26 17:51:47 +10:00
63dfb5bb97 Cleanup: naming (GPU immediate util) 2017-09-26 15:21:01 +10:00
86b81d25ea Missed from merge commit 2017-09-26 14:57:14 +10:00
24b083c8f3 Merge branch 'master' into blender2.8 2017-09-26 14:52:21 +10:00
aba2f8ea67 Beauty fill was skipping small faces 2017-09-26 12:59:23 +10:00
e40e29cd38 Fix T52871: beauty fill error
Only lock tri's facing different directions.
Needed because scanfill creates zero area faces.
2017-09-26 12:14:46 +10:00
293dc4e084 Revert "Fix T52871: BLI_polyfill_beautify_quad_rotate_calc_ex was mistakenly considering the state as degenerated"
This reverts commit a8f11f5422.

Result is no longer symmetrical, will investigate a different fix.
2017-09-26 12:14:04 +10:00
262ddbfda0 Add missing header 2017-09-26 12:14:04 +10:00
96e84d002a Fix T52901: New Depsgraph - Driver using "self" needs reloading file to work 2017-09-26 13:29:48 +13:00
b0ccf2322b Fix: When transforming GP strokes in "Local" mode, the strokes would get obscured
by the transform constraint lines

Ported over e7395c75d5 from the
greasepencil-object branch. I should've fixed this ages ago, but
couldn't figure out why at the time.
2017-09-26 13:00:38 +13:00
e8a0812a3b deps libs: fix xiph library support on sndfile on macOS 2017-09-26 02:17:39 +03:00
3ae0be45f1 Eevee: Implement Temporal Anti Aliasing / Super Sampling
This adds TAA to eevee. The only thing important to note is that we need to keep the unjittered depth buffer so that the other engines are composited correctly.
2017-09-25 20:14:42 +02:00
198c7d3687 DRW : Add new view_update mechanism.
This makes updates for the viewport cleaner and also add the possibility to add a new callback called when the scene is updated.
2017-09-25 20:14:42 +02:00
98dd2a518b Eevee: Fix SSR in orthographic view.
The problem was that orthographic views can have hit position that are negative. Thus we cannot encode the hit in the sign of the Z component.

The workaround is to store the hit position in screenspace. But since we are using floating point render target, we are loosing quite a bit of precision.
TODO: use RGBA16 instead of RGBA16F. But that means encoding the pdf value somehow.
2017-09-25 20:14:42 +02:00
00955d8d7a DRW : Add AA to non meshes objects.
You can change the amount of samples in the user preferences. You do not need to restart blender to see the effect in the new viewport.

This adds another Multisample Framebuffer and textures (so even more memory required).

It works by blitting the default_fb to the multisample_fb each time the renderer need to render one or more "wire" pass.
It it then blit back to the default_fb so that the rest of pipeline is working as expected.

We COULD lower the GPU memory / bandwidth usage to render everything to the same multisample fbo and change the logic depending on if MSAA is enabled or not, but I think it's a bit too much work for now.
2017-09-25 20:14:42 +02:00
709315a0d7 GPUTexture : Fix Bind/Unbind function so it works with multisample textures. 2017-09-25 20:14:42 +02:00
2a7b747f18 GPUFramebuffer: Fix Blit function so that it works with multisample textures. 2017-09-25 20:14:42 +02:00
e615724221 Fix compilation error after recent merge 2017-09-25 19:02:30 +05:00
98ba302f70 Merge branch 'master' into blender2.8 2017-09-25 18:57:43 +05:00
675cef0a16 Fix T52835: When driven IK influence change, ik animation have 1 frame delay 2017-09-25 18:48:55 +05:00
ce54d25fa9 Fix T52865: Improve wording of error message when saving packed images fails
Make it clear that the packed file could not be saved back out to disk
at the specified path (e.g. destination directory doesn't exist).
2017-09-26 01:25:18 +13:00
0d4e519b74 OpenVDB: Fix compilation error against OpenVDB 4
One crucial thing here: OpenVDB shoudl be compiled WITHOUT
OPENVDB_ENABLE_3_ABI_COMPATIBLE flag. This is how OpenVDB's Makefile is
configured and it's not really possible to detect this for a compiled library.

If we ever want to support that option, we need to add extra CMake argument and
use old version 3 API everywhere.
2017-09-25 14:44:17 +05:00
1d8aebaa09 Add an 'atomic cas' wrapper for pointers.
Avoids having to repeat obfuscating castings everywhere...
2017-09-25 10:40:50 +02:00
01a3c6b204 Tweak to fix for thread concurency in looptri generation.
Even if pointer assignment may be atomic, it does not prevent reordering
and other nifty compiler tricks, we need a memory barrier to ensure not
only that transferring pointer from wip array to final one is atomic,
but also that all previous writing to memory are “flushed” to
(visible by) all CPUs...

Thanks @sergey for finding the potential (though quite unlikely) issue.
2017-09-25 09:56:02 +02:00
cb6f07f59e Cycles: Cleanup, indentation 2017-09-25 11:15:54 +05:00
1c5f5fb95f Mirror Modifier: option to offset UV's
Useful for baking, so UV's can be moved outside the image
and not used to bake pixels (but still used for display).

D2801 by @Zuorion
2017-09-25 14:11:27 +10:00
4e15eddb52 Fix T52890: Crash unlinking sequencer sound 2017-09-25 10:28:17 +10:00
a8f11f5422 Fix T52871: BLI_polyfill_beautify_quad_rotate_calc_ex was mistakenly considering the state as degenerated 2017-09-23 12:59:02 -03:00
Julian Eisel
76444a13c3 Splash: Increase contrast of build info text
Now uses "Text Selected" theme color of "Menu Back" widget colors. Also
repositioned text slightly to have same margin on top and right (measured
by eye ;) ).
Tested with all bundled themes (contrib and no-contrib) and worked fine.

Considering that different splashes may need different colors for
overlaid text, using theme color may not be the best solution. I would
like to try how this works before adding an ugly way to force a certain
text color though.
Also tried different approaches, but this one I find the least ugly :S

As far as longer term plans go, we wanted to get a redesigned multi-page
splash screen anyway. At this point we can rethink how splash colors work
in general (i.e. auto-contrast, own splash theme colors, etc).
2017-09-23 16:02:25 +02:00
c0480bc972 Cycles: Fix compilation error of OpenCL megakernel on Apple 2017-09-23 17:07:19 +05:00
b460b8fb4a Cycles: Fix compilation error of megakernel on NVidia device
It is more readable to explicitly compare to NULL anyway.
2017-09-23 17:03:02 +05:00
874062b6ab Tracking: Followup to previous fix, need to remap frame number for sequence tracking 2017-09-23 16:18:27 +05:00
92aff05a7c Tracking: Cleanup, reuse existing variable 2017-09-23 16:16:22 +05:00
d430c462a3 Fix T52851: Per-frame traking is broken when sequence doesn't start at frame 1 2017-09-23 16:13:23 +05:00
840cce840e Tracking: Fix crash when tracking failed
Was a dangling pointer to a freed memory left behind.
2017-09-23 16:07:32 +05:00
dc86b7a4b5 Remove remaining qtcodecdata
This fixes a mistake in rBefd5e3c25401b43cbd7f909418835bb570db1ab3
2017-09-22 17:13:46 -04:00
efd5e3c254 Remove quicktime support
It has been deprecated since at least macOS 10.9 and fully removed in 10.12.

I am unsure if we should remove it only in 2.8. But you cannot build blender with it supported when using a modern xcode version anyway so I would tend towards just removing it also for 2.79 if that ever happens.

Reviewers: mont29, dfelinto, juicyfruit, brecht

Reviewed By: mont29, brecht

Subscribers: Blendify, brecht

Maniphest Tasks: T52807

Differential Revision: https://developer.blender.org/D2333
2017-09-22 16:40:05 -04:00
0e802fabb4 [cmake/deps_builder] update openjpeg to 1.5.2 to match the version in master/extern , add support for openjpeg in oiio. Mark webp as an optional component. 2017-09-22 13:57:21 -06:00
925f2c8b9d Fix T52875: install_deps.sh - numpy-1.13.1.tar.gz - 404 Not Found. 2017-09-22 18:56:37 +02:00
f2ea8e217b Object Mode : Add Outline FXAA
Adds a FXAA for smoothing out the extracted outlines.
The Post Process Anti Aliasing is only done on the Alpha channel of the outlines.
Because of that we need to add bleed the outline color out of the silouhette so the AA'd alpha can blend the right color and not pick black when the alpha is smoothed out of the silhouette.

Also because of the AA needs to have clear contrast to work with, I decided to ditch the "bluring" or the occluded outlines.

The FXAA adds an overhead of 0.17ms but we gain back 0.22ms * 4 = 0.88ms by removing the blur.

The FXAA Implementation is from Corey Richardson (cmr) (D2717). I had to modify it a bit to only filter the alpha channel.
2017-09-22 17:31:40 +02:00
128c7c3ba1 Merge branch 'master' into blender2.8 2017-09-22 13:26:49 +05:00
f320d0e0a8 Fix T52840: New Depsgraph - Mask editor not working correctly 2017-09-22 13:23:21 +05:00
225e52eaf8 Edit Mesh Mode : Fix GLSL compilation errors 2017-09-22 03:44:06 +02:00
56fd75c856 Edit Mesh Mode: Put AntiAliasing #define into shader include header. 2017-09-22 02:44:40 +02:00
1a4a1447b7 Edit Mesh Mode: Add a facing falloff effect
This let the user keep track of the shape by fading the center of the object.
An Opacity parameter is yet to be added.
2017-09-22 02:44:40 +02:00
406427bd4e Object Mode: Fix outline getting darker during expand steps. 2017-09-22 02:44:40 +02:00
02cd48a087 Edit Mode : Bias Face dot position 2017-09-22 02:44:40 +02:00
4bfa3f4f9b Edit Mesh Mode : Make line smoother.
This introduce some little artifacts on the border of edges because some pixel with very low opacity does not get discarded and then occlude the face rendered behind if it has not been drawn yet.
To fix this. I added an offset in the geometry shader for the edge fixup. This make the artifact only visible on the border of the object if there is a very dense wire region. It's only visible in edge select mode since vertex and face center also hides the artifacts.

We can enable this only if AA is enabled but for now it's always enabled.
2017-09-22 02:44:39 +02:00
b3b3c6d8ae build deps: add support for multiple xcode installs 2017-09-21 23:54:17 +03:00
07ec0effb6 Code cleanup: simplify kernel side work stealing code. 2017-09-21 22:29:18 +02:00
01dfaac77b [cmake_deps/msvc] Move llvm/clang harvest to their individual cmake files. 2017-09-21 13:10:55 -06:00
78345a46c1 deps build: add openjpeg to OIIO 2017-09-21 22:09:52 +03:00
e4f05df206 First development splash screen for Blender 2.8
Introducing a new header using the Blender socket logo,
commit of the source file will follow soon.

Splash committee: Ton Roosendaal, Dalai Felinto, Pablo Vazquez.

Artwork is a screenshot of 'Wanderer', an Eevee sample file
by Daniel Bystedt, available on blender.org (license: CC-BY-SA)
2017-09-21 20:30:28 +02:00
73e1435ab1 DRW: Fix regression
Textures were bound once. But since it was not unbound it's bind_num would not change and considered still bound next time a shader needed it.

Fix T52866
Fix T52855
2017-09-21 19:54:43 +02:00
d97f52f015 Revert "Fix T52855: Eevee: viewport artifacts"
This reverts commit 803c757c2b.
2017-09-21 19:43:53 +02:00
9775c4d68b [cmake_deps/msvc] Move boost harvest to boost.cmake 2017-09-21 11:16:52 -06:00
15ab0e6ddc [cmake/builddeps] update for site-packages on windows to support the new requests version. 2017-09-21 10:16:40 -06:00
Dalai Felinto
803c757c2b Fix T52855: Eevee: viewport artifacts
Partial revert of 9068c0743e.
This commit tried to do two things:

(1) Fix UBO binding logic [good]
(2) "Improve" texture binding logic [bad]

Don't ever mix different fixes and refactors in the same commit.
2017-09-21 17:41:39 +02:00
4808c488c5 CMake: Add extra requests dependencies
Apparently, we already had some code to deal with this. So for now just
added some extra dependencies needed for latest requests.
2017-09-21 18:53:02 +05:00
0c82a6fec8 Cleanup: unused define 2017-09-22 07:23:03 +10:00
Dalai Felinto
a99c64b12f Eevee: Fix wrong MEM_callocN allocation size 2017-09-21 15:52:51 +02:00
Dalai Felinto
9ad2c0b615 Depsgraph and collection enable/visibility
Iterate over invisible objects too, so lamps can still lit the scene.
Also, now you can use a collection to set an object to invisible, not
only to visible.

For example:
Scene > Master collection > bedroom > furniture
Scene > View Layer > bedroom    (visible)
                   > furniture  (invisible)

The View Layer has two linked collections, bedroom and furniture.
This setup will make the furniture collection invisible.

Note: Unlike what was suggested on D2849, this does not make collection
visibility influence camera visibility. I will keep this as a separate
patch.

Reviewers: sergey

Subscribers: sergey, brecht, fclem

Differential Revision: https://developer.blender.org/D2849
2017-09-21 14:45:08 +02:00
77377f0ea8 Depsgraph: Fix bug introduced by wrong merge conflict resolution 2017-09-21 16:09:49 +05:00
f5aa50853c 3D Text: Make Ctrl Backspace/Del delete words
Matches text-editor, console & text-button.
2017-09-21 20:43:49 +10:00
806bc55a34 Fix T52860: 3D Text crashes w/ Ctrl Backspace 2017-09-21 19:14:04 +10:00
50b9d1d019 Install_deps: Raise python and numpy versions (to 3.6.2 and 1.13.1 respectively). 2017-09-21 09:59:07 +02:00
e0f68e5d22 deps build: use pip to install requests 2.18.4 and it's deps 2017-09-21 09:33:00 +03:00
0c019a3ffc Fix T50450: Breakdowner doesn't work in Tweak Mode on translated NLA Strips 2017-09-21 17:38:30 +12:00
fde45132de Fix T52861: Keymap editor filter doesn't show shortcuts using "+" 2017-09-21 16:35:47 +12:00
26f98446b1 fix T52831 removed enforcement of matrix decomposition when animations are exported 2017-09-21 00:06:11 +02:00
a3b8f98913 revert commit c0a7e9b631 because it did not work as expected 2017-09-21 00:04:10 +02:00
c0a7e9b631 D2777: allow blank lines and lines with spaces/tabs in cut/paste 2017-09-20 22:48:38 +02:00
78c2242db5 Revert "Fix T52792: Typo in UI label of a HairInfo node socket."
This reverts commit 8ad479a322.
2017-09-20 22:06:23 +02:00
Stefan Werner
549c4bec9d Added extra "const" to satisfy the strict clang version in Xcode 9 2017-09-20 21:50:30 +02:00
Stefan Werner
ee30a4381f Added extra "const" to satisfy the strict clang version in Xcode 9 2017-09-20 21:47:45 +02:00
8ad479a322 Fix T52792: Typo in UI label of a HairInfo node socket. 2017-09-20 21:06:33 +02:00
692631551f [cmake/msvc] Update python to 3.6 + numpy to 1.13.1 2017-09-20 12:51:36 -06:00
25f28d348f Fix T52852: Assert in looptri calculation after recent changes.
Wrong condition in asserts...
2017-09-20 20:46:51 +02:00
c5491ba874 [cmake/depsbuilder/msvc] Update to python 3.6 / numpy 1.13.1
-No more hardcoded python35/36 tokens in the scripts
-disabled python module for boost, was not used
-Updated patches for python to support building with msvc2013
2017-09-20 12:31:40 -06:00
98d797b67c Fix missing ID remapping in Action editor callback.
Spotted by Joshua Leung (@aligorith), thanks!

Should probably be backported to 2.79a should we do it.
2017-09-20 20:26:40 +02:00
18a353dd24 Fix T52368: Cycles OSL trace() failing on Windows 32 bit. 2017-09-20 19:38:08 +02:00
14223357e5 Fix T52853: harmless Cycles test failure in debug mode. 2017-09-20 19:38:08 +02:00
90d4b823d7 Cycles: use defensive sampling for picking BSDFs and BSSRDFs.
For the first bounce we now give each BSDF or BSSRDF a minimum sample weight,
which helps reduce noise for a typical case where you have a glossy BSDF with
a small weight due to Fresnel, but not necessarily small contribution relative
to a diffuse or transmission BSDF below.

We can probably find a better heuristic that also enables this on further
bounces, for example when looking through a perfect mirror, but I wasn't able
to find a robust one so far.
2017-09-20 19:38:08 +02:00
095a01a73a Cycles: slightly improve BSDF sample stratification for path tracing.
Similar to what we did for area lights previously, this should help
preserve stratification when using multiple BSDFs in theory. Improvements
are not easily noticeable in practice though, because the number of BSDFs
is usually low. Still nice to eliminate one sampling dimension.
2017-09-20 19:38:08 +02:00
b3afc8917c Code cleanup: refactor BSSRDF closure sampling, for next commit. 2017-09-20 19:38:08 +02:00
d029399e6b Code cleanup: remove SOBOL_SKIP hack, seems no longer needed. 2017-09-20 19:38:08 +02:00
d750d182e5 Code cleanup: remove hack to avoid seeing transparent objects in noise.
Previously the Sobol pattern suffered from some correlation issues that
made the outline of objects like a smoke domain visible. This helps
simplify the code and also makes some other optimizations possible.
2017-09-20 19:38:08 +02:00
8289b47e3a Fix Cycles test report not closing files properly. 2017-09-20 19:12:26 +02:00
f54f680a26 Fix T52842: Incorrect description for bpy.types.MeshTextureFace.uv
Tweak rna_info module to generate valid info also for multi-dimensional arrays.
2017-09-20 16:40:11 +02:00
942c5997c1 Expose multi-dimensional array data in properties' introspection data.
Required to generate valid doc for such arrays!
2017-09-20 16:40:11 +02:00
c4bbf1e4b0 Fix rna_info.py module, broken by recent changes in bpy.types presumably.
Hope fix is OK, seems to work with API generation script at least.
2017-09-20 16:40:11 +02:00
adb647fb92 UI: fullstop at end of tooltips
Allows for multiple sentences not to look strange.
Convention not to include in RNA remains.
2017-09-20 23:59:26 +10:00
Dalai Felinto
f2db6cefa0 Layer collection enable flag
Right now this is exposed in the outliner, though all this
(visible/selectable/enable) should be moved to a new panel soon.

This removes objects from the depsgraph when the collection is disabled.

It allows you to "hide" lamps but still having them lighting the scene.
Same for light probes and other support objects.

Pending tasks:

* Have depsgraph to include invisible objects in the DEG_OBJECTS_ITER, and
then have Eevee and other engines to make a distinction between an
invisible and a visible object.

(for example, we probably want invisible objects to not show in the
viewport, but cast shadows and show up in light probes).

* Change how we evaluate collection settings so that an invisible
collection can force an object to be invisible.

Reviewers: campbellbarton

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2848
2017-09-20 14:15:35 +02:00
99c9f17098 deps build: correct sndfile fix 2017-09-20 13:20:23 +03:00
42c174d1a5 Manipulator: fix visibility check w/ 2-axis planes 2017-09-20 18:33:43 +10:00
31fc75ef93 Cleanup: move 3d manipulators into an array 2017-09-20 17:47:34 +10:00
851228766e Merge branch 'master' into blender2.8 2017-09-20 16:10:40 +10:00
a2d246c5c0 BLI_polyfill2d_test: script to generate test data 2017-09-20 13:40:30 +10:00
77dccbf481 deps build: fix sndfile building on macOS 2017-09-20 00:08:32 +03:00
46300a541d macOS: use python version 3.6 when building blender 2017-09-20 00:07:56 +03:00
c87c1ec1da deps build: bump Python to 3.6.2 and Numpy to 1.13.1 2017-09-20 00:04:23 +03:00
f680e42a4c Correct test ifdef in polyfill 2017-09-20 04:57:48 +10:00
16355d545b Fix T52834: Polyfill2D fails with co-linear edges 2017-09-20 04:29:04 +10:00
c4235356c9 BLI_polyfill2d_test: add test for T52834
Commented since it currently fails.
2017-09-20 03:40:13 +10:00
e00bb4d22c BLI_polyfill2d_test: Try flipped x/y axis
In T52834 this makes a difference.
2017-09-20 03:35:06 +10:00
869f0a840f Merge branch 'master' into blender2.8 2017-09-19 13:59:37 -03:00
98ea79cfde transform_snap_object: simplify IGNORE_BEHIND_RAY
`depth_get` is called in most of the time. So not worth going through so many conditions
2017-09-19 13:57:59 -03:00
e2e8f4b9e1 Audaspace: removing old device backend names. 2017-09-19 18:08:42 +02:00
af170839af Merge branch 'master' into blender2.8 2017-09-19 21:08:14 +05:00
b31faac17e Depsgraph: Fix wrong flag being assigned 2017-09-19 20:55:15 +05:00
96ce50449c Fix T52733 Percent mode for Bevel sometimes had nans.
Forgot some initialization.
2017-09-19 09:39:11 -04:00
3241905f40 Fix T52818: Tangent space calculation is really slow for high-density mesh with degenerated topology
Now we replace O(N^2) computational complexity with O(N) extra memory penalty.
Memory is much cheaper than CPU time. Keep in mind, memory penalty is like
4 megabytes per 1M vertices.
2017-09-19 17:50:09 +05:00
2dab6f499c Mikkspace: Cleanup, reduce indentation level 2017-09-19 17:50:09 +05:00
9591b5f618 Fix T52816: regression can't open file in 2.79 (crash).
Tentative fix, since I cannot reproduce thenissue for some reason here
on linux.

Core of the problem is pretty clear though, thanks to Germano Cavalcante
(@mano-wii): another thread could try to use looptris data after worker
one had allocated it, but before it had actually computed looptris.

So now, we use a temp 'wip' pointer to store looptris being computed
(since this is protected by a mutex, other threads will have to wait on
it, no possibility for them to double-compute the looptris here).

This should probably be backported to 2.79a if done.
2017-09-19 14:00:49 +02:00
1a4442b3db Fix T52823: New Depsgraph - Shrinkwrap crashes blender
The issue was caused by threading conflict around looptris: it was possible
that DM will return non-NULL but non-initialized array of looptris.

Thanks Campbell for second pair of eyes!
2017-09-19 16:12:05 +05:00
495d3c8dd7 CMake: update for renamed headers 2017-09-19 20:26:07 +10:00
7b95243240 BLI_utildefines_iter: Use for iteration helpers 2017-09-19 20:22:24 +10:00
60956397ca Cleanup: BLI_utildefines prefix for header-only libs
This allows to have different macro headers without them sharing
similar names to regular C modules.
2017-09-19 20:16:05 +10:00
215651af1b Boolean Modifier: add debug options
Only show & use when running in debug mode.
2017-09-19 18:29:52 +10:00
7177e0ac3e Fix T52811: At any framerate selected, video exported with 1000fps 2017-09-19 11:31:03 +05:00
36f5972ed0 Avoid bias when calculating quad split direction
Some error checks weren't being done in both directions
when calculating the best split direction for a quad.
2017-09-19 15:10:52 +10:00
9a2f7dd77b Correct recent error in boolean quad split check 2017-09-19 14:25:37 +10:00
2cdc2f2a25 Fix compiler warning 2017-09-19 16:20:51 +12:00
bb4a12914f Add some security checks against future bad float UIprecision values.
This commit and previous one should be backported to 2.79a should we
release it.
2017-09-18 20:04:27 +02:00
785e96a11d Fix (irc-reported by @sergey) invalid precision value in a float RNA property.
Maximum allowed UI float precision value is 6 (which means 7 digits).

Will change code checking on that in next commit.
2017-09-18 20:04:27 +02:00
d486b17088 [cmake/dependencies] Update libsndfile to 1.0.28 2017-09-18 10:54:37 -06:00
Dalai Felinto
f84448d4a0 Fix T52813: Audaspace: Leak when loading factory settings
Patch by Joerg Mueller (neXyon) with some touchups by me.
2017-09-18 16:16:03 +02:00
533ec46efb Merge branch 'master' into blender2.8 2017-09-18 23:56:19 +10:00
d0344d7b7d Cleanup: use clamped rounding functions 2017-09-18 23:55:41 +10:00
c4fc9c4a8e Math Lib: clamped rounding utility functions 2017-09-18 23:55:41 +10:00
ad80bfdab9 Merge branch 'master' into blender2.8 2017-09-18 18:10:39 +05:00
a6b156bf57 Color management: When look is applied, we can not consider spaces to match
This should fix T52812 after merge to blender2.8.
2017-09-18 18:09:53 +05:00
e6d5b94e83 Correct error in cage2d draw style enum 2017-09-18 23:02:27 +10:00
Dalai Felinto
d370e6c3ea Merge remote-tracking branch 'origin/master' into blender2.8 2017-09-18 14:44:44 +02:00
d0d9360a66 Fix T52800: fix UI flickering with Mesa on Linux.
Use triple buffer by default now on all platforms, remaing ones where:
* Mesa: seems to have been working well for a long time now, and not using
  it gives issues with the latest Mesa 17.2.0.
* Windows software OpenGL: no longer supported since OpenGL 2.1 requirement
  was introduced.
* OS X with thousands of colors: this option was removed in OS X 10.6, and
  that's our minimum requirement.
2017-09-18 13:19:48 +02:00
4c1ee47707 Merge branch 'master' into blender2.8 2017-09-18 15:54:56 +05:00
ab9079f459 Fix Cycles adaptive compile without volumes broken after recent changes.
Differential Revision: https://developer.blender.org/D2847
2017-09-18 12:52:32 +02:00
6bf3dfbcdb Fix T52801: reload scripts causes Cycles viewport render crash. 2017-09-18 12:52:32 +02:00
c622533fa0 Fix T52432: Blender crashes while using Ghost (new depsgraph) 2017-09-18 15:50:27 +05:00
a0e7dbc66d BMesh: move bridge tools stepping logic into macro
Also use floor division since regular division was giving a bias
on negative error values.
2017-09-18 13:18:54 +10:00
990515a5a7 Math Lib: add divide_floor_i
Integer division that floors on negative output (like Python's).
2017-09-18 13:18:50 +10:00
9134529b9e UI: avoid int cast before clamping number input
Values outside int range would overflow.
2017-09-17 18:00:13 +10:00
d7204aed95 Cleanup: SGI format, remove unused struct members 2017-09-17 18:00:08 +10:00
829916f4e5 Fix SGI foramt reader CVE-2017-2901
Integer Overflow Code Execution Vulnerability.

Reader no longer crashes on corrupt images (from own fuzz testing).
2017-09-17 16:30:34 +10:00
b884188f8a Cleanup: SGI format, avoid overflow
Harmless but causes warnings
2017-09-17 16:30:34 +10:00
a72e609204 Cleanup: SGI format, use uint/short/char types 2017-09-17 16:30:34 +10:00
Hristo Gueorguiev
6798a061b7 Cycles: Fix compilation error with OpenCL split kernel 2017-09-16 12:33:03 +02:00
a850d74312 Fix T51074: Boolean modifier inverts operation
Support for negative scaled objects.
2017-09-16 18:12:24 +10:00
d09c429e30 Fix writing Iris images w/ invalid header
Regression in e142ae77ca
2017-09-16 16:09:02 +10:00
9068c0743e DRW: Fix Ubo binding logic and improve Texture binding logic
Ubo needs to be rebound every times the shader changes.
This simplify the logic a bit.

Also modify texture binding logic to potentially reuse more already bound textures.
2017-09-16 02:16:55 +02:00
7c8e87fc52 Fix T52384: Bridge pair result depends on other loops
When 2x loops have different number of vertices,
the distribution for vertices fan-fill depended on the loop order
and was often lop-sided.

This caused noticeable inconstancies depending on the input
since edge-loops are flipped to match each others winding order.
2017-09-16 05:15:09 +10:00
f565d8c4ae Eevee: Fix T52738: Probes are black.
This fix the crappy binding logic.

Note the current method is doing a lot of useless binding. We should somewhat order the texture so that reused textures are already bound most of the time.
2017-09-15 20:09:09 +02:00
208d6f28c8 Merge branch 'master' into blender2.8 2017-09-15 14:19:22 -03:00
14eadf55fd RNA: expose RegionView3D clip planes 2017-09-15 13:55:52 -03:00
4fae536f60 Merge branch 'master' into blender2.8 2017-09-15 22:44:07 +10:00
378b74f025 Docs: only show versions in changelog side-bar 2017-09-15 22:20:14 +10:00
ec784b06ee Docs: update API changelog to 2.79 2017-09-15 22:06:23 +10:00
1a9217e222 Fix T52763: Boolean problem with vertex group 2017-09-15 16:33:52 +05:00
0c5ff0e558 GPUCodegen: Fix for loop overflow.
Fix asan error.
2017-09-15 11:42:53 +02:00
d120780fed BMesh: use less involved check for edge rotation
Was using function for edge rotation which was doing unnecessary checks
Use the face normal and BLI_polyfill_beautify_quad_rotate_calc directly.
2017-09-15 18:19:04 +10:00
c594087488 Polyfill Beautify: option to rotate out of degenerate state
Needed for 3D iterative edge-rotation to avoid flipping when projected
from different angles,
but could keep zero area faces in 2D polygons.
2017-09-15 18:14:17 +10:00
fdb8e17936 Fix error in recent boolean changes w/ quad split 2017-09-15 18:08:24 +10:00
028c5592cd Merge branch 'master' into blender2.8 2017-09-15 12:35:20 +05:00
8b3ad25862 Transform: Enable recursion dependency check for new depsgraph 2017-09-15 12:25:57 +05:00
95a8e73d40 Fix copy-paste error in recent particles fix
Was intersecting same triangle twice.
2017-09-15 11:35:24 +05:00
2aa2bec43a Fix T52442: bl_app_templates_system not working
Portable builds LOCAL files need to be
treated as system instead of using as a fallback to USER templates.
2017-09-15 05:57:37 +10:00
909da553e3 Fix bpy.utils.resource_path('SYSTEM') output
Would return the test path for developer builds:
{blender-dirname/release}

Now return an empty string when no path is found.
2017-09-15 05:47:23 +10:00
c75bd25cd8 Fix T52732: Particle system volume grid particles out of volume
Use more watertight and robust intersection test.

It uses now ray to triangle intersection, but it's all fine because segment was
covering the whole bounding box anyway.
2017-09-14 19:50:02 +05:00
3c1c3b64c5 Fix T52729: Decimals not showing over 100m or 100 feet
Use same 5 digits precision as we already use for e.g. Object's
location, for Object's dimensions too.

To be backported to 2.79a, should we do it.
2017-09-14 16:35:28 +02:00
a22590a62c Fix T52537: Dyntopo "detail flood fill" doesn't work in some cases
Mainly when object origin is not at the geometry bounding box center.

Seems to be straightforward to fix, hopefully it doesn't break some obscure case
where this was a desired behavior.
2017-09-14 18:56:16 +05:00
fc7ac0bc49 Correct error in last commit 2017-09-14 23:04:01 +10:00
8c21003248 Fix T52748: Select shortest face path fails 2017-09-14 23:01:07 +10:00
7aafa32c09 Fix T51416: Blender Crashes while moving Sliders
The issue here was that removing datablock from main database will poke editors
update, which includes buttons context to free users of texture. Since Cycles
will free datablocks from job thread, it might crash Blender since main thread
might be in the middle of drawing.

Solved by exposing extra arguments to bpy.data.foo.remove() which indicates
whether we want to perform ID user count and interface updates. While scripts
shouldn't be using those normally, this is the only way to allow Cycles to skip
interface update when removing datablock.

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2840
2017-09-14 17:03:40 +05:00
ff79406404 Fix T52653: Render output of linked scenes conflicts with other scenes with the same name
The issue was caused by render result identifier only consist of scene name,
which could indeed cause conflicts.

On the one hand, there are quite some areas in Blender where we need identifier
to be unique to properly address things. Usually this is required for sub-data
of IDs, like bones. On another hand, it's not that hard to support this
particular case and avoid possible frustration.

The idea is, we add library name to render identifier for linked scenes. We use
library name and not pointer so we preserve render results through undo stack.

Reviewers: campbellbarton, mont29, brecht

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2836
2017-09-14 16:50:19 +05:00
4bd014e951 Depsgraph: Fix crash in masking, related on T52749 2017-09-14 16:23:16 +05:00
75f36266df Merge branch 'master' into blender2.8 2017-09-14 16:17:22 +05:00
09c6c6c486 Fix T52749: New Depsgraph - Render View Mask is not initialized correctly 2017-09-14 16:12:01 +05:00
3573f49bfd Masks: Split layer evaluation into separate function
This way we can easily re-use bits of code for new dependency graph.

Currently should be no functional changes.
2017-09-14 16:09:06 +05:00
8140b51aa4 Fix T52739: Crash loading corrupted video files
Affects both "normal" open as a video file and thumbnail generation.
2017-09-14 14:56:25 +05:00
c57636f060 Fix failure in our UI code that could allow search button without search callbacks, leading to crash.
Related to (exposed by) T52735, fixes the reported crash but not the
underlying issue.

To be backported to 2.79a should we do one.
2017-09-14 10:58:47 +02:00
d827186c17 Fix T52723: Reset UV layers failed 2017-09-14 17:46:03 +10:00
f7163a7d0a Fix T52741: Follow track with depth object crashes Blender with new depsgraph 2017-09-14 12:31:54 +05:00
bd1f946413 Recent action-bake used Py3.6 syntax 2017-09-14 17:04:41 +10:00
892d304ded Fix T52291: Boolean fails w/ co-linear edged ngons
This means boolean tessellation wont match viewport tessellation
however it's needed to avoid zero area triangles causing problems.
2017-09-14 16:08:03 +10:00
5ae63f03d9 DRW: Fix texture binding logic. 2017-09-14 01:03:19 +02:00
3b080c3f66 GPUCodegen: Add New GPU_SOURCE_STRUCT to be used for Closure Sockets
This way we dont rely on the static array of chars that was causing T52385.

That fixes T52385.
2017-09-14 01:03:19 +02:00
a01fbc6689 Manipulator: use box style for render border 2017-09-14 05:05:28 +10:00
c9be499c31 Manipulator: cage2d expand hotspot
With new style drawing hotspot should be in the middle of the border,
not inside it.
2017-09-14 04:38:48 +10:00
c1ff05e66f Manipulator: disable hover for camera border 2017-09-14 04:10:33 +10:00
3bf36fa33b Manipulator: alternate cage2d draw style
Doesn't rely on hovering, more consistent with 2D drawing tools.
2017-09-14 03:54:32 +10:00
55fb6e7096 GPU_immediate_util: Add x,y radius to circle draw
A version of circle drawing for non 1:1 aspects
2017-09-14 03:54:32 +10:00
d5478e20cc Eevee: Fix AO disappearing when updating Probe Grids. 2017-09-13 19:40:53 +02:00
2d261685a9 Eevee: Fix T52357 : SSRefraction broken after adding probe
I forgot the reset the toggle after rendering the probes...
2017-09-13 19:31:48 +02:00
1fca11d5cb DRW: Fix incorrect Ubo Bind 2017-09-13 17:44:36 +02:00
4088c9fa68 Eevee: Get rid of glitchy black SSR.
Add sanitizer. I wanted to stay away from this because I think we should fix what causes NaNs in the first place. But there can be too much different factor causing NaNs and it can be because of user inputs.
2017-09-13 17:44:36 +02:00
6d359e4498 Cleanup: use explicit 2d suffix for imm utils
Avoid ambiguity between 2d/3d (which were already named).
2017-09-14 01:24:50 +10:00
2a01fb61f8 Cleanup: use safe free macro & comments 2017-09-14 01:24:47 +10:00
e9d8b780ae DRW: Fix leak (2nd attempt) cause by texture "state" tracking
This should get rid of the leak once for all.
2017-09-13 16:55:58 +02:00
2b2277ecbc DRW: Fix memleak in release mode. 2017-09-13 15:42:48 +02:00
37d8d4787c Merge branch 'master' into blender2.8 2017-09-13 23:44:13 +10:00
6f633dec5d Fix T52299: X resolution of 4 causes nodes to collapse
Was caused by numeric overflow when calculating preview dimensions.
Now we try to avoid really insance preview resolutions by fitting
aspect into square.
2017-09-13 18:31:36 +05:00
9abacf38fd Eevee: SSR: Making ray count a define rather than an uniform.
The branching introduced by the uniform caused problems on mesa + AMD in the resolve stage.
This patch create one shader per sample count without branching.
This improves performance of a single ray per pixel case (3.0ms against 3.6ms in my testing)
2017-09-13 15:29:38 +02:00
32449e1b21 Code cleanup: store branch factor in PathState. 2017-09-13 15:24:14 +02:00
9e258fc641 Code cleanup: avoid used of uninitialized value in case of precision issue. 2017-09-13 15:24:14 +02:00
37d9e65ddf Code cleanup: abstract shadow catcher logic more into accumulation code. 2017-09-13 15:24:14 +02:00
f77cdd1d59 Code cleanup: deduplicate some branched and split kernel code.
Benchmarks peformance on GTX 1080 and RX 480 on Linux is the same for
bmw27, classroom, pabellon, and about 2% faster on fishy_cat and koro.
2017-09-13 15:24:14 +02:00
c4c450045d Code cleanup: tweak inlining for 2% better CUDA performance with hair. 2017-09-13 15:24:14 +02:00
76e7c039ec Fix T52140: Align objects centers using origin for text
The issue was caused by operator redo which frees all object's evaluated data,
including bounding box. This bounding box can not be reconstructed properly
without full curve evaluation (need to at least convert font to nurbs, which is
not cheap already).
2017-09-13 17:40:11 +05:00
43858c4197 Cleanup: avoid right-shifted args in RNA register 2017-09-13 21:52:57 +10:00
29a7ad8b1a Node UI: scale cross by pixelsize
Draws a little smaller to fit with 2.8x manipulator.
2017-09-13 21:48:51 +10:00
71c1bd1bd8 Manipulator: cage2d option to grab w/ a center handle 2017-09-13 21:42:13 +10:00
04800ed434 Fix T52113: Compositor doesnt mix unrendered render layers well
Compositor was always defaulting to all-zero s output for missing passes.

This was broken in 4cf7fc3.
2017-09-13 15:46:19 +05:00
f472aea922 Compositor: Cleanup, get rid of nested ternary operators
Having single switch statement is much more readable.
2017-09-13 15:46:19 +05:00
17a117c7a0 Compositor: Cleanup, de-duplicate some code 2017-09-13 15:46:19 +05:00
4fde0910d5 Compositor: Cleanup, reduce indentation level in render layer node
There is absolute no reason to have such an indentation level, it only causes
readability and maintainability issues. It is really simple to make code more
"streamlined".
2017-09-13 15:46:19 +05:00
77eaf5cd7a Manipulator: Only allow negative scale w/ flag set
In most cases we don't want this by default
2017-09-13 18:20:37 +10:00
a5c9f15a0e Manipulator: use solid regions for select drawing
Needed for 3D view selection
2017-09-13 18:06:26 +10:00
0bf8d16d1c Manipulator: cage2d - uniform handle size 2017-09-13 15:46:28 +10:00
86c73ea8d7 Manipulator: fix cage2d scaling 2017-09-13 15:46:18 +10:00
8a5af5202c Eevee: Fix T52713: SSR not working in AMD
This was cause by a fairly funky unitialize buffer (last frame) that was causing NANs during the SSR resolve stage.
They were then propagated to the whole image during the next swap.

Bypassing the SSR completly if no valid history exists fixes the problem. Also disabling SSR data output in this case so we can have correct reflection in the 1st history buffer.
2017-09-12 18:32:29 +02:00
79a1d74c78 Eevee: Fix T52510: assert with volume defines.
This assert was not making sense at all. Removing
2017-09-12 17:50:21 +02:00
07e6e5edfb Eevee: Fix extinction of Light parallel to views.
This was a problem with orthographic views and lights without rotations. This introduce a small bias that should fix most cases.
2017-09-12 16:18:18 +02:00
Mathieu Menuet
659ba012b0 Cycles: change AO bounces approximation to do more glossy and transmission.
Rather than treating all ray types equally, we now always render 1 glossy
bounce and unlimited transmission bounces. This makes it possible to get
good looking results with low AO bounces settings, making it useful to
speed up interior renders for example.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2818
2017-09-12 15:37:35 +02:00
fc42063d1e Eevee: Fix wrong shadow Orco mapping. 2017-09-12 15:06:07 +02:00
1e1d34654b Eevee / DRW : Codestyle 2017-09-12 15:03:34 +02:00
d2202117fe T50354: Action length calculation added unnecessary padding if some F-Curves
only contained a single key (on the last real frame of the action).
2017-09-13 00:53:50 +12:00
a704a66914 Adding some verbose documentation
I thought this was already clear enough, but apparently not.
2017-09-13 00:53:46 +12:00
f2b3e1f712 Eevee: Fix T52480: Can't reproduce Metallic transparency with Principled + Mix Shader
You can now use a transparent shader as a completly transparent bsdf. And use whatever alpha mask in a mix shader between a transparent bsdf and another bsdf.
2017-09-12 14:25:04 +02:00
7a6f9ab587 Eevee: Fix T52546 : 129th light crashes Blender 2017-09-12 14:25:04 +02:00
fadc079740 Fix T52573: Cycles baking artifacts
Synchronize condition for faces split between Cycles itself and baking API.
2017-09-12 16:33:42 +05:00
e7b5bbae6a Cycles tests: Add baking features tests 2017-09-12 16:22:02 +05:00
4aee701f00 Fix T52679: Hole in bake normal
In fact, any type of baking might have caused holes in mesh.

The issue was caused by zspan_scanconvert() attempting to get order of traversal
'a-priori', which might have failed if check happens at the "tip" of span where
`zspan->span1[sn1] == zspan->span2[sn1]`.

Didn't see anything bad on making it a check when iterating over scanlines and
pick minimal span based on current scanline. It's slower, but unlikely to cause
measurable difference. Quality should stay the same unless i'm missing something.

Reviewers: brecht, dfelinto

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2837
2017-09-12 16:20:41 +05:00
de6ecc82ed Fix rare firefly in volume equiangular sampling when sampling short distance. 2017-09-12 12:50:44 +02:00
28532f1867 Cycles tests: add environment variable to update references renders.
This will copy new renders over references renders:
CYCLESTEST_UPDATE=1 ctest -R cycles
2017-09-12 12:50:44 +02:00
cd6c9e9e5f Cycles: improve sample stratification on area lights for path tracing.
Previously we used a 1D sequence to select a light, and another 2D sequence
to sample a point on the light. For multiple lights this meant each light
would get a random subset of a 2D stratified sequence, which is not
guaranteed to be stratified anymore.

Now we use only a 2D sequence, split into segments along the X axis, one for
each light. The samples that fall within a segment then each are a stratified
sequence, at least in the limit. So for example for two lights, we split up
the unit square into two segments [0,0.5[ x [0,1[ and [0.5,1[ x [0,1[.

This doesn't make much difference in most scenes, mainly helps if you have a
few large area lights or some types of HDR backgrounds.
2017-09-12 12:45:29 +02:00
d454a44e96 Fix Cycles bug in RR termination, probability should never be > 1.0.
This causes render differences in some scenes, for example fishy_cat
and pabellon scenes render brighter in a few spots. This is an old
bug, not due to recent RR changes.
2017-09-12 12:43:26 +02:00
467d92b8f1 Cycles: Tweaks to avoid compilation error of megakernel
Also moved code out of deep-inside ifdef block, otherwise it was quite confusing.
2017-09-12 13:33:46 +05:00
74eed8e30e Fix T52705: Lamps shadows are not refreshed when tweaking lamps parameters
Lamp and camera datablocks updates should flush some updates to corresponding
objects. Currently it's done as Parameters -> Parameters relations.
2017-09-12 11:58:30 +05:00
b07ee4e3a5 Update tgz script, remove deprecated GZIP use 2017-09-12 16:25:19 +10:00
f875e396ce Eevee: Fix T52593
Use a placeholder texture to remove problems with sampler with no texture bound to it.
2017-09-11 23:17:33 +02:00
d126ffbea4 DRW: Use static list (array) of texture/ubo to track bound textures/ubos.
This is in order to use the same texture on multiple sampler.
Also texture counter is reset after each shading group. This mimics the previous behaviour.
2017-09-11 23:15:29 +02:00
4757404eef Eevee: Fix performance issue on intel.
I did not checked if it makes a diff on other GPU. This might be change to be intel only.
2017-09-11 14:32:44 +02:00
92ace808db Eevee: Fix shadow copy shader error.
filter() is a reserved function.
2017-09-11 14:09:12 +02:00
35ee9ff7a0 Fix T52682: When hair number=faces number, particles/face = 1 , actually some hair is overlap.
Just using same code for distribution for face/volume as the one
changed/used for vertices since some months.

Note that this change is breacking compatibility, in that distribution
of particles over faces/volume may not be exactly the same as
previously.
2017-09-11 12:38:17 +02:00
7d7741d25f Merge branch 'master' into blender2.8 2017-09-11 16:52:53 +10:00
f56fea3d6b Fix T52701: Mesh shortest path fails at boundaries 2017-09-11 16:45:19 +10:00
7e56879772 Fix T52696: Sculpt - Brush spacing pressure artifacts
Was caused by divide-by-zero in paint_stroke_integrate_overlap()
in paint_stroke.c, as identified by Bob Smith (uvwxyz).

Thanks for the report!
2017-09-11 18:24:39 +12:00
49ba9d02d8 Eevee: Fix shadow bleeding after farclip for cubemaps.
NOTE: We should not check for radial distance. But this is faster.
2017-09-11 01:13:55 +02:00
6d2cd1719b Bake Action: operate on selected objects
Previously only the active object was used.

Use coroutines to support baking frames for multiple objects at once,
without having to playback the animation multiple times.
2017-09-10 17:16:47 +10:00
a4a59d578c PyAPI: Add object argument to bake_action
Avoids having to set the scene's active object first.
2017-09-10 14:30:03 +10:00
d97a5484af Eevee: Shadows: Update cascaded shadowmaps when rendering probes.
This is really resource intensive but there is no other way to correctly handle it.
2017-09-10 03:09:45 +02:00
351f10cd79 Eevee: Shadow: Fix, improve cascade shadow map UI. 2017-09-10 03:09:45 +02:00
90efcd6df7 Eevee: Shadows: Add cubemap filtering and adaptive sample count.
Filter size is constant in world space and not dependant of shadow resolution.
The filter size is limited to the number of precomputed samples.
2017-09-10 03:09:45 +02:00
314739bced Eevee: Shadow: Fix Incorrect shadowing after sun lamp far clip plane.
Reject cascade sample if not in shadowmap volume.
2017-09-10 03:09:45 +02:00
9fdf094b85 Eevee: Shadows: Filtering improvement.
- Replace poisson by concentric samples: Less variance. They are sorted by radius then by angle.
- Separate filtering into 2 blur. First blur is 3x3 box blur. Second is user dependant.
- Group fetches by group of 4.
2017-09-10 03:09:45 +02:00
adeaf37e77 Eevee: Add Cascaded Shadow Map options. 2017-09-10 03:09:45 +02:00
cc6e97d426 Lamps: Remove uper limit of the buffer bias parameter. 2017-09-10 03:09:45 +02:00
716f7859a8 Eevee: Add Cascaded Shadow Map support with filtering.
This brings some data structure changes.
Shared shadow data are stored in ShadowData (in glsl) (aka EEVEE_Shadow in C).
This structure contains the array indices of the first shadow element of this shadow "object".
It also contains how many shadow to evaluate (to be used for Multiple shadow maps).

The filtering is noisy and needs improvement.
2017-09-10 03:09:45 +02:00
6c17348e91 Eevee: Shadow: Add high bitdepth option.
This option is here for reducing the memory usage of shadow maps.

Also lower bitdepth are quicker to process.
2017-09-10 03:09:45 +02:00
f46b908cc5 Eevee: Expose Shadow filter size. 2017-09-10 03:09:45 +02:00
32e96448b9 Eevee: Add Variance Shadow Mapping
This is an alternative to ESM. It does not suffer the same bleeding artifacts.
2017-09-10 03:09:45 +02:00
e2603a6e82 Eevee: Shadows: Add UI buttons for size and method
Only one method is available right now. VSM and PCF are comming.
2017-09-10 03:09:45 +02:00
8b7a83a868 Eevee: Refactor Shadow System
- Use only one 2d texture array to store all shadowmaps.
- Allow to change shadow maps resolution.
- Do not output radial distance when rendering shadowmaps. This will allow fast rendering of shadowmaps when we will drop the use of geometry shaders.
2017-09-10 03:09:45 +02:00
11a9434c2d Resolve T52687: Add node label shows as 'Unknown'
Add type access method, need to extend to other types
for now just get node UI working properly again.
2017-09-09 22:56:58 +10:00
3c3d0898b0 PyAPI: Fix mathutils freeze allowing owned data 2017-09-09 11:08:38 +10:00
30d8829780 Docs: mathutils docstrings 2017-09-09 11:02:26 +10:00
90eb93791f Cleanup: mathutils vector comments
Use doxy markup & correct outdated info.
2017-09-09 10:50:40 +10:00
3930e46e37 Correct last commit 2017-09-09 10:15:16 +10:00
002cc6aef3 Cleanup: Simplify SWIZZLE macro
- Use indices instead of character args.
- Use numbered macros instead of variadic args.

Parsing using rtags used over 11gb of memory. While this should be
resolved upstream (report as #1053), the extra complexity didn't give
any real advantage.
2017-09-09 10:10:05 +10:00
4265d85f8b [msvc/make.bat] mention the msvc-2017 option in the make.bat help text. 2017-09-08 14:24:02 -06:00
ae41a08288 Cycles: Attempt to work around compilation of sm_20 and sm_21
Disabled forceinline for those architectures, which seems to be compiling
successfully more often.

There might be ~3% slowdown based on quick tests, but better be rendering
something rather than failing to compile kernels again and again.

Those architectures will be doomed for abandon once we'll switch to toolkit 9.
2017-09-08 18:37:54 +02:00
5d1a5001f4 Fix T52628: own error in string duplication
Error in 636baa598a
2017-09-09 02:08:58 +10:00
ce1f2e271d Cycles: disable fast math flags, only use a subset.
Empty BVH nodes are set to NaN which must be preserved all the way to the
tnear <= tfar test which can then give false for empty nodes. This needs
strict semantices and careful argument ordering for min() and max(), so
the second argument is used if either of the arguments is NaN.

Fixes T52635: crash in BVH traversal with SSE4.1.

Differential Revision: https://developer.blender.org/D2828
2017-09-08 15:12:37 +02:00
b02ab2e7d9 Fix: Grease Pencil pie menu keymaps were broken after the menus got renamed 2017-09-09 01:03:15 +12:00
c9afc41cfd Fix T52650:Grease pencil selection its not automatically updating in Clip Editor 2017-09-08 11:21:49 +02:00
2a3a747ca2 Fix T52678: Crash editing gpencil w/ frame-lock 2017-09-08 18:51:47 +10:00
5b026486e4 Fix leak caused by wrong ownership flag 2017-09-08 04:22:19 +10:00
a2989b89c3 Fix leak w/ ocio glsl draw 2017-09-08 04:20:58 +10:00
df58d6bf76 Fix T52046: View transform applied twice w/ GL render
Patch from @sergey w/ minor edit.
2017-09-08 03:57:07 +10:00
a133b74709 Merge branch 'master' into blender2.8 2017-09-08 03:18:39 +10:00
60020f57d7 Correct function name in argument parsing 2017-09-08 00:59:27 +10:00
daf7aed849 PyAPI: use bl_rna_get_subclass for node API
Returns a default value instead of an error when the type isn't defined.
2017-09-08 00:03:01 +10:00
e44bf43f6c PyAPI: add function to get an RNA subclass
This is inconvenient in regular Python, add a class-method
to perform the operation, eg:

bpy.types.Node.bl_rna_find_subclass("CustomNodeType")
2017-09-08 00:02:09 +10:00
accc94dd73 Cleanup: remove goto's 2017-09-07 22:53:46 +10:00
f4d46916fa UI: fix memory leak when copy-to-selected failed 2017-09-07 22:15:12 +10:00
1601089ece Merge branch 'master' into blender2.8
This discards node drawing changes which need to be written as shaders.
2017-09-07 14:53:06 +10:00
f1021ee929 Merge branch 'master' into blender2.8 2017-09-07 14:33:59 +10:00
3f8aaec6bd Weight Smooth: remove source option
Use current selection mode instead of an operator option.
2017-09-07 14:14:42 +10:00
5f7de54243 Fix T52639: Weight paint smooth tool crash 2017-09-07 13:20:39 +10:00
c3322603eb Cleanup: custom nodes template
- Use conventional (pep8) prop names
- Simplify class registration
2017-09-07 05:20:29 +10:00
5d65aee07a Workaround node types not being exposed
We might want to have a utility function for this,
for now just keep it working.
2017-09-07 05:17:02 +10:00
8172e8e528 Node UI: Add square and diamond socked draw styles
Currently not used by Blender's node trees

D2814 by @charlie
2017-09-07 04:45:38 +10:00
c10ea88420 Fix T52660: CUDA volume texture rendering not working on Fermi GPUs. 2017-09-06 18:12:45 +02:00
fb2e0592bc Fix crash using arrow manipulator 2017-09-07 01:56:42 +10:00
e2f42ff907 Merge branch 'master' into blender2.8 2017-09-06 17:23:47 +02:00
82ede9de48 Fix mistake in previous fix for T52640. 2017-09-06 17:22:38 +02:00
16fbb47c88 Use normalized project functions 2017-09-07 01:20:59 +10:00
4d8980a690 Fix T52640: crash when opening image file browser in some cases.
There was some invalid state in the screen here, some areas had
sa->full set even though no screen was maximized, which then caused
a restore from the wrong (empty) area, which then led to spacedata
being empty and a crash.

This fix properly clears the sa->full after restore, and also fixes
existing .blend files in such an invalid state.
2017-09-06 16:17:18 +02:00
584523e0ad Screw Modifier: remove doubles option
Vertices on the axis can be optionally merged,
nice for creating objects which close at the end-points.
2017-09-07 00:12:43 +10:00
6e0fd239e3 Math Lib: normalized vector project functions 2017-09-07 00:12:43 +10:00
2d407fc288 Fix T52661: mesh light shader using backfacing not working, after new sampling. 2017-09-06 13:51:48 +02:00
dd8016f708 Fix T52652: Cycles image box mapping has flipped textures.
This breaks backwards compatibility some in that 3 sides will be mapped
differently now, but difficult to avoid and can be considered a bugfix.
2017-09-06 13:51:45 +02:00
56ff14ea63 View3D Remap: skip defmaterial
This isn't library data.
2017-09-06 20:57:25 +10:00
e54caf76cb Fix T52663: Remap used invalid local-view data
Only the camera from View3D.localvd is used,
other pointers may be invalid.

Longer term we should probably clear these to ensure no accidents.
For now just follow the rest of Blender's code and don't access.
2017-09-06 20:52:49 +10:00
b41d34040b Merge branch 'master' into blender2.8 2017-09-06 16:50:59 +10:00
47b7f06d0e Fix error in high bit-depth image tile drawing
From @1xundoredo in D2824
2017-09-06 16:11:19 +10:00
0fd31c53ee Rigidbody: Fix regression introduced in ee3fadd
Baking rigid body cache was broken if some cached frames already
existed.

This is just a band aid for release, the logic need to be looked into
further.
2017-09-05 19:59:46 +02:00
4ad5df8858 Fix T52374: Changes of rigid body related settings during simulation will break the simulation
Revert 9cd6b03, 3edc8c1, b87d10d and do a better fix for T50230.
2017-09-05 19:59:46 +02:00
6c66e1bc83 Fix T52251: Knife cur displaces surface 2017-09-06 01:50:36 +10:00
750e38a526 Cycles: Fix compilation error with CUDA after recent changes 2017-09-05 16:52:45 +02:00
Dalai Felinto
518e768579 Fix T52441: Principle BSDF clearcoat
Since the change to prevent shader recompilation at every update, we got
a regression when clearcoat was used.

Basically at the shader build time we would determine if the shader
needed clear coat, and if it didin't, it would build a different GLSL
program.

However if later the user updated the clearcoat value so that it would
then require the full clearcoat shader, the user wouldn't get it until
manually forcing the shader to recompile, or reopening the file.

We now handle the optimization in the GLSL code. That adds a minimum
overhead due to branching. But the overall performance seems unchanged
(tested on linux in AMD and NVidia).

Reviewers: pascal, brecht, fclem

Differential Revision: https://developer.blender.org/D2822
2017-09-05 16:40:27 +02:00
bffa57e6d8 Manipulator: Fix arrow2d drawing outside hotspot 2017-09-06 00:40:20 +10:00
704f6a5184 Buildbot: Fix paths to sndfile and flac
Need this in 2.79 branch as well, since build rules are based on this files.
2017-09-05 16:17:48 +02:00
16e5b932b7 Manipulator: cage2d initial rotation support 2017-09-06 00:06:53 +10:00
0a1a7323e5 Manipulator: missing exit() call 2017-09-06 00:06:53 +10:00
f01e43fac3 Fix T52433: Volume Absorption color tint
Need to exit the volume stack when shadow ray laves the medium.

Thanks Brecht for review and help in troubleshooting!
2017-09-05 15:48:34 +02:00
572b1a644f Merge branch 'master' into blender2.8 2017-09-05 22:56:03 +10:00
4d85396fe4 Cleanup: use const
Also use assert w/ rotate_m4.
2017-09-05 22:45:44 +10:00
b0bbb5f34f Cycles: Cleanup, style 2017-09-05 12:43:02 +02:00
6859695055 Fix T52649: missing custom (split) normals from FBX exporter.
Own mistake in recent rB25c5928b2b6 (this DOES NOT affect 2.79 release).
2017-09-04 21:04:19 +02:00
4a744727be Fix T52531: Blender 2D stabilisation node issue when autoscale is selected
Threading conflict, should be safe for 2.79.
2017-09-04 16:41:28 +02:00
b07e983b61 PyAPI: Add bpy.utils.register_classes_factory
Avoids having boiler plate register/unregister functions.
2017-09-05 00:24:29 +10:00
71f0c32dad Fix T52522: VSE renders with alpha transparent PNG image incorrectly
Need some extra checks and should be probably end up in 2.79 since that's a regression.
2017-09-04 14:46:17 +02:00
885c0a5f90 Cycles: Fix compilation warning 2017-09-04 13:28:15 +02:00
33249f6987 Fix T52533: Blender shuts down when rendering duplicated smoke domain 2017-09-04 13:14:54 +02:00
3789ab4166 PyAPI: fix rna_info for changes in type access 2017-09-04 16:39:13 +10:00
30d7fbd7a0 PyDoc: update context_type_map 2017-09-04 16:19:27 +10:00
f4fb329808 RNA/PyAPI: Expose Py classes in bpy.types
Operators and their properties are two different types

Previously both operators and their properties are added
causing C operators to access the properties, Python the classes.

Favor consistency in this case so only Python classes are added.
2017-09-04 14:49:27 +10:00
85d53620aa Cleanup: avoid confusing assignment 2017-09-04 14:35:35 +10:00
718af8e8b3 T52534: Compositor artifacts when scaling
Increased the maxx and maxy area of interest when scaling in this case.
2017-09-03 16:47:39 +02:00
4d148471b6 Fix T52634: EditMesh Remove doubles could hang
A single diagonal axis was used for sorting coordinates,
the algorithm relied on users not having vertices axis aligned.

Use BLI_kdtree to remove doubles instead.

Overall speed varies, it's more predictable than the previous method.
Some typical tests gave speedup of ~1.4x - 1.7x.
2017-09-03 23:52:10 +10:00
459d76ec51 BLI_kdtree: utility function to remove doubles 2017-09-03 23:43:14 +10:00
9c1cc35be2 CMake: use Blender's glew by default
Use since it's always bundled to avoid any issues caused
by version mis-match.
2017-09-03 16:36:17 +10:00
b227a3388d Fix: Deleting GPencil keyframes in DopeSheet didn't redraw the view 2017-09-03 12:49:17 +12:00
4f6196a041 Fix: Border select for GPencil keyframes was including those in the "datablock" channels even though those weren't visible
This meant that it was easy to accidentally select too many keyframes
2017-09-03 12:49:16 +12:00
c671973092 Fix: GPencil Sequence Interpolation for thickness/strength was inverted
For example, if you have two keyframes:
  k1 = 1px, k2 = 10px

it was doing:
  1px, 9px, 8px, ..., 3px, 2px, 10px
instead of:
  1px, 2px, 3px, ..., 8px, 9px, 10px
2017-09-03 12:49:15 +12:00
53ec0e5166 Fix T52227: Time Slide tool doesn't take NLA mapping into account
To be backported to 2.79
2017-09-03 12:49:15 +12:00
fcd7ac1451 [deps/msvc] Debug flags for optimized debug libs were inverted for cxx. 2017-09-02 17:14:42 -06:00
32e36a1782 Correct own error simplifying matrix checks 2017-09-03 00:05:11 +10:00
7dfcbe01b0 Merge branch 'master' into blender2.8 2017-09-02 20:08:02 +10:00
3750389ce3 Cleanup: use title caps for labels
Also consistent quoting (single quotes for enums, text uses double).
2017-09-02 16:13:33 +10:00
39f8b245d4 Fixes to cage2d scaling in the node editor 2017-09-02 03:55:45 +10:00
2ca1f29748 BMesh: use predictable order for remove-doubles
Each qsort implementation may give different results when values match.

Now fallback to sorting by index.
2017-09-02 03:30:09 +10:00
ce112cf0df Revert "Manipulator: remove unused event hack"
This reverts commit 134e927965.

Writing into const event is very bad,
but this change broke compositor manipulators.

Will look into better solution eventually.
2017-09-02 00:55:29 +10:00
8d207cdc3b Fix T52472: VSE Audio Volume not set immediately
Audio mixing is done with volume interpolation. A new handle started at
volume 1, now starting at volume 0 for a smooth fade in.
2017-09-01 12:27:21 +02:00
a5cb23c441 Merge branch 'master' into blender2.8 2017-09-01 19:17:14 +10:00
94b7bf3ec2 RNA: demote non-strict class naming to warning
This stops a lot of add-ons from registering,
while this must be resolved but there no need to force error just now.
2017-09-01 17:06:14 +10:00
18b7f05480 Cycles: follow strict class naming convention 2017-09-01 16:08:25 +10:00
c843e84892 Merge branch 'master' into blender2.8 2017-09-01 02:30:48 +10:00
0bbae3f3f6 RNA: strict naming for types in bpy.types
Blender scripts already do this, some addons will need updating.
2017-09-01 01:00:57 +10:00
217fddcb8e Cleanup: strict naming conventions 2017-09-01 01:00:56 +10:00
Dalai Felinto
44e10a5c66 Increase max/min frame range to over a million
For some specific pipelines (e.g., holographic rendering) you can easily
need over a million frames (1k * 1k view angles).

It seems a corner case, but there is no real reason not to allow users
doing that.

That said we do loose subframe precision in the highest frame range. Which can
affect motionblur. The current maximum sub-frame precision we have is 16.
While the previous limit of 500k frames has a precision of 32.

Thanks to Campbell Barton for the help here.

To be backported to 2.79
2017-08-31 16:13:04 +02:00
636baa598a RNA: Limit which classes struct-map contains
Only add subclasses of: Menu, Panel, Header, UIList, Operator

This helps avoid unnecessary naming collisions,

See T52599 for details
2017-08-31 23:49:50 +10:00
018137f762 Cycles: Cleanup, indentation and trailing whitespace 2017-08-31 14:47:49 +02:00
323a7ab944 Merge branch 'master' into blender2.8 2017-08-31 21:57:38 +10:00
8b9e1707a1 Cycles: Fix typo in comment 2017-08-31 13:24:32 +02:00
a35aae9e49 Correct last commit 2017-08-31 19:12:55 +10:00
732f70a151 RNA: existing type check used wrong identifier
Own error in recent type checks, in many cases the 'idname'
is used for the struct identifier, not the 'identifier'
which is the Python class name in this context.
2017-08-31 18:45:00 +10:00
480def9c55 Fix T52591: OpenColorIO not working correct with OpenGL core profile on macOS.
Also remove textureSize() replacement code, is always supported now.
2017-08-30 19:59:07 +02:00
17f26e181f OCIO: use modern GLSL texture functions
small part of ongoing OpenGL upgrade
2017-08-30 13:33:37 -04:00
cc830e2586 Manipulator: correct pivot w/ non 1:1 aspect 2017-08-31 03:07:05 +10:00
eafe96a718 Manipulator: empty image manipulator, use aspect 2017-08-31 02:38:16 +10:00
00ba48a699 Manipulator: replace old cage2d manipulator
Mostly internal changes, keeping both manipulators
could have worked but there was no point long term.

There are still some glitches to resolve, will work on those next.
2017-08-31 02:00:16 +10:00
b448b025c7 Manipulator: rename callback type 2017-08-31 02:00:16 +10:00
4f1b510d75 Cycles: Add tangent attribute tests 2017-08-30 17:42:00 +02:00
29b2a47a8a Fix T52588: Shape key value driver variables of duplicated object sets refer to old objects.
Regression since 2.78, to be backported to 2.79.
2017-08-30 17:24:06 +02:00
Dalai Felinto
698bae05aa Eevee: Fix conditional statement depending on unitialized value
Basically since g_data was malloc'ed (instead of calloc'ed)
g_data->minzbuffer was never initialized.

So when running DRW_framebuffer_init after EEVEE_effects_init, the test
to *g_data->minzbuffer would lead to unpredictable results.

This was caught by valgrind, reported by Sergey Sharybin.
2017-08-30 17:00:00 +02:00
25c5928b2b Refactor 'split faces' mesh code.
Previous version was trying to do a quick and simple process in the case
we were only considering smooth/flat status of faces.

Thing is, even then, the algorithm was not actually working in all
possible situations, e.g. two smooth faces having a single vertex in
common, but no common edges, would not have split that vertex, leading
to incorrect shading etc.

So now, tweaked slightly our split normals code to be able to generate
lnor spaces even when autosmooth is disabled, and we always go that way
when splitting faces.

Using smooth fans from clnor spaces is not only the only way to get 100%
correct results, it also makes face split code simpler.
2017-08-30 16:52:47 +02:00
Dalai Felinto
510651ed72 Attempt to fix OpenColorIO issues on Mac
We cannot have version130 there (should use version 330 instead).
Patch suggested by Brecht Van Lommel
2017-08-30 15:45:11 +02:00
Stefan Werner
68dfa0f1b7 Fixing T52477 - switching from custom ray/triangle intersection code to the one from util_intersection.h. This fixes the bug and makes the code more readable and maintainable. 2017-08-30 11:48:49 +02:00
fbcf05f443 Depsgraph: Copy-on-write component does not depend on itself 2017-08-30 11:15:58 +02:00
998947360b Manipulator: remove inline matrix calculation 2017-08-30 18:13:25 +10:00
8b23549d47 Manipulator: run callback when calculating the final matrix 2017-08-30 18:04:42 +10:00
124ffb45a6 Cycles: Fix build with networking enabled 2017-08-30 00:19:44 -04:00
1457e5ea73 Fix Cycles Windows render errors with BVH2 CPU rendering.
One problem is that it was always using __mm_blendv_ps emulation even if the
instruction was supported. The other that the emulation function was wrong.

Thanks a lot to Ray Molenkamp for tracking this one down.
2017-08-29 22:55:35 +02:00
d34dac1070 Depsgraph: Fix crash when ungrouping node group
We shouldn't tag both COW and shading parameters ocmponents for update at
the same time.
2017-08-29 17:12:43 +02:00
9deccce07d Depsgraph: Fix missing material update when driving property in a group 2017-08-29 17:03:07 +02:00
696f4dc85f Alembic: Fix T52579: crash when replacing slightly different alembic files
Apparently with Maya in a certain configuration, it's possible to have an
Alembic object without schema in the Alembic file. This is now handled
properly, instead of crashing on a null pointer.
2017-08-29 16:58:13 +02:00
852d702da0 Fix possibly missing flushes back to copy-on-write operation
Could have happened if multiple tags per object happens.
2017-08-29 16:28:06 +02:00
Alexander Gavrilov
735e287271 Fix T48079: Maintain Volume constraint overcompensates.
The coefficient has been wrong since introduction for some reason.

Not backwards compatible, should not be merged to 2.7*.
2017-08-29 15:23:47 +03:00
01bdb0c76e Support Copy To Selected and Alt-Click for F-Curves in the curve editor.
This affects the curve display color setting, but is really intended
for future per-curve options.

The id_data reference in the created rna pointers refers to the object
even if the curve is actually owned by its action, which is somewhat
inconsistent, but the same problem can be found in existing code.
Fixing it requires changes in animdata filter API.
2017-08-29 14:30:44 +03:00
f846846941 Depsgraph: Fix missing updates when tweaking node tree parameters
The is following: split copy on write update for node trees, and if we are only
tagging for uniform buffer update we skip whole datablock copy and only invoke
copy default_values form original nodetree to a copied one.

Thing which i'm not sure is: whether we need to use different branches in graph
itself to control such a conditional behavior, or whether we need to store tag
somewhere in the dependency graph. There are obviously cons and pros in both
approaches, and need to think about this. Maybe with more examples it becomes
more obvious which way is better.

This only fixes manual tweaks for now, animation support is coming.
2017-08-29 12:58:55 +02:00
c1582667ca Add utility function to copy default values from one tree to another
The trees should match in nodes layout completely.
2017-08-29 12:55:03 +02:00
9ca03ba410 Manipulator: use cage2d_rotate in UV view
Use when selection bounds isn't a single point.
2017-08-29 20:04:31 +10:00
369cd8521b Manipulator: new cage2d manipulator
Adding alongside the existing one for now,
but it should eventually replace it.

Uses a matrix instead of (position + scale),
written so rotation can be done more easily.

Currently has a primitive handle for rotation, supports corner scaling.
2017-08-29 20:04:31 +10:00
c7f106cbe2 View2D: function to get view to region matrix 2017-08-29 19:36:40 +10:00
83ea224a7f Depsgraph: Fix missing updates when changing node tree topology
There were two issues here:

1. material_update did not do anything, because DEG_id_tag_update was storing
   update tags in original IDs, which had nothing evaluated. Even more, material
   update should have been called with evaluated version of material, Solved
   this by copying update tag from original ID to a copied one.

   However, perhaps DEG_id_tag_update should tag both original and copied ID,
   so updates are never gets lots if some depsgraph is not visible.

2. Tagging material for update should ensure it's copied version of node tree is
   up to date, otherwise material will still use old node tree.

This solves missing material updates when changing topology. Tweaking values is
still broken, because of GPUMaterial using pointer to original node's socket
value, which gets broken after copy-on-write of the node tree (pointers of nodes
are changing).
2017-08-29 11:32:25 +02:00
6b8132a153 Merge branch 'master' into blender2.8 2017-08-29 19:38:01 +10:00
3d56bfbc82 Merge branch 'master' into blender2.8 2017-08-29 16:06:26 +10:00
1c92ffa149 Transform: scale center override by aspect
Needed for image space.
2017-08-29 16:01:16 +10:00
db1ffe11b6 Cleanup: naming (RECT -> CAGE2D)
Make cage2d 'part' defines public (needed to assign operator actions).
2017-08-29 12:53:57 +10:00
156c0ab255 Depsgraph: Don't case ID_Type to short 2017-08-28 11:51:53 +02:00
52dd5c5fcf Merge branch 'master' into blender2.8 2017-08-28 11:44:39 +02:00
b4b1397ad9 Depsgraph: Don't cast ID_Type to short 2017-08-28 11:43:36 +02:00
f9f4e20871 Merge branch 'master' into blender2.8 2017-08-28 11:27:50 +02:00
2e71927622 Make GS macro return proper IDType type
Previously it was returning short, which was really easy to (a) compare against
non-ID type value (b) forget to handle some specific value in switch statement.

Both issues happened in the nearest past, so it's time to tighten some nuts
here.

Most of the change related on silencing strict compiler warning now, but there
is also one tricky aspect: ID_NLA is not in the IDType enum. So there is still
cast to short to handle that switch. If someone has better ideas how to deal
with this please go ahead :)
2017-08-28 11:21:55 +02:00
f4b3678646 Atomics: Use system headers directly, without bad level dependency to BLI
This will make it easier to re-use library as-is in other projects,
such as Cycles standalone repo for example.
2017-08-28 11:06:15 +02:00
49e7b77b19 Depsgraph: Pass copy-on-write pointer to material update
Unfortunately, there is something else wrong going on here, which makes objects
black after tweaking material settings.
2017-08-28 11:00:42 +02:00
6b5d8c29e6 Merge branch 'master' into blender2.8 2017-08-28 10:33:29 +02:00
b11b5b273e Buildbot: Tweak nightly schedule of builds
Basically, schedule linux 64 earlier on, so builds are ready for nightly benchmarks.
2017-08-28 09:12:53 +02:00
7114b5681f Missing from last commit (missed manually resolving) 2017-08-28 16:29:13 +10:00
8cd2b6ca8e Merge branch 'master' into blender2.8 2017-08-28 16:04:42 +10:00
a520e7c85c Transform: center override
Hidden option to override transform center.
Needed for manipulators that define their own center.
2017-08-28 16:00:28 +10:00
af108a2f26 Merge branch 'master' into blender2.8 2017-08-28 14:25:10 +10:00
c8627b9067 EditMesh: set edge-rin subdiv minimum to 1
This only made sense for bridge tool.

D2785 by @mbjorkegren
2017-08-28 14:25:00 +10:00
2f8c8ec8fb Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 14:25:00 +10:00
0f1fc5f50d Fix T51400: Pasting hex code fails
The # prefix is supported,
the button didn't give enough space to paste it.

D2812 by @candreacchio
2017-08-28 14:25:00 +10:00
c16a98bb06 Fix T52498: Deleting force field doesn't remove "Surface" from modifier stack.
Logic in `ED_object_check_force_modifiers` was inconsistent between add
and remove modifier cases.

Should be safe enough for 2.79.
2017-08-28 14:25:00 +10:00
1261a29fc0 EditMesh: set edge-rin subdiv minimum to 1
This only made sense for bridge tool.

D2785 by @mbjorkegren
2017-08-28 13:01:11 +10:00
cb7f1f8160 Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 12:40:36 +10:00
0b5cabdca5 Fix T51400: Pasting hex code fails
The # prefix is supported,
the button didn't give enough space to paste it.

D2812 by @candreacchio
2017-08-28 12:18:39 +10:00
Julian Eisel
e0ce01c3b1 Fix blenderplayer compilation 2017-08-28 02:08:47 +02:00
ddff9d0ea6 Manipulator: support operator per-part
A single manipulator could only assign a single operator to each part.
Now each part can have it's own.

Also modify 2D selection callback, 2D started at 1, 3D at 0.
Now use -1 for unset value, start both at 0.
2017-08-28 00:56:08 +10:00
dcebad773f Fix T52498: Deleting force field doesn't remove "Surface" from modifier stack.
Logic in `ED_object_check_force_modifiers` was inconsistent between add
and remove modifier cases.

Should be safe enough for 2.79.
2017-08-27 12:20:21 +02:00
ca9801bd42 Merge branch 'master' into blender2.8 2017-08-27 16:35:51 +10:00
c90452e111 BLI_rect: Function to calculate a matrix from 2 rctf's 2017-08-27 16:19:34 +10:00
b1f2b69884 Missing from last commit 2017-08-27 15:24:41 +10:00
6178cf8353 Cleanup: use stubs for eigen gtest 2017-08-27 15:21:09 +10:00
2ff7ba2c6c Correct matrix stack assert 2017-08-27 11:22:31 +10:00
b07dcb8fb0 Missed last commit 2017-08-27 03:51:25 +10:00
b6b27b0671 Fix T52515: Crash on BMesh.to_mesh() 2017-08-27 02:44:15 +10:00
79111f9246 Merge branch 'master' into blender2.8 2017-08-27 00:51:54 +10:00
7e43210edb WM: move theme check out of ED_view3d_draw_select_loop
In 2.8x this needs to be in view3d_opengl_select,
so simplest to make in master too.
2017-08-27 00:48:52 +10:00
fa365d5f2f Fix minor Mesh -> BMesh conversion issues
- Vertex only meshes never restored their selection history.
- Select history was cleared on the source instead of the target.

Simple Optimizations:
- Avoid O(n^2) linked list looping that checked the entire list before
  adding elements (NULL values in the source array to prevent dupes).
- Re-use vert & edge lookup tables instead of allocating new ones.
2017-08-26 23:14:18 +10:00
fe71c86888 Fix T52478: Error report "Shrinkwrap: out of memory" on invisible target.
Shrinkwrap must check it does have valid target data.

Safe for 2.79 release.
2017-08-26 14:48:00 +02:00
5c4fc93f67 Fix T52538: Outliner crash when displaying groups and using Show Active on editmode bone not in any groups
There's no guaranty that given ID is found in current outliner tree...

Safe for 2.79, though not a regression.
2017-08-26 12:28:21 +02:00
58d92cefbd [cycles/ctest] fix failing tests when output folder doesn't exist yet. 2017-08-25 17:17:49 -06:00
5121dacf9d Fix for fix (tm): Residue of the debug code 2017-08-25 21:33:44 +02:00
90110d3732 Fix mistake in previous tangent space optimization 2017-08-25 21:30:20 +02:00
12f627cd9f Cycles: Cleanup, naming of variable
Always use b_ prefix for C++ RNA data.
2017-08-25 21:30:20 +02:00
ee61a97632 Cycles: Add assert to catch possibly wrong logic 2017-08-25 21:30:20 +02:00
f9a3d01452 Cycles: Mark pixels with negative values as outliers
If a pixel has negative components, something already went wrong, so the best option is to just ignore it.

Should be good for 2.79.
2017-08-25 17:46:15 +02:00
e2ffad7823 Fix T52481: After making all local, local proxies of linked data get broken after file save and reload.
Issue was nasty hidden one, the dual status (mix of local and linked)
of proxies striking again.

Here, remapping process was considering obdata pointer of proxies as
indirect usage, hence clearing the 'LIB_TAG_EXTERN' of obdata pointer.
That would make savetoblend code not store any 'lib placeholder' for
obdata data-block, which was hence lost on next file read.

Another (probably better) solution here would be to actually consider
obdata of proxies are fully indirect usage, and simply reassign proxies
from their linked object's obdata on file read...

However, that change shall be safer for now, probably good for 2.79 too.
2017-08-25 16:16:32 +02:00
Dalai Felinto
ae04e27bfa Revert "material Glsl: Fix tangent with new orco."
This reverts commit 3888227a7b.

This "Fix" was made while ORCO was broken. Now that orco itself is fixed
this is no longer required, otherwise Tangent node produces different
results in Cycles and Eevee.
2017-08-25 15:40:40 +02:00
d79fa8dc4d Another optimization of tangent space calculation
Don't use quick sort for small arrays, bubble sort works way faster for small
arrays due to cache coherency. This is what qsort() from libc is doing actually.
We can also experiment unrolling some extra small arrays, for example 3 and 4
element arrays.

This reduces tangent space calculation for dragon from 3.1sec to 2.9sec.
2017-08-25 14:54:44 +02:00
52778ce625 Cleanup: missing break (harmless for now) 2017-08-25 22:53:37 +10:00
49717d4971 Optimize tangent space calculation by inlining functions
Brings tangent space calculation from 4.6sec to 3.1sec for dragon model in BI.
Cycles is also somewhat faster, but it has other bottlenecks.

Funny thing, using simple `static inline` already gives a lot of speedup here.
That's just answering question whether it's OK to leave decision on what to
inline up to a compiler..
2017-08-25 14:50:04 +02:00
90299e4216 Cycles: Add utility function to query current value of scoped timer 2017-08-25 14:27:34 +02:00
12d527f327 Cycles: Correct logging of sued CPU intrisics 2017-08-25 14:27:34 +02:00
dfae3de6bd Cycles: Fix stack overflow during traversal caused by floating overflow
Would be nice to be able to catch this with assert as well, will see what would
be the best way to do this/.\

Need to verify with Mai that this solves crash for her and maybe consider
porting this to 2.79.
2017-08-25 14:27:34 +02:00
Dalai Felinto
0feeef89f0 Fix T52528: generated texture mismatch between Cycles and Eevee
Finally orco should be working 100% on Eevee now. Thanks for Sergey
Sharybin for reporting this.
2017-08-25 14:22:21 +02:00
Dalai Felinto
99b1f9f4f4 Revert "Eevee: Fix generated coordinates when no texture coordinates connected"
This reverts commit 0e29a97813.
2017-08-25 14:22:21 +02:00
Dalai Felinto
4e975b6b44 Fix ORCO never used for draw manager (Eevee)
Related to T52528.
2017-08-25 14:22:21 +02:00
8e6c18a98f Merge branch 'master' into blender2.8 2017-08-25 22:22:58 +10:00
de669c3b60 WM: ensure 3D view theme is used in select-loop
Yet another case where theme could be used uninitialized.
2017-08-25 22:10:27 +10:00
f8f6f8f26e Merge branch 'master' into blender2.8 2017-08-25 20:45:16 +10:00
16377abda8 WM: initialize WM and deps before handling events
This avoids obscure bugs where operators could run from
events that happen before the UI and depsgraph have been initialized.

See: D2809 for details.
2017-08-25 20:26:52 +10:00
Dalai Felinto
0e29a97813 Eevee: Fix generated coordinates when no texture coordinates connected
Orco should behave the same if it comes from unconnected vec inputs, or
from the Texture Coordinate -> Generated node output.

Fixup for 11e7e0769a.

This is related to T52528. The coordinates are still different between
Eevee and Cycles, but at least it behaves consistent within itself.

In fact the shader should now be correct, but the orco attributes we are
passing the shader seems to be where the problem is. But it's to be
tackled separately.
2017-08-25 11:47:38 +02:00
2d5935a9c0 This copyright text (copied to binary distros) had a confusing statement about
scripts being "Artwork" which is your sole property and free to license.

I've removed the reference to scripts in this text.

This was from 2002! With our Python scripts becoming part of how Blender runs,
such scripts now are officially required to be compliant with GNU GPL.

For more information; check the FAQ or consult foundation@blender.org
https://www.blender.org/support/faq/
2017-08-25 11:11:19 +02:00
9e762693db Fix manipulator remove tag, it cleared all groups 2017-08-25 15:19:30 +10:00
3f4b3fdfba Manipulator: zero grab offset w/o target property
Some manipulators are used like on-screen buttons,
in this case it doesn't make sense to keep track of their state,
so zero the offset when its unused.

Needed for lamp-target manipulator.
2017-08-25 15:13:11 +10:00
738d942d29 Correct error in recent use of PyC_Long_*
Regression in 46cf33bf0
2017-08-25 02:09:23 +10:00
1b5a690c72 Fix crash handling manipulator events before drawing 2017-08-25 00:20:14 +10:00
33f9b6d016 Depsgraph: Fix crash editing mesh in edit mode 2017-08-24 16:01:08 +02:00
97fadb7b59 Depsgraph: Cleanup typo 2017-08-24 15:52:52 +02:00
9662803833 Fix error using wrong theme settings w/ depth draw
Clicks events before first draw would assert,
unlikely to cause user visible errors but
would assert in UI_ThemeGetColorPtr.
2017-08-24 23:22:55 +10:00
a679457263 Fix T51907: New Depsgraph - Camera constraint is not evaluated properly
This is more a workaround for until we've got proper visibility flush, which
will likely happen in blender2.8 branch.
2017-08-24 14:35:48 +02:00
436d1b4e90 Cycles: FIx issue with -0 being considered a non-finite value 2017-08-24 14:32:56 +02:00
Dalai Felinto
552656611b Merge remote-tracking branch 'origin/master' into blender2.8 2017-08-24 10:41:59 +02:00
Dalai Felinto
1fb2637006 Cycles Bake: Fix overflow when using hundreds of images
We have a hardcored limit of 1000 images to be baked.
However anything anove 100 would be leading to overflow in the code.

Caught by warning from builder bot (my compiler doesn't even complain
about this, but it should).
2017-08-24 10:34:56 +02:00
e20c825b05 Manipulator: modal callback can now cancel & pass events
Re-use operator return flags for manipulator modal & invoke,
this means manipulators can allow navigation or other events to be
handled as they run - see T52499
2017-08-24 17:04:28 +10:00
134e927965 Manipulator: remove unused event hack 2017-08-24 12:02:08 +10:00
76b74a93a8 Fix Cycles CUDA transparent shadow error after recent fix in c22b52c.
Fishy cat benchmark was rendering with wrong shadows. Cause is unclear,
adding printf or rearranging code seems to avoid this issue, possibly a
compiler bug. This reverts the fix and solves the OSL bug elsewhere.
2017-08-24 03:43:02 +02:00
b85d36d811 Code cleanup: remove shader context.
This was needed when we accessed OSL closure memory after shader evaluation,
which could get overwritten by another shader evaluation. But all closures
are immediatley converted to ShaderClosure now, so no longer needed.
2017-08-24 03:43:02 +02:00
e476298084 Docs: rename var and comment how it's used
switch_from_camera wasn't right since it was used for auto-perspective.
2017-08-24 02:11:31 +10:00
Dalai Felinto
efd07aaada Fix blenderplayer (tm) 2017-08-23 17:55:50 +02:00
0671814e3b Merge branch 'master' into blender2.8 2017-08-24 01:07:09 +10:00
0b5b464e82 Correction to last fix 2017-08-24 01:05:20 +10:00
76d695f761 Fix T52490: NDOF orbit doesn't lock in ortho view
Regression in af3f7db caused by own fix for T51324
2017-08-24 00:51:25 +10:00
520ea73ad0 Fix bplayer (c) 2017-08-23 16:43:10 +02:00
3277bd4031 Fix T52396: Crash loading template w/o config dir 2017-08-23 22:06:42 +10:00
579edb1510 Cycles: Add maximum depth stat to bvh builder 2017-08-23 06:54:26 -04:00
2540741dee Fix implementation of atomic update max and move to a central location
While unlikely to have had any serious effects because of limited use, the
previous implementation was not actually atomic due to a data race and
incorrectly coded CAS loop. We also had duplicates of this code in a few
places, it's now been moved to a single location with all other atomic
operations.
2017-08-23 06:54:25 -04:00
5c60721c9e Fix T51805: Overlapping volumes renders incorrect on AMD GPU
We need to make sure we can store all volume closures for all objects in volume
stack. This is a bit tricky to detect what would be the "nestness" level of
volumes so for now use maximum possible stack depth. Might cause some slowdown,
but better to give reliable render output than to fail quickly.

Should be safe for 2.79 after extra eyes.
2017-08-23 12:35:23 +02:00
cb4884f50b Merge branch 'master' into blender2.8 2017-08-23 20:16:47 +10:00
b9513706cb Cleanup: mark VA_NARGS_COUNT as public
Was already used in two other headers, remove underscore prefix.
2017-08-23 20:16:17 +10:00
37cfa44222 Cleanup: move variadic defines to their own header
So we can use in headers without pulling in many other defines.
2017-08-23 20:16:17 +10:00
1a76bc7aeb Fix T52218: Missing update when reconnecting node
If node was connected to output, we tag tree for update no matter where
the node was re-plugged to.

Should be safe for 2.79.
2017-08-23 11:49:20 +02:00
54507234b7 RNA: use string join functions as with operators 2017-08-23 19:40:48 +10:00
917d069cdb Merge branch 'master' into blender2.8 2017-08-23 19:21:52 +10:00
cf8d35edc8 RNA: use string-join to simplify operator register
Also sanity check macro-operator ID's.
2017-08-23 19:18:22 +10:00
81c0e643a0 BLI_string_utils: string joining utility functions
Includes a version that takes a separator and macros for convenience.
2017-08-23 19:17:27 +10:00
55861cb234 PyAPI: avoid instantiating args twice in macro
Would cause problems if args included function calls.
2017-08-23 18:48:32 +10:00
9d6d413c7c RNA: check for duplicate manipulator names 2017-08-23 16:22:48 +10:00
58a4c767a1 Merge branch 'master' into blender2.8 2017-08-23 16:10:45 +10:00
b8d77c44f1 Cleanup: remove space from filenames 2017-08-23 15:50:44 +10:00
46b9f89f5e Tests: fix incorrect check for hidden dir
Copy-pasted mistake in tests and tools.
2017-08-23 15:36:39 +10:00
1e60ac3394 RNA: report error on struct naming collision
Fixes T52463, error instead of crash.
2017-08-23 15:02:21 +10:00
4761dea573 RNA: keep structs_map valid w/ ID duplicate & free 2017-08-23 14:14:55 +10:00
8899ac1550 GHash: BLI_ghash_reinsert_key utility function
Useful when ghash keys are reallocated.
2017-08-23 13:03:35 +10:00
980a8646d8 Fix T52466: Silence search for button_context menu type.
We were showing "search for unknown menutype WM_MT_button_context" messages in terminal which were not helpful for users, so now they are disabled.

To be backported to 2.79
2017-08-22 21:35:09 +02:00
f09dee5aed Fix error in PointerProperty argument list
Regression in a7b3047
2017-08-23 02:14:33 +10:00
4d8e3b649b Fix T52483: Fill is incorrect for interpolated strokes
The recalc flag must be enabled for new interpolated strokes.
2017-08-22 17:43:20 +02:00
9cfb72ff81 Merge branch 'master' into blender2.8 2017-08-22 16:31:33 +02:00
9f40153094 Fix T52209: New Depsgraph - animated follow curve constraint sometimes freaks out when the curve has a parent 2017-08-22 16:27:33 +02:00
f3e02eb32e Depsgraph: Cleanup, make code friendlier to be edited in columns 2017-08-22 16:24:58 +02:00
c80ab62aee Depsgraph: Remove placeholder for path evaluation
Wasn't used in years, if it really needs to be dedicated operation it needs to
be revisited anyway.
2017-08-22 16:12:01 +02:00
4699799288 Fix threading conflict when doing Cycles background render
It is possible to have same image used multiple times at different frames,
which means we can not free it's buffers without any guard. From quick tests
this seems to be doing what it is supposed to.

Need more testing and port this to 2.79.
2017-08-22 15:50:05 +02:00
831e86d539 GPUTexture: Remove Warning. 2017-08-22 14:41:36 +02:00
Dalai Felinto
d7b3e33af4 GL_TEXTURE_2D_ARRAY wasn't handled in GPU_texture_update
Although the problem was exposed in 9457715d9a, the problem was in the
original code that was copied over. To have:

```
} else { /* EXPECTED_VALUE */
```

Without an BLI_assert(value == EXPECTED_VALUE); is asking for troubles.
Yet another reason to favour switch statements with:

```
default:
    BLI_assert(!"value not implemented or supported");
```

Instead of chained if/else if/else /* expected_value */.
2017-08-22 14:37:28 +02:00
5f4066c87d add GPU_glew header 2017-08-22 22:22:21 +10:00
7e6b702e65 Fix T52053: Sculpt missing update w/ clay engine
Leaving sculpt mode wasn't updating the mesh because the update
flushed from the depsgraph ignored edits to vertex location.
2017-08-22 22:10:13 +10:00
2f19559258 Cleanup: naming for mesh dirty flags
- NOCHECK -> ALL
- ALL -> MAYBE_ALL

Where 'MAYBE_ALL' checks to see if the mesh has changed.
This is clearer that `BKE_MESH_BATCH_DIRTY_ALL` is dirty and
going to be updated without any guess-work.
2017-08-22 22:07:25 +10:00
1155fc94fd Fix T52454: Crash in DEG_graph_on_visible_update when activating scene layer
Most likely needs in 2.79 final release.
2017-08-22 12:53:34 +02:00
Dalai Felinto
9457715d9a GPU Texture: Use switch instead of if/else 2017-08-22 12:30:03 +02:00
cc5e90f75d Manipulator: template for Python manipulator
This is an example of a manipulator that defines it's own geometry.
2017-08-22 20:16:22 +10:00
f4fe405da9 Manipulator: Add API target_get/set/range wrappers
Allows Python manipulators access the values of target properties
needed for Python to make use of the general target property interface.
2017-08-22 18:57:38 +10:00
bd935b5aed Merge branch 'master' into blender2.8 2017-08-22 18:21:05 +10:00
ccff7c3c82 PyAPI: Minor gawain corrections 2017-08-22 18:13:19 +10:00
417581636f Eevee: Fix T52486
For that introduce an update function for textures.
2017-08-22 10:22:11 +02:00
691ed21842 PyAPI: replace PyC_FromArray with typed functions
This was meant to be generic but introduced possible type errors
and unnecessary complication.
Replace with typed PyC_Tuple_PackArray_* functions.

Also add PyC_Tuple_Pack_* macro which replaces some uses of
Py_BuildValue, with the advantage of not having to parse a string.
2017-08-22 18:10:57 +10:00
049932c4c3 Fix panorama render crash with split kernel, due to incorrect buffer pointer.
Also some refactoring to clarify variable usage scope.
2017-08-22 00:41:07 +02:00
296d74c4b1 Cycles: reorganize Performance panel layout, move viewport BVH type to debug. 2017-08-21 19:05:17 +02:00
81a76469ca Fix for recent fix in fc890cd, cstdint is c++11 only so don't use it yet. 2017-08-21 19:05:17 +02:00
7e87849257 Cleanup: rename manipulator API functions
- WM_manipulatorgrouptype_remove- > free
- WM_manipulator_group -> WM_manipulator_group_type

Naming here is still a bit confusing,
now at least free/remove are differentiated.
2017-08-22 02:06:46 +10:00
be89b95e98 Fix crash re-registering manipulators
Duplicating strings caused problems using strings in
both struct hash and manipulator group types own hash.
2017-08-22 01:55:11 +10:00
37a5fe2d4d Fix T52479: Regression: Motion Tracking no longer works 2017-08-21 17:23:42 +02:00
3e555d3d78 Merge branch 'master' into blender2.8 2017-08-21 15:41:03 +10:00
0033f0e161 Cleanup: uneven/double indentation 2017-08-21 15:38:11 +10:00
592dd9dea6 Modify menu from last commit
Also correct tool-tip.
2017-08-21 15:24:40 +10:00
361c7cbbc5 Fix T52434: Restore mesh center of mass calculation
The new method while improved for solid objects
doesn't work for non-manifold meshes, keep both.
2017-08-21 15:19:08 +10:00
d007828ae7 Eevee: Offset the for each AA sample.
This means we have less overall noise for rendered image.
SSR, AO, and Refraction are affected by this change.

SSR still exhibit artifacts because the reconstruction pattern needs to change every frame (TODO).
2017-08-21 01:39:23 +02:00
43a6cf1504 Cycles: attempt to recover from crashing CUDA/OpenCL drivers on Windows.
I don't know if this will actually work, needs testing. Ref T52064.
2017-08-20 23:18:25 +02:00
fc890cdae2 Fix Windows build error after recent Python changes in a10a7f42. 2017-08-20 23:15:43 +02:00
47d1f67eab Fix T52473: blender internal Fresnel and Layer Weight only work with linked normal.
Please backport this to 2.79.
2017-08-21 00:09:16 +02:00
41e6068c76 Revert "Cycles: remove square samples option."
This reverts commit 757c24b6bc.

We'll revisit this when doing deeper sampling changes.
2017-08-20 23:46:05 +02:00
1d1ddd48db Fix T52470: cycles OpenCL hair rendering not working after recent changes. 2017-08-20 23:32:20 +02:00
1b79d323d9 Cleanup: move gawain header out of GPU_matrix
Avoids requiring glew headers in Python API.
2017-08-21 01:41:20 +10:00
ce0fce2207 Code cleanup: deduplicate some bsdf node methods. 2017-08-20 17:37:22 +02:00
146b0c6b04 Fix T52439: Crash after adjusting lenght of hair particles.
Regression from rBfed853ea78221, calling this inside thread worker was
not really good idea anyway, and we already have all the code we need in
pre-threading init function, was just disabled for vertex particles
before.

To be backported to 2.79.
2017-08-20 17:18:48 +02:00
4f881e0d97 CMake version bump: 3.5 2017-08-20 17:01:27 +02:00
b5f8063fb9 Cycles: support baking normals plugged into BSDFs, averaged with closure weight. 2017-08-20 16:51:53 +02:00
a7362eb219 Manipulator: helper API for drawing custom shapes
This exposes 2 methods for manipulators:
- new_custom_shape
- draw_custom_shape

This can be used for script authors to create and re-use shapes
without dealing with lower level API's.
2017-08-21 00:11:16 +10:00
adabc315e9 PyAPI: add gpu.select (initial module)
This only exposes load_id, it's needed for Python manipulator drawing.
2017-08-20 23:13:42 +10:00
59e10bae3c Manipulator: add read-only matrix_world 2017-08-20 22:44:22 +10:00
0b07c2c8a2 Code cleanup: remove copy of shader graph for bump, no longer needed. 2017-08-20 14:27:51 +02:00
2530ae6c74 Merge branch 'master' into blender2.8 2017-08-20 21:22:00 +10:00
e27a59d411 Replace BLI_INLINE w/ Py_LOCAL_INLINE for Python
Recent inclusion caused build error with the BGE.
2017-08-20 21:14:33 +10:00
cb03cc6600 PyAPI: gpu.matrix.push_pop context manager
Avoid un-balanced push/pop usage (which can interfere with Blender's
internal state) using a context manager.
2017-08-20 19:42:31 +10:00
f6825d333b Fix bpy library load: invalid function signature 2017-08-20 19:04:16 +10:00
8037f3602f PyAPI: Add exceptions to stack push/pop
Raise exception when stack limits are reached.
2017-08-20 17:26:51 +10:00
33b265c4fb PyAPI: use PyC_Long_As... for gawain
Avoids inline overflow checks.
2017-08-20 15:58:37 +10:00
7497488149 Merge branch 'master' into blender2.8 2017-08-20 15:50:15 +10:00
46cf33bf01 PyAPI: Make use of PyC_LongAs... API
Avoids setting exceptions inline,
also use Matrix_ParseAny for bmesh.ops.

Some inline exceptions are kept because they show useful details.
2017-08-20 15:49:10 +10:00
a10a7f42de PyAPI: Integer conversion functions
Python's C-API doesn't provide functions to get
int's at specific integer sizes.

Leaving the caller to check for overflow,
which ended up being ignored in practice.

Add API functions that convert int/uint 8/16/32/64, also bool.
Raising overflow exception for unsupported ranges.
2017-08-20 15:39:08 +10:00
2ff9c8a3bc PyAPI: avoid redundant PyLong_AsLong call
Assigning to an RNA array converted from Python to C twice.
2017-08-20 15:30:14 +10:00
64c7cf2036 PyAPI: correct int range checking 2017-08-20 10:34:21 +10:00
07ca9860e2 [windows/make.bat] add option to automatically download libs.
The thing that most often still goes wrong for new users building blender on windows is checking out the libraries, some skip over the wiki, some check out to the wrong folder, in an effort to reduce the time i spend on this, I added detection of svn and misisng libs to make.bat .

When the user has svn installed, and the libdir is missing he'll be asked if he wants to download them

if svn is not installed, or the user chooses 'no' the current error message is shown.

Reviewers: Blendify, sergey, juicyfruit

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2782
2017-08-19 12:00:45 -06:00
c22b52cd36 Fix T52452: OSL trace broken after shadow catcher recent changes.
We should only early out with any hit in BVH traversal if the only visibility
bits used are opaque shadow. Not when opaque shadow is one of multiple bits.
2017-08-19 18:14:16 +02:00
4218b9367e Cycles tests: pass Blender custom arguments from CYCLESTEST_ARGS.
This is useful for testing with different devices, split kernel, OSL,
impact of integrator settings, etc.
2017-08-19 18:14:16 +02:00
cfa8b762e2 Code cleanup: move rng into path state.
Also pass by value and don't write back now that it is just a hash for seeding
and no longer an LCG state. Together this makes CUDA a tiny bit faster in my
tests, but mainly simplifies code.
2017-08-19 18:14:16 +02:00
4e4e872478 PyAPI: Add gpu.matrix API 2017-08-20 00:01:19 +10:00
2332051419 Merge branch 'master' into blender2.8 2017-08-19 21:54:05 +10:00
1cc4033df8 PyAPI: expose matrix parsing function 2017-08-19 21:36:50 +10:00
4437ccf476 Correct error in gawain wrapper for non-gcc compilers 2017-08-19 20:22:15 +10:00
08094e8f23 Audaspace: cmake fixes, lowering to 3.0 minimum required. 2017-08-19 11:46:21 +02:00
9a262ed47e Cleanup: remove unneeded include
Complicated using GPU_matrix from PyAPI.
2017-08-19 17:16:24 +10:00
5720890cf8 Eevee: Bloom: Add Bloom Color
Moar artistic control yay!
2017-08-19 02:40:02 +02:00
63f70ef14d Eevee: Bloom: Add Clamp setting
It's purpose is to limit the amount of light that spread across the screen.

Not entierly sure if it's very usefull, but it sure help to avoid to drown the screen in bloom.
2017-08-19 02:39:16 +02:00
2abc21ace5 Eevee: Fix problem with GPU_texture_generate_mipmap
This function was called to recreate the lower mip level of the probe texture. But this is not it's usage and it introduced a stall.

This patch add cubemap mipmap level regeneration in eevee_effects.c
2017-08-19 01:20:09 +02:00
4d428d14af Fix T52443: Cycles OpenCL build error after recent mesh lights changes. 2017-08-19 01:02:55 +02:00
a702ff4c03 CMake: Boost no longer needed for Audaspace references either 2017-08-18 19:07:39 +02:00
d282dc04ef Cycles tests: add light type tests. 2017-08-18 17:09:12 +02:00
5cf36c0f05 Cycles tests: make page less wide, use relative URLs for serving through http. 2017-08-18 17:09:08 +02:00
Dalai Felinto
036f43f3cd Eevee: Convert metallic nodes into princinpled nodes
And wipe metallic out of the map.
2017-08-18 17:08:23 +02:00
Dalai Felinto
e8f0ee157b Swap Eevee material output with (Cycles) Material Output
Since we started supporting the (Cycles) Material Output old files
stopped working. There is no reason to keep the original Eevee material
otuput anymore.

It includes doversion for old files.
2017-08-18 17:00:45 +02:00
Dalai Felinto
8ab6e8aad6 Expose Transparency BSDF for Eevee UI 2017-08-18 16:59:13 +02:00
Dalai Felinto
2dad2aa9b7 Uniform Buffer Objects: More complete padding solution
Move floats around when needed to accomodate vec3 arrays efficiently.

With this we use slightly less memory when possible. Basically vec3s are not
treated as vec4 unless we have no float to use for padding).

Reviewers: fclem, sergey

Differential Revision: https://developer.blender.org/D2800
2017-08-18 16:42:58 +02:00
659be38760 Eevee: Rework GTAO
This includes big improvement:
- The horizon search is decoupled from the BSDF evaluation. This means using multiple BSDF nodes have a much lower impact when enbaling AO.
- The horizon search is optimized by splitting the search into 4 corners searching similar directions to help which GPU cache coherence.
- The AO options are now uniforms and do not trigger shader recompilation (aka. freeze UI).
- Include a quality slider similar to the SSR one.
- Add a switch for disabling bounce light approximation.
- Fix problem with Bent Normals when occlusion get very dark.
- Add a denoise option to that takes the neighbors pixel values via glsl derivatives. This reduces noise but exhibit 2x2 blocky artifacts.

The downside : Separating the horizon search uses more memory (~3MB for each samples on HD viewport). We could lower the bit depth to 4bit per horizon but it produce noticeable banding (might be fixed with some dithering).
2017-08-18 15:09:43 +02:00
25789f24f2 Eevee: Add some utils functions 2017-08-18 15:07:17 +02:00
2018df9939 Eevee: MinmaxZ: Avoid unecessary conversions. 2017-08-18 15:07:17 +02:00
91ab64f38f GPU_texture : Add RG8 format. 2017-08-18 15:07:17 +02:00
95b1b7756d Eevee: Fix some problem with Glass & Diffuse BSDF with SSR
Diffuse was not outputing the right normal. (this is not a problem with SSR actually)

Glass did not have proper ssr_id and was receiving environment lighting twice.
Also it did not have proper fresnel on lamps.
2017-08-18 15:07:17 +02:00
Dalai Felinto
f4bd416b34 Fix ubo vec3 alignment issue
This fixes the Principled shader in Eevee, among other nodes.

Basically before we were treating all the vec3 as vec4 as far as memory
goes. We now only do it when required (aka, when the vec3 is not
followed by a float).

We can be even smarter about that and move the floats around to provide
padding for the vec3s. However this is for a separate patch.

That said, there seems to be some strong consensus in corners of the
internet against using vec3 at all [1]. Basically even if we get all the
padding correct, we may still suffer from poor driver implementations in
some consumer graphic cards.

It's not hard to move to vec4, but I think we can avoid doing it as much
as possible. By the time 2.8 is out hopefully most drivers will be
implementing things correctly.

[1] - https://stackoverflow.com/questions/38172696
2017-08-18 12:21:02 +02:00
6fe38bf1cc PyAPI: Gawain checks for range
Raise error on vert-buffer data overflow.
Also exception on attempting to fill data thats already on the GPU.
2017-08-18 18:58:52 +10:00
4e468ceb71 PyAPI: Fix memory leak w/ empty, allocated enums 2017-08-18 18:29:27 +10:00
aae0737f57 CMake: Boost no longer needed for Audaspace 2017-08-18 18:17:29 +10:00
0c57d85941 Fix building w/o Audaspace 2017-08-18 18:16:13 +10:00
986267300b Audaspace: Moving audaspace 1.3 into extern.
Deleting the old internal audaspace.

Major changes from there are:
- The whole library was refactored to use C++11.
- Many stability and performance improvements.
- Major Python API refactor:
 - Most requested: Play self generated sounds using numpy arrays.
 - For games: Sound list, random sounds and dynamic music.
 - Writing sounds to files.
 - Sequencing API.
 - Opening sound devices, eg. Jack.
- Ability to choose different OpenAL devices in the user settings.
2017-08-18 08:24:12 +02:00
d0dad02604 Cleanup: use lowercase prefix for local API's
Also some minor corrections.
2017-08-18 08:58:26 +10:00
cb67873ac5 PyAPI: Iniital gawain API for Python
Wraps vertex-format, vertex-buffer and batch's (enough for drawing).

Doesn't yet expose index-buffers or shaders.
2017-08-18 08:45:41 +10:00
73df38a879 RNA: don't register manipulator properties by name
Matching behavior for operators.
2017-08-18 07:50:31 +10:00
ac28a4fba7 Fix leak in Python BGE filter & image types 2017-08-18 00:55:16 +10:00
Stefan Werner
7a4696197d Cycles: Fix for a division by zero that could happen with solid angle triangle light sampling 2017-08-17 15:07:59 +02:00
743bacaa6f Fix T52401: "Export Keying Set" operator generated incorrect ID's for shapekeys
To be backported.
2017-08-18 01:03:28 +12:00
Stefan Werner
8141eac2f8 Improved triangle sampling for mesh lights
This implements Arvo's "Stratified sampling of spherical triangles". Similar to how we sample rectangular area lights, this is sampling triangles over their solid angle. It does significantly improve sampling close to the triangle, but doesn't do much for more distant triangles. So I added a simple heuristic to switch between the two methods. Unfortunately, I expect this to add render time in any case, even when it does not make any difference whatsoever. It'll take some benchmarking with various scenes and hardware to estimate how severe the impact is and if it is worth the change.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: Vega-core, brecht, SteffenD

Tags: #cycles

Differential Revision: https://developer.blender.org/D2730
2017-08-17 12:44:32 +02:00
4d93323b8a Gawain: name struct's
Needed to reference without first including headers.
2017-08-17 20:37:37 +10:00
Dalai Felinto
8644fce3b7 Fix blenderplayer 2017-08-17 11:56:24 +02:00
5492d2cb67 Cycles: Calculate correct remaining time when using a larger pixel size 2017-08-17 02:00:44 +02:00
264d0cc6a0 Merge branch 'master' into blender2.8 2017-08-16 19:10:18 -03:00
9b1e0f5af6 Remove unnecessary #include "ED_transform.h" 2017-08-16 19:08:52 -03:00
85169de54d Transform: remove unused function 2017-08-16 18:55:55 -03:00
4b6c482d69 DwM: use batch select for vertex paint mode 2017-08-17 07:13:02 +10:00
7c96f613e4 DwM: Use Batch's for drawing selection
Use mesh batch cache for mesh selection.
Note that we could create the batches and free immediately
so they don't take up memory.

This resolves a problem where selection was limited
to immediate-mode buffer size.
2017-08-17 06:34:02 +10:00
916b9b311f Transform: Move enum SnapSelect to ED_transform_snap_object_context 2017-08-16 14:16:30 -03:00
a773ac4bda Support MSVSC 2017 15.3.0 (compiler 19.11)
The compiler version has changed in the last VS2017 update to 1911 and the old 1910 version is not working anymore.
2017-08-16 09:45:08 -06:00
Dalai Felinto
a4068d0083 Fix zombie manipulators when deleting collection from outliner
ND_LAYER and ND_LAYER_CONTENT both need to trigger manipulators updates.
2017-08-16 12:50:00 +02:00
90aa02290a Cleanup: rename GPU gawain functions
Were using Batch_ prefix still
2017-08-16 20:32:42 +10:00
Dalai Felinto
6bca0dcf7b Fix T52415: Copy/Pasting a mesh immediately crashes blender
Since the paste object is pasted in the active collection, and not on
its original one, we need to flush/calculate the new collection base
settings (visibility, selectability, ...).

DEG_id_tag_update() for the scene now. Though it may be better to tag
only the object specific IDs in the future.
2017-08-16 12:14:31 +02:00
Dalai Felinto
2b95617b15 Update code comments from DAG_id_tag_update to DEG_id_tag_update 2017-08-16 12:00:45 +02:00
846c11c8cf Gawain: remove GWN_batch_discard_all
Use ownership flags instead.
2017-08-16 19:51:46 +10:00
1f3724f7f4 Fix T52414: Blender 2.79 crash on object duplication via menu.
Caused by own recent changes in handling of verts/edges/etc. arrays storage
for raycasting (rBe324172d9ca6690e8).

Issue was actually even weirder - there is absolutely no reason at all to
release DM here, those finaldm are stored in Object or EditMesh structs and
handled by general update system, other code shall never try to release them!
2017-08-16 10:52:49 +02:00
Dalai Felinto
18ce2bfac6 Depsgraph/Layers: Keep original visibility when doing full scene copy
Originally we were not respecting the original visibility flags of the
collections. However this is required for Copy-on-write (CoW).

Remember to update the svn lib tests folder. I had to update some of the
json files there.

Also adding a new unittest for this particular issue:
Test render_layer_scene_copy_f
2017-08-16 10:35:26 +02:00
dbd300ab20 DwM: use gawain ownership flags for mesh drawing 2017-08-16 17:47:58 +10:00
4f97be617c Gawain: add ownership flag to Gwn_Batch
Flag ownership for each index array & vbo's
so we don't have to manually keep track of this and use the right free call.

Instead this can be passed on creation.

See D2676
2017-08-16 17:42:05 +10:00
1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00
b68b26c265 Attempt to fix GLSL errors on Blender startup.
I couldn't reproduce either, but calling min() with different argument
data types and indexing vectors with an index not known at compile time
seem likely to cause problems.

Ref T52404, T52404.
2017-08-15 18:52:25 +02:00
84d33023ab Merge branch 'master' into blender2.8 2017-08-15 18:51:25 +02:00
535e83687d macOS build: simplify python install for new 10.9 libraries.
We stop using the .zip file and just have all files now in
lib/darwin/python/lib, along with numpy, numpy headers and requests.
This makes it consistent with Linux and simplifies code.

For old libraries the .zip stays, code for that gets removed when we
fully switch to new libraries.
2017-08-15 17:40:27 +02:00
477ee3a9de Fix Cycles presets after recent removal of some settings. 2017-08-15 17:40:27 +02:00
d56fb5b09d Fix missing clear of Object->drawdata listbase in new copying code. 2017-08-15 17:13:09 +02:00
5426d7134d Fix remaining issues with new Scene copying.
Some idprops were not correctly merged from source into destination.
2017-08-15 17:09:31 +02:00
c8b3f13c9e Bring new IDP_MergeGroup() on par with other copying logic.
We now have to support more complex copying types, which are controlled
by flags, so all copying logic will need to take those at some point (at
least, all potentially dealing with IDs).
2017-08-15 16:42:20 +02:00
cf2f6a986c Fix building with OCIO after recent gawain files renamings. 2017-08-15 16:35:46 +02:00
42374984f1 Fix scene_collection_copy always afecting IDs usercount.
_copy_data() functions shall not do that at all anymore. Kept as option
for now even though that helper is only called from here...

Also moar varnames renaming to standard _src/_dst sufixes.
2017-08-15 16:23:53 +02:00
b6308d79e5 Cleanup: use 'gwn' prefix for gawain filenames
Looking up names project wide or setting breakpoints wasn't so.
Names like common.h or element.h are also too generic.
2017-08-16 00:25:47 +10:00
d9e253abce Correct last commit 2017-08-16 00:25:47 +10:00
119cbf8cf5 Cleanup: rename vars with proper _src/_dst postfixes in new Scene ID data copy func. 2017-08-15 16:05:07 +02:00
77497175fa Cleanup/refactor: no new general arg-less macros enforcing var names please!
We do have an history of those pieces of evil in our code, would be nice
to get fully rid of it, but at the very least let's not add more of them
in new code. :)
2017-08-15 15:59:38 +02:00
90d80ddaa2 Fix new Scene ID copying code.
Missed depsgraph_legacy new pointer to nullify when merged/adapted new
ID copying code to blender2.8.
2017-08-15 15:26:22 +02:00
3bca9f5fed Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/makesrna/intern/rna_render.c
2017-08-15 13:02:45 +02:00
3311505fd0 Manipulator: border editable only w/ selected camera
While this isn't really needed, active border was annoying.
2017-08-15 20:55:13 +10:00
f20d7bed14 Alembic import: report object name in face color index out of bounds error 2017-08-15 12:43:17 +02:00
ac88a3942e Alembic import: fix crash when face color index is out of bounds.
This can happen with Alembic files exported from Maya. I'm unsure as to the
root cause, but at least this fixes the crash itself.

Thanks to @looch for reporting this with a test file. The test file has to
remain confidential, though, so it's on my workstation only.
2017-08-15 12:35:33 +02:00
caefe4943b [deps_build/macOS] Fix FFMPEG & VPX configure command
FFMPEG & VPX don't handle target with --build parameter, so we need to make sure use of plain configure command

Reviewed by: Brecht Van Lommel
Differential Revision: http://developer.blender.org/D2791
2017-08-15 12:26:33 +03:00
Dalai Felinto
dd5e674a86 Fix blenderplayer 2017-08-15 10:18:38 +02:00
ed3c3992ad Error in last commit
Get/set mismatch, reading from pchan, writing to bone.
2017-08-15 17:42:59 +10:00
d3ba86de07 Manipulator: Add b-bone spline editing
This needs some improvements since
matching handles *exactly* is a bit involved.
2017-08-15 17:39:41 +10:00
ecfc0370e0 Manipulator: grab3d use own vars to store offset
Was complicating general use case, also support for transforming with matrix_space set.
Add matrix_space support for manipulator_window_project_2d too.
2017-08-15 17:13:32 +10:00
dfb890947d Manipulator: store initial-final matrix for reuse
Also take matrix_space into account when calculating final pixel size.
2017-08-15 13:46:09 +10:00
66c1b23aa1 Cycles/BI: Add a pixel size option for speeding up viewport rendering
This patch adds "Pixel Size" to the performance options, which allows to render
in a smaller resolution, which is especially useful for displays with high DPI.

Reviewers: Severin, dingto, sergey, brecht

Reviewed By: brecht

Subscribers: Severin, venomgfx, eyecandy, brecht

Differential Revision: https://developer.blender.org/D1619
2017-08-15 01:22:40 +02:00
a8eaaa21e0 [build_deps/Windows] Add numpy headers to the python include folder on windows, required for D2716 2017-08-14 15:21:36 -06:00
e79db3b2f8 [depsbuilder] fix outdated python patch on windows. 2017-08-14 15:11:44 -06:00
30e0100813 [depsbuilder] Fix broken osl flags on windows. 2017-08-14 15:11:05 -06:00
Stefan Werner
86eb8980d3 Cycles: Fixed broken camera motion blur when motion was not set to center on frame
Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2787
2017-08-14 20:24:30 +02:00
3ab46f4204 Merge branch 'master' into blender2.8 2017-08-14 17:07:30 +02:00
595cfd2a81 Fix T52331: Motion blur shutter length not keyable
The only reason shutter time was marked as non-animatable is because Blender
Internal render does not support such animation. But this is something what
users are keeping asking for and now Blender Internal is on it's way out.

Enabled animation of this property, but noted in tooltip that Blender Internal
does not support animation of this property.
2017-08-14 16:38:50 +02:00
3cd51c0379 Fix T52391: Crash on duplicating material.
Bug in new ID copying code, thanks once again to stupid nodetrees, we
ended up wrongly remapping MA node->id pointers to NodeTree when copying
materials using node trees...
2017-08-14 15:40:54 +02:00
03a02cd109 Cleanup: confusing naming in BKE_node_tree_copy_data(). 2017-08-14 15:40:11 +02:00
04f034abad New ID Copying code: fix node_tree_copy_data still potentially increasing usercount of its gpencil pointer.
_copy_data() functions of datablocks shall never handle that, it's done
by generic calling code in library.c.
2017-08-14 15:17:23 +02:00
4e6324dd59 Cycles: Guard memcpy to potentially re-allocating memory with lock
Basically, make re-alloc and memcpy from the same lock, otherwise one
thread might be re-allocating thread while another one is trying to
copy data there.

Reported by Mohamed Sakr in IRC, thanks!
2017-08-14 14:55:47 +02:00
f0c2f4fa91 Tracking: Fix missing checks in operator poll functions
Reported by Vuk Gardašević (lijenstina) in IRC, thanks!
2017-08-14 11:46:00 +02:00
a850235a44 Fix T51850: Motion tracking - poor performance with keyframe matching on large video
Enabled cache for frame accessor and tweaked policy so we guarantee keyframed
images to be always in the cache. The logic might fail in some real corner case
(for example, when doing multiple tracks at once on a system where we can not
fit 2 clip frames in cache) but things are much better now for regular use.
2017-08-14 11:43:19 +02:00
ba84eb0f19 Tracking: Make frame accessor cache safe for threading 2017-08-14 11:43:19 +02:00
d36579bb96 Tracking: Cleanup, newlines and comments 2017-08-14 11:43:19 +02:00
ae561855cc Tracking: Cleanup, de-duplicate code 2017-08-14 11:43:19 +02:00
725a577327 Trackign: Add some basic logging about caching in frame accessor 2017-08-14 11:43:19 +02:00
4ac019cc07 Tracking: Make frame access cache aware of region
Cache is still kept disabled, need to think of a policy for cache cleanup.
2017-08-14 11:43:19 +02:00
7dfc1ad6c1 Tracking: Correct comparison in cache keys
This code wasn't uses, but the key comparison was totally wrong.
2017-08-14 11:43:19 +02:00
87e05c152a Tracking: Cleanup and some comments 2017-08-14 11:43:19 +02:00
51643056b0 Move back master to BCon1 (aka alpha) status.
Forgot to do that the other week, master is no more 2.79 RC!
2017-08-14 10:44:19 +02:00
230be97284 Merge branch 'master' into blender2.8 2017-08-14 12:13:55 +10:00
a8fbe991cd [build_deps/Windows] Prevent writing of any files into the source tree. 2017-08-13 13:02:15 -06:00
eccaa6da26 GPU_framebuffer: Fix incorrect last level. 2017-08-13 15:21:47 +02:00
e3468d7ec2 Eevee: Optimize and improve GTAO Horizon search
This fix a bug when occluder are on the edge of the screen and occludes more than they should.

Grouped the texture fetches together and clamp the ray at the border of the screen.

Also add a few util functions.
2017-08-13 14:30:47 +02:00
82e0419cc0 Eevee: Fix the AO problem around object edges.
This was due to missing GL_TEXTURE_MAG_FILTER.
2017-08-13 14:30:47 +02:00
2087158d5b DRW: Make Cache timing global and not per object.
This is to fix some performance bottleneck.
2017-08-13 14:30:47 +02:00
dc7fcebb33 Code cleanup: make L_transparent part of PathRadiance. 2017-08-13 01:19:07 +02:00
7542282c06 Code cleanup: make DebugData part of PathRadiance. 2017-08-13 01:19:07 +02:00
fce405059f Code cleanup: make it easier to test only Sobol, CMJ or Pseudorandom. 2017-08-13 01:19:07 +02:00
8f97108353 Cycles: optimize CPU split kernel data init. 2017-08-12 20:43:34 +02:00
601f94a3c2 Code cleanup: remove unused Cycles random number code. 2017-08-12 20:40:38 +02:00
6919393a51 Fix T52372: CUDA build error after recent changes. 2017-08-12 20:37:06 +02:00
22872857d4 Merge branch 'master' into blender2.8 2017-08-13 01:14:55 +10:00
b500f42700 WM: load UI for new file, even when pref disabled
Loading startup file always loads the UI now.
2017-08-13 01:09:48 +10:00
57f1475b18 GPU_framebuffer: Fix performance issue on intel.
This should fixes the error message that a stall occured because of busy mipmap.

This happened on the minmax buffer generation and introduced a random 0.2ms latency.
I'm not sure of what was happening though.
2017-08-12 16:16:43 +02:00
b858b44f2e Eevee: Fix and opimize MinMaxZ generation. 2017-08-12 16:16:43 +02:00
d7639d57dc Fix T52368: OSL trace() crash after recent changes. 2017-08-12 14:32:52 +02:00
76d0ab9750 Code cleanup: fix various compiler warnings. 2017-08-12 14:08:03 +02:00
f1a14740ba Merge branch 'master' into blender2.8 2017-08-12 14:01:54 +02:00
60ab0b8418 Fix T52298: hidden lamps still compute shadow buffers in viewport. 2017-08-12 13:22:26 +02:00
85ad248c36 Code cleanup: fix warning and improve terminology. 2017-08-12 13:18:05 +02:00
673c9dce08 Merge branch 'master' into blender2.8 2017-08-12 19:08:49 +10:00
a4bcdf5fb1 Fix T52329: Boolean with aligned shapes failed
Creating ngons with multiple axis aligned shapes in the middle of a
single face would fail in some cases.

This exposed multiple problems in BM_face_split_edgenet_connect_islands

- Islands needed to be sorted on Y axis when X was aligned.
- Checking edge intersections needed increased endpoint bias.
- BVH epsilon needed to be increased.
2017-08-12 18:35:47 +10:00
091ae0ea71 Math Lib: add isect_seg_seg_v2_point_ex
This exposes end-point bias argument, needed in rare cases.
2017-08-12 18:35:47 +10:00
b5cd89bab9 Fix width estimation for buttons with short labels in pie menus
Differential Revision: https://developer.blender.org/D2781

To be backported to 2.79 branch
2017-08-12 11:00:19 +03:00
ac17f29b2f Cleanup: quiet warnings 2017-08-12 14:07:26 +10:00
a60727080f Merge branch 'master' into blender2.8 2017-08-12 14:06:29 +10:00
ccb8e78d6c Cleanup: whitespace 2017-08-12 13:43:40 +10:00
4a1762f769 iFix T52050: Empty VSE preview for scene strips with OpenGL preview + Rendered settings.
'OpenGL Preview' checkbox was redundant now, just use seq_prev_type
value only.

Might be OK for 2.79, but should be double-checked first...
2017-08-11 18:02:54 +02:00
00cb352790 Fix T52149: LoopTriArray computation was not correctly protected against concurrency.
Note: this commit seems to work as expected (also with transform
snapping etc.). However, it is rather unsafe - not enough for 2.79 at
least, unless we get much more testing on it. It also depends on three
previous ones.

Note that using a global lock here is far from ideal, we should rather
have a lock per DM, but that will do for now, whole DM thing is doomed
to oblivion anyway in 2.8.

Also, we may need a `DM_DIRTY_LOOPTRIS` dirty flag at some point. Looks
like we can survive without it for now though... Probably because cached
looptris are never copied accross DM's?
2017-08-11 17:08:41 +02:00
c034193821 Cleanup: remove useless DM_ensure_looptri().
That one was doing exactly same thing as `dm->getLoopTriArray()`, no
point in having twice the same code here...
2017-08-11 17:08:41 +02:00
e324172d9c Fix transform snap code using 'allocated' flags to get verts/edges/etc. arrays again from DM.
This was... horribly wrong, CDDM will often *not* need to allocate
anything to return arrays of mesh items! Just check whether array
pointer is NULL.

Also, remove `DM_get_looptri_array`, that one is useless currently,
`dm->getLoopTriArray` will always return cached array (computing it if
needed).
2017-08-11 17:08:41 +02:00
e9cbc700ef Cleanup: deduplicate DM's getLoopTriArray() callback.
All three functions were doing exactly the same thing, simpler to only
have one in that case!
2017-08-11 17:08:41 +02:00
9567529b8f Merge branch 'master' into blender2.8 2017-08-12 00:23:49 +10:00
e6da7bb75c Fix T52346: Alt-I (Delete Keyframes) on a NlaStrip's Extrapolate property would crash 2017-08-12 01:52:51 +12:00
b6fda7fa43 Fix T52327: Entering/Exiting NLA Tweakmode disables Scene -> Only Keyframes from Selected Channels
The tweakmode flag and the selected-channels flag accidentally
used the same value, due to confusion over where these flags were
supposed to be set. The selected-channels flag has now been moved
to use a different value, so that there shouldn't be any further
conflicts.

To be ported to 2.79.
2017-08-12 01:41:22 +12:00
b2392afc50 Fix bevel clamping bugs T51247 and T50819.
Old bevel 'Clamp overlap' code was very naive: just limit amount
to half edge length. This uses more accurate (but not perfect)
calculations for the max amount before (many) geometry collisions
happen. This is not a backward compatible change - meshes that
have modifiers with 'Clamp overlap' will likely have larger allowed
bevel widths now. But that can be fixed by turning off clamp overlap
and setting the amount to the desired value.
2017-08-11 09:13:27 -04:00
30e83d58ff Object Apply Transform: option to apply properties
In some cases users may want to disable this option
to avoid changing other properties besides vertex locations.
2017-08-11 22:32:07 +10:00
31be0a6e52 Fix T52344: Softbody on Text.
Own previous fix (rBd5d626df236b) was not valid, curves are actually
supported by SoftBodies. It was rather a mere UI bug, which was not
including Surfaces and Font obect types in those valid for softbody UI.

Thanks to @brecht for the head up!

Also, fix safe for 2.79, btw.
2017-08-11 14:27:34 +02:00
d9323a537f Tweak maximum sizes of vertices/handle vertices
* 255 maximum seems excessive for F-Curve handle vertices; now reduced to 100

* Vertex Size is no longer restricted to the old 10px maximum size limit
  (used because Windows limited the maximum vertex size drivers needed to
  support)
2017-08-12 00:06:00 +12:00
8d42a26891 Fix: Muted strips in NLA draw with dotted borders again
It's more important that there is some form of feedback that the strips
are muted (i.e. dotted borders) than the fact that those dotted borders
may have slightly rounded corners. So, just use a regular sharp-cornered
rect when the strips need to be muted.
2017-08-12 00:05:59 +12:00
043b156c83 Code Cleanup: Use utility function here
There's no reason to manually iterate over items in a DLRBT_Tree,
as the structure is designed to be able to be safely casted down
to a ListBase and ListBase-like nodes..
2017-08-12 00:05:58 +12:00
fc016dca41 Revert C99 "cleanups" from rB09bfc378895f 2017-08-12 00:05:58 +12:00
329cd762c3 Nla Drawing: Fix strip outlines being drawn too thick 2017-08-12 00:05:57 +12:00
12c2be8c02 GraphEdit Drawing: Make active F-Curve slightly thicker 2017-08-12 00:05:56 +12:00
572745cc89 GraphEdit Keyframe Drawing: Tweak styling of handles
* Reduce interior fill opacity - These should *not* be shaded
* Adjust thickness of lines to match the old chunkiness more
2017-08-12 00:05:56 +12:00
2e25754ecd Cycles: Clarify new argument in PathRadiance 2017-08-11 13:49:50 +02:00
596ee4b505 Cycles tests: Draw images on top of checkerboard
This way it's easier to see alpha-channel only images, such as shadow catcher
images on transparent film.
2017-08-11 13:49:50 +02:00
bd069a89aa Fix T52229: Shadow Catcher artifacts when under transparency
Added some extra tirckery to avoid background being tinted dark with transparent
surface. Maybe a bit hacky, but seems to work fine.
2017-08-11 13:49:50 +02:00
00d10977c8 Eevee: SSR: Change clamp default. 2017-08-11 12:59:32 +02:00
d9f2e4c4c5 Eevee: Refraction: Fix low roughness artifact. 2017-08-11 12:53:17 +02:00
59a52fef6c Pie menu's sub-rows ignore 'EXPAND' flag
Regression, to be backported in 2.79.
2017-08-11 13:18:30 +03:00
daa834bc11 RNA: Operators were excluded from struct map
Recent changes meant structs that were registered without a name
wouldn't get added to the map.
Now assigning identifiers manages the struct-map.
2017-08-11 20:11:01 +10:00
58ee738310 GHash: note that 'deprecated' is used for private 2017-08-11 19:10:19 +10:00
bc88ee3292 Error in last commit, problems with unregister
We can't free the identifier before its used when
removing from the ghash.
2017-08-11 19:10:19 +10:00
d5d626df23 Fix T52344: Softbody on Text.
For some reasons (c) softbody modifier was marked as compatible with
curves... Would need much more work though, so for now just removing
that flag!
2017-08-11 10:24:57 +02:00
91d882a8c9 RNA: Use hash lookups for structs
Adding structs was checking for duplicates
causing approx 75k string comparisons on startup.

While overall speedup is minimal,
Python access to `bpy.types` will now use a hash lookup
instead of a full linked list search.

See D2774
2017-08-11 18:11:25 +10:00
317b8d9669 Transform: Snap used multiple eval contexts
Changes for 2.8x to use EvaluationContext caused some confusion

- Would use scene layer passed from snap context.
- Would generate duplis from Main eval context.
- Would take context argument and use it to create another eval context.

Adding context args all over and filling in a new eval-context
for every ray-cast test isn't ideal either.

Remove the context argument since the purpose of
SnapObjectContext is to avoid this kind of confusion.
Store the EvaluationContext once and re-use.
2017-08-11 11:23:39 +10:00
d1328feeb1 Merge branch 'master' into blender2.8 2017-08-11 10:33:39 +10:00
0398ee10a1 WM: don't load preferences on 'File -> New'
User preferences are now only loaded on...

- Initial startup.
- Factory-settings.
- Setting app-templates.
2017-08-11 09:40:28 +10:00
c4201e57f3 Eevee: Re: Fix NaN
This should be faster and apparently more stable.
2017-08-11 01:26:05 +02:00
aa575a3152 Eevee: SSR Clamp color when blurring buffers.
This effectivly reduce firefly bleeding all over the place.
We still need the clamp in the resolve pass because the level 0 has not been clamped.
NOTE: I did not clamped each sample individually for performance BUT I did not profile it to know how much it cost.
2017-08-11 01:26:05 +02:00
0665f58a57 Eevee: Fix NaN
This was surely cause by float overflow. Limit roughness in this case to limit the brdf intensity.
Also compute VH faster.

Add a sanitizer to the SSR pass for investigating where NANs come from. Play with the roughness until you see where the black pixel is / comes from.
2017-08-11 01:26:05 +02:00
757c24b6bc Cycles: remove square samples option.
It doesn't seem that useful in practice, was mostly added to match some
other renderers but also seems to be causing user confusing and accidental
long render times. So let's just keep the UI simple and remove this.

Differential Revision: https://developer.blender.org/D2768
2017-08-11 01:10:56 +02:00
8a7c207f0b Cycles: change defaults for filter glossy, clamp and branched path AA.
We're adding some bias by default, which now I think is the right thing
to do from a usability point of view since you really need to use those
options anyway to get clean renders in a practical time.

Differential Revision: https://developer.blender.org/D2769
2017-08-11 01:10:50 +02:00
977e7b68cb Cycles: add denoising tests, keep new image even if no reference exists. 2017-08-11 01:09:35 +02:00
267e75158a Fix T52322: denoiser broken on Windows after recent changes.
It's not clear why this only happened on Windows, but the code
was wrong and should do a bitcast here instead of conversion.
2017-08-11 01:09:35 +02:00
c31e221d4f Fix crash checking for Blender version 10+
PyAPI could trigger this, for now just truncate.
2017-08-11 09:00:00 +10:00
535a6cde64 Cleanup: redundant 'static' variable
Also use BLI_snprintf.
2017-08-11 08:49:09 +10:00
3d677d9190 Fix OSX duplicate path in Python's sys.path
The '..' in the path caused simple comparisons to fail.

D2780 by @akitula
2017-08-11 08:42:27 +10:00
e5604a2fa4 Cleanup: whitespace 2017-08-11 08:32:05 +10:00
3895c1e57e CMake: only build msgfmt if international is used
Changes to BLI would always rebuild msgfmt.
2017-08-11 08:14:04 +10:00
a8e1a7ba6d Fix MSVSC error
The array must have any initialization value
2017-08-10 17:41:47 +02:00
48a0fd6de8 Fix after last merge. 2017-08-10 16:04:01 +02:00
4a4c6da0f8 Merge branch 'master' into blender2.8 2017-08-10 15:57:59 +02:00
aa1b35bb60 Fix install_deps usage of patches.
Who in Hell did rename those files and did not update accordingly
install_deps.sh script???
2017-08-10 15:56:13 +02:00
017b7ee273 DPI: add back option to control line width, tweak default width.
Adds thin/default/thick modes to add -1/0/1 to the auto detected line width,
while leaving the overall UI scale unchanged.

Also tweaks the default line width threshold, so thicker lines start from
slightly high UI scales.

Differential Revision: https://developer.blender.org/D2778
2017-08-10 15:54:22 +02:00
e786ea6419 Fix T52334: images with non-color data should not change color space on save. 2017-08-10 15:49:17 +02:00
6e2f17ea02 Eevee: Refraction: Add "thickness" parameter.
This enables to fake a second refraction event. This is great to simulate thin planar objects such as glass panels.
2017-08-10 15:43:48 +02:00
896154d15d Eevee: Fix multiply blend mode. 2017-08-10 15:43:48 +02:00
2ba11d72a2 Object Mode Engine: Optimize outline passes.
Group texture fetches to hide latency. 3.2ms -> 2.2ms (constant time improvement, not depending on scene complexity)

Could optimize further with textureGather (require OpenGL 4.0).
2017-08-10 15:43:48 +02:00
7641f92710 Eevee: Refraction: Make it available for opaque materials.
Theses Materials are rendered after the SSR pass.
The only difference with previous method is that they have a depth prepass (less overdraw) and are not sorted.
2017-08-10 15:43:48 +02:00
7ef8a49ad5 DRW: Indent profiler timings. 2017-08-10 15:43:48 +02:00
723778b162 Eevee: Fix AO not working. 2017-08-10 15:43:48 +02:00
d16342e5fd Eevee: Add Screen Space Refraction.
For the moment the only way to enable this is to:
- enable Screen Space REFLECTIONS.
- enable Screen Space Refraction in the SSR parameters.
- enable Screen Space Refraction in the material tab.
2017-08-10 15:43:48 +02:00
98a7f1b335 Eevee: Refraction: Fix border artifacts. 2017-08-10 15:43:48 +02:00
f53fa8d148 Eevee: SSR: Fix cone footprint estimation. 2017-08-10 15:43:48 +02:00
0ab8b93fdd Eevee: SSR: Blur Mipmaps more.
Cost is negligeable (Only 0.02 ms more) and it improve stability.
2017-08-10 15:43:48 +02:00
99f37bf2a2 Eevee: SSR: Refine Raytrace Algorithm.
We track the previous ray position offseted by the thickness. If the sampled depth is between this value and the current ray position then we have a hit.
This fixes rays that are almost colinear with the view vector. Thickness is now only important for rays that are comming back to the camera.

As a consequence, this simplify a lot of things.

Also include some refactor.
2017-08-10 15:43:48 +02:00
292f5ab758 Eevee: Correct Mipmap texel alignment.
Since we are working with non power of 2 textures, the mipmap level UV does not line up perfectly.
This resulted in skewed filtering and bad sampling of the min/max depth buffer.
2017-08-10 15:43:47 +02:00
e0078cd953 Eevee: Add Refraction via probes. 2017-08-10 15:43:47 +02:00
aaa469a403 Eevee: Small code codestyle and fixes.
Rename get_specular_dominant_dir to get_specular_reflection_dominant_dir.
Add Zero length N check everywhere.
2017-08-10 15:43:47 +02:00
8e36089e41 Eevee: LUT generation.
We generate a 3D lut to precompute the btdf intensity.
I decided to use a 64*64*16 (N dot V, ior, roughness) because the btdf varies less with roughness than with IOR.
We also remap the ior to better use the space in the LUT.
2017-08-10 15:43:47 +02:00
4ec58659ad Eevee: Add precomputed BTDF LUT. 2017-08-10 15:43:47 +02:00
33ab011ae4 Tweak and extend POV syntax hilghting.
*Changed categories of some keywords
*reordered some longer keywords that didn't appear
*Activated another color (reserved builtins) by Leonid
*added some HGPOV and UberPOV missing keywords

Patch by Maurice Raybaud (@mauriceraybaud). Thanks to Leonid for additions, feedback and Linux testing.
Related diffs: D2754 and D2755.

While not a regression, this is new feature and would be nice to have it
backported to final 2.79.
2017-08-10 15:31:47 +02:00
64a87ee843 Cleanup: make seq dupli scene operands' names match global copying convention.
Followup to rB1037b90cb831b, forgot to save that file :(
2017-08-10 15:06:53 +02:00
05be2a8c45 Cleanup: de-duplicate makefile OS checks 2017-08-10 22:37:35 +10:00
ba4ffe90cd Manipulator: add compositor corner-pin widgets 2017-08-10 21:07:06 +10:00
1037b90cb8 Cleanup: make seq dupli scene operands' names match global copying convention. 2017-08-10 13:00:01 +02:00
ca3f601f93 Fix T52332: crash when duplicating sequencer strips.
Bug introduced in recent ID copying refactor.

This commit basically sanitizes seq strip copying behavior, by making
destination scene pointer mandatory (and source one a const one).
Nothing then prevents you from using same pointer as source and
destination!
2017-08-10 12:56:32 +02:00
5b6ead05bd Fix T52324: Metaball disappears when deleting first metaball object.
Lost specific MBall 'need update' case here in last year's refactor.

While technically not a regression, nice to have in 2.79.
2017-08-10 12:32:50 +02:00
8c4ccab5fe Merge branch 'master' into blender2.8 2017-08-10 11:14:36 +02:00
cf7a2c93e3 Cleanup & fix potential NULL pointer dereferencing. 2017-08-10 10:28:13 +02:00
a152743ba3 Fix T52314: New ID copy code (rBrB9da7dfa1586d) Breaks node previews in compositor.
"Just" forgot to copy data block's name in 'NO_MAIN' case... *sigh*
2017-08-10 10:28:13 +02:00
422fddab87 Cycles: Fix instanced shadow catcher objects influencing each other 2017-08-10 09:22:33 +02:00
5a618ab737 Cycles: De-duplicate trace-time object visibility calculation
We already have enough files to worry about in BVH builders. no need to add yet
another copy-paste code which is tempting to be running out of sync.
2017-08-10 09:21:02 +02:00
464c045b31 Manipulator: grab3d option to align to view
Use for lamp-target, makes it easier to click on.
2017-08-10 16:35:45 +10:00
8520cb4af0 Manipulator: cage2d translate in 3D view support
Needed for moving image-empties.
2017-08-10 14:30:02 +10:00
5406109fbf Manipulator: add image-empty manipulator 2017-08-10 14:08:38 +10:00
d5289f9d80 Manipulator: apply cage2d scale before offset
Needed when offset takes factor into account.
2017-08-10 14:03:37 +10:00
535d917870 Manipulator: expose use_draw_offset_scale to RNA 2017-08-10 09:59:17 +10:00
1d6b99b157 Cleanup: don't abbreviate color w/ manipulator API 2017-08-10 09:59:12 +10:00
7cb65cc038 Manipulator: rename grab enum
We'll want some 3D shapes, so name existing shapes 2D
2017-08-10 09:44:42 +10:00
de3c165713 Forgot to change magicnumber of OIIO built lib in previous commit... 2017-08-09 18:21:35 +02:00
6e7e081e3e install_deps: disable PTex in our OIIO building for now, broken on newest systems. 2017-08-09 18:16:21 +02:00
5fac99ca7a Manipulator: use offset-scale for lamp target 2017-08-09 23:49:27 +10:00
2f20b5242c Manipulator: disable cursor grabbing for 2D groups
We could make this a manipulator type flag,
for now disable for all 2D manipulators since its annoying for cage2d.
2017-08-09 23:39:08 +10:00
b4d44b98e8 Alembic: Adjusted unit test for Blender 2.8 to use scene layers. 2017-08-09 15:08:19 +02:00
6883f10f14 Merge branch 'master' into blender2.8 2017-08-09 15:08:06 +02:00
ed500ac8c7 Fix for previous commit
Accidentally got semicolon removed just before commit.
2017-08-09 15:00:47 +02:00
e00364c88e Fix strict compiler flags on 32bit Linux 2017-08-09 14:58:49 +02:00
2ec865035c Error in last commit 2017-08-09 22:55:18 +10:00
cb02f5250d Fix typo in new ID copying code. 2017-08-09 14:38:24 +02:00
8403ec5160 Manipulator: Add function to calculate matrix
Each manipulator was doing this slightly differently,
use shared function which can optionally override each matrix.
2017-08-09 22:34:08 +10:00
176ad9ecdd Cycles: Remove ulong usage
This is a bit confusing, especially when one mixes OpenCL code where ulong equals
to uint64_t with CPU side code where ulong is expected to be something else from
the naming.

This commit makes it so we use explicit name, common on all platforms.
2017-08-09 14:08:58 +02:00
45d7513f84 Fix T52240: Alembic Not Transferring Materials Per Frame
When a mesh changes its number of vertices during the animation,
Blender rebuilds the DerivedMesh, after which the materials weren't
applied any more (causing the default to the first material slot).
2017-08-09 13:59:58 +02:00
cdfeebd139 Alembic: Renamed variable assigned_name → assigned_mat
The variable is a pointer to a Material, not to a name/string.
2017-08-09 13:59:58 +02:00
422dc1ea1f Typo fix 2017-08-09 13:59:58 +02:00
8cfb9b9535 Fixed Alembic unit test
Commit b6d7cdd3ce changed how the mesh data
is deformed, which wasn't taken into account yet in this unit test.

Instead of directly reading the mesh vertices (which aren't animated any
more), we convert the modified mesh to a new one, and inspect those
vertices instead.
2017-08-09 13:59:58 +02:00
b5e6a21f1d Cleanup: Quiet warning 2017-08-09 20:24:51 +10:00
8c488cb97f Fix T52315: Crash on duplicating Scene without world.
Regression from rBa7b3047cefcbf, to be backported to 2.79.

Like... seriously... :|
2017-08-09 10:55:30 +02:00
55d28e604e Cycles: Proper fix for recent OpenCL image crash
Problem was that some code checks to see if device_pointer is null or
not and the new allocator wasn't even setting the pointer to anything
as it tracks memory location separately. Setting the pointer to non
null keeps all users of device_pointer happy.
2017-08-09 04:27:39 -04:00
06bf34227b Revert "Cycles: Fix crash changing image after recent OpenCL changes"
This reverts commit f2809ae0a6.
2017-08-09 04:24:03 -04:00
3f644682b0 Manipulator: add sun-beam node manipulator 2017-08-09 18:08:10 +10:00
d186ab6560 Manipulator: grab3d - support for 2d views
Also internal changes so arrow3d matches grab3d's behavior.

Needed to add WM_MANIPULATOR_DRAW_OFFSET_SCALE flag so
we can optionally apply offset in worldspace or screen scaled values.
2017-08-09 18:07:55 +10:00
f0d4420cc0 Fix spin rotate axis
Also disable lamp-target for cameras (might enable later).
2017-08-09 18:02:10 +10:00
00f22403ac Manipulator: replace hard coded color w/ theme 2017-08-09 18:02:10 +10:00
2190c0c7e5 Modules test: Don't print backtrace for files which are ignored
This could make output really polluted, where it'll be hard to see actual
issues.

It is still possible to have all backtraces printed using BLENDER_VERBOSE
environment variable.
2017-08-09 09:42:03 +02:00
fdb1c81117 Merge branch 'master' into blender2.8 2017-08-09 09:12:16 +02:00
f2728939df Fix T52280: The Image node in Compositing can't read Z buffer of openEXR in 2.79
As part of the fix for T51587, I removed the Depth output for non-Multilayer
images since it seemed weird that PNGs etc. that don't have a Z pass still get
a socket for it.
However, I forgot about non-multilayer EXRs, which are a special case that can
actually have a Z pass.

Therefore, this commit brings back the Depth output for non-multilayer images
just like it was in 2.78.
2017-08-09 00:29:23 +02:00
99c13519a1 Cycles: More fixes for Windows 32 bit
- Apparently MSVC does not support compound literals
  in C++ (at least by the looks of it).

- Not sure how opencl_device_assert was managing to
  set protected property of the Device class.
2017-08-08 22:32:51 +02:00
c961737d0f Cycles: Fix compilation error of filter kernels on 32 bit Windows
We don't enable global SSE optimizations in regular kernel, and we
keep those disabled on Linux 32bit.

One possible workaround would be to pass arguments by ccl_ref, but
that is quite a few of code which better be done accurately.
2017-08-08 22:01:17 +02:00
8563494823 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/modifiers/intern/MOD_meshsequencecache.c
2017-08-08 19:16:25 +02:00
b6d7cdd3ce Fix T51701: Alembic cache screws up mesh.
Use same trick as in DataTransfer modifier e.g. to avoid modifying
existing mesh's data.
2017-08-08 18:22:24 +02:00
f2809ae0a6 Cycles: Fix crash changing image after recent OpenCL changes
Steps to reproduce:
- Create shader Image texture -> Diffuse BSDF -> Output. Do NOT select image yet!
- Start viewport render.
- Select image from the ID browser of Image Texture node.

Thing is: with the memory manager we always need to inform device that memory
was freed.
2017-08-08 17:17:04 +02:00
0e57282999 Cycles: Fix compilation error without C++11
Common folks, nobody considered master a C++11 only branch. Such decision is to
be done officially and will involve changes in quite a few infrastructure related
areas.
2017-08-08 17:02:26 +02:00
e8b6bcd65c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/object/object_add.c
	source/blender/python/intern/bpy_app_handlers.c
2017-08-08 16:43:25 +02:00
4fe1bf85af Fix fixed width box layouts
Regression, to be backported in 2.79.
2017-08-08 17:37:51 +03:00
ddfd57c0d2 Cleanup: mostly namings in make_object_duplilist_real code. 2017-08-08 16:09:01 +02:00
a78b596272 Fix T52260: Blender 2.79 Objects made duplicates real still refer armature proxy.
New code was handling correctly ID's internal references to self, but
not references between 'made real' different objects...

Regression, to be backported in 2.79.
2017-08-08 16:09:01 +02:00
90b3dba515 Fix T52255: New Depsgraph - Constraint and Drivers not working together when the driver references itself 2017-08-08 15:27:25 +02:00
126830b56c Depsgraph: Cleanup, make it easier to debug on laptop 2017-08-08 15:27:25 +02:00
19d19add1e Cycles: Cleanup, de-duplicate function parameter list
Was only needed to sue const reference on CPU. Now it is done using ccl_ref.
2017-08-08 15:27:25 +02:00
fd397a7d28 Cycles: Add utility macro ccl_ref
It is defined to & for CPU side compilation, and defined to an empty for any GPU
platform. The idea here is to use this macro instead of #ifdef block with bunch
of duplicated lines just to make it so CPU code is efficient.

Eventually we might switch to references on CUDA as well, but that would require
some intensive testing.
2017-08-08 15:27:25 +02:00
01ee88563b Fix T46329: scene_update_{pre,post} doc needs clarification
The documentation for the bpy.app.handlers.scene_update_{pre,post}
handlers states that they're called "on updating the scenes data".
However, they're called even when the data hasn't changed. Of course
such handlers are useful, but the documentation should reflect the
current behaviour.

Reviewers: mont29, sergey

Subscribers: Blendify

Maniphest Tasks: T46329

Differential Revision: https://developer.blender.org/D1535
2017-08-08 15:16:51 +02:00
ed4707be47 Fix width estimation for empty layouts in pie menus 2017-08-08 15:52:14 +03:00
d85af2aa3f Update CUEW to latest version
Previous update pulled too much of system-wide typedefs.
2017-08-08 14:27:28 +02:00
c8a8589d4f Fix T52263: Crash When Splitting and Merging Areas with Header Text Set.
Not a regression, but safe enough to be included in 2.79.
2017-08-08 14:07:34 +02:00
12834fe0f0 Update CUDA wrangler to latest version
Brings new declarations from toolkit version 8.0, also fixes some
pointers used in function declarations.
2017-08-08 13:58:42 +02:00
ec8ae4d5e9 Cycles: Pack kernel textures into buffers for OpenCL
Image textures were being packed into a single buffer for OpenCL, which
limited the amount of memory available for images to the size of one
buffer (usually 4gb on AMD hardware). By packing textures into multiple
buffers that limit is removed, while simultaneously reducing the number
of buffers that need to be passed to each kernel.

Benchmarks were within 2%.

Fixes T51554.

Differential Revision: https://developer.blender.org/D2745
2017-08-08 07:12:04 -04:00
b53e35c655 Fix compilation error when building without Blender
Simply disabled python tests, they can't be run anyway (since blender target is
not enabled) and we don't have any player-related tests in that folder.
2017-08-08 11:32:33 +02:00
6af7d7e05e Cleanup: remove incorrect comment
enum values aren't saved in files.
2017-08-08 11:28:47 +10:00
8f6b5f1f3c Fix CMake dependencies builder issues on Linux with TBB and Python packages. 2017-08-08 02:33:37 +02:00
cf8add42b8 Merge branch 'master' into blender2.8
Stupid git handles merges terribly when there are conflicts and branch
is modified buring merge process... :((((
2017-08-07 21:09:10 +02:00
451ccf7396 Cycles: Cleanup, move curve intersection functions to own file
This way curve file becomes much shorter and it's also easier to write a
benchmark application to check performance before/after future changes.
2017-08-07 20:53:30 +02:00
77a7a7f455 Cycles: Cleanup, trailign whitespace 2017-08-07 20:53:30 +02:00
95fe9b2617 Cycles: Cleanup, remove bvh prefix from curve functions
Those are nothing to do with BVH, and can be used separately.
2017-08-07 20:53:30 +02:00
a4bbce8949 Cycles: Fix compilation error on NVidia OpenCL after recent refactor
Still need to verify this is proper thing to do for AMD OpenCL. At least now
i can compile OpenCL kernel on my laptop with sm21 card.
2017-08-07 20:52:24 +02:00
e673c9dc93 Merge again... 2017-08-07 20:48:22 +02:00
41830cc432 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 20:34:36 +02:00
947040cf2b Fix compilation error when rigid body is disabled 2017-08-07 20:11:19 +02:00
3c14f02eac Build: add scripts to build dependencies for Windows and macOS.
Note these are intended for platform maintainers, we do not intend to
support users making their own builds with these. For that precompiled
libraries from lib/ should be used.

Implemented by Martijn Berger, Ray Molenkamp and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D2753
2017-08-07 17:54:26 +02:00
fc38276d74 Fix Cycles shadow catcher objects influencing each other.
Since all the shadow catchers are already assumed to be in the footage,
the shadows they cast on each other are already in the footage too. So
don't just let shadow catchers skip self, but all shadow catchers.

Another justification is that it should not matter if the shadow catcher
is modeled as one object or multiple separate objects, the resulting
render should be the same.

Differential Revision: https://developer.blender.org/D2763
2017-08-07 17:54:26 +02:00
dc4d850d10 Fix Windows build errors with recent Cycles SIMD refactoring. 2017-08-07 17:54:26 +02:00
25b8eb4631 Merge branch 'master' into blender2.8 2017-08-07 17:48:14 +02:00
e7c6b244c9 Build: add scripts to build dependencies for Windows and macOS.
Note these are intended for platform maintainers, we do not intend to
support users making their own builds with these. For that precompiled
libraries from lib/ should be used.

Implemented by Martijn Berger, Ray Molenkamp and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D2753
2017-08-07 17:46:06 +02:00
8b73c9a437 Fix Cycles shadow catcher objects influencing each other.
Since all the shadow catchers are already assumed to be in the footage,
the shadows they cast on each other are already in the footage too. So
don't just let shadow catchers skip self, but all shadow catchers.

Another justification is that it should not matter if the shadow catcher
is modeled as one object or multiple separate objects, the resulting
render should be the same.

Differential Revision: https://developer.blender.org/D2763
2017-08-07 17:44:15 +02:00
dc213ca066 Fix Windows build errors with recent Cycles SIMD refactoring. 2017-08-07 17:44:15 +02:00
9da7dfa158 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
b282716c3a Merge branch 'master' into blender2.8 2017-08-07 16:16:43 +02:00
580741b317 Cycles: Cleanup, space after keyword 2017-08-07 14:47:51 +02:00
771e6120c8 Cycles tests: CMake side changes to support recent files split in the SVN repo 2017-08-07 14:33:47 +02:00
0f3f093d3b Cycles: add HTML report to inspect failed test images.
Shows new, reference and diff renders, with mouse hover to flip between
new and ref for easy comparison. This generates a report.html in
build_dir/tests/cycles, stored along with the new and diff images.

Differential Revision: https://developer.blender.org/D2770
2017-08-07 14:01:24 +02:00
ee77c1e917 Code refactor: use float4 instead of intrinsics for CPU denoise filtering.
Differential Revision: https://developer.blender.org/D2764
2017-08-07 14:01:24 +02:00
a24fbf3323 Code refactor: add, remove, optimize various SSE functions.
* Remove some unnecessary SSE emulation defines.
* Use full precision float division so we can enable it.
* Add sqrt(), sqr(), fabs(), shuffle variations, mask().
* Optimize reduce_add(), select().

Differential Revision: https://developer.blender.org/D2764
2017-08-07 14:01:24 +02:00
a8cc0d707e Code refactor: split defines into separate header, changes to SSE type headers.
I need to use some macros defined in util_simd.h for float3/float4, to emulate
SSE4 instructions on SSE2. But due to issues with order of header includes this
was not possible, this does some refactoring to make it work.

Differential Revision: https://developer.blender.org/D2764
2017-08-07 14:01:24 +02:00
5e4bad2c00 Cycles: remove option to disable transparent shadows globally.
We already detect this automatically based on shading nodes and per shader
settings, and performance of this option is ok now all devices.

Differential Revision: https://developer.blender.org/D2767
2017-08-07 14:01:24 +02:00
d1752167a9 Fix T52278: 'Default' application template fails
Own error in 7398b3b7
2017-08-07 21:20:57 +10:00
2a74f36dac Fix Cycles CUDA adaptive megakernel build error. 2017-08-07 00:27:08 +02:00
f5f6f9c9ac Fix broken API doc generation: Partially revert rBa372638a76e0
Making those arrays static remove them from exported symbols, which
breaks API doc generation script.

To be backported to 2.79 branch.
2017-08-06 17:35:41 +02:00
459365443f Manipulator: experimental lamp positioning tool
- New manipulator tracks lamps to position under cursor.
- Works with multiple lamps, keeping relative offsets.
- Holding Ctrl moves the lamp.
- Access via manipulator or Shift-T.

Code could be improved, but like to get feedback from users.
2017-08-06 19:50:09 +10:00
45dcd20ca9 Cycles: CUDA split performance tweaks, still far from megakernel.
On Pabellon, 25.8s mega, 35.4s split before, 32.7s split after.
2017-08-05 14:32:59 +02:00
48adef4444 Merge branch 'master' into blender2.8 2017-08-05 07:53:07 +10:00
fa05718f27 View3D: expose normal from depth publicly 2017-08-05 07:30:28 +10:00
cd023b6cec Cycles: remove min bounces, modify RR to terminate less.
Differential Revision: https://developer.blender.org/D2766
2017-08-04 23:11:03 +02:00
1210b47a85 Tracking: Undefine temporary define
Missed this in previous commit.
2017-08-04 21:12:11 +02:00
796437247f Manipulator: fix cage2d cancel not resetting 2017-08-04 20:33:26 +10:00
a65a64cbca Manipulator: fix 2d overlay w/ Blender Render 2017-08-04 19:18:55 +10:00
e6daa161dd Tracking: Remove limit of 50 points of the track history
Was quite stupid reason for this: static size of array.

Now we allocate needed amount of points in heap if requested path length is
getting too big.
2017-08-04 09:11:26 +02:00
d7905dab6a Manipulator: add compositor crop manipulator 2017-08-04 16:45:33 +10:00
0db4dab0c3 Tracking: Cleanup of transform code 2017-08-04 08:13:38 +02:00
54cea98046 Manipulator: add manipulator space matrix
Render-border & crop-node 2d-cage manipulators where unreasonably
complicated to implement because there was no good way to define
the sub-region the manipulator was transforming in
(render border within the camera's frame for example).

Add matrix-space variable,
remove scale property from cage2d manipulator, use matrix instead.
2017-08-04 15:34:01 +10:00
0c48a091f9 Tracking: Cleanup, use boolean instead of integer 2017-08-04 07:21:01 +02:00
0a3295953c Manipulator: fix check for custom function 2017-08-04 15:17:21 +10:00
2952798cd6 BLI_math: use const args for mul_m#_series 2017-08-04 15:05:02 +10:00
b156b968ae Manipulator: modal was drawing in wrong draw-step 2017-08-04 09:41:45 +10:00
7821bac08d Manipulator: remove unused draw step 2017-08-04 09:35:07 +10:00
caf1a5fc44 Manipulator: correct center-pivot clamping 2017-08-04 09:23:50 +10:00
e16e96433f Merge branch 'master' into blender2.8 2017-08-04 08:26:05 +10:00
696599edac CMake: test build configuration support
D2765 by @akitula
2017-08-04 08:11:42 +10:00
3b57504c09 error in last commit 2017-08-03 20:05:43 +10:00
c3eac16eb7 Manipulator: disallow negative scale when resizing 2017-08-03 20:04:22 +10:00
c8d02fce93 Manipulator: use matrix to convert view coords
Was doing this with property get/set but this made view operations
require refreshing manipulator properties.
Simplify by operating on properties in their own space.

Also disable clamping for now since it assumes pixel-space.
2017-08-03 19:45:56 +10:00
e92cf80a5c Fix for last commit
Missed check for non-camera view frame
2017-08-03 18:09:11 +10:00
fe8fcb4343 Manipulator: render border widget
Note there are issues clamping & updating,
will resolve as part of changes to cage2d widget.
2017-08-03 17:57:00 +10:00
c27446b5a0 Depsgraph: Fix wrong data type used for armature tag
Spotted by Ray aka LazyDodo, thanks!
2017-08-03 08:19:13 +02:00
0d01cf4488 Cycles: Extra tweaks to performance of header expansion
Two main things here:

1. Replace all unsafe for #line directive characters into a single loop,
   avoiding multiple iterations and multiple temporary strings created.

2. Don't merge token char by char but calculate start and end point and
   then copy all substring at once.

This gives about 15% speedup of source processing time. At this point
(with all previous commits from today) we've shrinked down compiled
sources size from 108 MB down to ~5.5 MB and lowered processing time
from 4.5 sec down to 0.047 sec on my laptop running Linux (this was a
constant time which Blender will always spent first time loading kernel,
even if we've got compiled clbin).
2017-08-03 08:07:06 +02:00
4fada2e10f Manipulator: Use 2D manipulators in the 3D view
Also split update flag into draw-steps,
since drawing 3D manipulators was tagging 2D as being refreshed.
2017-08-03 15:12:47 +10:00
fc9da74942 Manipulator: use default for cage2d dimensions
Also minor cleanuup, assign new vars for manipulator group.
2017-08-03 11:28:26 +10:00
acde5bb669 Cleanup: split 3D view manipulators by type 2017-08-03 08:30:58 +10:00
be7de5f239 Cleanup: warnings 2017-08-03 08:08:47 +10:00
cd2bb7831d Cleanup: rename selectionbase -> select_id 2017-08-03 08:01:09 +10:00
ca67cdb73c Merge branch 'master' into blender2.8 2017-08-03 07:14:02 +10:00
c6c49d90dc Remove volatile, causing issues w/ GCC/ubsan
Was Cygwin workaround, no longer needed.
2017-08-03 07:10:20 +10:00
ba98f06acc mikktspace: minor optimization
Add a safe version of normalize since all uses of normalize
did zero length checks, move this into a function.

Also avoid unnecessary conversion.

Gives minor speedup here (approx 3-5%).
2017-08-03 07:03:59 +10:00
f879cac032 Cycles: Avoid some expensive operations in header expansions
Basically gather lines as-is during traversal, avoiding allocating
memory for all the lines in headers.

Brings additional performance improvement abut 20%.
2017-08-02 20:59:19 +02:00
a280697e77 Cycles: Support "precompiled" headers in include expansion algorithm
The idea here is that it is possible to mark certain include statements
as "precompiled" which means all subsequent includes of that file will
be replaced with an empty string.

This is a way to deal with tricky include pattern happening in single
program OpenCL split kernel which was including bunch of headers about
10 times.

This brings preprocessing time from ~1sec to ~0.1sec on my laptop.
2017-08-02 20:59:19 +02:00
4ad39964fd Cycles: Speed up #include expansion algorithm
The idea is to re-use files which were already processed. Gives about 4x speedup
of processing time (~4.5sec vs 1.0sec) on my laptop for the whole OpenCL kernel.

For users it will mean lower delay before OpenCL rendering might start.
2017-08-02 20:59:19 +02:00
8ff2c14015 Fix T52250: Glitch in UI in the addon panel regression 2017-08-02 17:46:04 +03:00
3e6f5f3643 GraphEdit Handle Drawing: Fix handle-vertex size regression (2.7 -> 2.8)
Keyframe handle vertices (the circles on the ends of the handles)
should always be larger than the central vertex. This brings back the
"outer" radius value from the old gluDisk(), and doubles it to get the
necessary diameter, to scale it properly.

TODO's:
- Get rid of all fills inside these circles
- Make the central vertex square-shaped again
2017-08-03 01:52:07 +12:00
440bce242d Keyframe Drawing: Fix 2.7 -> 2.8 regressions
* Outlines of keyframes were too thick and ugly

* Size differences between keyframe types was being swallowed
  by the pixel-fudge factor, leaving colour as the only distinguishing
  factor (bad!)
2017-08-03 01:25:55 +12:00
b569151ffb Manipulator: add area lamp manipulator 2017-08-02 19:22:35 +10:00
dc4ded855a Manipulator: Make cage2d usable in the 3D view 2017-08-02 19:22:29 +10:00
1b51c34e8b Manipulator: correct cage-2d scale update 2017-08-02 08:34:59 +10:00
4afc94080c Cleanup: prefer tuples over lists 2017-08-02 07:55:15 +10:00
f934f54b84 2.79 release: new splash, yeah! 2017-08-01 19:23:19 +02:00
ebd51a022a 2.79 release: update version numbers & readfile versionning code. 2017-08-01 19:22:31 +02:00
c42c129393 Render: make Cycles and Evee support each other's output material nodes.
This changes the Cycles exporting and Cycles/Eevee UI code to support both
output material nodes, giving priority to the renderer native one. Still
missing is Eevee code to prefer the Eevee output node.
2017-08-01 19:13:41 +02:00
13d324f26b Tweak multi-units tests to match new precision handling in conversion from raw value to prety-printed one.
Note that new code allows to enable again the '1 million miles' tests.
2017-08-01 16:43:40 +02:00
636289b755 Fix multi-units drawing re precision handling.
This is still far from prefect, but yet much better than what we had so
far (more consistent with inheritent precision available in floats).

Note that this fixes some (currently commented out) units unittests, and
requires adjusting some others, will be done in next commit.
2017-08-01 16:42:35 +02:00
c1e177ad29 BLI_math: add simple helper to get amount of 'integer' digits in a float number. 2017-08-01 16:34:02 +02:00
110d6832a8 Fix typo in 2d-cage manipulator 2017-08-01 21:22:17 +10:00
6341380fbf Cleanup: warnings 2017-08-01 17:24:30 +10:00
5709021f52 Correct previous commit, instance should be cleared
Clear instance in case creating creating new instance fails.

In practice this shouldn't happen,
but better not cause further errors if it does.
2017-08-01 17:17:38 +10:00
5ac9e587d4 PyRNA: Ensure changed types creates a new instance
Changing lamp type for eg needs to create a new instance.
2017-08-01 17:14:09 +10:00
a108d81af9 Merge branch 'master' into blender2.8 2017-08-01 15:00:49 +10:00
4c38d84e73 Cleanup: double promotion 2017-08-01 13:35:26 +10:00
702e9c556f Cleanup: warnings from last commit 2017-08-01 12:31:19 +10:00
8ddaa6a4e2 Merge branch 'master' into blender2.8 2017-08-01 10:38:36 +10:00
a372638a76 Cleanup: use static vars where appropriate 2017-08-01 09:06:34 +10:00
2b7edb77c9 Fix fcurve color assignment 2017-08-01 08:27:35 +10:00
b425e94381 Correct accidental variable declaration 2017-08-01 07:55:01 +10:00
becb413f29 Fix T52224: auto IK not respecting length, after recent bugfix. 2017-07-31 19:22:03 +02:00
66110c6b98 Code cleanup: fix warning with clang. 2017-07-31 19:07:29 +02:00
f815aa01eb Fix T52232: Crash in RNA_enum_from_value while inspecting compositor image node properties in outliner.
Bug was in RNA nodes code actually, itemf functions shall never, ever
return NULL!

Note that there were other itemf functions there that were potentially
buggy. Also harmonized a bit their code.
2017-07-31 16:51:43 +02:00
b6cb7b2c92 Fix two issues with recent changes to number display while editing them.
* Numbers with units (especially, angles) where not handled correctly
regarding number of significant digits (spotted by @brecht in T52222
comment, thanks).
* Zero value has no valid log, need to take that into account!
2017-07-31 15:43:14 +02:00
b71366801e Eevee: SSR: Change clamp to a real clamp and add Max Roughness.
Clamp will now works as in Cycles.

Max roughness limit ssr to a certain roughness level: for noise / performance tweaking.
2017-07-31 15:18:38 +02:00
1be1600c32 Eevee: Draw background after depth prepass.
Reduce overdraw. 0.4ms goes to 0.01ms if background is completely occluded.
2017-07-31 15:18:38 +02:00
683e31fd80 Eevee: SSR: Rewrote the raytracing algorithm.
It now uses a quality slider instead of stride.
Lower quality takes larger strides between samples and use lower mips when tracing rough rays.

Now raytracing is done entierly in homogeneous coordinate space. This run much faster.
Should be fairly optimized. We are still Bandwidth bound.

Add a line-line intersection refine.
Add a ray jitter between the multiple ray per pixel to fill some undersampling in mirror reflections.

The tracing now stops if it goes behind an object. This needs some work to allow it to continue even if behind objects.
2017-07-31 15:18:38 +02:00
39e1518d41 Fix glitch updating manipulator after undo
Running undo would notify manipulators to refresh,
but this still allowed for events in the queue to be handled,
where manipulators could be drawn for selection before
their refresh callback runs.

This made Python manipulators raise exceptions
about referencing invalid data (or crash).

Now tag manipulator update on file load (including undo)
and ensure the refresh callback runs
before drawing manipulator selection.

Also split manipulator map refresh flag in two since selection doesn't
perform the same operations as regular drawing.
2017-07-31 14:35:10 +10:00
3b15ff3fb4 Cleanup: use enum typedef for manipulator drawstep 2017-07-31 13:15:02 +10:00
538b191a03 Correct last commit, for-loop included NULL check 2017-07-31 11:39:17 +10:00
ac2b1663ef Cleanup: remove next/prev from manipulator map 2017-07-31 11:26:03 +10:00
18773f3f15 Fix manipulator Python API crash w/ undo
Split up manipulator free & unlink, so freeing window data doesn't
run callbacks that might use freed data.
2017-07-31 06:45:05 +10:00
0467443930 Fix manipulator keymap initialization
Update flag was cleared before being checked
when registering after load.
2017-07-31 04:47:24 +10:00
c90a3af879 Manipulator: Check we don't add multiple times 2017-07-30 15:47:57 +10:00
49c0ad1188 Revert "Fix manipulator handles getting added each refresh"
This reverts commit 122706db9c.

Would loose manipulators, will check for duplicates instead.
2017-07-30 15:38:32 +10:00
367ec386d1 BLI_memiter: minor cleanup 2017-07-30 14:23:08 +10:00
be97238308 DwM: use BLI_memiter for draw storage & iteration
This will only be noticeable for drawing many instances.

In contrived use-case with many instances, and `USE_PROFILE` disabled
this can close to double playback FPS.

The option to disable this is left in the code in case we want to
debug memory use.

See D2756 for details.
2017-07-30 02:26:36 +10:00
71388b094f DwM: add ability to disable the timer
This interferes with benchmarking draw times,
so this makes it easy to turn off.
2017-07-30 01:31:36 +10:00
913d8ec608 BLI_memiter: Small API for many small allocations
- Each allocation can be a different size
  (but should be smaller than the chunk size).
- Result can be looped over in order of allocation.
- Allocations are aligned to pointer size to avoid unaligned reads.
2017-07-30 00:08:17 +10:00
09eac0159d Property path generation fixes 2017-07-29 15:23:01 +03:00
277dc47eea Remove volatile, causing issues w/ GCC/ubsan
Should remove from master since its workaround for Cygwin
but too close to release.
2017-07-29 08:58:11 +10:00
1ee11b5085 Merge branch 'master' into blender2.8 2017-07-29 08:49:34 +10:00
fb1cd7648f Cleanup: quiet picky ubsan warnings 2017-07-29 08:42:32 +10:00
361acb6991 Cleanup: multistatement-macros warning 2017-07-29 08:21:01 +10:00
393ba0cf16 Cleanup: multistatement-macros warning 2017-07-29 08:18:20 +10:00
0e26707bce Merge branch 'master' into blender2.8 2017-07-29 06:44:04 +10:00
214bbd4c02 Replace magic numbers with deprecated names
The names aren't meaningful but means it wont
accidentally use valid names.

Also remove textured-font setting
2017-07-29 06:27:40 +10:00
f3782c0a9e Fix T52195: Sculpt from Python fails
When calling sculpt from Python,
setting 3D 'location' but not 2D 'mouse' stopped working in 2.78.

Now check if the operator is running non-interactively and
skip the mouse-over check.
2017-07-29 06:05:43 +10:00
e2a7e1e494 WM: OP_IS_INVOKE was being incorrectly set
Calling an operator with EXEC_* context would still set the invoke flag.
2017-07-29 05:44:58 +10:00
87d5e34453 Fix T52213: Enum drivers no longer work
Regression in D1812: PyDriver variables as Objects

Taking the Python representation is nice in general
but for enums it would convert them into strings,
breaking some existing drivers.
2017-07-29 02:39:16 +10:00
c558763ef5 Merge branch 'master' into blender2.8 2017-07-29 01:46:27 +10:00
e038830650 Resolve T45301 by adding option for old behavior
Some users really liked previous behavior,
so making it an option.

Cursor Lock Adjustment can be disabled to give something close to
2.4x behavior of cursor locking.

When lock-adjustment is disabled placing the cursor the view.
This avoids the issue reported in T40353
where the cursor could get *lost*.
2017-07-29 01:37:51 +10:00
2eb2655181 Cleanup: clear deprecated UI flags
Also adds cursor-lock flag, to be used in next commit.
2017-07-29 01:28:58 +10:00
9b22dbcc0d Fix T52156: Hair dynamics broken with density texture
Even strands that were excluded by the density texture were being added
to the DM passed to cloth, but these ended up having some invalid data,
because they were not fully constructed.

This simply excludes `UNEXISTED` particles from the DM generation, as
would be expected.
2017-07-28 15:30:26 +02:00
e39dc48bd5 Fix crash when duplicating object
This fixes null pointer check fiasco.
2017-07-28 13:02:20 +02:00
05f377805b Fix T52148: Point Density Texture ID User decrement error related to the Object field.
Note that fix is not perfect, systematically make refcounting of all IDs
assigned to node's id pointer, which breaks the 'do not refcount
scene/object/text datablocks' principle...

But besides that principle being far from ideal in general, it becomes
pretty much impossible to apply when using //generic// ID pointer,
unless we add some kind of type data to that pointer somehow.

So for now, better to live with that, than having broken usercount.
2017-07-28 12:43:06 +02:00
50cc0aa0d1 Depsgraph: Re-use evaluated mesh across frames and remove time dependency from all CoW components
This commit is a work forward having less updates during playback, which speeds
things up a lot here. The idea is simple: stop update all copy-on-write
datablocks (which implies full re-evaluation actually) on frame change and
re-use existing evaluated meshes as much as possible.

This brings playback speed to 24 fps on the dino test scene here. Performance
drops down a lot when armature is animated tho, but that's because of need of
tangent space calculation which we can't do much about from just a dependency
graph.

Hopefully this doesn't make copy-on-write too unstable, quick tests here are
surviving fine.
2017-07-28 12:27:34 +02:00
d41acacc61 Fix T52212: Vgroups doesn't work after Carve Boolean 2017-07-28 11:55:58 +02:00
38eabcb858 Fix potential 'divide-by-zero' in our UI fitting code.
Reported by coverity, better fix even if highly unlikely to happen...
2017-07-28 10:56:41 +02:00
304e5541cb Fix T52208: Using UI_BUT_REDALERT flag for UI_BTYPE_KEY_EVENT buttons crashes Blender.
but pointer was not assigned in that case...
2017-07-28 10:38:47 +02:00
c694f6e3fa Cleanup: Remove gitignore for api images 2017-07-27 16:04:42 -04:00
9323182e73 Prevent crash when duplicating object which doesn't have evaluated base properties yet
This mainly happens when copy on write is enabled.
2017-07-27 16:29:45 +02:00
03d258d613 Copy on write: Prevent crash when duplicating object with particle system
Transform system was using global main, which might have been pointing to a
freed scene layer.
2017-07-27 16:28:16 +02:00
1bd9531fda Fix UI messages... 2017-07-27 15:20:44 +02:00
549f43e928 Depsgraph: Attempt to keep evaluated mesh when possible
Currently wouldn't make any difference, but required for upcoming work of
getting rid of time dependency for copy-on-write component.
2017-07-27 15:19:37 +02:00
6ef34525a1 Depsgraph: Cleanup, variable name 2017-07-27 15:19:37 +02:00
e90468e5a3 Depsgraph: Cleanup, use some utility functions to shorten construction code
Still some cleanup is possible.
2017-07-27 15:19:36 +02:00
cf38371155 Depsgraph: Create ID nodes on build-time expansion using node builder
This will allow us to do some builder-specific trickery when ID nodes are
requested to be created from build-time expansion.
2017-07-27 15:19:36 +02:00
55527d83e2 Depsgraph: Allow stealing copy-on-written pointer
This will become handy when we'll be re-using evaluated meshes for
objects after relations are updated.
2017-07-27 15:19:36 +02:00
3441af49bd Depsgraph: Fix possibly missing lamp update when lamp data changes 2017-07-27 15:19:36 +02:00
41a3aafd48 Depsgraph: Make it possible to use given pre-allocated ID as a copy 2017-07-27 15:19:36 +02:00
4c5537ed42 Copy on write: Make sure freeing evaluated mesh does not cause crash when re-evaluating the object 2017-07-27 15:19:36 +02:00
7d014bca91 DRW: Fix vertex buffer too large. 2017-07-27 14:51:44 +02:00
88b911aa9e Eevee: Fix probes interfeering with SSR. 2017-07-27 14:51:44 +02:00
05d73ec06f Eevee: Planar Reflection: only support mirror reflection if not using SSR. 2017-07-27 14:51:44 +02:00
c6a74edcf8 Eevee: Fix bloom once and for all.
... Hopefully ...
2017-07-27 14:51:44 +02:00
ec6170061e DRW: Add stats group to eevee and object mode. 2017-07-27 14:51:44 +02:00
5bfa3cf6e9 DRW: Revamp the performance debugging tool.
Old performance debug was doing queries for every frame even if not debugging perf.
Also, it did not record when a pass was draw multiple time, leading to incorect measurement.

New module also allows to group the timers to limit infos displayed.

Also fix the background CPU draw timer.
2017-07-27 14:51:44 +02:00
4003409430 Fix factory setup using user scripts path still 2017-07-27 22:22:26 +10:00
2b8f50e1d4 Depsgraph: Fix crash happening in copy-on-write of images
Was a threading conflict or so in the cache limiter, and in fact
we don't even want images to be copied.
2017-07-27 13:26:21 +02:00
f1d6bad4b6 Fix T51776: Make sure button icons are updated on Ctrl-ScrollWheel 2017-07-27 12:55:17 +02:00
Julian Eisel
980efaf4fd Fix button text overlapping with shortcut text in popups
The purpose of the keymap strings is probably for un-embossed menu items
like seen in most pulldowns. I can't see a reason for also adding that
string for regularly drawn buttons within popups, we don't add it
anywhere else in the UI either. So this commit makes sure shortcut
strings are only added to buttons that are drawn like pulldown-menu
items.
2017-07-27 12:28:16 +02:00
Julian Eisel
492b5d0bc3 Minor code style corrections 2017-07-27 12:28:16 +02:00
c72eb6288e Fix Label colors in popups 2017-07-27 12:28:16 +02:00
72e228a155 Fix: use click style if a pie was spawned by release or click event 2017-07-27 12:28:16 +02:00
f8bd6adee2 Depsgraph: Skip iterating over all ntree users on node tree parameter update
Also make sure drivers on node tree properties will work correctly for viewport.
2017-07-27 11:50:14 +02:00
Julian Eisel
920bff5224 Fix button text overlapping with shortcut text in popups
The purpose of the keymap strings is probably for un-embossed menu items
like seen in most pulldowns. I can't see a reason for also adding that
string for regularly drawn buttons within popups, we don't add it
anywhere else in the UI either. So this commit makes sure shortcut
strings are only added to buttons that are drawn like pulldown-menu
items.
2017-07-27 11:49:41 +02:00
Julian Eisel
129c3ac7b3 Minor code style corrections 2017-07-27 11:44:51 +02:00
ec22809025 Fix Label colors in popups 2017-07-27 10:27:29 +03:00
3e8b2288f5 Fix: use click style if a pie was spawned by release or click event 2017-07-27 10:13:40 +03:00
b01d38ef7d Manipulator: remove names
They weren't used anywhere,
both C & Py manipulators better assign to vars (no lookup needed).
2017-07-27 07:43:15 +10:00
1f15c61ce1 stub update 2017-07-27 07:41:24 +10:00
11e95fcdd2 Merge branch 'master' into blender2.8 2017-07-27 07:35:44 +10:00
5c963128ea Cleanup: remove check for old GCC&PPC 2017-07-27 07:29:16 +10:00
17230ec11f Cleanup: Py3.7x warning 2017-07-27 07:29:16 +10:00
320fc70cf2 Minor template code patch. (objectHitList =/= hitObjectList)
The Blender text editor's built in python template "Gamelogic" has a reference near the bottom to "objectHitList" as an alleged attribute to the KX_TouchSensor. This name is incorrect, it's correct name is "hitObjectList."

Attempting to access the suggested objectHitList returns error...
```
AttributeError: 'KX_TouchSensor' object has no attribute 'objectHitList'
```

The provided diff corrects this minor error.

Reviewers: kupoman, moguri, campbellbarton, Blendify

Reviewed By: Blendify

Tags: #game_engine, #game_python

Differential Revision: https://developer.blender.org/D2748
2017-07-26 16:05:54 -04:00
48e8a1a167 Fix crash in recent changes to instancing
Registrable classes already handled their own instancing,
changes to enable instancing everywhere conflicted.
2017-07-27 03:27:14 +10:00
6fe2a48d3e Last commit broke WITH_PYTHON_SAFETY
Re-enable BPY_id_release call with thats enabled.
2017-07-27 02:12:40 +10:00
0b5f056119 BPY_id_release was a nop, use RNA invalidate directly 2017-07-27 02:07:04 +10:00
723f2b292f Fix T52186: Crash on bevel
bContext is not always available in transform, so need to use explicit
scene and scene layer to create evaluation context from.
2017-07-26 16:33:44 +02:00
22342a7647 CLeanup: Use utility function in BKE 2017-07-26 16:33:44 +02:00
a01c1849e9 Depsgraph: Add utility function to initialize evaluation context from scene and layer 2017-07-26 16:33:44 +02:00
e99350aeaa Cleanup, line wraps 2017-07-26 16:33:44 +02:00
776c765400 Initialize time for evaluation context when creating from bContext 2017-07-26 16:33:44 +02:00
66e28a2827 Fix T52176: Bevel doesn't correctly work with default empty Vgroup.
`defvert_array_find_weight_safe()` was confusing 'invalid vgroup' and
'valid but totally empty vgroup' cases.

Note that this also affected at least ShrinkWrap and SimpleDeform
modifiers.
2017-07-26 16:23:24 +02:00
3ed5c9a610 PyAPI: Store PyInstances for ID's
This means once an ID is created,
it will keep using the same PyObject instance.

This has some advantages:
- Avoids unnecessary re-creation of instances on UI poll / redraw.
- Accessing free'd ID's gives an exception instead of crashing.
  (long standing annoyance!, though this only applies to ID's
   and not yet other data that uses the ID's - vertices for eg).
- Allows using instance comparison (a little faster).

Note that the instances won't be kept between undo.
2017-07-26 23:49:20 +10:00
40a45e393e PyAPI: Fix for instancing (Blender owns a reference)
Also set newly created values to the instance pointer.
2017-07-26 23:05:00 +10:00
80befca6e5 Manipulator: only check for highlight once
Was doing 2x lookups which is OK for click-select
but this runs on mouse-move and can become slow.

May enable this again if highlighting logic changes.

Also scale hotspot by pixelsize.
2017-07-26 20:54:37 +10:00
245a67386b blenderplayer stub update 2017-07-26 18:18:32 +10:00
2e83897f91 Cleanup: typedef enums
Manipulator enum types are easy to confuse, use typedefs.
2017-07-26 18:00:26 +10:00
54bc49e6f9 Manipulator: refactor/fix selection logic
- Cleanup array access, move into functions.
- Store allocated size to avoid realloc's on every add/remove.
- Make select editable from Python.
- Rename select callback to select_refresh
  (collided with select boolean).
- Call select_refresh when de-selecting as well as selection.
2017-07-26 08:34:09 +10:00
dee19b8cb7 FaceMaps: add select flag
For use by manipulators since they don't have their own persistent data
in the blend file.
2017-07-26 08:34:09 +10:00
3b84a0b3d2 Eevee: Fix post process with Ugly color.
This was cause by some post process not always sampling the highest mipmap.
But if there is no need for mipmapping (i.e. no SSR) these levels will be undefined.
So forcing all Post FX shader to sample level 0 fix this.
2017-07-25 22:07:35 +02:00
4fd70c99a5 Eevee: SSR: Add support for planar probes.
This add the possibility to use planar probe informations to create SSR.
This has 2 advantages:
- Tracing is less expensive since the hit is found much quicker.
- We have much less artifact due to missing information.

There is still area for improvement.
2017-07-25 22:07:35 +02:00
8c3ecc9651 Workaround for crash drawing face-maps after undo 2017-07-26 05:10:20 +10:00
2b1cd24c6e Fix T52190: Depth picking fails 2017-07-26 02:35:27 +10:00
80e03e7709 Depsgraph: Support changing scene's render engine 2017-07-25 15:11:51 +02:00
f7636f0ef2 Depsgraph: Make sure armature mode is properly changed in all copied versions 2017-07-25 14:53:19 +02:00
6a7d7586e5 Depsgraph: Initial support of pose mode for copy-on-write armature
Some basic code, makes it possible to pose existing armature.

Probably still lots of corner cases to cover, but need to start somewhere.
2017-07-25 14:38:10 +02:00
247ddb6237 Depsgraph: Fix relations update when transform is done and there was no temporary constraints created 2017-07-25 14:38:10 +02:00
f848374e49 Cleanup: rename active to modal
This matches operators naming and should avoid confusion in future if we
want to use active as term for last-selected.
2017-07-25 22:39:58 +10:00
762fa7bee3 Depsgraph: Remove unsued node flag 2017-07-25 14:06:36 +02:00
5d327eda98 Manipulator: option to draw all while interacting 2017-07-25 22:02:16 +10:00
0612011b91 Manipulator: support select-drag to tweak 2017-07-25 21:34:20 +10:00
b97bf844b3 Merge branch 'master' into blender2.8 2017-07-25 20:53:10 +10:00
edc6bec9d6 PyAPI: Skip user scripts w/ factory-startup
Adds bpy.app.factory_startup,
used to check if user scripts should be loaded.
2017-07-25 20:52:08 +10:00
8a2fdb3749 Manipulator: break after an event is handled
Now works the same as other event handling functions.
2017-07-25 20:17:54 +10:00
50e88740c4 Fix PyManipulators having keymaps registered twice
Manipulators which are registered before UI initialized would have their
keymaps initalized twice (duplicate keymap items).
2017-07-25 20:06:49 +10:00
35d9f68121 Python module test: Don't cfail the test when import failure happens in preset 2017-07-25 11:39:10 +02:00
9bdd12d884 Merge branch 'master' into blender2.8 2017-07-25 17:36:49 +10:00
d1dc5e0a53 PyAPI: utility for creating register, unregister
This simplifies creation of register, unregister functions that
simply forward calls submodules.
2017-07-25 17:34:34 +10:00
e93804318f Fix T51450: viewport render time keeps increasing after render is done.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2747
2017-07-25 01:47:04 +02:00
Matheus de Sousa Faria
b7fb00f512 Fix compositor Glare node with Simpler Star resulting in uneven rays.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1867
2017-07-25 00:48:34 +02:00
d99532e1d8 Fix crahs when doing preview from a scene withotu world 2017-07-24 17:42:55 +02:00
ff6e8b0b50 Depsgraph: Avoid assert failure in some harmless cases 2017-07-24 17:41:29 +02:00
7260a693e1 Cleanup: trailing space 2017-07-25 01:28:15 +10:00
c75f6d9245 Cleanup: remove scons config 2017-07-25 01:28:15 +10:00
7fbd529fb5 Revert "ransform: fix unreported bug: geometry hidden by clipping border (alt + b) is not bypassed in snap to faces"
This reverts commit 7f09b55d01.
2017-07-24 12:08:23 -03:00
34b248b746 Depsgraph: Synchronize collection visibility after copy
BKE_scene_copy explicitly ignores visibility of "source" collections make all
collections visible. This is also tested by regression tests.

While it seems more logical to simply preserve all possible visibility flags
and overrides, don't feel like submitting to a behavior-changes without talking
to author of those guards first.

This commit fixes cycles material preview.
2017-07-24 17:03:53 +02:00
35d044e40d Fix compilation error of alembic test after recent eval_ctx changes 2017-07-24 16:50:47 +02:00
34c2628f32 Eevee: Silence printfs. 2017-07-24 16:36:57 +02:00
b3466921b8 Depsgraph: Fix typo in comment 2017-07-24 16:32:07 +02:00
b11926487f Depsgraph: Fix crash when trying to create full copy of scene 2017-07-24 16:24:41 +02:00
1ddb3c953d Depsgraph: Textures and images are actually covered by depsgraph
Might be missing relation links tho.
2017-07-24 16:24:41 +02:00
deecfb5476 Depsgraph: Avoid creating ID nodes for objects which are coming from collections and not layers
If object is only listed in collection but not added to any of layers we shouldn't create
placeholder for it, because otherwise we'll leave lots of placeholder ID nodes.

Question: can we make this exception to be more reliable?
2017-07-24 16:24:41 +02:00
7b420e1908 Depsgraph: Be consistent about id type variable name 2017-07-24 16:24:41 +02:00
7721f8a269 Depsgraph: Cleanup, use utility function to clear lists 2017-07-24 16:24:41 +02:00
4719dbafdf Depsgraph: Ignore palettes from copy-on-write routines
They are not covered by dependency graph.
2017-07-24 16:24:41 +02:00
c21dd69060 Eevee: Fix crash when saving file with motion blur. 2017-07-24 16:21:43 +02:00
7f09b55d01 ransform: fix unreported bug: geometry hidden by clipping border (alt + b) is not bypassed in snap to faces
The geometry behind the farther clip_plane is not bypassed
2017-07-24 11:13:33 -03:00
8dd0ce6b78 Eevee: Fix double buffer issue. 2017-07-24 15:55:21 +02:00
27dd82a951 Eevee: SSR: Refactor multiple rays. Plus other changes...
-Allow a maximum of 4 rays per trace pixel.
-Removes parameter Normalize: use normalization all the time now.
-Add firefly clamp slider.
2017-07-24 15:36:37 +02:00
7585c82722 Eevee: Make MinmaxZ compatible with textureArray 2017-07-24 15:36:37 +02:00
85f1b7358a Eevee: Planar Reflection: Remove distance approximation.
This commit separate the depth texture into another texture array.
This remove the need to output radial depth into alpha.
Unfortunatly it's difficult to recover position from the non linear depth buffer when applying reflection without adding a bunch of stuff.
This is in preparation of SSR planar reflections.
2017-07-24 15:36:37 +02:00
1d99d08d50 Eevee: SSR: Add two hit option.
This option add another raytrace per pixel, clearing some noise.
But multiplying the raytrace cost.
2017-07-24 15:36:37 +02:00
76bf4f2cd3 Eevee: SSR: Fix Opengl Render.
Add a constant number of 4 drawing loop to accumulate 4 "bounce" of light in SSRs.
2017-07-24 15:36:36 +02:00
56ba01a561 Eevee: SSR: Fixed problem with un-initialized texture.
Also add another debug buffer and cleanup in effect_ssr_frag.glsl
2017-07-24 15:36:36 +02:00
c5f4342692 Eevee: SSR: Small fixes
- Encode normals for other opaque bsdf so they are not rejected by the normal facing test.
- Early out non reflective surfaces.
- Add small offset to raytrace to avoid self intersection.
- Fix fallback probes not appearing.
2017-07-24 15:36:22 +02:00
f6c60ffcad Eevee: SSR: Add Weight Normalization option. 2017-07-24 15:28:27 +02:00
e5dae98999 Eevee: SSR: Add View Facing fadeout.
Also make hit boolean depends on hit coord not on pdf.
2017-07-24 15:28:27 +02:00
d2462e3d26 Eevee: SSR: Add fullscreen raytrace option and Screen border factor. 2017-07-24 15:28:27 +02:00
9906ef06b1 Eevee: SSR: Use noise to dither the stride banding. 2017-07-24 15:28:27 +02:00
a3732412ad Eevee: SSR: Add stride and thickness parameters.
Also polished the raytracing algorithm.
2017-07-24 15:28:27 +02:00
18aa6cf1cc Eevee: SSR: Add fullscreen raytrace. 2017-07-24 15:28:27 +02:00
e0c1323737 Eevee: HiZ buffer: Split into two 24bit depth buffer
This way we don't have float precision issue we had before and we save some bandwidth.
2017-07-24 15:28:27 +02:00
a2932078ec Eevee: SSR: Add firefly filter and refine noise reduction.
Push to 9 resolve sample.
Add an normalization as an option since it gives harsh limits.
2017-07-24 15:28:27 +02:00
b576d06050 Eevee: Codestyle. 2017-07-24 15:28:27 +02:00
e8912dd844 Eevee: SSR: Do the SSR pass only for probes if there is no valid double buffer.
This prevent black reflection when initializing SSR.
2017-07-24 15:28:27 +02:00
f1bf9d6bfb Eevee: SSR: Add mipmap filtering and bias to reduce noise.
Also fix the roughness factors.
2017-07-24 15:28:27 +02:00
09413fad12 Eevee: Fix glossy node roughness. 2017-07-24 15:28:27 +02:00
babef873fc Eevee: SSR: Don't block the ray if tracing behind object.
This requires to check for backface after a hit.
2017-07-24 15:28:27 +02:00
72a4778391 Eevee: SSR: Add per pixel resolve of multiple rays. 2017-07-24 15:28:27 +02:00
b1a8803c24 Eevee: SSR: Add roughness random rays. 2017-07-24 15:28:27 +02:00
7938848b63 Eevee: SSR: Add double buffer so we can read previous frame color.
Also add simple reprojection and screen fade to the SSR resolve pass.
2017-07-24 15:28:27 +02:00
14bedf80cd Eevee: SSR: Make raymarch step bigger. 2017-07-24 15:28:27 +02:00
ebc2833ca1 Eevee: Fix Shader compilation. 2017-07-24 15:28:27 +02:00
3be8ab881e Eevee: SSR: Add simple raytracing.
Still imprecise.
2017-07-24 15:28:27 +02:00
19323a0ff5 Eevee: Fix clip/hashed alpha prepass/shadow crash. 2017-07-24 15:28:27 +02:00
1d00a66f5d Eevee: SSR: Encode Normal in buffer and add cubemap fallback.
Normals can point away from the camera so we cannot just put XY in the buffer and reconstruct Z later as we would not know the sign of Z.
2017-07-24 15:28:27 +02:00
2a84331f02 Eevee: SSR: Output ssr datas to buffers.
Output in 2 buffers Normals, Specular Color and roughness.
This way we can raytrace in a defered fashion and blend the exact contribution of the specular lobe on top of the opaque pass.
2017-07-24 15:28:27 +02:00
04f8e1b21c Eevee: Ssr: Add ssr id to glossy nodes.
An id is given to each glossy node in order to determine which specular lobe is using ssr.
2017-07-24 15:28:27 +02:00
b379f02f20 Fix T50039: texture paint soften strength not working with float images. 2017-07-24 15:02:39 +02:00
b7fbe6ae5d Initialize scene layer for evaluation context used by preview renderer
Ideally need to clean and sane and impossible-to-break way of making sure
evaluation context is fully initialized, but that would need some thoughts
and experimentation.
2017-07-24 15:00:44 +02:00
bbb1c0a077 Render preview: Always make sure all ID datablocks references by objects are in bmain
Otherwise we'll have confused dependency graph builder, which wouldn't be able to
build proper graph.

Didn't find a way to avoid world copy here, we can probably escape with some shallow
copy here, but that will currently complicate code a lot.

Ideas to consider here:

- Use shallow copy of existing world after new ID management API is in place.

  Downside would be thread safety, kind of nice to have everything local.

- Switch depsgraph away from ID_TAG and do hash lookup or so.

  This will slow down depsgraph builder, but will make code more reliable.
2017-07-24 14:50:26 +02:00
James Fulop
c3c0495b30 Fix T51948: pen pressure not detected with some Wacom tablets.
Generalizes current conditions, QT implements it the same way.
2017-07-24 13:54:36 +02:00
f65a8bbdb7 Correct invalid assert use 2017-07-24 17:32:28 +10:00
4fd3582b32 Manipulator: view-selected support
Only applies to selected manipulators
(currently not used for regular manipulators).
2017-07-24 17:26:02 +10:00
d53028b450 Manipulator: Expose Context.manipulator_group
Needed for operators run by the manipulator keymap
so they can access their selected manipulators.
2017-07-24 17:21:09 +10:00
c7bc2f5e87 Manipulator: handle keymaps for selected items
Was only handling keymap items when the cursor
was hovering over a manipulator.
2017-07-24 17:19:36 +10:00
9e929c911e Fix Cycles multi scatter GGX different render results with Clang and GCC.
The order of evaluation of function arguments is undefined, and the order
was reversed between these compilers. This was causing regressions tests
to give different results between Linux and macOS.
2017-07-23 23:25:12 +02:00
392b6a303e Manipulator: setup_keymap callback
Also remove manipulator_group argument, the info's in the class.
2017-07-24 03:27:57 +10:00
e982ebd6d4 Fix T52152: allow zero roughness for Cycles principled BSDF, don't clamp. 2017-07-22 23:58:51 +02:00
ec831ee7d1 Fix Cycles denoising NaNs with a 1 sample renders.
This was causing different render results with different compilers. We
can't do much useful with 1 sample, but better for debugging.
2017-07-22 23:58:51 +02:00
b4528d8897 Fix use of uninitialized value in Cycles, probably did not cause a bug. 2017-07-22 21:29:10 +02:00
9a5d06cdd5 Manipulator: use select keymap when enabled 2017-07-23 02:45:41 +10:00
661a05de23 Fix error in previous merge 2017-07-21 18:32:27 -04:00
3aeabe3afa Merge branch 'master' into blender2.8 2017-07-21 18:28:32 -04:00
a27b6ae4a9 Transform: remove unused argument 2017-07-21 18:04:05 -03:00
70eac432b7 UI: Add Open Image button to Mask Stencil Image panel
In the future we should make these two buttons on one line
However because we need `gen_context = 'PAINT_STENCIL'`
this is a little hard and we need to find a proper solution.
One might be using `context_pointer_set`

Patch by @craig_jones with edits by @blendify

Differential Revision: https://developer.blender.org/D2710
2017-07-21 16:52:41 -04:00
9e40977c27 UI: Add Open Image button to Mask Stencil Image panel
In the future we should make these two buttons on one line
However because we need `gen_context = 'PAINT_STENCIL'`
this is a little hard and we need to find a proper solution.
One might be using `context_pointer_set`

Patch by @craig_jones with edits by @blendify

Differential Revision: https://developer.blender.org/D2710
2017-07-21 16:46:35 -04:00
64fd45b1df Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-21 14:20:24 -03:00
34f0250f32 Another solution to bug T38358 and related
Moving the ray_start_local to the new position does not lose as much precision as moving the ray_org_local to the corresponding position.

The problem of inaccuracy is within the functions: `bvhtree_ray_cast_data_precalc` and` fast_ray_nearest_hit`. And not directly in the values of the rays.
2017-07-21 14:02:16 -03:00
122706db9c Fix manipulator handles getting added each refresh
The same manipulator map handler would accumulate,
slowing down interactions.
2017-07-22 01:57:23 +10:00
ac0da72a60 Fix compilation error with Collada enabled 2017-07-21 17:44:11 +02:00
911f239d09 Merge branch 'master' into blender2.8 2017-07-21 16:08:31 +02:00
11204fce4e Fix strict compiler warning in BGE when linking directly to SDL 2017-07-21 16:07:59 +02:00
5605c26fcd Fix function declaration of some modifiers
Those functions did not use evaluation context.

Also fixed lots of unused variables warnings caused by commented out code which
needs to be ported away from DerivedMesh and to evaluation context.
2017-07-21 15:54:42 +02:00
cd301bf654 Depsgraph: Cleanup, remove unused function argument 2017-07-21 15:37:51 +02:00
9c2f55baa1 Fix compilation error with smoke and rigid body disabled 2017-07-21 15:36:59 +02:00
1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
9edb7e49d7 Depsgraph: Fix missing material update when changing links in node tree 2017-07-21 14:20:30 +02:00
4e28d88ece Fix T51724: Blender 2.80 EEVEE, Cycles, Clay Black Wall Graphical Glitch 2017-07-21 12:08:25 +02:00
9fbef5d5d5 Merge branch 'master' into blender2.8 2017-07-21 11:18:02 +02:00
4d67034076 Fix T52134: New depsgraph crashes when evaluating several psys on from object 2017-07-21 11:12:34 +02:00
2200e5a280 Fix strict compiler error after recent UI changes 2017-07-21 10:52:36 +02:00
8b17ec0c00 Fix T52136: Blender segfault (stack overflow most certainly) when converting to mesh.
Stupid mistake in own recent refactor.
2017-07-21 10:24:20 +02:00
dc6fcb8ecf UI/floats: Reduce our UI_PRECISION_FLOAT_MAX by one to avoid most rounding issues.
The way we use it, UI_PRECISION_FLOAT_MAX is actually + 1 to get total
number of digits, and float only has 7 meaningful digits, so that define
shall be at 6.
2017-07-21 10:12:35 +02:00
c425653f16 Set face-map to active when selecting
It was annoying have to use select operator to know which facemap
applies to the active face. This behavior follows materials.
2017-07-21 15:50:58 +10:00
db8bc1d982 Fix a few harmless maybe uninitialized warnings with GCC 5.4.
GCC seems to detect uninitialized into function calls now, but then isn't
always smart enough to see that it is actually initialized. Disabling this
warning entirely seems a bit too much, so initialize a bit more now.
2017-07-21 00:54:58 +02:00
0d4fd7528f Fix T46560: 2D paint smear and soften brushes not working with alpha.
Interpolate rather than do alpha over mix, matching projection paint.
2017-07-21 00:47:43 +02:00
2b132fc3f7 Fix T52135: Cycles should not keep generated/packed images in memory after render. 2017-07-20 23:47:05 +02:00
a4cd7b7297 Fix potential memory leak in Cycles loading of packed/generated images. 2017-07-20 23:46:58 +02:00
3ededb19d8 Depsgraph: Fix crash when updating materials with copy on write enabled
The code was freeing GPU materials from non-main thread.
2017-07-20 17:48:36 +02:00
dfcb568c16 Fix T51925: Eevee: Animated Eevee values slowdown
Move material update from RNA callback to dependency graph.
2017-07-20 17:48:36 +02:00
177a8f6dab Manipulator: add access to manipulator's group 2017-07-21 00:51:03 +10:00
6b0d4302be PyAPI: use instancing when supported
This means when a new data-type is returned it will use the same
instance as the previously created one (if it exists).
2017-07-21 00:50:18 +10:00
57ee488404 Partially revert previous commit, some unwanted changes sneaked in 2017-07-20 16:15:13 +02:00
21f27692da Depsgraph: Use explicit material update operation code
Avoids string comparison on key matching.
2017-07-20 16:03:04 +02:00
83b0bf9166 Depsgraph: Solve TODO about more granular particle settings update tagging 2017-07-20 15:38:48 +02:00
905366ca7e Fix/workaround T52127: Combed hair from 2.78 not showing when appending
Quick solution to prevent particle components from being tagged for complete
re-evaluaiton.
2017-07-20 15:16:57 +02:00
3b12a71972 Fix T52125: principled BSDF missing with macOS OpenCL. 2017-07-20 15:15:43 +02:00
84a87bf45a Depsgraph: Fix crashes when OCIO configuration is missing
We were creating copy on write version of scene prior to validating color management
settings for the original scene.
2017-07-20 15:00:09 +02:00
b7d0cfaa60 Depsgraph: Fix missing UV layers with copy on write enabled 2017-07-20 14:29:13 +02:00
Stefan Werner
c1ca3c8038 Cycles: fixed the SM_2x CUDA kernel build that I broke in my previous commit 2017-07-20 13:28:34 +02:00
00ddbd5848 Depsgraph: Fix crash with copy on write when scene has legacy bases
The remapping code was creating plkaceholders for objects coming from legacy
bases, but since those objects were never created by dependency graph (since
they are supposed to be ignored) the copy on write relations creation was
confused.

Now we do some special trickery to clear legacy bases on copy on write.
2017-07-20 13:27:34 +02:00
f42bb9d278 Depsgraph: Ignore groups from copy on write expansion
Groups will not have IDs in the dependency graph, so we shouldn't
create them for CoW as well.
2017-07-20 13:27:34 +02:00
f5f34a9aa6 RNA: face-map access
Currently RNA doesn't give us a good way of accessing singleton layers,
for now expose as a layer list (skin & paint-pask do this too).

Noted in T47811 that this should be changed.
2017-07-20 19:52:26 +10:00
819f3b37da BMesh face map layer access 2017-07-20 19:52:26 +10:00
Dalai Felinto
eee4755c74 Fix active object doesn't show on templateID
Before that if you went to the object panel tab in the Properties Editor
the active object wouldn't show in the first panel.
2017-07-20 10:37:53 +02:00
Stefan Werner
4bc6faf9c8 Fix T52107: Color management difference when using multiple and different GPUs together
This commit unifies the flattened texture slot names for bindless and regular CUDA textures. Texture indices are now identical across all CUDA architectures, where before Fermi used different indices, which lead to problems when rendering on multi-GPU setups mixing Fermi with newer hardware.
2017-07-20 10:03:27 +02:00
0e2f8ed8a6 Depsgraph: Move strict checks under ifdef blocks
Those checks are not always helpful, since id remapping doesn't want to
worry about which components to tag for update. Perhaps in the future we
will introduce special flag which would mean "tag everything possible"/
2017-07-20 09:44:09 +02:00
Julian Eisel
827dc700ba Fix T51969: Filebrowser "Open File" button disappear when double-click thumbnail
This reverts commit 82ba89b042 (which caused T51969) and adds an
alternative fix (don't unset area stored in modal handler for fileselect
handlers).
2017-07-19 21:46:30 +02:00
adc43ff43f Merge branch 'master' into blender2.8 2017-07-20 03:53:44 +10:00
6e90294e08 Fix topology mirror ignoring center verts
Caused select-mirror to fail with edges & faces.
2017-07-20 03:52:53 +10:00
7fd4ad448c Clay Engine: Fix blue noise warning when compiling without clay. 2017-07-19 18:17:56 +02:00
02e318e8b9 Eevee: Fix crash when using lamps in dupli groups. 2017-07-19 18:17:56 +02:00
Dalai Felinto
2382f979e2 Doversion: Set Clay when opening "Blender Render" engine scenes
We get already enough reports of people complaining about crashes on
edit mode unaware that they are in the non-supported Blender Render
engine.

Blender Render is going away, no reason to keep it around. Once we have
a nice fallback on Eevee and fast file loading we can default to Eevee
instead.
2017-07-19 18:14:50 +02:00
9f9244b6ae Depsgraph: Remove redundant argument from add_id_node() 2017-07-19 17:31:32 +02:00
e29c54674c Depsgraph: Fix strict compiler error with copy on write disabled 2017-07-19 16:26:22 +02:00
53c1d15675 Depsgraph: Fix particle system freeing accessing freed particle settings
Need to ensure CoW IDs are freed in the right order.
2017-07-19 16:21:12 +02:00
496d18614f Depsgraph: Fix heap use after free when freeing scene with compositor
This is the fake ID nature of compositor again. Need to discard such
pointers before freeing datablock even for scenes (before it was done
for objects only).
2017-07-19 15:20:07 +02:00
6bb7a4cdf2 Depsgraph: Fix assert failure on Cycles render
Was happening when there was material in bmain but not used by any object.
2017-07-19 15:20:07 +02:00
17dcdbcf16 Depsgraph: Fix remapping of node trees when they reference self material 2017-07-19 15:20:07 +02:00
e49aa6beac Depsgraph: Add missing expansion od custom bone shapes 2017-07-19 15:20:07 +02:00
5d9a1b440b Depsgraph: Fix wrong ID remapping when armature object is constructed prior to it's targets
Previously it was possible to run into situation when armature is constructed prior to
objects which are used for it's constraints. This was causing wrong scene evaluation.

Now we create placeholders for objects used by armature in case they don't have ID node
yet, which ensures we have proper mapping from original to copy-on-write ID pointer.
2017-07-19 15:20:07 +02:00
a532fe561e Depsgraph: Ensure scene camera object is always built 2017-07-19 15:20:07 +02:00
b2ca2bb591 Depsgraph: Add code which helps catching cases when requested ID node is not ready yet
This shows the bug when IK solver doesn't update reliably when targeted an external
object and when that object is handled by build_object() after the armature.
2017-07-19 15:20:06 +02:00
49e496118b ID: Add run-time flag indicating that ID is coming from copy-on-write 2017-07-19 15:20:06 +02:00
44c6d45c2e Depsgraph: Fix compilation error in previous commit 2017-07-19 15:20:06 +02:00
c2ffea7f12 Depsgraph: Remove hacky workaround for copy-on-write tagging flushing updates to everything
Wasn't working reliably,m and it's somewhat dangerous anyway. Seed something smarter.
2017-07-19 15:20:06 +02:00
3212e72cfe Depsgraph: Fix crash opening file with IK solver with copy on write enabled
The issue was caused by id_copy_no_main() changing pointers of constraints used
in pose to a newly allocated ID. This is correct, but caused confusion too our
copy on write remapping, because we are mimicing inplace duplication by copying
memory over from a temporarily duplicated ID to a proper placeholder. This was
causing dangling pointers in pose to a temporarily allocated ID.

Now we add special code to remapping callback which replaces temporary ID with
a proper one.
2017-07-19 15:20:06 +02:00
ac136babb5 Depsgraph: Restore ID datablock tag when Object is tagged with OB_RECALC_DATA
Was lost in one of the previous commits.
2017-07-19 15:20:06 +02:00
3efde4a03c Depsgraph: Restore workaround for CoW objects not being fully expanded 2017-07-19 15:20:06 +02:00
17cd9f8df4 Depsgraph: Prevent wrong particles state when canceling playback 2017-07-19 15:20:06 +02:00
c3f64ea009 Depsgraph: Fixes to make particle system behave more correct
Couple of main things here:

- Properly handle PSYS_UPDATE_* flags from DEG_id_tag_update.

  There are still some possible issues here related on the fact
  that we don't differentiate different PSYS_UPDATE_* flags here
  and handle the mall the same.

  Other possibility here is that object level particle settings
  evaluation might be forced when particle system evaluation is
  tagged for update. Didn't see actual issue here yet, but need
  a closer look.

- Don't tag non-object datablocks on visibility changes.

  Those don't depend on visibility anyway. This prevents particle
  settings IDs from flushing updates to all objects, causing all
  cached particles to be lsot.

- Only update translation and geometry components on visibility
  changes.

  Once again, this prevents particle cache from being invalidated.

  We might need to tag material components here still tho.
2017-07-19 15:20:06 +02:00
a31233f5d2 Depsgraph: Stop tagging all IDs for update on depsgraph rebuild
This code needs to be changed. For the time being CoW might become less stable,
but need to stop doing such tag for other work.
2017-07-19 15:20:06 +02:00
414cc821d8 Depsgraph: Initial implementation of more granular tagging
This commit makes it so that only ID components which correspond to the tag
flag are tagged for update (previously the whole ID would have been updated
in the most of cases).

This allows us to have more granular tag flags and prevent tagging of things
we don't want to be tagged.
2017-07-19 15:20:06 +02:00
50f5f0957c Depsgraph: Cleanup, de-duplicate couple of utility functions 2017-07-19 15:20:06 +02:00
5eddc183b0 Depsgraph: Cleanup, remove unused untested functions 2017-07-19 15:20:06 +02:00
5727e8706f Depsgraph: Use dependency graph flush routines to update particle settings
Previously tagging particle settings for update will iterate over all objects and
all their particle system to see whether something needs an update or not. Now we
put ParticleSettings as an ID to the dependency graph, so tagging it for update
will nicely flush updates to all dependent particle systems.

Current downside of this is that due to limitation of flush routines it will cause
some extra particle system re-evaluation when it technically not needed, and what's
more annoying currently it will discard point caches more often.

However, this is a good and simple demonstration case to improve tagging/flushing
system to accommodate for such cases (similar issues happens with CoW and shading
components). So let's try to find some generic solution to the problem!
2017-07-19 15:20:06 +02:00
2fe5cf4807 Depsgraph: Use explicit parameters eval operation code
This replaces usage of generic PLACEHOLDEWR with string lookup with more
explicit opcode. This should make it faster to build dependency graph by
avoiding string comparisons when it's not needed.

There should be no user measurable different.
2017-07-19 15:20:06 +02:00
917bff4f44 Depsgraph: Add generic parameters evaluation operation code
Currently unused, but the idea is to use this code instead of placeholder
operation code followed by string comparison.
2017-07-19 15:20:06 +02:00
9356119765 Depsgraph: Use more explicit naming for operation codes
This way it's better indication what group of operation codes things belongs to.
2017-07-19 15:20:06 +02:00
ec2bca26e8 Despgraph: cleanup, make separation of opcodes strings more clear 2017-07-19 15:20:06 +02:00
62de80166e Depsgraph: Use more explicit name for particle system evaluation opcode 2017-07-19 15:20:06 +02:00
73adf3e27d Fix (unreported) seldom crash when using previews in filebrowser.
Hopefully fix it actually, at least could not reproduce it anymore with
that changen, but Was already quite hard to trigger before.
We need a memory barrier at this allocation, otherwise it might happen
after preview gets added to done queue, so preview could end up being
freed twice, leading to crash.
2017-07-19 12:55:05 +02:00
abe0527e0f Manipulators: use nearest manipulator
Add utility function to get the nearest hit
2017-07-19 20:12:24 +10:00
5376b3eeca Fix T52116: Blender internal BVH build crash in degenerate cases. 2017-07-19 11:06:20 +02:00
dd64cedd0b Merge branch 'master' into blender2.8 2017-07-19 14:38:22 +10:00
3daa641d7f Fix T52092: Crash un-grouping nodes 2017-07-19 14:32:31 +10:00
Dalai Felinto
231d688219 Outliner: Use scene_layer from context 2017-07-18 17:14:43 +02:00
8b2785bda5 Fix T49498: continuous grab issues on macOS, particularly with gaming mouses.
Change the implementation so it no longer takes over the mouse cursor motion
from the OS, instead only move it when warping, similar to Windows and X11.
Probably the reason it was not done this way originally is that you then get
a 500ms delay after warping, but we can use a trick to avoid that and get much
smoother mouse motion than before.
2017-07-18 16:11:33 +02:00
3cfb248bb6 Fix T52109: Folder search won't work when selecting animation output folder.
Text search would not run in case there was no 'type' enabled in filter
buttons. Now instead consider that no types enabled == all types
enabled.
2017-07-18 16:01:28 +02:00
Dalai Felinto
c226488a27 Layer cleanup: get rid of one of the placeholder functions 2017-07-18 11:16:14 +02:00
Dalai Felinto
f3039c7e78 Context/Workspace: Get scene layer from workspace 2017-07-18 11:16:14 +02:00
ecb5b55d7f Fix bad loss of precision when manually editing values in numbuttons.
While drawing nice 'rounded' values is OK also for 'low precision'
editing like dragging and such, it's quite an issue when you type in a
precise value, validate, edit again the value, and find a rounded
version of it instead of what you typed in!

So now, *only when entering textedit of num buttons*, we always get the highest
reasonable precision for floats (and use exponential notation when
values are too low or too high, to avoid tremendous amounts of zero's).
2017-07-18 10:41:00 +02:00
2174a2118b Cleanup: use WM_event prefix for modal_tweak_exit 2017-07-18 18:09:26 +10:00
7784cf30eb WM: move WM_event_is_last_mousemove to the WM API 2017-07-18 18:07:49 +10:00
3534c3e0df Eevee: Avoid crash when using dupli objects.
This is waiting a for a better solution.
2017-07-18 10:05:16 +02:00
fe8fc79cee Eevee: Fix transparency not drawing after volumetrics.
Fix T52089, Fix T52091
2017-07-18 10:05:16 +02:00
0926b896b6 Eevee: Fix crash with transparency. 2017-07-18 10:05:16 +02:00
876cc5b7c0 Merge branch 'master' into blender2.8 2017-07-18 18:10:19 +10:00
5f35682f3a Fix T52021: Shadow catcher renders wrong when catcher object is behind transparent object
Tweaked the path radiance summing and alpha to accommodate for possible contribution of
light by transparent surface bounces happening prior to shadow catcher intersection.

This commit will change the way how shadow catcher results looks when was behind semi
transparent object, but the old result seemed to be fully wrong: there were big artifacts
when alpha-overing the result on some actual footage.
2017-07-18 09:46:21 +02:00
d8906f30d3 Cycles: Remove meaningless camera ray check
In branched path tracing main loop is always a camera ray, with varying
number of transparent bounces.
2017-07-18 09:27:36 +02:00
2475dbdc94 Merge branch 'master' into blender2.8 2017-07-18 13:09:36 +10:00
66383ea206 Cleanup: quiet picky warnings 2017-07-18 12:14:18 +10:00
16fc2ad28e Transform: avoid possible uninitialized var 2017-07-18 12:13:41 +10:00
Dalai Felinto
f04c06498b Fix layers unittest - we cannot use nestted get_pointer calls
Remember to update your //lib/tests folder as well.

Patch by Bastien Montagne(mont29)
2017-07-17 18:46:00 +02:00
9bbb197d14 Work around small DPI resulting in blurry fonts, clamping auto DPI to minimum 96.
Since we added auto DPI on Linux, on some systems the UI draws smaller than before
due to the monitor reporting DPI values like 88. Blender font drawing gives quite
blurry results for such slightly smaller DPI, apparently because the builtin font
isn't really designed for such small font sizes. As a workaround this clamps the
auto DPI to minimum 96, since the main case we are interested in supporting is
high DPI displays anyway.

Differential Revision: https://developer.blender.org/D2740
2017-07-17 18:31:19 +02:00
d268cad06a Fix T52090: clarify meaning of EnumProperty number when using ENUM_FLAG. 2017-07-17 18:31:19 +02:00
f05f2f0336 Fix T51971: IK non-uniform scale regression.
This is a different fix for the issue from D2088, preserving backwards compatibility
for IK stretching. The main problem with this patch is that this new behavior has
been there for a year, so it may break rigs created since then which rely on the new
IK stretch behavior.

Test file for various cases:
https://developer.blender.org/diffusion/BL/browse/trunk/lib/tests/animation/IK.blend

Reviewers: campbellbarton

Subscribers: maverick, pkrime

Differential Revision: https://developer.blender.org/D2743
2017-07-17 18:31:19 +02:00
Dalai Felinto
0e49d5376c Revert "Unittests: Workaround for basact->object.id.name written as DATA"
This reverts commit aa578fba53.
2017-07-17 18:06:49 +02:00
9feeb14e91 fix T52065: Joint ID was generated wrong for bone animation exports 2017-07-17 16:39:47 +02:00
Dalai Felinto
aa578fba53 Unittests: Workaround for basact->object.id.name written as DATA
This was introduced on e7fb013a60. Although I would love to investigate the
issue I'm mostly concerned with gettings the tests working again.
2017-07-17 16:22:42 +02:00
Dalai Felinto
a258c5d325 Unittests: Make sure layer tests pass with or without workspace 2017-07-17 16:22:07 +02:00
Dalai Felinto
36977a962b Removing unused layer TODO placeholders 2017-07-17 14:40:12 +02:00
Dalai Felinto
8dadeab47f Fix shadow geometry shader 2017-07-17 14:28:17 +02:00
06505c5264 Fix T39925: Set Origin to Geometry on a new text object moves the origin away from the object
No need to take into account font size here...
2017-07-17 12:56:12 +02:00
d4246476d0 Py API doc generation: remove reference to "Blender/Python Add-on Tutorial"
That one has been moved to wiki!
2017-07-17 11:36:27 +02:00
4c835b9168 Eevee: Fix double promotion. 2017-07-17 11:01:31 +02:00
d0aa620912 Buildbot: Switch to GCC-7 for Linux build slaves
This is GCC version was used for Testbuild1 and Testbuild2.
2017-07-17 09:32:19 +02:00
Dalai Felinto
728d64c5dc Fix blenderplayer 2017-07-17 09:30:39 +02:00
f942511fd2 Manipulator: allow ID-writing for most callbacks 2017-07-17 17:20:54 +10:00
ab5be294ce Manipulator: split alpha out of color property
Gives more convenient access from Python: `mathutils.Color`

Also correct some copy-paste error w/ property subtypes.
2017-07-17 15:06:18 +10:00
02257ace22 Fix crash re-registering the same manipulator type
Wasn't unlinking from the group instance.
2017-07-17 14:36:20 +10:00
d221a999cb Manipulator: add snap flag 2017-07-17 14:16:23 +10:00
193d7d6333 Merge branch 'master' into blender2.8 2017-07-17 13:21:05 +10:00
bc8a9c47c6 PyDoc: minor change to recent workaround
- Isolate workaround in single string and link to issue.
- Quiet unused file warning (since it's an include).
2017-07-17 13:18:58 +10:00
3d1e5bca88 PyAPI: don't use deprecated PyModule_GetFilename
Allows compiling with newer Python versions.
Also add missing decref when compiling as a py-module.
2017-07-17 12:53:55 +10:00
a11808a248 Manipulator: allow py manipulators w/o properties
These could be used for manipulators that run operators.
2017-07-17 12:29:37 +10:00
4e22e24689 BPY API: Fix broken ref link 2017-07-16 18:11:58 -04:00
2d0c9542fe BPY API: Fix usless links leading to compile errors
See https://github.com/sphinx-doc/sphinx/issues/3866 for more information
2017-07-16 17:11:05 -04:00
7021aa245d Fix T52058: Jumping to keyframe causes Blender to freeze indefinitely
Revise the logic here to be more robust when keyframes with
similar-but-different frame numbers (e.g. 70.000000 vs 70.000008)
would cause the search to go into an infinite loop, as the same
keyframe was repeatedly found (and skipped).
2017-07-17 02:26:49 +12:00
5c30bc285c Fix T52034: cell noise renders different.
Tweak the bias from the previous fix a bit to be more backwards compatible in
some scene. In the end which way we round is quite arbitrary, but keeping the
case where the texture coordinate is exactly zero the same seems better.
2017-07-16 01:27:55 +02:00
49c29dc82f Fix T52066: Grid Mesh UV's aren't correct 2017-07-16 00:03:52 +10:00
a3d9ef2ea5 Merge branch 'master' into blender2.8 2017-07-14 17:26:46 -03:00
8009564503 Snap System: Fixed index of objects used to make snap to volume
*note: make a complete test scene
2017-07-14 17:25:16 -03:00
37242f0a47 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-14 16:56:36 -03:00
08b59ab7b9 Snap System: Use function that does the interactor instead of Macro
Macro makes debugging difficult. And in that case I was escaping from the style used in Blender
2017-07-14 16:52:31 -03:00
ebc22b4490 Fix MSVSC compiler warning
A void function cannot return a value
2017-07-14 20:59:26 +02:00
0736d567f0 Snap System: minor issues
rename obj -> ob_iter
2017-07-14 14:46:07 -03:00
Dalai Felinto
2a489273d7 Implement Uniformbuffer objects for nodetree parameters
For users that means you can tweak shaders in the nodetree and things
are way faster. This is a huge improvement, particularly in
systems that have no shader cache.

From the code perspective it means we are no longer re-compiling the
shader every time a value is tweaked in the UI. We are using uniforms
for those values.

It would be slow to add that many uniforms for all the shaders. So
instead we are using UBO (Uniform Buffer Objects).

This fixes the main issue of T51467. However GWN_shaderinterface_create() still
needs to be improvedi. When opening a .blend all shaders are compiled once, so
optimizing it will bring a measurable impact.

========================================================================
NOTE: This breaks update of Cycles material upon nodetree nodes
tweaking. It will be fixed separately by depsgraph, once tackling T51925
(Animated Eevee values slowdown).

The idea is to make Depsgraph update more granular. The XXX TODO in
rna_nodetree.c will be tackled at that time as well.
========================================================================

Reviewers: sergey, brecht, fclem

Differential Revision: https://developer.blender.org/D2739
2017-07-14 17:46:10 +02:00
73b1425297 DwM: don't use context to apply color-management
Would give different results for off-screen rendering.
2017-07-15 00:50:13 +10:00
51442b64d6 Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-14 11:24:43 -03:00
5fb5b74890 Snap System: missing change 2017-07-14 11:20:28 -03:00
8f14b96f7b Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-14 10:42:59 -03:00
c6ddef7359 Snap System: fix rename ob to obj
This would bring problems with dupli objects
2017-07-14 10:41:47 -03:00
92f3b4ac64 Depsgraph: Initial support of armatures for copy-on-write
This commit makes simple cases to work, for example:

- IK solver to an external object
- Object with Armature modifier, "parented" to the deforming armature
  (via animation).

More complicated setups (like agent rig) are crashing still.
2017-07-14 15:06:50 +02:00
Dalai Felinto
0ea4bb51df Another fix for snapping after merge in 2.8 2017-07-14 15:06:17 +02:00
Dalai Felinto
4467efe971 Fix snap in 2.8 after poor merge from master
If you merge from master to blender2.8 after a commit, remember to test in 2.8, otherwise what is the point?
Specially if it's a non-essential commit such as c9817c67fc.

Bug introduced on: f4155d3778 (the merge
that included the above commit).
2017-07-14 14:43:54 +02:00
Dalai Felinto
9d318acfa7 Merge remote-tracking branch 'origin/master' into blender2.8 2017-07-14 14:34:46 +02:00
Dalai Felinto
78e2238fe4 Revert "Fix T51794: Crash on hair file when opening with no UI"
This reverts commit 0095f4f834.
2017-07-14 11:44:26 +02:00
Dalai Felinto
b48694639a Workspace: Fix crash on preview, and sanitize placeholder functions
This commit effectively makes workspace switching useless as far as the
active scene layer goes.

The functions from the scene layer API to get the correct scene layer
from "context" were a placeholder to be addressed by the workspace
commit.

When workspace was merged, however G.main was used as a replacement to pass the
correct argument for the functions. As it turned out (surprise!) this
leads to crash on render preview.

We need to get rid of:
* BKE_scene_layer_context_active_ex_PLACEHOLDER
* BKE_scene_layer_context_active_PLACEHOLDER

And either use SceneLayer explicitly or replace it by:
* BKE_scene_layer_from_workspace_get
2017-07-14 11:42:31 +02:00
0f793ee606 Fix unit test error on Windows 2017-07-14 09:53:27 +02:00
018df5a49a Cleanup: use 'r_' prefix for return args 2017-07-14 17:05:22 +10:00
d31276abd0 Cleanup: long lines 2017-07-14 16:56:02 +10:00
661f5a24d1 DwM: Show face-mask overlay even with full-shading
Without this face selection would be used but invisible,
display this over fully shaded surface.
2017-07-14 16:45:47 +10:00
25dba156be Fix T51945: LMB select swaps manipulator buttons 2017-07-14 16:14:19 +10:00
886ea37572 Fix T51979: Eevee: Bloom artifacts w/ zero area faces 2017-07-14 15:27:08 +10:00
6f66498c10 Revert "Eevee: Fix the NaN pixel issue."
This reverts commit d02711ed88.
2017-07-14 14:45:18 +10:00
f4155d3778 Merge branch 'master' of git@git.blender.org:blender.git into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-13 20:12:17 -03:00
c9817c67fc Snap System: Replace creation and destruction of the object list by a Macro
The macro got a little strange, but it's better than using the MEM_mallocN inside a loop, or repeat the lines
2017-07-13 19:39:17 -03:00
ad7f782e17 Merge branch 'master' into blender2.8 2017-07-13 18:05:20 +02:00
7daae642d8 Cleanup: Fix MSVC warning message
The const key is required by compiler to avoid warning
2017-07-13 17:54:24 +02:00
31ad03dbde Merge branch 'master' into blender2.8 2017-07-13 17:36:52 +02:00
f8f90e1312 Fix compilation error in Freestyle 2017-07-13 17:24:12 +02:00
474454be39 Cleanup/rename etc. dashed line shaders.
Goal is to make them more modular, to allow more variants (variable
single-color, thickness, ...) to be added without having to
copy-and-change-one-line of whole chain of shaders.
2017-07-13 16:47:58 +02:00
a651f5da66 Sequence editor: Renamed "Override" to "Overwrite" in "Set Selected Strip Proxies"
The option has always (un)set the "Overwrite" flag on all strips. Calling
it "Override" seems misleading, since even when unchecking it, it overrides
whatever was set on the selected strips. It really just (un)sets the
"Overwrite" flag, and now it is also labeled as such.
2017-07-13 16:26:19 +02:00
c9aef27326 Depsgraph: Begin work on making depsgraph per-scene-layer
This is a first step towards proper depsgraph "ownership", where
we would allow scene to be in multiple states dependent on active
workspace or scene layer.

This commit introduces a basic API to get proper dependency graph
for a given scene layer. It also renames scene->depsgraph to
depsgraph_legacy, so it's easier to search0-n-replace in the future.
2017-07-13 15:43:36 +02:00
065cd6e4e4 Remove unused function
It wasn't really correct from the copy-on-write point of view anyway,
so better not to have potentially really dangerous function.
2017-07-13 15:23:37 +02:00
38cfd7b9e7 Depsgraph: Fix crash with copy-on-write enabled after recent changes
The issue was caused by original datablock being returned where we
were expecting copy-on-written one to be returned.
2017-07-13 15:23:37 +02:00
07c6011b57 Depsgraph: Add extra information to debug logging 2017-07-13 15:23:37 +02:00
84c6ce6b04 Merge branch 'master' into blender2.8 2017-07-13 21:24:02 +10:00
ab05108acb Depsgraph: Make it more explicit in naming what version of data getetrs returns 2017-07-13 12:57:19 +02:00
5fe2423ed5 Use explicit scene_layer variable name for public API 2017-07-13 12:51:35 +02:00
248bba81e7 Fix texture paint crash when painting onto stencil 2017-07-13 20:50:02 +10:00
Dalai Felinto
8c17b5fe42 Eevee small cleanups 2017-07-13 12:04:49 +02:00
Dalai Felinto
445963f299 Eevee: Fix crash on eevee lamps and shadows 2017-07-13 12:04:49 +02:00
eb759730b1 Correct error from texface removal
Missed stencil layer
2017-07-13 19:30:00 +10:00
a3240df269 Always using full shading for eevee + sculpt mode
Also disable for dyntopo & multires since its currently not supported.
2017-07-13 19:09:40 +10:00
86b7698a3e Merge branch 'master' into blender2.8 2017-07-13 17:21:11 +10:00
e656dcd365 Revert T44320: UV island overlap considered linked
In the reported example it seemed reasonable to apply this change.
But it causes a much more common case (selecting projections)
to be split into 2x islands.

Resolves T50970
2017-07-13 14:32:04 +10:00
d3f7b04f04 Fix T51100: Vertex pick fails after extrude 2017-07-13 14:13:59 +10:00
ffea77253e Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-12 20:45:02 -03:00
2771f602e6 Snap System: remove unused function 2017-07-12 20:43:28 -03:00
b4988d01cb DwM: Option to use final material over mode shading
Support using full material shading in sculpt & paint modes mode.

Access 'Full Shading' from the display panel when in paint modes.
2017-07-13 01:59:44 +10:00
95a7a0a06e Gawain: add GWN_vertbuf_clear
Needed to clear the buffer without freeing.
2017-07-13 01:48:52 +10:00
5ee5c595ba Merge branch 'master' into blender2.8 2017-07-12 23:18:11 +10:00
457596d4df BMesh: move safe loop-normal-calc to own function
This makes sense when we want to avoid float precision error
for near co-linear edges. OTOH, this is an arbitrary decision,
so keep functions separate.
2017-07-12 23:13:04 +10:00
59b93123e9 Merge branch 'master' into blender2.8 2017-07-12 11:49:43 +02:00
e5ee6cb448 Depsgraph: Remove meaningless comment
We are already on the new depsgraph only for quite some time now.
2017-07-12 11:08:51 +02:00
87164114a3 Cycles: Enable SSS from Principled BSDF only when actually in use
This gives speed up for the split kernel in scenes using the principled BSDF
but without subsurface scattering.
2017-07-12 04:40:24 -04:00
0837d19126 Merge branch 'master' into blender2.8 2017-07-12 13:59:13 +10:00
8603424d0a Cleanup: unused vars 2017-07-12 13:58:48 +10:00
1f933c94a7 Cycles: Fix comparison in principled BSDF
Could have lead to black pixels.
2017-07-11 23:41:22 -04:00
29ec0b1162 Fix T52027: OSL getattribute() crash, when optimizer calls it before rendering. 2017-07-11 22:39:51 +02:00
ac76a3caba Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-11 17:06:43 -03:00
3f39719b5d Fix [T51595]: Snap to edge does not work with high zoom level
That problem occurs because of the imprecision of `short int` (16 bits).
The 3d coordinates are converted to 2d, and when they are off the screen, their values can exceed 32767! (max short int value)

One quick solution is to use float instead of short

The snap code is actually a little tricky. I want to make some arithmetic simplifications in it
2017-07-11 17:03:49 -03:00
1b91b443e0 Eevee: Transparency: Fix crash when using transparent shadows.
Fixes T52024
2017-07-11 21:52:30 +02:00
593b80143b Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-11 14:24:32 -03:00
b3f62b68a9 Style (remove characters that caused "a binary file") 2017-07-11 14:22:07 -03:00
538475dec7 Merge branch 'master' of git@git.blender.org:blender.git into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-11 13:54:08 -03:00
dd1edb0954 Snap System: Separate raycast functions from nearest2d functions
The only similarity between these functions is that both serve to snap.
However their codes are totally different from one another.
So by separating these functions, it:
- removes the need to put several conditions;
- simplifies and
- optimizes the code
2017-07-11 13:47:28 -03:00
11ee5aa4f9 Avoid any possibility of using scene from different main in CTX_data_scene_layer
While these functions might be considered a temporary solution, please still be
very accurate about data ownership and where data is coming from.
2017-07-11 16:40:18 +02:00
ded2b30ebc Alembic: Adjusted unittest for Blender 2.8 2017-07-11 16:28:52 +02:00
4233ccfb6c Merge branch 'master' into blender2.8 2017-07-11 16:18:17 +02:00
32edfd53d9 Fix T52022 Alembic Inherits transform not taken into account
Alembic's "inherits transform" flag wasn't taken into account when
constructing the parent object relations.
2017-07-11 16:17:27 +02:00
Dalai Felinto
e5d74954bf RNA/UI: Always use capitalized words in the UI 2017-07-11 15:46:15 +02:00
085ed00e42 A bunch of fixes for Pose Library while checking on T51607
* Display a warning above the pose list if the pose library is in an invalid
  state (i.e. when it has keyframes but no pose-markers associated with those
  keyframes). This warning prompts users to run the "Sanitize Pose Library Action"
  operator, which should fix up such issues.

* "Sanitize" operator now creates unique names for each newly create pose
  marker it generates, including the frame on which it found the pose
2017-07-12 01:33:08 +12:00
cd3b3e4a57 Fix: Accidentally left debug print in last commit 2017-07-11 23:39:35 +12:00
fdfcbfd040 Fix T52009: F-Curve "Stepped interpolation" modifier "restrict frame-range" IN and OUT parameters cannot be edited
The problem here was that the "frame_start" and "frame_end" RNA properties of
the Stepped FModifier were shadowing/overriding "frame_start" and "frame_end"
properties of the base FModifier. As a result, when the range() callback
for the In/Out parameters (defined as part of the base FModifier) checked
it's start/end properties, they were always still zero, meaning that the
acceptable range for the In/Out parameters was 0 -> 0 = 0.

Note:
If you've got old files with this problem, you'll need to manually click on
the frame_start/end properties to flush out the old values. It's probably
not worth the effort of applying a version patch for this (given that this
modifier is not one of the most often used ones AFAIK).
2017-07-11 23:33:24 +12:00
b452003015 Fix T51879: NLA Influence can not be autokeyed
As with Strip Time, the updates here would get triggered before the
autokeying had a chance to record the unkeyed values, making it impossible
to autokey.
2017-07-11 23:33:24 +12:00
0a57597aff Temporary fix for crash related to VBO update on shader change
This frees the whole mesh batch cache, instead of only the required
parts, as freeing specific parts of a cache is currently causing
crashes.
2017-07-11 13:03:27 +02:00
64890a62cd Eevee: Add failsafe check in shadow material. 2017-07-11 12:42:59 +02:00
c0f2cbab4e Eevee: Transparency: Add transparent Shadow method UI. 2017-07-11 12:39:35 +02:00
ec9330d206 Eevee: Fix default closure to match cycles. 2017-07-11 12:39:35 +02:00
91d324b3dc Eevee: Transparency: Add support for Clip and Stochastic shadows. 2017-07-11 12:39:35 +02:00
a57bc75576 Eevee: Transparency: Add hide backside option. 2017-07-11 12:39:35 +02:00
a098d02718 Eevee: Transparency: Add object center Z sorting.
Better algo should take bounding box center, but it's not referenced yet in the draw call and cannot be tweaked by user.
2017-07-11 12:39:35 +02:00
ad7458d00c Eevee: Transparency: Add Alpha Blend mode. 2017-07-11 12:39:35 +02:00
d6b46f9ea5 DRW: Make Additive blending alpha premult. 2017-07-11 12:39:35 +02:00
d35c24f87b Eevee: Transparency: Add support for blend ADD and MULTIPLY.
This introduces a new transparency pass.
It bypass the radial distance encoding in alpha for the transparent shaders.
2017-07-11 12:39:35 +02:00
55022884ba DRW: Add shading group state disable.
This is a way to remove some state flag per Shading Group.
2017-07-11 12:39:35 +02:00
eb8dddaab1 Eevee: Material: Code cleanup in order to add transparency support. 2017-07-11 12:39:35 +02:00
05bef13b53 Eevee: Add support for Alpha clip and Hashed Alpha transparency.
Hashed Alpha transparency offers a noisy output but has the benefit of being correctly ordered. Noise can be attenuated with Multisampling / AntiAliasing.
2017-07-11 12:39:35 +02:00
e2c0197a96 Merge branch 'master' into blender2.8 2017-07-11 12:30:30 +02:00
e26f61a2b5 Cycles: Disable OpenCL clFlush workarounds
This is something which was reported to work fine by Mai, Benjamin and
confirmed by myself. Disabling this workaround gains us some speedup:

                      Before           Now
bmw27                04:28.42        04:07.79
classroom            09:26.48        08:54.53
fishy_cat            08:44.01        08:18.70
koro                 09:17.98        08:57.18
pavillon_barcelone   12:26.64        11:52.81

Test environment is:
- Ubuntu 16.04, with all updates installed
- AMD RX 480 GPU
- amdgpu pro driver version 17.10-450821
2017-07-11 12:16:58 +02:00
36ef6ff66b Theme Flatty Light
Color GraphEditor tabs, brighter 3D viewport gradient
2017-07-11 11:17:36 +02:00
d5d7d453a5 Fix memory leak caused by node clipboard
The issue was caused by combination of following factors:

- Clipboard cleanup function will pass node tree as NULL to node free
  function.

  This is fine on it's own, we don't have tree in clipboard.

- Node free function will call node storage cleanup only when there is
  a non-NULL node tree.

  This is somewhat weird, because storage cleanup does not take node
  tree as argument.

So the solution here: move node storage cleanup outside of check that
node tree is not NULL.
2017-07-11 11:06:36 +02:00
1dfc4be6ab Opensubdiv: Fix compilation error with older Opensubdiv versions 2017-07-11 11:05:39 +02:00
d415a1cbd6 Fix T49034: multi-drag crashes when UI forces exit 2017-07-11 19:10:40 +10:00
Dalai Felinto
2325d15d02 Lamps should not have their own gpu material
This was leading to multiple crashes when freeing the lamps or
materials when opening old files.

Follow up on b50839038d.
2017-07-11 11:02:56 +02:00
218c254e72 Resolve T51745: Mesh extrude keep-orig needs edges
Document to avoid confusion when called from Python.
2017-07-11 14:48:55 +10:00
64dd9a117d Merge branch 'master' into blender2.8 2017-07-11 14:21:05 +10:00
a247b367b0 Fix T51761: wpaint select depth limit fails
Limit select fails with circle and border select.

Regression in 2.76
2017-07-11 14:05:59 +10:00
8677c76f13 Fix (unreported) broken uvsculpt in Scene's toolsettings' copying.
This was serious bug actually, probably a crasher in case you free
original or copy after duplication...
2017-07-10 21:22:59 +02:00
665288ccd7 Fix (unreported) Scene's copying toolsettings' clone and canvas, and particles' scene and object pointers.
imapaint's clone and canvas are refcounting Image usages.

And particle's editsettings' object and scene seem to be pure runtime
data (they are reset to NULL in readcode), so resetting them to NULL
here as well.
2017-07-10 21:12:42 +02:00
46b9124241 Fix strict compiler warning 2017-07-10 17:43:27 +02:00
bb0bdc6ce2 Revert "Revert "Revert "Temporarily disable material preview (T51796 workaround)"""
This reverts commit 6df053e527.
2017-07-10 16:49:04 +02:00
205d750a63 Depsgraph: Use explicit bmain pointer passed to layer utilities
it is not necessarily that depsgraph is built from G.bmain.

This will solve issue reported in T51782.
2017-07-10 16:47:12 +02:00
8692c3a83f Depsgraph: Fix wrong layer used
Should be context, not render active one here.
2017-07-10 15:45:06 +02:00
6df053e527 Revert "Revert "Temporarily disable material preview (T51796 workaround)""
The "fix" happened due to a mistake in copy-on-write commit, that mistake solved
preview render but broke something else.

This reverts commit 45720922f7.
2017-07-10 15:43:04 +02:00
806bc4b433 Fix (unreported) Scene copying doing very stupid things with World and LineStyle usercounts.
Really, really, really need to get rid of this usercount handling
everywhere, hopefully incomming ID copying rewrite will help sanitize
that mess. But fix was needed for 2.79 release!
2017-07-10 15:11:58 +02:00
45897f12f8 Fix T51931: VBO not updating when UVs are added to shader node tree
UVs need specific data in the VBO, which is not computed unless the
shaders assigned to the mesh actually use UVs. When adding UVs to the
shader, the VBOs were not being recomputed to include the required data.

This adds a DEG relation between the shader and the mesh, and recomputes
the required data if the shader changed.

Thanks Sergey, for all the DEG stuff...
2017-07-10 14:43:57 +02:00
9a4cfc3e77 Partial fix of T51989: Don't set image user offset for movie files
While this is handy for image sequences, it's totally meaningless for movie files.
2017-07-10 14:23:29 +02:00
440c91b1f6 Fix T52011: Border render is incorrect with multiple scenes
The code was somewhat weird: it was first copying border/crop settings from
the "source" scene, then was checking border settings of the current scene
and only then was copying border from "source" scene.

Now we first copy border/crop flags, then copy border from source and then
check whether border is a full-frame.
2017-07-10 12:28:18 +02:00
d33cacf7e4 Fix image empties not drawing
A pointer to the uniform data for the empty drawing was being freed
before the actual draw call, which invalidates the uniform.

This makes the data only be freed after drawing.
2017-07-10 11:39:08 +02:00
7d5e9285b5 Merge branch 'master' into blender2.8 2017-07-10 17:48:57 +10:00
5b1c1d4d23 Error in last commit 2017-07-10 17:44:49 +10:00
910ab14145 Fix T51998: Anim player uses 100% CPU
The loop running with no events didn't sleep.
Now wait for events when paused.
2017-07-10 17:37:00 +10:00
2c10e8a3cf Fix T51052: CacheFile Open crashes from Python
Note that bpy.data access makes more sense here,
but better not crash when called from Python.
2017-07-10 17:06:25 +10:00
2bd908ca6e Merge branch 'master' into blender2.8 2017-07-10 16:35:56 +10:00
c055536d23 Curve: add assert for invalid next/prev use 2017-07-10 16:29:57 +10:00
004a143760 Fix T51665: No orientation for nurbs, polygons 2017-07-10 16:29:54 +10:00
2acd05b24c Fix T52007: Cancel bezier curve transform fails
Auto & aligned handles wouldn't restore to their correct locations.

Note that a more direct fix for the bug is possible
(storing the handle locations to restore on cancel).

But that still gives some odd behavior, see code-comments for details.
2017-07-10 13:38:28 +10:00
00f3ab2fb2 Fix T51898: missing sequence strip color space validation on load. 2017-07-10 01:10:26 +02:00
Dalai Felinto
2ad524bc83 Fix blenderplayer 2017-07-09 19:53:33 +02:00
f7e4484bfe Merge branch 'master' into blender2.8 2017-07-08 23:45:36 +02:00
ba256b32ee Fix T52001: material draw mode principled BSDF artifacts at some angles.
The default anisotropic tangent computation could fail in some cases,
leading to NaNs and artifacts. Use a simpler formulation that doesn't
suffer from this.
2017-07-08 23:42:20 +02:00
0584c5ba8e Fix T51959: Windows + Intel GPU offset between UI drawing and mouse.
Unfortunately this means disabling the code that ensures the title
bar is properly scaled with DPI, however better to have that as a
cosmetic issue than Blender being unusable with a lot of Intel GPUs.
2017-07-08 22:11:07 +02:00
fdadb4829c Gawain: Add support for compressed index with instancing. 2017-07-08 18:21:49 +02:00
3361f2107b Fix T51967: OSL crash after rendering finished (mainly on Windows). 2017-07-08 02:46:06 +02:00
eb8c45508d Merge branch 'master' into blender2.8 2017-07-08 02:08:41 +02:00
dbaaff2e09 Fix build after previous commit. 2017-07-08 02:07:39 +02:00
5eead4b74e Cycles: recognize Eevee material output. 2017-07-08 01:14:50 +02:00
db28e2deb9 Merge branch 'master' into blender2.8 2017-07-08 01:02:11 +02:00
7dc3ad2287 Fix T51889: new file or load factory settings results in broken UI.
Fix some cases that still assumed there to be a global DPI, instead of a per
window DPI that needs to be set before reading U.dpi.
2017-07-08 00:54:05 +02:00
1e21778261 Fix T51977: New depsgraph removes the grass in victor scene
For now just make new depsgraph do similar updates to the old one.

See bug report for more detailed information about what was going on.
2017-07-07 16:38:56 +02:00
4d4ebc8300 Fix T51991: Disabled for viewport particle system becomes visible after BI render
Move check for psys render data before it is actually requested for creation.
2017-07-07 16:13:50 +02:00
Dalai Felinto
e960cecdf8 GPU: Silence warning of potentially unused variable (NormalMatrix) 2017-07-07 15:10:09 +02:00
Dalai Felinto
15f5457502 Draw Manager: Use defines instead of hardcoded enum values 2017-07-07 12:34:36 +02:00
00d476976e Fix T50973: Directional blur node doesn't clamp value if using driver
The issue was caused by combination of following factors:

- Blender Internal viewport render can not distinguish between which parts of
  main database changed, so it does full database re-sync when anything is
  tagged for an update.

  This way, if any NodeTree (including compositor) is changed, Blender Internal
  viewport is tagged for full render database update.

- With old dependency graph, scene-level drivers are evaluated on every
  iteration of scene_update_tagged, even if nothing is tagged for an update.

  This causes compositor drivers be evaluated quite often.

- Driver evaluation checks whether value was changed, and if so it tags
  corresponding ID type as updated (this is what was telling viewport to do
  render database update).

  This check was quite stupid: current property value was checked against the
  one coming from driver expression. This means, if driver value is outside
  of the hard limit range of the property, the property will always be
  considered updated.

The fix is to compare current property value against clamped value from the
driver.
2017-07-07 12:08:14 +02:00
09bf3b1764 Eevee: Show the metadata and output panel when eevee is selected as a render engine 2017-07-07 11:57:38 +02:00
Dalai Felinto
3615350957 Merge remote-tracking branch 'origin/master' into blender2.8 2017-07-07 11:27:48 +02:00
fee7f688c3 Cycles: Fix ambiguity in call of min() function 2017-07-07 10:40:19 +02:00
d25ccf83ad Fix T51978: Setup Tracking Scene after Motion Tracking fails the first time 2017-07-07 09:36:25 +02:00
aaec4ed07d Fix T51980: Motion Tracking - png image files appear in the Blender program directory when using refine
Residue of debug code remained form some older bug fix.
2017-07-07 09:27:24 +02:00
d290266049 Eevee: Add dimension panel to eevee
Up until now users had to switch to Blender Internal to set the dimension of their openGl renderings. This simple change adds the panel at the top of the scene render tab.
2017-07-06 23:43:55 +02:00
6eea22b2b7 Eevee: Fix Planar Reflection bug / background artifact.
This was cause by a missing uniform.
2017-07-06 18:28:25 +02:00
d35e525d10 GPUTexture: Change default comparison mode to GL_NONE.
This default will prevent more errors in the future.
Also compare mode is less used nowadays.

Fixes T51904
2017-07-06 17:02:16 +02:00
d02711ed88 Eevee: Fix the NaN pixel issue.
It's cause by degenerate triangle having normals set to (0,0,0) which may not be compressed like it should.
This fix the problem in the final indirect lighting evaluation which might be costly.
2017-07-06 16:01:21 +02:00
28a9d7ec6e Add option to OpenImage operator not to detect sequences.
Otherwise, there would be no way to load a bunch of pictures with
'sequence pattern' in name in a single operation.

Related to T51778.
2017-07-06 14:52:55 +02:00
c217d518ef Eevee: Unlock compatible bsdfs in node add menu. 2017-07-06 13:32:19 +02:00
e5462421c0 Eevee: Add support for common BSDFs.
Add Diffuse BSDF, and Glossy.

Also Use World normal instead of view normal as input.
2017-07-06 13:32:19 +02:00
a69e3c9ee1 Fix T51943: Depsgraph: world update happening eternally on background (set) scene
The issue was caused by updates being flushed for all scenes, while actual update
was only called for an active one.

Not sure why do we need to flush updates for all scenes, so now we only flush
scenes which are updated.
2017-07-06 13:29:59 +02:00
9d71ec5f8d Merge branch 'master' into blender2.8 2017-07-06 12:21:21 +02:00
a7a5c20fbc Fix T51955: Changing Auto-IK length crashes Blender (with new-depsgraph)
New dependency graph is tacking root bone into account when building the graph.
This is required in order to get proper dependencies between bones. so we can
reliably use bones as targets from the same rig (and even indirect relations
via external objects). This forces us to tag relations for update when we change
root IK chain bone.

Since relations rebuild is not fully trivial operation, we only do it for
the new dependency graph. In the future it'll be nice to avoid whole graph
rebuild for such cases, but that's mentioned as a TODO.
2017-07-06 12:15:30 +02:00
bdd814d87d Fix T51015: Pack all into blend automatically leaves checkbox enabled.
Makes absolutely no sense to forcefully enable that automatic packing option here,
user can do this himself if they likes, from the very same menu...
2017-07-06 11:54:56 +02:00
9c3f1ad003 Cycles: Add artificial memory limit debug option for OpenCL 2017-07-06 05:25:46 -04:00
95b345b2fe Revert "Cycles: use std::min and max for extra overloads"
We already have this in util_algorithm.h

This reverts commit cff172c762.
2017-07-06 04:21:29 -04:00
f9963f29e8 Cycles: Dont allow global size to fall to zero 2017-07-05 20:19:15 -04:00
222b96e5c7 Cycles: Detect out of memory before buffer allocation in OpenCL devices 2017-07-05 20:19:12 -04:00
cff172c762 Cycles: use std::min and max for extra overloads 2017-07-05 19:43:34 -04:00
f67c331bed Eevee: Volumetrics: Avoid light leaking if last step is going trough geometry. 2017-07-06 00:28:13 +02:00
cb55498159 Merge branch 'master' into blender2.8 2017-07-05 22:25:05 +02:00
aea4456101 Better fix for sequencer crash when text strip doesn't have effect data.
This situation happens when a file with a text effect sequencer strip is
loaded in Blender < 2.76 and saved. This destroys the effect data, causing
a crash in Blender ≥ 2.76.

d2f748a222 prevented the crash when opening such a file, but accessing
the strip still caused a crash. This commit fixes that by actually
initialising the invalid strip. Of course this still causes data loss, but
that already happened by opening & overwriting the file in Blender < 2.76.
2017-07-05 22:18:41 +02:00
91808a67e8 Eevee: Volumetrics: Fix enum flag. 2017-07-05 22:17:09 +02:00
31f8ca5034 Cycles: Fix compilation error after recent logging changes
This file uses std::ostream for helper << operators, so need to make sure
corresponding header is included.
2017-07-05 20:40:55 +02:00
d2f748a222 Sequencer: Prevent crash when text strip doesn't have effect data. 2017-07-05 20:22:28 +02:00
7b565c8a76 Eevee: Fix typo... 2017-07-05 19:57:02 +02:00
Dalai Felinto
5495f89cf6 Fix User Interface for Volumetric 2017-07-05 19:23:57 +02:00
c62f82e35b Eevee: Fixups.
Fix float promotion and missing layer parameters.
2017-07-05 19:15:32 +02:00
f6c739cbcd Eevee: Volumetrics: Add Light contribution clamping.
This avoid too much variance at light centers and remove some noise.
2017-07-05 19:14:50 +02:00
031a4d5e22 Eevee: Volumetrics: Do not add anisotropy attribute, average it.
This makes no sense to add theses. In cycles, each volume node is computed separatly. In eevee only the combined parameters are evaluated and phase should be averaged in this case.
2017-07-05 18:31:43 +02:00
b5ee6dd9a3 DrawManager: Fix manipulator blend mode.
This was giving issue with volumetrics.
2017-07-05 18:29:40 +02:00
291b365e26 Eevee: Volumetrics: Add settings. 2017-07-05 18:28:48 +02:00
8b78a8d9bc Eevee: Volumetrics: Add support for Position Coordinates.
This enables texturing of the noise via procedural or baked textures.
Note that it gets quickly really heavy.
2017-07-05 18:21:06 +02:00
f8aab24fb5 Eevee: Volumetrics: Add Volume Absorption node. 2017-07-05 18:21:06 +02:00
d5448eac6c Eevee: Volumetrics: Colored Transmittance support.
Render the transmittance in another color buffer and apply it separatelly.
It's a bit more slow because the upsample step needs to be done twice.
2017-07-05 18:20:19 +02:00
ed4e62997e Eevee: Volumetrics: Match cycles scattering. 2017-07-05 18:03:36 +02:00
Dalai Felinto
971ecfa721 Eevee: Move volumetric to its own panel, new settings to come 2017-07-05 17:58:27 +02:00
Dalai Felinto
6de28e7f90 Override template: Add text and icon optional parameters 2017-07-05 17:58:27 +02:00
Dalai Felinto
eb48eeba84 Expose rna_translate_ui_text to be used for interface templates 2017-07-05 17:58:27 +02:00
5e9ad8065a Code comments regarding last commit (forgotten to add before)
Using an arbitrary face as the source of the UV data is mostly fine, as
vertices on seams will generally map to different parts of the texture
that have the same color.

This is regarding fed853ea78
2017-07-05 16:19:41 +02:00
bdeeb29482 Merge branch 'master' into blender2.8 2017-07-05 15:50:01 +02:00
fed853ea78 Fix T51296: UVs not working for hair emitted from vertices 2017-07-05 15:48:54 +02:00
e3bddcb215 Compositor: Fix compilation error and crash when using defocus search
Was just wondering what the option is doing. Not sure yet, but let's fix
couple of issues here.
2017-07-05 15:37:33 +02:00
d37dd97e45 Cycles: Pass string by const reference rather than by value
Some of the functions might have been inlined, but others i don't see
how that was possible (don't think virtual functions can be inlined here).

In any case, better be explicitly optimal in the code.
2017-07-05 12:27:41 +02:00
58c456b12d Cycles: Fix compilation error when building without Glog and no C++11 2017-07-05 12:01:12 +02:00
f3764d51bd Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2017-07-05 09:20:48 +02:00
Dalai Felinto
84d20dd227 Eevee: Fix world test for volumetric
Compiler even throws a warning at this.
2017-07-04 18:07:39 +02:00
3898236b81 Third fix for my merge: crash after switch to edit mode reported by @dfelinto 2017-07-04 17:53:19 +03:00
4d124418b7 Fix T51834: Active Object and Groups color difference imperceptible
16 was not enough here, -32 seems to give OK results.
2017-07-04 16:01:16 +02:00
0ef48ad504 One more fix for merged 'normal map tangents not working correctly when there are no UV maps.' 2017-07-04 16:25:49 +03:00
f23ed929ee Merge branch 'master' into blender2.8
Conflicts:
	source/blender/makesdna/DNA_particle_types.h
2017-07-04 13:13:49 +02:00
f86b43e130 Fix T51965: Custom Bone Shape Wireframe setting affects wireframe thickness.
Clearing of custom bones outline's line thickness was not done at proper
point, wireframe drawing never changes line thickness, only solid draw
with outline does...
2017-07-04 13:11:33 +02:00
d1dfd5fa26 Fix T51703: Rigid body with delta transform jumps when transforming
When doing any transformation on a rigid body object that has delta
transforms, the object would be offset by the amount of the delta
transform.
2017-07-04 12:27:21 +02:00
fc8f6e8f7a Eevee: Fix Closure define. 2017-07-04 11:40:12 +02:00
b87d10d4fe Better fix for rigid body not resimulating
Last fix only accounted for direct changes to the RB settings, but
failed for, say, object transformations. This fix accounts for any
change that might invalidate the RB cache.
2017-07-04 10:57:57 +02:00
3edc8c1f9b Fix rigid body not resimulating after cache invalidation
Fix 9cd6b03187 introduced a bug that
prevented simulation after a cache invalidation (for instance when
changing a setting after simulating). This fixes that.
2017-07-04 09:22:42 +02:00
b09052002c Eevee: Add support for volumetrics in node tree.
Only volume scatter is implemented for now.
2017-07-03 22:08:33 +02:00
2eef097831 GPU Codegen: Add new closure socket type.
This allow specialized shaders to redefine the closure interface to fit their needs.

For instance, Volumetric closure needs to pass more than one vec4 (absorption vec3, scattering vec3, anisotropy float).
2017-07-03 22:08:33 +02:00
65b01014b9 Eevee: Initial implementation of Volumetrics. 2017-07-03 22:08:33 +02:00
9d2ee7998a Draw Manager: Add new blend mode for transmission.
This blend Mode is doing  Source + Destination * Alpha.
2017-07-03 22:08:33 +02:00
9b66a320bf Eevee: Fix luma calculation for lamp fresnel. 2017-07-03 22:08:33 +02:00
Dalai Felinto
e571e6d60e Fix edit mode not drawing
This was introduced on 1ad0cc6bde.
2017-07-03 21:48:39 +02:00
Dalai Felinto
3eeac771d0 Fix alembic after merge from master 2017-07-03 21:16:34 +02:00
Dalai Felinto
3fc342bda0 Fix building with gcc6 after merge from master 2017-07-03 21:16:34 +02:00
de2faa395f Fix for merged 'normal map tangents not working correctly when there are no UV maps.' 2017-07-03 20:13:52 +03:00
e1482841dd Merge branch 'master' into blender2.8 2017-07-03 19:53:00 +03:00
15fd758bd6 Fix T51950: Abnormally long Cycles OpenCL GPU render times with certain panoramic camera settings
The problem here was that when a "invalid" path is generated by the panoramic camera, it was tagged
as RAY_TO_REGENERATE with the intention of generating a new path in kernel_buffer_update.

However, since that state was not handled in kernel_queue_enqueue, kernel_buffer_update did not
process the path which resulted in an infinite loop.
2017-07-03 18:26:19 +02:00
6782a6076c Cycles: Add missing split kernel to CPUDevice 2017-07-03 18:26:18 +02:00
56422ff6c3 Fix T51523: Lattice modifier affecting particles even when disabled
Particles were ignoring the lattice modifier visibility, and
"influence" property.
2017-07-03 18:00:13 +02:00
Dalai Felinto
1ad0cc6bde Eevee: Hide lightprobe data when using "Only Render" 2017-07-03 16:16:24 +02:00
1fb3075803 Fixed build error on Windows / VS2015 2017-07-03 16:09:19 +02:00
0900914d96 Alembic: fix T51820 for sequence files not loading properly. 2017-07-03 16:08:41 +02:00
7b12957267 Alembic: avoid crashing when doing certain file operations.
Things like missing directories are now properly checked for, rather than
crashing Blender.

This also adds support for relative paths when opening an ABC file.
2017-07-03 15:28:19 +02:00
Dalai Felinto
d97c3bc7ad Merge branch 'master' into blender2.8 2017-07-03 15:18:46 +02:00
95a97f79cc Alembic: renamed offset → sequence_offset 2017-07-03 14:21:17 +02:00
44397a7a0a Fix T51883: Wrong matrix computation in "Make Duplicates Real" 2017-07-03 12:51:10 +02:00
Dalai Felinto
871325e26f Fix T51963: Eevee: ASAN crash on copy_attrib_name
Bug introduced on f6bb3262f1.

CustomData_get_named_layer returns a different result than
CustomData_get_named_layer_index.
2017-07-03 12:47:00 +02:00
d48a9528ca Fix missing return error introduced by last commit
End of non-void function was being reached since
f5535fcb83
2017-07-03 12:12:27 +02:00
f5535fcb83 Fi T51023: MixRGB constant folding not effective with clamp option. 2017-07-03 05:25:27 +02:00
cda24d0853 Fix T51855: Cycles emssive objects with NaN transform break lighting. 2017-07-03 05:04:43 +02:00
46c7d45f77 Fix T51889: broken UI after File > New without a userpref.blend.
BLO_update_defaults_userpref_blend() was being run when no user preferences
were loaded from memory.
2017-07-03 02:24:40 +02:00
0c122d64d2 Fix T51734: batch-generate previews crashes on some materials. 2017-07-02 23:40:53 +02:00
Lucas Veber
405121d613 Fix T51759: fluid simulation particles not remoevd when colliding with outflow objects.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2719
2017-07-02 22:42:08 +02:00
3232d8ec8f Fix T51951: cell noise texture precision issue at unit vertex coordinates.
Solution is to bias the coordinates a little, same as Cycles checker texture.
2017-07-02 22:00:10 +02:00
e3e5ecfaa8 Fix T51746: normal map tangents not working correctly when there are no UV maps.
Patch by Alexander, with some refactoring by Brecht.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2709
2017-07-02 21:28:10 +02:00
eb1532a860 Fix T51772: double undo entry for color picker editing. 2017-07-02 21:27:41 +02:00
29c8c50442 Fix T51956: color noise with principled sss, radius 0 and branched path. 2017-07-02 19:21:08 +02:00
eb420e6b7f Fix T51957: principled BSDF mismatches in GLSL viewport. 2017-07-02 18:37:50 +02:00
52b9516e03 Fix principled BSDF incorrectly missing subsurface component with base color black. 2017-07-02 18:22:24 +02:00
79f27fc8d3 Fix T51947: failure setting sequence.use_proxy/crop/translation to False 2017-07-01 23:20:06 +02:00
3de5370e9d Cleanup: unused defines 2017-07-01 20:19:12 +10:00
5b2b5a4258 Fix ED_OT_undo_redo operator 2017-07-01 10:51:26 +03:00
Dalai Felinto
49a35033be Fix T51877: Deleting a scene uses freed memory
At the moment libblock_remap_data_preprocess is using
FOREACH_SCENE_OBJECT to iterate over all the objects of the scene and
unlink them.

However we were storing a reference to the Base of the removed object.
Anyways, the loop is now sanitized so that this crash no longer happens.

Also now we have an unittest for this.
2017-06-30 19:03:02 +02:00
9cd6b03187 Fix T50230: Rigid Body simulation shouldn't step when time is beyond cached area
This makes the last time (`ltime`) stored in the rigid body world (`rbw`)
only be updated once a simulation step actually occurs, this prevents
another simulation step from being solved unless the current time is
exactly one frame after the last cached frame. Thus this prevents the
formation of gaps in the cache, such as seen in T50230.

Reviewers: mont29, sergey, angavrilov

Tags: #physics

Maniphest Tasks: T50230

Differential Revision: https://developer.blender.org/D2458
2017-06-30 15:58:57 +02:00
76eefa5c0d Better fix for isfinite problem - works in older gcc's too.
Previous fix relying on __cplusplus value didn't fix for older
gcc's on linux, but this fix does.
2017-06-30 09:04:01 -04:00
1938a81e42 Fix compile error after recent 9c2bbfb6 commit.
Older C++ compilers use finite instead of isfinite.
2017-06-30 07:47:37 -04:00
Dalai Felinto
b43cdc91ce Fix T51721: OpenGL Detection is broken on Windows
Now computers that support OpenGl3.3 (but not 4.5) can run Blender 2.8.

For any given HDC, you may only call SetPixelFormat *ONCE* any future
calls for the same HDC will fail. And computers that would support only
OpenGL 3.3 wouldn't have a change to get a valid OpenGL context because
the pixelformat was already set while trying to probe the supported
contexts.

We fix this by splitting the final context creation from the query of
supported OpenGL versions.

Patch by Ray Molenkamp (bzzt_ploink/LazyDodo) with code style fixes and
comments by me.
2017-06-30 13:33:54 +02:00
0831099664 Eevee: Principled BSDF: add support for specular tint + optimisation
Only use clearcoat version if there is something linked or if the clearcoat value is not 0.
2017-06-30 14:12:25 +02:00
178c470c43 Eevee: Fix specular shadowing.
Compute luminance approximation instead of using green channel.
This is to match cycles principled bsdf.
2017-06-30 14:10:42 +02:00
1b4bd1c84e Fix T51118: Outliner crash when unlinking collection
The outliner tree was not being rebuilt after unlinking a collection,
and thus a dangling pointer to the collection was kept in the tree.
2017-06-30 12:32:18 +02:00
1a6ae0c70e DwM: Use GWN_vertbuf_raw_* access for shading data
Gives approx 14% speedup here.
2017-06-30 18:31:04 +10:00
34e4948682 Fix T51919: Tangents need UV's allocated 2017-06-30 17:48:18 +10:00
bc347f6015 Merge branch 'master' into blender2.8 2017-06-30 13:46:53 +10:00
c8fa716c06 Cycles: Use float constants instead of double 2017-06-29 23:07:18 -04:00
56dcfcce05 Cycles: Disable baking in mega kernel when not in use to improve build times 2017-06-29 23:07:18 -04:00
9c2bbfb6ce Fix T50887: Holes in fluid mesh on Windows
D2556 by @chrisr
2017-06-30 11:48:12 +10:00
9210a4faf3 Fix unpredictable trackball rotation
D2729 by @IgorNull

Currently, trackball rotation sequentially applies rotation across x axis and y axis,
which produces a strange/unusable result on diagonal pointer motion.

This change fixes the problem by using a single axis which is orthogonal
and proportional to mouse delta - matching view-port trackball.
2017-06-30 11:10:05 +10:00
eb88f0c321 Workaround T51934: Array's > SHRT_MAX aren't supported 2017-06-30 10:10:22 +10:00
cdb07ff30e Eevee: Fix broken default coordinate (reported via IRC by Dalai Felinto). 2017-06-29 20:23:06 +02:00
Dalai Felinto
98c8b5a6fb No need to free all the shaders when appending or reloading libraries
To recompile all the shaders is expensive. And something to be avoided at all costs.

It was needed before because for every new lamp in the file we needed to
recompile the shaders. Now this is no longer required since we are using
UBOs for the sahders.
2017-06-29 19:07:21 +02:00
Dalai Felinto
2c62493891 Eevee: No need to free all the gpu materials when world changes.
We have a world probe that is used to prevent exactly that.
2017-06-29 18:57:06 +02:00
7c72079381 Fix hair shading after Eevee shader refactor 2017-06-29 18:45:11 +02:00
90e16b8e03 Eevee: Fix world probe with world without nodetree. 2017-06-29 17:32:13 +02:00
5e96df7d27 Eevee: Remove Geometry shader usage for background.
This fix the behaviour of the light path node that separates the probes background from the viewport background.
2017-06-29 17:08:13 +02:00
790b15112b Eevee: Fix T51922: Avoid division by 0.
Problem was caused by a division by 0 when rendering the probes. This patch make the visibility equal to 1.0 in this case.
2017-06-29 17:08:13 +02:00
95797336f5 Eevee: Prepare support for future Anisotropic shading. 2017-06-29 17:08:13 +02:00
3888227a7b material Glsl: Fix tangent with new orco. 2017-06-29 17:08:13 +02:00
2eca054e14 Remove dupli-group support for non-empty objects
Behavior for mixing object-data & dupli data was confusing,
exporters and render engines often got it wrong.
2017-06-30 00:03:08 +10:00
f39d06589e Fix warnings in draw_cache_impl files 2017-06-29 15:46:00 +02:00
0210c6b9de Fix T51890: Turning off viewport display for array modifier is blocking dupliface in final render
DupliVert/Face were not using render DM at render time.
2017-06-29 15:44:00 +02:00
b606161458 Fix T51821: Viewport not updating when switching worlds 2017-06-29 14:49:46 +02:00
916344b49e Fix error getting the tangent layer name 2017-06-29 21:24:09 +10:00
db71df4f3f Fix world not updating when changing node links
When changing node links for the world material, a redraw of the
viewport was not being triggered.
2017-06-29 12:28:25 +02:00
7dc9e42721 Missing from last commit 2017-06-29 20:33:24 +10:00
fd3589e4c9 DwM: optimize mesh batch conversion
- Replace GWN_vertbuf_attr_set with Gwn_VertBufRaw & GWN_vertbuf_raw_step
  to avoid intermediate copy.
- Avoid extra conversion step with: float[3] -> short[3] -> Gwn_PackedNormal.
  We can skip the short[3].

Gives approx 6% speedup here.
2017-06-29 20:11:16 +10:00
34566aa969 Gawain: add method of stepping over data directly
This avoids using GWN_vertbuf_attr_set which needs to calculate the
offset and perform a memcpy every call.

Exposing the data directly allows us to avoid a memcpy in some cases
and means we can write to the vertex buffer's memory directly.
2017-06-29 20:09:05 +10:00
2343dcf0d2 Gawain: Use common prefix for packed normal 2017-06-29 18:54:23 +10:00
2113dbb013 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_select.c
2017-06-29 10:11:17 +02:00
a57a7975a1 Fix T51926: Selecting pose icon under expanded group in outliner causes crash.
Cannot switch uninstantiated armature to Pose mode...
2017-06-29 10:09:58 +02:00
10c887762a DwM: no need to calculate face normal 2017-06-29 15:52:08 +10:00
abd9d50faa Cleanup: quiet negative shift warning 2017-06-29 15:34:50 +10:00
f6bb3262f1 DwM: add CD_AUTO_FROM_NAME for mesh conversion 2017-06-29 15:23:47 +10:00
15079b0b43 Fix crash & performance regression w/ base lookup
Was doing O(n^2) list lookups with blender-render drawing & transform.
Also missing NULL checks would crash.

Use Object.base_flag (already used by new draw manager in places)
to avoid list lookup.

Note, transform still performs inefficient lookups,
but only for selected parents (like 2.7x), not all parents.
2017-06-29 12:19:22 +10:00
e14fd19105 Eevee: Add Initial support for Principle BRDF.
Lots of things not working yet but it's comming.
2017-06-29 01:47:59 +02:00
8d57f4e3c6 Eevee: Remove ShadingData struct.
That was a bad idea after all.
2017-06-29 01:47:59 +02:00
2117334737 Fix assert calculating tangents with no faces 2017-06-29 07:57:23 +10:00
a1a40bfe70 GPUTexture : Un-clamp float rect datas.
We do not need it anymore because we do not use glu anymore. And we need full range for HDRI Lighting.
2017-06-28 22:26:44 +02:00
1f3fd8e60a Fix T51909: Cycles: Uninitialized closure normals for the Hair BSDF
As the title says, the normal wasn't set for the Hair BSDF because it wasn't
needed before. However, the denoiser uses it to store the feature passes, so
it needs to be set now.
2017-06-28 21:32:02 +02:00
beb375cdb2 GPU_codegen: Fix geometry shader. 2017-06-28 21:28:24 +02:00
ada6e720f9 GPU_codegen: Add support for passing attributes through the geometry stage.
Should fix some issues with missing attributes in Eevee.
2017-06-28 21:05:43 +02:00
b5696f2799 Fix node UI not using translation context correctly.
Now that some node types may have custom context, we need to handle that
in the (convoluted :| ) UI code of nodes as well.

Reported in T43295 by Gabriel Gazzán (@gab3d), thanks.
2017-06-28 20:50:21 +02:00
26b699a105 Eevee: Fix shader linking error. 2017-06-28 18:28:52 +02:00
b6a2d255c3 Eevee: Fix Shadow Map bug: fix T51924 2017-06-28 17:21:57 +02:00
03b915d711 Eevee: Fix Shader compilation on certain driver. 2017-06-28 16:51:31 +02:00
6d0dbd3169 Probe: Irradiance Volume: Fix default clip start. 2017-06-28 16:32:08 +02:00
1982e724f4 Eevee: Refactor of shading code to be more modular.
This will enable creating shading models more easily.
2017-06-28 16:32:08 +02:00
0782c9f8dc Fix T51920: Invalidate draw cache when changing object origin 2017-06-28 14:58:25 +02:00
16eca8f47e Fix own really stupid mistake/typo in previous commit... 2017-06-28 13:21:04 +02:00
2c0ee61f6d Fix T51900: Crash after pressing "F" multiple times.
`BMO_iter_as_array()` may fill less items than requested in given array,
so we have to update number of items to work on from its returned value,
otherwise code might try to use uninitialized memory.
2017-06-28 10:53:52 +02:00
4a061a87e6 DwM: mesh data now only creates data thats used
Read from the GPUMaterial to find custom-data layers used for drawing.

This resolves problem where having UV's would always calculate tangents
causing noticeable slow down compared to 2.7x.
2017-06-28 13:44:28 +10:00
e78c0840f2 DwM: create eevee materials before the mesh
To know which custom-data layers will be needed in the mesh.

No functional change yet.
2017-06-28 13:36:55 +10:00
fc3d0da2fd DWM: Fix own error checking wrong layer type
Would calculate all tangents for every UV layer.
2017-06-28 11:39:05 +10:00
87dd9c31a0 GPU: split GPU_material_from_nodetree in two
Add GPU_material_from_nodetree_find to avoid having to construct other
arguments which won't be used in the case the material is exists.
2017-06-28 10:59:25 +10:00
037876659f Fix own error removing texface
Setting the name crashed with NULL poly layer.
2017-06-28 10:23:27 +10:00
87a95558a0 Fix own error removing texface
Using pointer offsets from different arrays
2017-06-28 10:11:49 +10:00
df70e3de63 DWM: separate tangents from UV conversion
Prepare for different number of UV/Tangent layers.
2017-06-28 09:55:40 +10:00
dbaa6c2aa2 GPU: GPU_generate_pass_new now takes vertex-attrs
Needed so we can tell which custom-data layers to use from the mesh.
2017-06-28 09:37:44 +10:00
2ed82d2e6b Fix missing globalsBlock in edit mode latice drawing
This was causing lattice vertices not to be drawn.
2017-06-27 18:40:39 +02:00
Dalai Felinto
f11bcbed9d Fix T51913: Context tab for textures issue
The original code was doing a sanity check to see if existing index was
out of range. However the comparison was wrong.

So if the previous ct->user (active index of texture node) was larger
than then number of available texture nodes + 1 in the other material,
we would never re-set the index to 0.

Bug introduced on c31f74de6b.

There was an early attempt of fixing this (2b2ac5d3cc) but it was just working
by pure, luck. And failing in cases like the one from this bug report.
2017-06-27 16:56:43 +02:00
d04f30c5d8 Implement weight colors for lattices in draw manager 2017-06-27 15:59:13 +02:00
6e83ace809 LightProbes: Change 3d view display shape.
Introduce specific shape for each probe type to easily identify them.
2017-06-27 15:00:14 +02:00
cbfdd02f2c Fix typo in Eevee hair UV handling 2017-06-27 11:59:22 +02:00
bb0e8f1c55 Cleanup: remove unused function 2017-06-27 18:05:44 +10:00
3cb562c994 mikktspace: minor optimization
Add a safe version of normalize since all uses of normalize
did zero length checks, move this into a function.

Also avoid unnecessary conversion.

Gives minor speedup here (approx 3-5%).
2017-06-27 16:14:58 +10:00
c218d4b008 Eevee: Bloom: fix black bloom artifacts. 2017-06-27 05:18:00 +02:00
62b1d11613 RNA: update_gpu_tag() to force Batch re-generation 2017-06-27 11:09:30 +10:00
e6be5b8a2c Merge branch 'master' into blender2.8 2017-06-27 09:59:36 +10:00
b796ce0f26 CMake: Only set CMAKE_BUILD_TYPE_INIT when not set
Convenience makefile now uses CMAKE_BUILD_TYPE_INIT,
this means you can change the build type of an existing build
and it won't be overwritten when running `make`.

Useful if you want to add debug info to a release build for profiling.
2017-06-27 09:50:35 +10:00
03b46f7941 Cleanup: quiet warning
Passing NULL arg when nonnull attr is used.
2017-06-27 07:39:44 +10:00
8cc8aad4f9 Scene object iterator: minor optimization
Avoid an extra hash when adding to gset
2017-06-27 07:30:21 +10:00
0394c04a7f Eevee: Add Planar reflection blurring.
This method is very cheap and inaccurate. This will fill the gap untill better model is supported.
2017-06-26 21:04:53 +02:00
daf02baaea Add new DRW_draw_pass_subset function
This function allows to draw only a selected range of shading groups.

This is required for some special situations as grease pencil strokes.
2017-06-26 20:42:58 +02:00
5a1bdf2c3a Add warning that 'purge all' action in Outliner does save to current .blend file.
This is a very important, potentially deadly side-effect of this
operator. If something goes wrong, it can save a broken .blend file.

Ideally we could get rid of that operation anyway, once ID management if
fully renewed, but for now would rather keep it around.

Related to T51902.
2017-06-26 19:00:45 +02:00
d4ca2ec9d5 Fix T51902: Severe problem with relocating linked libraries when using proxies.
Fix is a bit ugly, but cannot think of another solution for now, at
least this **should** not break anything else.

And now I go find myself a very remote, high and lonely mountain, climb
to its top, roar "I hate proxies!" a few times, and relax hearing the echos...
2017-06-26 18:55:30 +02:00
Dalai Felinto
1758330220 Fix viewport rendering with anti-aliasing - workaround
This commit makes the fullsample option for viewport renderings always
on: Render > OpenGL Render Options > Full Sample.

(The UI still allows users to set this, so we will need to revisit this
before 2.8 releases).

Even in computers that can handle MSAA we had issues.
The way Blender gpu_* implementation is handling anti-aliasing is buggy.
For example, in Blender 2.7x if you have depth of field in a viewport
with multi-sampling, the DoF gives us jagged edges.

Since Eevee uses framebuffers for a lot of things, this issue was
leading to very visible buggy render in some computers, and more subtle
inconsistent buggy renders in others (easy to test with the depth of
field in Eevee).
2017-06-26 18:30:21 +02:00
a48bd0db71 Remove disabled code for freeing shaders on scene update
Some code for freeing shaders on scene updates (because of previous
dependency shaders had on lamps) had been disabled, as it is no longer
required. This removes that code altogether.
2017-06-26 18:16:05 +02:00
b50839038d Stop object shaders from being updated when changing lamp properties
Object shaders no longer depend on lamp data at compile time, thus they
don't need to be invalidated when lamps change. Disabling shader
recompilation allows fast viewport updates when changing lamp settings.

Note that even though shaders for lamps are currently not being used,
`lamp_changed` is still freeing the lamp shaders, as at some point we
might want to use shaders for lamps...
2017-06-26 17:53:47 +02:00
3c2f0466d8 Enable optional jack in install_deps.sh
Based on D2578, now you can install JACK audio server and use it in
Blender build without having to specify the `--with-all` option (that
one still enables also JACK of course).

Reviewers: mont29

Maniphest Tasks: T51033

Differential Revision: https://developer.blender.org/D2578
2017-06-26 16:12:32 +02:00
bafb904807 Fix T51559: Update draw cache when changing flat/smooth shading
This also renames some flags/variables to be more generic for updating
purposes. The call used here was previously only used for updating
paint data, but as it was reused here, flags and variables were renamed
to accomodate more clearly to the new usages.
2017-06-26 14:52:59 +02:00
Dalai Felinto
37593b6a42 New scenes should use Eevee, not Blender Render 2017-06-26 12:47:33 +02:00
e304150701 Enable shadow catching for Eevee hair
Shadow catching was disabled for hair in Eevee, because of an issue in
the shadow maps. The issue has since been resolved, so this re-enables
shadow catching for hair.
2017-06-26 12:30:30 +02:00
cbbfacdac0 Hair UV implementation for Eevee
This implements UV support for Eevee hair, enabling the usage of
textures.
2017-06-26 12:17:18 +02:00
Dalai Felinto
6f0b80425b Fix shaders not working in Eevee
Not a single node based shader was working since a recent merge from
master.

The merge brought changes from the principle bsdf shader where
unsupported gl_ProjectionMatrix was still being used.
2017-06-26 12:14:21 +02:00
21f088018a Used Py3.6 feature by accident, check version 2017-06-26 19:57:48 +10:00
d68f698cf0 Merge branch '28' into custom-manipulators 2017-06-26 19:38:40 +10:00
28b2f1c305 Manipulator: Python API
Initial support for Python/Manipulator integration
from 'custom-manipulators' branch.

Supports:

- Registering custom manipulators & manipulator-groups.
- Modifying RNA properties, custom values via get/set callbacks,
  or invoking an operator.
- Drawing shape presets for Python defined manipulators (arrow, circle, face-maps)

Limitations:

- Only float properties supported.
- Drawing only supported via shape presets.
  (we'll likely want a way to define custom geometry or draw directly).
- When to refresh, recalculate manipulators will likely need
  integration with notifier system.

Development will be continued in the 2.8 branch
2017-06-26 16:38:04 +10:00
a513f1c97e Merge branch '28' into custom-manipulators 2017-06-26 15:47:40 +10:00
c9e33b36de Correct copy-paste error manipulator 2017-06-26 15:46:27 +10:00
5eadb457fd Manipulator: add range_get callback 2017-06-26 15:45:11 +10:00
1ec6c5b4d1 Merge branch '28' into custom-manipulators 2017-06-26 15:10:59 +10:00
ba6d9fefc2 Rename wmManipulatorPropertyType.type -> data_type 2017-06-26 14:36:37 +10:00
3edff2e1a4 Manipulator: use 'void *' for callback data args
Non-float properties should be editable too.
2017-06-26 14:33:10 +10:00
5b555dc28a Docs: Manipulator.target_set_handler docstring
Also generalize checks for callable args
2017-06-26 14:18:46 +10:00
7ba53e900f Building without Python works again 2017-06-26 13:59:55 +10:00
6d7f0acf08 Merge branch '28' into custom-manipulators 2017-06-26 13:50:41 +10:00
2d2c64dd18 Building without Python works again 2017-06-26 13:50:11 +10:00
6d1ae5897f Merge branch 'master' into blender2.8 2017-06-26 13:43:56 +10:00
fb96228441 Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data 2017-06-26 13:41:44 +10:00
0a79b350b5 Merge branch 'master' into blender2.8
Note that this drops all changes from master,
useful commits will need to be cherry-picked.

Did this since most commits were relating to UV/textures
which is complicated by texface being removed in 2.8
2017-06-26 13:38:23 +10:00
f0863f2a80 Merge branch 'master' into blender2.8 2017-06-26 13:27:54 +10:00
0172ed8fe5 Building w/o Python works again 2017-06-26 13:26:44 +10:00
3cbf77b34f Cleanup: committed by accident 2017-06-26 13:21:09 +10:00
a4f16c63a2 Manipulator: name setting function
Default name includes group-name,
we may want to set the name without a prefix.
2017-06-26 13:16:25 +10:00
5eca16cf8b Manipulator: templates/examples for Py-API 2017-06-26 13:14:23 +10:00
b0ee9aaa5d Fix freestyle lineset panels being animatable 2017-06-25 20:03:19 -04:00
957a77c0ba UI: Fix Capitalization Inconsistency 2017-06-25 19:55:05 -04:00
085bb4cc82 Merge branch '28' into custom-manipulators 2017-06-26 08:41:35 +10:00
3a1f77650d WM: Fix crash in transform-orientation access
Need to support orientation access when context is NULL.
2017-06-26 08:38:21 +10:00
120bd4a729 Merge branch '28' into custom-manipulators 2017-06-26 08:30:57 +10:00
70b5cec5fa Manipulator: add optional properties argument
Needed for RNA/Py API
2017-06-26 08:19:55 +10:00
d1639ec787 Manipulator: add Manipulator.target_set_operator
Expose WM_manipulator_set_operator to RNA
2017-06-26 07:56:43 +10:00
c822b1612f Docs: correct doc-strings 2017-06-26 07:36:29 +10:00
1c053c6a12 Collada: Exporter now only exports either 'Materials' or 'UV Textures as Materials'. This makes the user interface more streight 2017-06-25 22:06:42 +02:00
ad58617bd2 fix: overlooked the RET_ZERO appendix 2017-06-25 17:04:47 +02:00
c9b95c28f6 fix: T51622 The exporter now exports meshes as <Triangles> when all contained polygons are tris 2017-06-25 14:51:51 +02:00
fcb8761966 fix: Collada fprintf needs std::string be converted to char * 2017-06-25 13:18:21 +02:00
1340c7bcdc fix: collada: removed unnecessary extra qualification 2017-06-25 13:10:03 +02:00
d17786b107 fix: adjusted collada declaration after changes in collada module.
@campbell Barton: Why is this declaration needed at all in stubs.c?
Further up the file collada.h is imported and that already decalres
the function and results in a duplicate declaration.
2017-06-25 10:50:19 +02:00
bdacb60a92 Collada: Fix: Geometry exporter did not create all polylist when meshes are only partially textured 2017-06-24 23:33:34 +02:00
ddabe465b5 collada: export UV Textures as materials. Note: the reimport of the exported collada files will have materials assigned instead of UV Face Textures! This is expected behavior 2017-06-24 22:16:47 +02:00
a2a301bdb9 collada: change image export: export either UV Textures or Materials. This
avoids wrong texture data when multiple objects are exported. Note: This
commit might possiblyt not work fully. The full feature is added with the
next commit)
2017-06-24 22:16:47 +02:00
89060babbc Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data 2017-06-24 22:16:47 +02:00
0d2b1da3a6 Collada: added new functions for improved material exporter (not used yet) 2017-06-24 22:16:47 +02:00
ce531ed1a1 Fix T50856: crash when minimizing window on AMD / Windows. 2017-06-24 19:20:56 +02:00
f51438aea0 Fix T51792: crash calling bpy.ops.screen.animation_cancel while scrubbing. 2017-06-24 18:02:30 +02:00
3c7355b3a2 Revert "Fix py-api doc building"
This reverts commit 838a4622cf.

Also add missing 'lightprobe'
2017-06-24 17:01:25 +10:00
838a4622cf Fix py-api doc building 2017-06-24 16:11:24 +10:00
07f34ee843 Eevee: Fix linking error. 2017-06-24 05:25:33 +02:00
28ff238c45 Eevee: Planar reflection: Fix normal deformation for background pixels.
Now it matches world cubemap perfectly.
2017-06-24 05:24:59 +02:00
bff98ce3f7 Eevee: Fix opengl error cause by bad texture configuration.
This is fragile and the whole Texture/Framebuffer should be extended to be more flexible.
2017-06-24 01:46:07 +02:00
8035c0f3c6 Eevee: Use smaller texture for placeholders. 2017-06-24 01:44:43 +02:00
e92940c6f3 Eevee: Planar Reflection: Add contact hardening normal distortion.
Save radial distance to camera in alpha channel of the planar probe.
Use this distance to modulate distortion intensity when shading the surface.
2017-06-24 01:08:26 +02:00
a6593645bf Eevee: Add AO support in planar reflection.
Technically this enables the use of MinmaxZ pyramid inside the probe captures.
Also Disable AO for cubemap probes because it shows big discontinuities at cubeface limits.
2017-06-23 22:51:38 +02:00
5e3f902eaa Eevee: Planar Reflection: Fix precision issue near cliplane.
The problem was that the depth prepass was using the clip plane but not the shading pass.

During the clipping stage, the triangle is converted to a quad clipped to the given clip plane.
But this introduce subtle changes in the depth when this new geometry is rasterized. Since the shading pass was using an EQUAL depth test, the depth values from the shading pass were not always equal to the depth prepass.

Enabling clipping in the shading vertex shader has a too small impact to require a dedicated shader.
2017-06-23 22:51:38 +02:00
1111e64c72 Eevee: Planar reflection: Fix bad texture binding. 2017-06-23 22:51:38 +02:00
Dalai Felinto
dd608ba20e Silence warnings (tsc, tsc) 2017-06-23 16:45:14 +02:00
986a3d15ac GPUMaterial: Avoid freeing GLSL shaders when changing scene properties.
This was causing major slowdown when changing Colormanagment settings or post processing.
2017-06-23 16:41:56 +02:00
45720922f7 Revert "Temporarily disable material preview (T51796 workaround)"
This reverts commit 0d9611718d.

The preview issues have been solved by CoW commit
802027f3f8
2017-06-23 12:26:54 +02:00
a764044ccc Fix Eevee "No output node" issue
This fixes an issue introduced by the new output node system, where "No
output node" was displayed in the material panel even when an output
node was present.
2017-06-23 10:49:09 +02:00
Dalai Felinto
c2d285f0ff Grease Pencil: Fix hardcoded DKEY for continous drawing 2017-06-23 10:46:30 +02:00
bddb4de47c Fix T51845 2017-06-23 11:05:54 +03:00
e0ec4ab09a Merge branch '28' into custom-manipulators 2017-06-23 17:25:33 +10:00
0f99793dee Manipulator: partial depth support
Use the depth flag added for this purpose.
Although this only works for regular currently, not selection.
2017-06-23 17:24:56 +10:00
a879546528 Merge branch '28' into custom-manipulators 2017-06-23 16:49:11 +10:00
d47cb2a4e4 Manipulator: disable GL state changes drawing geometry
If there is case this is needed, we can enable and restore state
for now it seems OK to disable.
2017-06-23 16:47:49 +10:00
e3db258efd Manipulator: Name access 2017-06-23 16:18:31 +10:00
0997fd51e2 Merge branch '28' into custom-manipulators 2017-06-23 15:57:23 +10:00
16b807e84f Manipulator: flip scale flag usage
Naming was confusing, while technically correct -
the result is no scaling (manipulator ignores zoom-level).

Also remove 3D from name since this can be supported for 2D views too.
2017-06-23 15:54:27 +10:00
82d79f1feb Manipulator: expose matrix, scale & flags via RNA 2017-06-23 15:42:55 +10:00
6ea3408e4b Merge branch '28' into custom-manipulators 2017-06-23 14:51:22 +10:00
0a5d7efab3 Manipulator: rename struct members
Rename:
- matrix -> matrix_basis
- user_scale -> scale_basis
- scale -> scale_final

Match RNA names being added to custom-manipulator branch.
2017-06-23 14:50:44 +10:00
12b985f1b1 Eevee: Put pack AO parameters. 2017-06-23 04:13:08 +02:00
c2711c6f48 Merge branch '28' into custom-manipulators 2017-06-23 11:21:43 +10:00
823144f0a6 Manipulator: add tweak-snap (not used yet) 2017-06-23 11:15:16 +10:00
3a243ad83f Eevee: Attempt to optimize GTAO shader.
Unroll horizon search loop. Use fast version of acos.
On nvidia linux, unrolling the 2nd loop is giving very high compilation time.
2017-06-23 02:52:34 +02:00
fbffd6d364 Eevee: Fix OpenGl errors.
Also assert if texture does not exists in draw manager. Keeping it sane.
2017-06-23 02:52:34 +02:00
1b494fff49 Merge branch '28' into custom-manipulators 2017-06-23 09:21:00 +10:00
221c7fdaf0 Manipulator: fix broken hover option
Hover flag caused manipulators not to update
(Camera DOF works again).
2017-06-23 09:18:53 +10:00
06cc5e4994 DrawManager: Add support for writting to depth without depth testing.
Disabling depth test will prevent from writting to depth buffer.
Add DRW_STATE_DEPTH_ALWAYS to always pass the depth test and write to depth.
2017-06-22 18:54:03 +02:00
Dalai Felinto
5b2e596ce9 Eevee: Fix max range of lightprobes 2017-06-22 18:35:08 +02:00
Dalai Felinto
d9c5433144 Eevee: Interface and units
We should use PROP_DISTANCE whenever appropriate.
Also rename "Data Draw Size" > "Size" in the UI for the lightprobes.
2017-06-22 17:37:31 +02:00
Dalai Felinto
4cd9a3e337 Light Probes: interface changes, and renames
Although we are calling all of them light probes, there are a lot of
differences between them. This commit does the following:

* Prevent user from changing the probe type once added

* Unify "sphere" and "cube" probes into reflection cubemap
(as before you can switch between them from the probe UI)

To be done
==========
* Don't show add probe menus unless we are on Eevee

* Light probes panels should not be visible in Clay. Light probe objects
should not be visible in Clay viewport (nor on Cycles).

Notes
=====
* We need icons for the different light probes, and for lightprobes as a
whole (we are using RADIO for now).
2017-06-22 17:30:15 +02:00
Dalai Felinto
7773a8ad04 Indicate to users when manual conversion of Eevee materials is needed
We now shows a report error when user opens a file that need fixing.
It's fine(ish) to not do doversion. It's not fine to not communicate that.
2017-06-22 10:48:41 +02:00
b4f354e668 Merge branch '28' into custom-manipulators 2017-06-22 18:40:21 +10:00
f1824507e2 Manipulator: target property definitions
Changes from custom-manipulator branch.

- use property type definitions.
- add property free callback.
- move properties into the wmManipulator struct (over alloc).
- use array length from property types instead of arg passing.
2017-06-22 18:39:28 +10:00
7abed4e433 Fix T51867: Insert Keyframe I - L / I - R / I - S key combos are broken.
Reorder keyingsets registration order, since it also afects order of I
menu options, better show most used ones first, pure alphabetical order
is not great here... Will likely break some muscle memory though. :|

Based on D2720 by Carlo Andreacchio (@candreacchio), thanks.
2017-06-22 10:29:55 +02:00
Dalai Felinto
be4b5551c7 Fix T51863: CompositorNodeSwitchView have the wrong rna API
Although the original report was about the docs, the real issue was in
the API.

My original commit started from a copy-paste from the Switch
Node. However I don't use custom1 for thew Switch View node.

The docs is slightly incomplete since it would be nice to mention the
views here. Or maybe even expose them via Python. But honestly they are
generated depending on the scene multi-view settings.
2017-06-22 10:25:05 +02:00
1b9399f446 Remove counter of set properties, just check when needed 2017-06-22 18:24:25 +10:00
b4cceaa51c Merge branch '28' into custom-manipulators 2017-06-22 18:13:45 +10:00
4d9eb2c589 RNA/Python API for defining py-manipulator callbacks 2017-06-22 18:05:20 +10:00
e3c2b45138 Cleanup: remove redundant user_data arg
This is already accessible from the property
2017-06-22 14:05:39 +10:00
5ac5729ea7 Remove unneeded length arg
Was also missing assignment to wmManipulatorProperty.type
2017-06-22 13:58:10 +10:00
87adeb8dd9 Eevee: Ambient Occlusion: Enable Multibounce approximation and Change influence factor.
Making the influence a power for easy tuning. Works like a contrast knob.
2017-06-22 03:51:06 +02:00
779c950098 Eevee: Ambient Occlusion: Initial implementation.
Implement GTAO (Ground Truth Ambient Occlusion) which is a special case of Horizon Based Ambient Occlusion that is more physically accurate.
Also add a bent normal option to sample indirect irradiance (diffuse lighting) with the least occluded direction.
2017-06-22 03:51:06 +02:00
5ccc02277d Eevee: Improve material variation managment.
- Unify variations between default shaders and material shader.
- Only create default shader passes if needed.

Downside is that we have a big array of passes and shading grp in the vedata ... And it will double in size each time a new variation flag is added.
2017-06-22 03:51:06 +02:00
1159d8ccc9 Eevee: Ambient Occlusion: Add UI properties. 2017-06-22 03:51:06 +02:00
2c7f6db8d1 Eevee: Minmax Depth Pyramid.
This commit introduce the computation of a depth pyramid containing min and max depth values of the original depth buffer.
This is useful for Clustered Light Culling but also for raytracing on the depth buffer (SSR).
It's also usefull to have to fetch higher mips in order to improve texture cache usage.

As of now, 1st mip (highest res) is half the resolution of the depth buffer, but everything is already done to be able to make a fullres copy of the depth buffer in the 1st mip instead of downsampling.
Also, the texture used is RG_32F which is a too much but enough to cover the 24bits of the depth buffer. Reducing the texture size would make things quite faster.
2017-06-22 03:51:06 +02:00
ed59d03bfc GPUFramebuffer: Add recursive downsampling function.
This special case function enables rendering to a miplevel while using the miplevels above as texture input.
This is needed for some algorithm (i.e. creating a min-max depth pyramid texture).
2017-06-22 03:51:06 +02:00
fe2ff3fc89 GPUTexture: Support for nearest sampling with mipmaps. 2017-06-22 03:51:06 +02:00
d8a3400d55 Remove length argument since it's stored in the property 2017-06-22 11:36:31 +10:00
b2f1b1bc31 Missed in last commit 2017-06-22 11:31:37 +10:00
ce4e980d3d Manipulator: properties into 'wmManipulator'
We normally only have one or two, don't have a separate linked list.
Also store type in the property.
2017-06-22 09:40:24 +10:00
1979176088 Cycles: Fix excessive sampling weight of glossy Principled BSDF components
If there was any specularity in the Principled BSDF, it would get a sampling
weight of one regardless of its actual impact.

This commit makes Cycles estimate the contribution of the component and adjust
the weighting accordingly, which greatly improves the noise characteristics of
the Principled BSDF in many cases.

Note that this commit might slightly change the brightness of areas when using
MultiGGX and high roughnesses, but the new brightness is more accurate and
closer to the result of Branched Path Tracing. See T51836 for details.

Differential Revision: https://developer.blender.org/D2677
2017-06-22 00:09:56 +02:00
8cb741a598 Fix T51836: Cycles: Fix incorrect PDF approximations of the MultiGGX closures
The PDF of the MultiGGX sampling is approximated by the singlescattering GGX
term as well as a scaled diffuse term that makes up for the energy in the
multiscattering component that's missed by GGX.

However, there were two problems with the glossy terms: The diffuse term missed
a normalization factor, and the singlescattering term was not properly scaled
down based on the albedo estimate.

The glass term was completely wrong and has been rewritten. It uses the fresnel
factor to weight reflection vs. refraction and uses the glossy MultiGGX model
for reflection.
For refraction, the correct singlescattering term is now used, and a new
albedo approximation is used that was derived by evaluating GGX albedo for
roughnesses from 0 to 1 and IORs from 1 to 3 and fitting numerical
approximations to it. The resulting model has a mean relative error of 9e-5,
but could probably be simplified without losing noticable accuracy in the
final render.

The improved PDFs help with glossy highlights (due to better light sampling vs.
closure sampling MIS) and fix the situation described in T51836 where mixing
MultiGGX with other closures (as it happens in e.g. the Principled
BSDF) causes incorrect darkening.
2017-06-22 00:09:56 +02:00
e8a04a5a18 PyAPI: Add Manipulator.target_prop_set_property
RNA method for Python to call into C or Py defined manipulators.
naming might change.
2017-06-22 07:49:24 +10:00
968093ec2f Fix T51862: principled shader GLSL artifacts in ortho mode. 2017-06-21 21:31:08 +02:00
14ea0c5fcc Fix T51849: change Cycles clearcoat gloss to roughness.
This is compatible with UE4 and more consistent with specular and transmission
roughness, even if it deviates from the original Disney BRDF.
2017-06-21 19:55:20 +02:00
Dalai Felinto
4ceb006706 Merge remote-tracking branch 'origin/master' into blender2.8 2017-06-21 15:14:42 +02:00
Dalai Felinto
22466a5bdf Fix typo in builtbot config 2017-06-21 14:05:23 +02:00
ab6411e32c Python support for manipulator target-property definitions
Note that these aren't used at the moment.
2017-06-21 21:10:17 +10:00
Dalai Felinto
2ae172ec32 Fix blenderplayer (tm) 2017-06-21 12:25:07 +02:00
af35455912 Fix T51856: BKE_mesh_new_from_object() would often generate default 'Mesh' named datablock.
This is annoying especially for exporters who do use mesh name, since it
broke any relation with actual Mesh naming in original Blend file.

Unfortunately, we cannot avoid the extra .xxx digits. ;)
2017-06-21 10:30:38 +02:00
c394c9506c Merge branch '28' into custom-manipulators 2017-06-21 17:12:04 +10:00
85c5c5531e Manipulator: edit_properties -> target_properties
Naming was too confusing between properties of a manipulator
and properties it edits.
2017-06-21 17:06:24 +10:00
c3a8b51413 Manipulator: Move types into their own directory 2017-06-21 16:24:16 +10:00
b483e937a1 Merge branch '28' into custom-manipulators 2017-06-21 14:14:50 +10:00
b7669ac1c6 Manipulators: move settings to ID properties
This makes manipulator access closer to operators,
and allows Python access.

This adds RNA for manipulators, but not Python registration yet.

- Split draw style into 2x settings:
  `draw_style` (enum) & `draw_options` (enum-flag)
- Rename wmManipulator.properties -> properties_edit,
  Use wmManipulator.properties for ID-properties.
  Note that this area of the API will need further work since
  manipulators now have 2 kinds of properties & API's to access them.
2017-06-21 14:10:14 +10:00
7966a7baa9 Revert change that added screen to manipulator-map
Temporary screens caused a crash here,
if we can't assume an area will never have its screen changed
better not store a back-pointer.

This makes `rna_ManipulatorProperties_find_operator` search even more
exhaustive. Not nice but hard to avoid :S
2017-06-21 13:24:56 +10:00
f410b18832 PyAPI: minor improvement to type check 2017-06-21 13:23:40 +10:00
695a824595 Merge branch '28' into custom-manipulators 2017-06-21 12:45:02 +10:00
5b51dcacbc PyAPI: add intern strings
Avoid string conversion on each use.
2017-06-21 12:43:19 +10:00
a355197f13 Merge branch '28' into custom-manipulators 2017-06-21 12:23:10 +10:00
d9bb08f111 RNA: avoid many calls to 'RNA_struct_is_a'
Quicker to find the ID-subtype then use direct pointer comparisons.

Also modify `ID_code_to_RNA_type` so missing ID-codes raise a warning
(handy when adding new ID types).
2017-06-21 12:19:37 +10:00
Dalai Felinto
0ef7ccb4d7 Introduce functions/options to indicate the type of render
We should be able to differentiate between OpenGL render (viewport
render), offline render (F12), and view render (viewport draw).

This allows for us preventing offline render to skip mode drawings, grid, ...
Even OpenGL render can benefit from this forcing a higher quality
anti-alias and sampling than the viewport drawing.

I'm not sure if it's clever to keep the memset(0x00) outside the render
loop function as it is in this patch. An alternative is to just pass the
render "type" as a flag to the render function, and set DST.options
inside it. (I may change this tomorrow, I will wait to hear from
Campbell on that).
2017-06-20 20:07:18 +02:00
9e08019b74 Fix: Icon alignment for scaled pie buttons with no text 2017-06-20 20:15:04 +03:00
5c5c09439a Clean node names and organize menus for eevee
This makes the node menus aware of the Cycles/Eevee distinction, and
only show the relevant nodes for the current engine. Names have also
been changed to accomodate for the new output node system.
2017-06-20 18:39:59 +02:00
aaf37e1216 Implement Eevee output node system
This makes Eevee consistent with Cycles, by having a single output node,
and multiple shader nodes that connect to it.

Note that node systems for Eevee saved before this will be missing the
output node, and thus will show an invalid material. This is easily
resolved by connecting the shader output to a new output node.
2017-06-20 18:39:49 +02:00
Dalai Felinto
c2f4308e6b Fix blenderplayer build (tm) 2017-06-20 15:51:51 +02:00
Dalai Felinto
63d71edfca Fix collada build after gawain rename/refactor
Collada files should not have been touched.

Bug introduced on: c31f24c63b
2017-06-20 15:42:51 +02:00
e3b1d562a7 Fix (unreported) missing Image usercount increase when copying UVProject modifier. 2017-06-20 13:46:09 +02:00
bc50631490 Use id-properties for manipulator type data 2017-06-20 15:41:57 +10:00
754925e518 Remove unneeded library 2017-06-20 04:54:57 +10:00
ebf99c6788 Merge branch '28' into custom-manipulators 2017-06-20 04:47:20 +10:00
c31f24c63b Manipulators: store operator type instead of id
Avoids lookups on each access.
2017-06-20 04:44:34 +10:00
9e3df0d223 Merge branch '28' into custom-manipulators 2017-06-20 04:13:42 +10:00
243b42af49 Alembic tests: make failures a bit easier to diagnose. 2017-06-19 17:55:51 +02:00
81775e1920 Fix T51762: Unit test script_alembic_import is failing.
Implemented workaround for use with the legacy depsgraph.
2017-06-19 17:50:43 +02:00
56dea4b7cd Fix warning in view3d_draw. 2017-06-19 16:31:20 +02:00
7461bb3f52 Fixed bl_load_py_modules / script_load_modules unit test
It tried to assert that
addons/io_blend_utils/blender_bam-unpacked.whl/__init__.py was loaded when
the io_blend_utils module was imported. However, this happens only on
demand, and not directly when importing the add-on.
2017-06-19 15:28:52 +02:00
c9291ab2ac Use for/else instead of setting 'ok' variable.
This is more efficient, and this use case is exactly what the else clause
is for.
2017-06-19 15:28:52 +02:00
9af3119c53 Removed trailing spaces 2017-06-19 15:28:52 +02:00
Dalai Felinto
701a76769d Fixup for gawan rename
inten/opencolorio and *.cc were ignored.

Build error introduced on b4d053efc7.
2017-06-19 15:19:25 +02:00
54c9803e81 Depsgraph: Fix crash with mouse select in edit mode with Copy-on-Write enabled 2017-06-19 15:09:48 +02:00
24486513d5 Fix (unreported) bad copying code of Surface Deform modifier. 2017-06-19 14:57:40 +02:00
5347aa40d5 Fix compiler warnings from own recent rB0d5c7e5e36b9. 2017-06-19 14:43:44 +02:00
1addac8e0c Fix (unreported) bad copying of Ocean modifier.
Was needlessly complicated code, forgot to copy a value (foam_fade), and
was utterly leaking memory!
2017-06-19 14:43:15 +02:00
fbff09bf7a Depsgraph: Synchronize selection from original scene to copied-on-write one
This makes it possible to select objects in the viewport.

Selection in edit mode is still tricky, mainly because currently such update
would require tagging batch as updated, which is not possible with using just
and original object because it will never have batch.

Possible solution here would be to introduce some "batch" or "render" component
to depsgraph ID node for objects, so we can tag batch for update via depsgraph
tagging API.
2017-06-19 13:23:42 +02:00
802027f3f8 Depsgraph: Initial groundwork for copy-on-write support
< Dependency graph Copy-on-Write >
 --------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

This is an initial commit of Copy-on-write support added to dependency graph.
Main priority for now: get playback (Alt-A) and all operators (selection,
transform etc) to work with the new concept of clear separation between
evaluated data coming from dependency graph and original data coming from
.blend file (and stored in bmain).

= How does this work? =

The idea is to support Copy-on-Write on the ID level. This means, we duplicate
the whole ID before we cann it's evaluaiton function. This is currently done
in the following way:

- At the depsgraph construction time we create "shallow" copy of the ID
  datablock, just so we know it's pointer in memory and can use for function
  bindings.

- At the evaluaiton time, the copy of ID get's "expanded" (needs a better
  name internally, so it does not conflict with expanding datablocks during
  library linking), which means the content of the datablock is being
  copied over and all IDs are getting remapped to the copied ones.

  Currently we do the whole copy, in the future we will support some tricks
  here to prevent duplicating geometry arrays (verts, edges, loops, faces
  and polys) when we don't need that.

- Evaluation functions are operating on copied datablocks and never touching
  original datablock.

- There are some cases when we need to know non-ID pointers for function
  bindings. This mainly applies to scene collections and armatures. The
  idea of dealing with this is to "expand" copy-on-write datablock at
  the dependency graph build time. This might introduce some slowdown to the
  dependency graph construction time, but allows us to have minimal changes
  in the code and avoid any hash look-up from evaluation function (one of
  the ideas to avoid using pointers as function bindings is to pass name
  of layer or a bone to the evaluation function and look up actual data based
  on that name).

  Currently there is a special function in depsgraph which does such a
  synchronization, in the future we might want to make it more generic.

At some point we need to synchronize copy-on-write version of datablock with
the original version. This happens, i.e., when we change active object or
change selection. We don't want any actual evaluation of update flush happening
for such thins, so now we have a special update tag:

  DEG_id_tag_update((id, DEG_TAG_COPY_ON_WRITE)

- For the render engines we now have special call for the dependency graph to
  give evaluated datablock for the given original one. This isn't fully ideal
  but allows to have Cycles viewport render.

  This is definitely a subject for further investigation / improvement.

This call will tag copy-on-write component tagged for update without causing
updates to be flushed to any other objects, causing chain reaction of updates.
This tag is handy when selection in the scene changes.

This basically summarizes ideas underneath this commit. The code should be
reasonably documented.

Here is a demo of dependency graph with all copy-on-write stuff in it:

  https://developer.blender.org/F635468

= What to expect to (not) work? =

- Only meshes are properly-ish aware of copy-on-write currently, Non-mesh
  geometry will probably crash or will not work at all.

- Armatures will need similar depsgraph built-time expansion of the copied
  datablock.

- There are some extra tags / relations added, to keep things demo-able but
  which are slowing things down for evaluation.

- Edit mode works for until click selection is used (due to the selection
  code using EditDerivedMesh created ad-hoc).

- Lots of tools will lack tagging synchronization of copied datablock for
  sync with original ID.

= How to move forward? =

There is some tedious work related on going over all the tools, checking
whether they need to work with original or final evaluated object and make
the required changes.

Additionally, there need synchronization tag done in fair amount of tools
and operators as well. For example, currently it's not possible to change
render engine without re-opening the file or forcing dependency graph for
re-build via python console.

There is also now some thoughts required about copying evaluated properties
between objects or from collection to a new object. Perhaps easiest way
would be to move base flag flush to Object ID node and tag new objects for
update instead of doing manual copy.

here is some WIP patch which moves such evaluaiton / flush:

  https://developer.blender.org/F635479

Lots of TODOs in the code, with possible optimization.

= How to test? =

This is a feature under heavy development, so obviously it is disabled by
default. The only reason it goes to 2.8 branch is to avoid possible merge
hell.

In order to enable this feature use WITH_DEPSGRAPH_COPY_ON_WRITE CMake
configuration option.
2017-06-19 13:21:44 +02:00
e917bc5ee0 Fix (unreported) bad copying code in Mesh Deform modifier. 2017-06-19 12:55:11 +02:00
0d5c7e5e36 Fix (unreported) Dynamic Paint modifier not increasing ID usercount in copy function.
*Sigh* One more example of why we should keep ID management handling in
as few places as possible! It's impossible to keep more than a few
places in sync regarding which ID pointer is refcounted etc.
2017-06-19 12:25:41 +02:00
ab1af7b3e5 Merge branch '28' into custom-manipulators 2017-06-19 20:22:36 +10:00
0956b09d95 Merge branch '28' into custom-manipulators 2017-06-19 20:21:57 +10:00
e9aaf5ed21 Fix (unreported) memory leak in Fluid modifier copying.
Also generally simplify/sanitize this copy code.
2017-06-19 12:21:14 +02:00
b4d053efc7 Gawain API naming refactor
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
2017-06-19 20:18:04 +10:00
349946bd01 Cleanup: quiet warnings 2017-06-19 20:09:26 +10:00
33e5163550 CMake: Remove unused legacy depsgraph option
We don't have legacy depsgraph anymore, no reason to keep the option.
2017-06-19 11:14:40 +02:00
4046f3a54d Manipulator: use ui-scale for widgets 2017-06-19 19:03:22 +10:00
5a029d7a6d Eevee: Add data display for planar reflection.
Maybe not very useful but it's here for feature parity with the other probes.
The fragment shader clipping is here because I'm lazy and don't want to creating a proper quad Batch.
2017-06-19 10:47:56 +02:00
bd9a328b58 Eevee: Fix Planar Probe offset changing influence calculation. 2017-06-19 10:47:56 +02:00
0993af5484 Planar Probe: Add UI, 3d view Display and change defaults. 2017-06-19 10:47:56 +02:00
3e4b9d2b5a Eevee: Initial implementation of planar reflections.
Still pretty barebone: No roughness support, No normal distortion support.
2017-06-19 10:47:56 +02:00
5c67ac2236 Eevee: Add special shader for depth prespass.
This way we can extend it to output more data (like motion vectors).
Add a variation that uses clip distances.
2017-06-19 10:47:56 +02:00
539225db81 DrwManager: Remove the need for buffers to be available.
This way we can just avoid binding a texture by setting it's ref to NULL.
2017-06-19 10:47:56 +02:00
6dbe2b0385 DrwManager: Remove unnecessary ifs. 2017-06-19 10:47:56 +02:00
83a001267a Probe: Add planar type. 2017-06-19 10:47:56 +02:00
9a5cb2e6f8 DrwManager: Add support for Custom Clipping Planes 2017-06-19 10:47:56 +02:00
9a040fa3d4 DrwManager: Add the possibility to invert backfacing.
This is done in order to support planar reflection rendering.
2017-06-19 10:47:56 +02:00
8a10fa1c53 GPUFramebuffer: Add support to attach individual texture layer. 2017-06-19 10:47:56 +02:00
7b14065729 Manipulator: de-duplicate flags and scale option 2017-06-19 17:52:26 +10:00
f37137cd0b Merge branch '28' into custom-manipulators 2017-06-19 16:58:56 +10:00
2ecb9856bc Cleanup: move copy-paste code into function 2017-06-19 16:12:11 +10:00
9649c6bef5 Merge branch 'master' into blender2.8 2017-06-19 15:06:48 +10:00
72c9141a7a Cleanup: doxygen comments
Also remove duplicate & mismatching comments from grease-pencil header.
Keep comments close to implementation to avoid getting out of sync.
2017-06-19 10:04:30 +10:00
3190eaf109 Fix T51774: Children particles hair interpolation not correct with textures or dp.
Children where always getting at least one segment of fixed length...

Now fully hidden ones (zero length) get no segment at all.

Note that even very short ones keep getting one 'unit' length segment - would
rather avoid changing that at this point, given how complex children
particles 'length' can get with all kind of modifiers... Think we can
live with that for now anyway.
2017-06-19 00:03:36 +02:00
f158a206f2 Fix T51840: UI redraw in node editor header missing on pointcache bake
Missing a notifier handler in the node editor
2017-06-18 16:31:59 +02:00
cd8c46627f Fix unreported: Copy-pasting nodes crashes when they have an undefined type 2017-06-18 05:14:26 +02:00
cf7447dacb Manipulator: comments 2017-06-18 09:08:30 +10:00
f860369ebf Manipulator: use matrix for manipulator direction
Remove type-specific axis functions.
2017-06-18 08:37:50 +10:00
49be79693c Manipulator: use matrix instead of origin
This avoids having to use manipulator-type specific functions
to set the orientation.
And will make it simpler to access transformation from Python.

Currently the matrix is still used as an offset in places.
Also per-type orientation values still need to be removed.
2017-06-18 05:38:10 +10:00
b94a433ca3 Docs: Fix file:line links in generated API docs 2017-06-18 02:38:20 +10:00
1ec987f73c Add Cone: tip soft-min should be zero
Default value should be included in range.
2017-06-18 02:07:22 +10:00
726127d0dd Merge branch '28' into custom-manipulators 2017-06-18 01:48:57 +10:00
83c28ff96a Merge branch 'master' into blender2.8 2017-06-18 01:44:08 +10:00
54f0f87a4b Cleanup: use uint 2017-06-18 01:34:41 +10:00
8bf108dd48 Guarded allocator: Fix type in macro definition
The crash did not happen yet because we always had proper vmemh defined in
the parent scope.

Patch by Ivan Ivanov (aka obiwanus), thanks!

Differential Revision: https://developer.blender.org/D2715
2017-06-17 16:13:30 +02:00
a56de26704 Manipulator: draw options for dial
- Option to start helper angle lines based on a vector
  instead of the initial mouse coords (useful for bisect & spin).
- Option to show 2x helper lines
  useful when dial is used to rotate an axis value.
2017-06-17 15:32:47 +10:00
865bf8ecbc Manipulator: correct dial angle
Calculation was done in screen-space giving inaccuracy,
making the angle incorrect for tool code.

Cast mouse coords onto the dial plane to calculate the angle instead.
2017-06-17 14:34:23 +10:00
57c9bc9bb0 Manipulator: fix general purpose dial use
Wasn't checking own location when checking if flip is needed.
2017-06-17 11:55:53 +10:00
03f67fd5b0 Cleanup: unused code 2017-06-17 11:32:30 +10:00
608cabe2a1 Manipulator: Ignore zoom-level for on-screen widgets 2017-06-17 11:24:26 +10:00
41e22cccee Camera widget only drew 3 sides 2017-06-17 11:09:08 +10:00
df541af546 RNA: remove manipulator arg
There is no need since 'self' is the manipulator.
(was left in from these callbacks being attached to manipulator-group).
2017-06-17 10:37:51 +10:00
444914d2a5 RNA wrap wmManipulator.setup callback 2017-06-17 10:27:29 +10:00
1f188d7a1c Merge branch '28' into custom-manipulators 2017-06-17 10:24:50 +10:00
aeeebacd6a Cleanup: minor consistency tweak for type name 2017-06-17 10:04:48 +10:00
8c22d31dcc Manipulator: remove type specific 'new' functions
Instead use generic 'WM_manipulator_new', adding a new 'setup'
callback (like wmManipulatorGroup.setup) used to initialize type vars.

This moves conventions closer to wmOperator and simplifies exposing to
Python.
2017-06-17 10:02:54 +10:00
71b70b23b3 Manipulator: initial manipulator for spin operator 2017-06-17 06:38:51 +10:00
df017f7867 Manipulator: New grab preset, use for bisect 2017-06-17 06:14:29 +10:00
2b8d599b3a Manipulator: add array get/set functions 2017-06-17 02:38:49 +10:00
ed6d88f06a PyAPI: Fix warning about indent 2017-06-16 12:30:18 -04:00
Dalai Felinto
946bc4d3c1 Fix object selection doversion issue since Workspace
Workspace commit (7f564d74f9) made
selection to not be carried away from 2.7x files into 2.8.
2017-06-16 18:12:22 +02:00
fc4154f857 Fix T51810: Add minimal example of usage of translation API for non-official addons. 2017-06-16 16:43:46 +02:00
34389999b2 Usual i18n/UI messages fixes.
Please do not add useless tooltips! We have enough messages to translate
already...
2017-06-16 12:50:24 +02:00
24ec761bb4 Merge branch 'master' into blender2.8 2017-06-16 10:26:37 +02:00
794311c92b Cycles: Fix race condition happening in progress utility
This is not enough to mutex-guard modification code of integer values,
since this operation is NOT atomic. This is not even safe for a single
byte data types.

For now guarded the getter functions, similar to other functions in
this module.

Ideally we want to switch modification to an atomic operations, so we
wouldn't need any locks in the getters.
2017-06-16 10:22:35 +02:00
18e1c8d9fa PyAPI: Fix changed ref link 2017-06-15 22:03:22 -04:00
a348023196 PyAPI: Add HTML logo and favicon
Differential Revision: https://developer.blender.org/D2621
2017-06-15 22:01:04 -04:00
127a754615 PyAPI: Remove addon tutorial
This page now lives at https://docs.blender.org/manual/en/dev/advanced/scripting/addon_tutorial.html
2017-06-15 22:01:03 -04:00
11a74ada7d Merge branch '28' into custom-manipulators 2017-06-16 08:53:29 +10:00
e306499a41 Missed last commit 2017-06-16 08:52:42 +10:00
637fa5f670 Cleanup: rename manipulator files 2017-06-16 08:51:14 +10:00
359698b05f Very minor edit (2.8 sync) 2017-06-16 08:46:56 +10:00
f16c595486 Missed in recent removal of face-maps 2017-06-16 08:44:07 +10:00
65905a76c2 Add bisect manipulator
Example that uses library widgets to control an operator,
the API hasn't been reviewed yet so this can be seen as a test.
2017-06-16 08:25:24 +10:00
400d3f85e1 Add support for delayed manipulator removal
This is needed so manipulators can tag themselves for removal
without causing problems from freeing data within a callback.

Also use properties within the dial manipulator and fix an error where
removing a wmManipulatorGroupType didn't remove its keymap.
2017-06-16 08:20:27 +10:00
5e2583a836 Remove face-map / armature integration
Since we're unlikely to use this, it's tedious to keep so many
differences from 'blender2.8' branch.

Currently the only difference between this
branch and 2.8 is RNA/Python work-in-progress integration.
2017-06-16 08:02:25 +10:00
e5a9a4fc6a Merge branch '28' into custom-manipulators 2017-06-16 07:41:42 +10:00
6b502731a5 CMake: print absolute CMakeCache.txt
Message didn't show the path of the file to remove
which could be confusing.
2017-06-16 07:38:20 +10:00
4054914813 UV manipulator from custom widgets branch
This isn't advanced, just adding to get custom
manipulator branch from being too much out of sync with 2.8.
2017-06-16 07:34:23 +10:00
960b32a84c Initial bisect widget
Uses view 3d manipulator option
2017-06-16 06:55:49 +10:00
74ed086b10 Merge branch '28' into custom-manipulators 2017-06-16 06:29:27 +10:00
643df8fdab Add support for delayed removal
This is needed so manipulators can tag themselves for removal
without causing problems from freeing data within a callback.

Also use properties within the dial manipulator and fix an error where
removing a wmManipulatorGroupType didn't remove its keymap.
2017-06-16 06:24:42 +10:00
Dalai Felinto
281a4540e2 Expose World ID panel for Eevee
That said, materials need to be updated when switching the world.
2017-06-15 18:46:14 +02:00
Dalai Felinto
cd21236ea1 Fix duplication of scene, it was missing duplication of layer properties 2017-06-15 18:37:02 +02:00
ff157b2d12 Merge branch '28' into custom-manipulators 2017-06-16 01:33:50 +10:00
51404724cc Merge branch 'master' into blender2.8 2017-06-16 01:29:20 +10:00
1d966ca7a1 Math Lib: add angle_on_axis_v3v3_v3
Use for calculating the angle between 2 directions on an axis.

Also signed version and normalized plane projection,
use when input is normalized.
2017-06-16 01:27:58 +10:00
60c5b3f76f Merge branch 'master' into blender2.8 2017-06-15 16:37:10 +02:00
3d03616772 Cleanup: do not use BKE_libblock_free_ex() unless needed! 2017-06-15 16:20:51 +02:00
a35e733ff1 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/MeshImporter.cpp
	source/blender/editors/object/object_add.c
	source/blender/editors/screen/screen_edit.c
2017-06-15 15:54:11 +02:00
880e96dd66 Fix/workaround 'convert object' messing up linked data.
'Convert To...' Object operation has very weird effect of actually
working at obdata level, not object level, which means *all* objects
(even unselected/hidden/in other scenes/...) using same obdata will be
converted to new selected type.

IMHO this is very bad behavior, but... not a bug really, so do not
change this for now.

But at least, do not do that when working on some linked data, else it
leaves Blend file in invalid (incoherent) state until next reload.

So workaround for now is to enforce the 'Keep Original' option when some
linked object/obdata is affected by the operation.

Also fixed somewhat broken usercount handling in Curve->Mesh part.
2017-06-15 15:47:16 +02:00
Dalai Felinto
60a36f2028 Eevee: Use PROP_NONE for probe grid resolution
It makes no sense to use PROP_PIXEL as unit here.
2017-06-15 15:02:32 +02:00
Dalai Felinto
32cd8ac710 Layers: Scene copy should copy selection as well.
We need this for Depsgraph, otherwise CoW scene will have different selection properties.
2017-06-15 13:47:14 +02:00
9e0a253ea1 Cleanup: make Group Unlink outliner action use `BKE_libblock_delete() too.
Same as in rB2bd51474a44...
2017-06-15 13:06:31 +02:00
4f063b1e9a Merge branch '28' into custom-manipulators 2017-06-15 21:05:12 +10:00
ddb8330571 Cleanup: remove useless call to BKE_screen_free() in screen deletion.
`BKE_libblock_free()` will call it itself.
2017-06-15 13:00:11 +02:00
ee5ed2ae26 Fix dangerous code when deleting Scene.
That one was probably not an actual issue, except maybe in some corner
cases (like deleting a linked scene also used by some other linked scene).

Again, better not try to do smart & complex freeing logic outside of
BKE_library area, let's keep spaghetti nitghmare in a single place!
2017-06-15 12:57:08 +02:00
830df9b33d Updates to manipulator API
While this is work-in-progress from custom-manipulators branch
its stable so adding into 2.8 so we don't get too much out of sync.

- ManipulatorGroupType's are moved out of the manipulator-map and are now
  global (like operators, panels etc) and added into spaces as needed.
  Without this all operators that might ever use a manipulator in the 3D
  view would be polling the viewport.
- Add optional get/set callbacks for non-RNA properties
  Needed so re-usable manipulators can control values that
  don't correspond to a single properly or need conversion.
- Fix divide by zero bug in arrow manipulator (when moving zero pixels).
2017-06-15 20:56:22 +10:00
2bd51474a4 Cleanup: make Group Unlink operator use BKE_libblock_delete(), since that's what it is doing.
Previous code (same as what `BKE_libblock_free_us()` is doing when
usercount reach 0) was probably OK in that specific case, but still not
good idea, and potentially risky.
2017-06-15 12:49:40 +02:00
7853ebc204 Fix collada importer doing own handling of usercount/freeing.
Better use generic `BKE_libblock_free_us()`.
2017-06-15 12:44:15 +02:00
25c0666b90 Fix potentially dnagerous code in doversionning of brush.
Even though in that specific it was probably safe-ish, there is no
guarantee at this point Brush we want to remove are not used somewhere,
better take the slightly slower, much safer `BKE_libblock_delete()` path here.
2017-06-15 12:38:55 +02:00
7a80c34f52 Fix serious bug in 'curve-to-mesh' conversion code.
Eeeeeek!^2 Calling unconditionnaly ID freeing `BKE_libblock_free()` on a
datablock (ob->data, i.e. Curve) that may be used elsewhere...
Veryveryvery bad!
2017-06-15 12:34:12 +02:00
b488988ab1 Fix potential memory leak in Sequencer sound strip creation code. 2017-06-15 12:32:27 +02:00
bbfa2f361c Merge branch '28' into custom-manipulators 2017-06-15 20:27:11 +10:00
c3e588455a Dial manipulator didn't have a modal callback
Until 3d-viewport manipulators change functionality we need to it
working how it already is.

So add modal operator which is called from draw when there are no
properties applied to the manipulator.

This will be needed to have a general rotation manipulator.
2017-06-15 20:20:35 +10:00
Dalai Felinto
1a7099f3ec Fix T51463: Eevee motion blur not working (with AMD)
GLSL needs FragColor to be initialized. The default vec4 value seems to be
implementation dependent. Or it's a bug on Mesa/AMD.
2017-06-15 11:31:45 +02:00
826f3c715c Fix strict cflags compilation after recent const changes 2017-06-15 10:19:33 +02:00
35ec72bcb8 Merge branch 'master' into blender2.8 2017-06-15 10:17:51 +02:00
038b73bab1 Fix compilation error with strict cflags after recent const changes 2017-06-15 10:14:56 +02:00
692ce81d93 Further improvements of text editor for POV-Ray
*tryed "#" as preprocessor used in POV-Ray for language keywords best behaviour was to have it as a punctuation symbol
*moved "finish" to its proper category
*changed order of some POV-Ray ini files keywords to have them work better
*added a few keywords from latest pov version
*Fixed C-style closing of multiline comments (*/)

Reviewers: campbellbarton, mont29

Reviewed By: campbellbarton, mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D2707
2017-06-15 09:34:38 +02:00
a96030b3da PyAPI: Add toctree link on parent page of submodule 2017-06-15 01:41:28 -04:00
44fd84bcc3 PyAPI: Proper Solution to bpy.app 2017-06-15 00:54:41 -04:00
f2d7a28a09 Probes: Modify Add Menu and change defaults. 2017-06-15 00:57:16 +02:00
f5203e6cba Probe: Fix display of the Influence of grid probes. 2017-06-15 00:57:16 +02:00
634dbfa2ed Eevee: Fix grid probe updating when updating cube probe. 2017-06-15 00:57:16 +02:00
cac851a00e Eevee: Probes: Add data display for cubemaps. 2017-06-15 00:57:16 +02:00
810464e5f7 Eevee: Group octahedron map functions into one file. 2017-06-15 00:57:16 +02:00
246ee82a2f Eevee: Some probe update changes.
Dont render grids if cubemap count changes (because it does not depends on).
Recalc lighting if probe type change.
2017-06-15 00:55:45 +02:00
9c82203e82 Eevee: Probes: Change falloff of irradiance grid. 2017-06-15 00:55:45 +02:00
99ff1bb21a Probe: fix clip distances showing only for one probe. 2017-06-15 00:55:45 +02:00
0ca2f5affd Eevee: Irradiance grid: support for non-blocking update and multiple bounces. 2017-06-15 00:55:45 +02:00
26e710b1fd Eevee: Add Grid debug display. 2017-06-15 00:55:45 +02:00
4873ff005b Eevee: Fix probe diffuse computation. 2017-06-15 00:55:44 +02:00
49ba446f68 Eevee: Split irradiance functions to their own new file. 2017-06-15 00:55:44 +02:00
88602ea017 Probe: Fix probe panel 2017-06-15 00:53:41 +02:00
4a83f3e2a5 Eevee: Disable specular when rendering probes.
This prevents weird reflections and really strong indirect lighting.
2017-06-15 00:53:41 +02:00
fbd05d3b6a Probe: fix grid default resolution. 2017-06-15 00:53:41 +02:00
dccf46f18f Eevee: Add Irradiance Grid support
Early implementation. Slow and still has quality
3 ways of storing irradiance:
- Spherical Harmonics: Have problem with directionnal lighting.
- HL2 diffuse cube: Very low resolution but smooth transitions.
- Diffuse cube: High storage requirement.

Also include some name change.
2017-06-15 00:53:41 +02:00
8e5609665f Probe: Add grid probe parameters. 2017-06-15 00:53:41 +02:00
df7c609fda PYAPI: Fix mathutils doc structure 2017-06-14 16:47:43 -04:00
7439919ac0 Merge branch 'master' into blender2.8 2017-06-14 22:39:33 +02:00
eeb9e5316a Make whole ID copying code use const source pointer.
Noisy change, but safe, and better do it sooner than later if we are to
rework copying code. Also, previous commit shows this *is* useful to
catch some mistakes.
2017-06-14 22:38:11 +02:00
31437b0d4d Fix three obvious mistakes in brush/mask/cachefile ID copying.
They were modifying some source ID prop, instead of copied version of
it... Found while making all source of ID copying const. ;)
2017-06-14 22:38:11 +02:00
5e485e34e8 PYAPI: fix documention structure of bpy.app 2017-06-14 16:19:05 -04:00
28d623f95d Don't use undo for manipulator tweak operator
This causes problems when tweaking an operator
2017-06-15 06:07:13 +10:00
748d06ae5a Fix divide by zero dragging the arrow 2017-06-15 06:06:45 +10:00
58526b3bec Cleanup: remove redundant access function 2017-06-15 05:33:49 +10:00
9a0673a5d4 Fix missing toctree for bmesh submodules 2017-06-14 15:22:26 -04:00
e1983adef4 PYAPI: Fix freestyle submodules without tocrees
Fixes 6 compile warnings
Follow up on rBf87ca5f1c314f67353b6111d3647aef159dc07c6
2017-06-14 14:42:44 -04:00
e70f887534 Cleanup: use consistent abbreviation for manipulator vars 2017-06-15 02:45:17 +10:00
1c20d194e1 Manipulator Properties
- Add a different kind of properties that use function callbacks
  instead of RNA.
  Needed for situations when there isn't 1:1 correspondence
  between the manipulator's position and the internal value.
- Move manipulator properties into their own file.
2017-06-15 02:44:22 +10:00
dbca1afefa Add an option to free scene without doing id-counters
This is similar to some other datablocks. Mainly applies to collections,
so freeing scene does not involve changing any non-directly owned data.

There are two main usecases foreseen for the future:

- Less CPU ticks on bmain free, where everything is freed anyway and
  there is no need to preserve id counters.

- Easier freeing of temporary data, including data which is used by
  depsgraph's copy-on-write mechanism.

Neither of those are currently implemented, but will be shortly.
2017-06-14 16:59:52 +02:00
c59abb4c9a Implement hair in eevee
New implementation of hair for Eevee.

Note: A hard coded "transmission" property is being used. This should
eventually be exposed to the UI, possibly in the form of SSS
properties.
2017-06-14 14:04:36 +02:00
0d9611718d Temporarily disable material preview (T51796 workaround)
This stops the memory breakage caused by the material preview jobs,
to enable the new hair drawing implementation.

(This should be reverted once T51796 is actually fixed!)
2017-06-14 14:03:58 +02:00
28af03c1c2 Merge branch 'master' into blender2.8 2017-06-14 12:02:58 +02:00
481cf2982b Depsgraph: Cleanup, indentation 2017-06-14 12:01:52 +02:00
6656af2d11 Merge branch 'master' into blender2.8 2017-06-14 11:17:13 +02:00
20e5052a72 Remove unused bmain argument from BKE_libblock_free_data 2017-06-14 11:16:34 +02:00
48cd25a11a Merge branch 'master' into blender2.8 2017-06-14 10:54:58 +02:00
97f9f90986 Cleanup: Indentation got broken in previous commit 2017-06-14 10:54:30 +02:00
edad3076a9 Merge branch 'master' into blender2.8 2017-06-14 10:48:20 +02:00
1e6ad49dca Add utility function to free memory used by a datablock
This function is similar to BKE_libblock_free but does no DEG
tagging or any extra things, just operates on memory.
2017-06-14 10:45:20 +02:00
07c7bbef0d Merge branch 'master' into blender2.8 2017-06-14 10:11:18 +02:00
bbd0d43417 Depsgraph: Remove unused ID node removal 2017-06-14 10:10:52 +02:00
64aa0cff89 Cycles: Fix typo in comment 2017-06-14 09:54:07 +02:00
0e44c1af38 Merge branch 'blender2.8' into custom-manipulators 2017-06-14 17:19:01 +10:00
26efc7bbd1 Merge branch 'master' into blender2.8 2017-06-14 17:17:00 +10:00
2462320210 Fix buffer read error w/ 2 pass select queries
Also don't do second pass when the first has no hits.
2017-06-14 17:10:24 +10:00
e073bb66bd Cleanup: rename callbacks 2017-06-14 16:27:44 +10:00
Julian Eisel
a394d68177 Fix possible heap use-after-free in workspace lib-linking
Caused by one of the recent commits during workspace review.
2017-06-14 00:09:37 +02:00
Julian Eisel
c9de10a632 Fix compiling blenderplayer (tm) 2017-06-13 23:40:31 +02:00
Julian Eisel
0095f4f834 Fix T51794: Crash on hair file when opening with no UI
Just a workaround for now.
2017-06-13 23:37:37 +02:00
5530aa6aaa Cleanup: remove DNA_manipulator_types.h 2017-06-14 04:14:32 +10:00
6bb897a76d Cleanup, rename callbacks 2017-06-14 03:19:53 +10:00
98bcc65543 Edit to last commit, add string versions of add-remove 2017-06-14 02:50:42 +10:00
aff22a4b39 RNA/Py API for runtime add/remove
WindowManager.manipulator_group_type_add/remove
2017-06-14 02:37:02 +10:00
be4cf933ab Merge branch 'master' into blender2.8 2017-06-13 17:45:36 +02:00
f02e04f133 Add utility function to get size of given ID type
Optionally it'll also give name used for memory allocation.
2017-06-13 17:42:31 +02:00
Dalai Felinto
6ea6c51670 Better Fix for T51777: Separating objects by selected vertices
This reverts commit 47b9d0d040. And
implement a fix that doesn't require Depsgraph refresh.
2017-06-13 16:31:42 +02:00
b37c589319 Further changes to manipulator API's.
These changes are intended for operators to register their own
widget-types temporarily, so _every_ operator that uses manipulators
doesn't need to keep them continuously polling the view to check if the
operator is running.

- Register `wmManipulatorGroupType` globally (like all other RNA types).
- Add `wmManipulatorGroupTypeRef` for type-maps to reference groups.
- Remove `wmManipulatorMapType.idname` (spaceid & regionid are enough info).
- Add PERSISTENT flag for `wmManipulatorGroupType`
  intended for use with operators so loading a new file for eg doesn't
  keep the manipulator type around.
2017-06-14 00:04:35 +10:00
7cfa6094ab Merge branch 'master' into blender2.8 2017-06-13 15:11:58 +02:00
6becdf5d00 Depsgraph: Pass function bindings by const reference
Avoids using copy-constructor invoked every time we pass function
to the builder functions.

Should lower number of CPU ticks spent during DEG construction.
2017-06-13 15:10:29 +02:00
4577bda634 Merge branch 'master' into blender2.8 2017-06-13 14:16:43 +02:00
90bc882068 Depsgraph: Remove root node concept
Was rather weird and only used for time source. It is simpler to make depsgraph
to keep track of time source directly.

No need to introduce extra entitites without actual need.
2017-06-13 14:13:55 +02:00
Hristo Gueorguiev
6cfa3ecd4d Fix T51791: Point Density doesn't work on GPU 2017-06-13 13:50:27 +02:00
b0b83c0db4 Draw manager: Fix initialization of static struct
It's first member is a multi-dimensional array, so proper way to initialize that
is to use multiple levels of braces.
2017-06-13 12:20:20 +02:00
4c6cb33764 Draw manager: Don't check matrix to be non-NULL
It isn't a pointer, so the check was confusing and totally redundant.
2017-06-13 12:17:55 +02:00
56ad2f0f1a Woarkspace: Remove residue of hidden type
There is no reason to be special for workspace and go against other design
decision in Blender. If something like this is going to become a common
practice in Blender it should be well thought and well tested, including
tests of all supported compilers and configurations.

This feature was relying on type re-definition, which is not only confusing
but also available in C11 only.
2017-06-13 12:02:08 +02:00
40c04dd649 Cycles: Cleanup, indentation 2017-06-13 10:28:38 +02:00
0aa5431998 Cycles: Fix compilation error of OpenCL mega kernel
Was some mismatch in address space. Seems to be caused by recent additions.

Additionally, moved decoupled ray marching functions under ifdef, so they
don't try to use malloc() functions.

Thanks Mai for testing the patch!
2017-06-13 10:26:45 +02:00
7dd24427ef Move manipulator type API into its own file 2017-06-13 17:47:45 +10:00
0b1e9ff65d Support dynamic registration w/ RNA widget types
Dynamically registered types are now correctly initialized in each view.
2017-06-13 16:48:59 +10:00
04f7eca61a Remove unused register+init functions
This needs to be split out for dynamic registered types anyway.
2017-06-13 15:15:09 +10:00
eaadfdbdc0 CMake: add missing includes 2017-06-13 14:51:15 +10:00
ea4ffbe0e9 Merge branch '28' into custom-manipulators 2017-06-13 14:18:59 +10:00
Dalai Felinto
47b9d0d040 Fix T51777: Separating objects by selected vertices in Eevee causes crash
I considered just copying the evaluated data from the LayerCollection.
However we need to run the evaluation so Depsgraph can handle overrides.

I will double-check with Sergey Sharybin.
2017-06-12 18:35:39 +02:00
Dalai Felinto
193a1df8fa Renaming: *_Iterator_begin/next > *_iterator_begin/next 2017-06-12 18:19:54 +02:00
2270ca9023 Merge branch 'master' into blender2.8 2017-06-12 16:55:57 +02:00
85fafccb4c Depsgraph: Remove residue from partial updates support 2017-06-12 16:55:04 +02:00
Dalai Felinto
109447d008 Draw Manager: Fix memory issues when copying scene 2017-06-12 16:12:33 +02:00
Dalai Felinto
8ca497b911 Depsgraph: Traversing should be consistent for nodes and relationship
We need to traverse the same exact objects for both nodes and relationship
builder. We were using FOREACH_SCENE_OBJECT for relationships, which
would lead to plenty of warnings in multiple situations.

In the future we will need to change this to build the depsgraph
relations and nodes to one single render_layer.

Fix T51780: If an object is in two collections and I do a full copy of
scene things go bad
2017-06-12 16:08:57 +02:00
0f4f4d8754 Merge branch 'master' into blender2.8 2017-06-12 15:12:36 +02:00
d8957e4cce Depsgraph: Use depsgraph from handle rather than from scene
This way the code is more decoupled from the way where depsgraph is stored.
2017-06-12 14:45:43 +02:00
1ba6ef25b6 Depsgraph: Add utility function to get depsgraph from node handle
The idea is to use this function for modifiers' updateDepsgraph functions
instead of doing direct scene->depsgraph access.
2017-06-12 14:41:46 +02:00
987ec1d030 Depsgraph: Remove outdated comment 2017-06-12 14:25:05 +02:00
f52dc2f371 Rename probe to light-probe
Probe is a real general term, the new name is used often in docs online.
2017-06-12 21:34:55 +10:00
a27e361495 Merge branch '28' into custom-manipulators 2017-06-12 14:44:46 +10:00
12bd960df9 Fix crash drawing non-mesh geometry 2017-06-12 14:43:19 +10:00
00c4f49a6d Cleanup: indentation, long lines 2017-06-12 13:38:21 +10:00
5ccaef6d67 Fix T51737: Material properties error
D2706 by @knox
2017-06-12 12:55:47 +10:00
1bd6ed7128 Correct gtest EXPECT use 2017-06-12 10:25:18 +10:00
Hristo Gueorguiev
04530c9383 Cycles: adjust supported driver version for AMD GPUs
On Windows 17.Q1 and 17.Q2 return driver version 2236.10.
2017-06-11 23:17:46 +02:00
Julian Eisel
09eb11363e Use two decimal places for UI scale User Preference option 2017-06-11 22:59:54 +02:00
eb1cde5a81 GTest: initial kdopbvh test
Currently only find-nearest, ray-casting needs to be added.
2017-06-11 19:10:33 +10:00
dfd8b38e0c BLI_kdopbvh: add ifdef's for debugging info
Allow to quickly enable print & tree verify.
2017-06-11 18:56:56 +10:00
558bea2252 Cycles Denoising: Add more failsafes for invalid pixels
Now, when there is no usable neighboring pixel for denoising, the noisy value
is preserved instead of producing a NaN.
Also, negative results are clamped to zero.

Note that there are just workarounds that don't fix the underlying problems,
but these issues are very rare and I'm not sure if it's even possible to fix
the underlying problems without introducing a significant slowdown or quality
decrease in other situations.
Because of that and since 2.79 is happening very soon, I just went for these
workarounds for now.
2017-06-11 01:51:39 +02:00
Julian Eisel
0dd6e5bfee UI: Replace placeholder icons in object-add menu
Replaces the placeholder 'emtpy' icons of "Force Field" and "Group
Instance" entries in object-add menu with proper new ones.

Icons by @zlsa, thanks a lot!

Maniphest task T51291.
2017-06-10 16:47:21 +02:00
c2f6ca313e Draw Cache: fix probe vbo size 2017-06-10 13:57:39 +02:00
e097fc4aa6 Cycles: Selectively include denoising in kernel 2017-06-10 04:45:13 -04:00
eb293f59f2 Cycles: Pass all buffers to each kernel call for OpenCL
Technically not passing all buffers used by a kernel is undefined
behavior. We haven't had any issues with this so far on AMD or
Nvidia, but it's known to be a problem with Intel and we received
a report from AMD that this is a problem on newer hardware, so we
need to make this change at some point.

Unfortunately there a cost to being correct, about 5% for the
benchmark scenes. For low sample counts it's even worse, I've
seen up to 50% slowdown. For the latter case I think adjusting
tile updating logic can help, but not sure what that would look
like yet (it would be just a few lines change however).
2017-06-10 04:08:49 -04:00
6238214159 Cycles: Faster split branched path tracing by sharing samples with inactive threads
Unlike regular path tracing, branched path tracing is usually used with lower
sample counts, at least for primary rays. This means that are less samples for
the GPU to work on in parallel and rendering is slower. As there is less work
overall there is also more inactive threads during rendering with BPT. This
patch makes use of those inactive rays to render branched samples in parallel
with other samples.

Each thread that is preparing for a branched sample will attempt to find an
inactive thread and if one is found the state for the sample is copied to that
thread. Potentially, if there are enough inactive threads, 100s of branched
samples could be generated from the same originating thread and ran in
parallel giving large speed ups.

Gives 70% faster render for pavillion midday scene. 20-60% faster on BMW
with car paint replaced with SSS/volumes.
2017-06-10 04:08:49 -04:00
32299d32e7 Cycles: Modify path_radiance_accum_sample to use atomics for split kernel
Samples ran in parallel need a safe way to accumulate their results
with the results of other threads.
2017-06-10 04:08:02 -04:00
6995b50e41 Cycles: Add function to dequeue a ray 2017-06-10 03:51:18 -04:00
4360e8ce13 Cycles: Add atomic decrement functions to util_atomic.h 2017-06-10 03:51:18 -04:00
ea846a4dfc Cycles: Add kernel to enqueue inactive rays
The queue will be used to make reuse of inactive threads to keep
the GPU more busy.
2017-06-10 03:51:18 -04:00
Hristo Gueorguiev
1f0998baa7 Cycles: Blacklist unsupported OpenCL devices
Due to various driver issues with AMD GCN 1 cards we can no longer support
these GPUs. This patch makes them unavailable to select for Cycles rendering.

GCN cards 2 and higher are still supported. Please use the most recent
drivers available to ensure proper functionality.

See here for a list to check which GPUs are supported:
https://en.wikipedia.org/wiki/List_of_AMD_graphics_processing_units
2017-06-10 03:51:18 -04:00
af2a93a94e Merge branch '28' into custom-manipulators 2017-06-10 15:34:22 +10:00
a5b3df7545 Rename node_widgets -> node_manipulators 2017-06-10 10:59:19 +10:00
054a6a06f2 Missed last commit 2017-06-10 10:59:16 +10:00
11d90f0f3b Manipulator Update/Refactor
Sync with custom-manipulators branch

- Use identifiers for properties.
- Property array index access.
- Remove operator from manipulators
  (wasn't used and will likely add in a different way).
2017-06-10 10:42:35 +10:00
fa1145d475 Cleanup: consistent naming
Use shorter names for manipulator
2017-06-10 10:20:54 +10:00
e24950052b Merge branch '28' into custom-manipulators 2017-06-10 09:18:56 +10:00
072f3c5723 Replace array of properties with a named list
This is useful for Py/RNA access.

Add support for indexing arrays too.
2017-06-10 09:16:43 +10:00
0a5e9e2f56 Probe: Small UI improvments
-Better falloff default.
-Add clip distance visualisation.
-Reformat UI and add a display panel.
2017-06-10 00:36:33 +02:00
b35f562e18 Eevee:Uuse compressed format for probes.
One 1024px² octahedral probe (according to the GPU mem stats):
- RGBA16F = 17Mb
- RGB_11_11_10 = 4Mb
For the time being I prefer to maximize the number of probe possible in the scene for users to test.
This is obviously a temporary solution and the final choice of cubemap format should be exposed to the user.
2017-06-09 23:51:48 +02:00
97a77b43be Eevee: Probe: fix roughness bug and optimize probe evaluation. 2017-06-09 23:24:51 +02:00
a17bb772a0 Probe: Add object mode volume visualisation 2017-06-09 23:21:55 +02:00
85990343f6 Probe: Remove Bounding Box parameter.
After using it for like 30 sec, the min max bound box is absolutely not practical. Reverting into using a unit cube with object transform.
This also simplify the code.
In the future of center probes will be implemented using another object matrix (via an object pointer).
2017-06-09 23:21:23 +02:00
c73206acc5 Cycles: Fix denoising passes being written when they're not actually generated 2017-06-09 23:02:56 +02:00
0a898e2405 Cleanup Cycles Denoising platform-specific defines 2017-06-09 22:38:16 +02:00
7dc51f87ed Cycles Denoising: Speedup reconstruction by skipping near-zero weights 2017-06-09 22:38:16 +02:00
20572497a4 Eevee: Add parallax correction to probe reflections 2017-06-09 22:30:49 +02:00
f0bbb67e8a UI: Fix some small ui inconsistencies
- Use "..." to indicate non immediate action.
- First letter of words in labels should be capitalized.
2017-06-09 15:25:17 -04:00
Julian Eisel
da30509725 Fix failing render-layer tests after workpsace commit 2017-06-09 19:30:14 +02:00
ebb2c1511b Fix missing updates when changing probe's clipping
Probes were completely out of depsgraph, so tagging them could not work at all.

For now using some placeholder operations just to ensure order of updates.
2017-06-09 18:06:10 +02:00
Dalai Felinto
dadb99074c Fix crash when using sculpt dynamic smooth 2017-06-09 17:32:51 +02:00
Julian Eisel
2bb004e03d Fix crash when deleting active workspace render-layer
Also fixes some failing unit-tests for render-layers.
2017-06-09 17:17:28 +02:00
Dalai Felinto
f35df9a25a Draw Manager: stop using stack memory!
We still do it a few times, but that helps already. Related to T51718.

Note that it also reinforces the idea that any geometry datablock will
have a generated copy-on-write Mesh provided by Depsgraph.
2017-06-09 16:39:36 +02:00
Dalai Felinto
35f8a02496 Implement a new util function to get reference of mesh tex space 2017-06-09 16:39:36 +02:00
e0bc5b533c Cleanup: get rid of some now unused animdata ID management custom functions.
That's the kind of commit that are nice to do - getting rid of
half-working custom pieces of code, now that we have generic tools
to do same thing. ;)
2017-06-09 16:30:59 +02:00
f097e73a2a Fix crash when making local object+obdata with linked armature.
Reported by Andy Goralczyk (@eyecandy) over IRC, thanks!

Simply nuke all that poor broken custom one-by-one handling in
object_relations.c code, and use highly complex but powerful and
well-tested BKE_library_make_local() in all cases of MakeLocal!

ID management, especially related to linking, is very hairy matters,
better to have as few as possible core functions managing all the dirty
details. ;)
2017-06-09 16:30:59 +02:00
ccc625ce23 Eevee: Fix crash when saving file / opengl render. 2017-06-09 15:01:32 +02:00
37f8c03ab3 Add arrow and dial manipulators with RNA access 2017-06-09 20:41:17 +10:00
Dalai Felinto
ee93bc806b Eevee DoF: Use more reasonable UI range for anamorphic bokeh
Regular camera lens have a ratio of 1.0. The anamorphic bokeh can be
used freely as an artistic decision, but it's nice to clamp it to 2.0,
to match real cameras.

That end up giving a reference for artistis playing with the
parameters unaware of the more realistic limits.
2017-06-09 11:56:40 +02:00
Dalai Felinto
461ea375ad Fix T51720: Depth of Field Bug - Black Screen 2017-06-09 11:56:22 +02:00
e15cde73b1 Merge branch 'blender2.8' into custom-manipulators 2017-06-09 19:51:59 +10:00
bb773acd5f Merge branch 'master' into blender2.8 2017-06-09 19:40:47 +10:00
d7f33668d6 Math Lib: Add mat3_from_axis_conversion_single
Single axis version of mat3_from_axis_conversion,
when the second axis isn't important (orienting an arrow for eg).
2017-06-09 19:31:27 +10:00
d583af0026 Fix T51756: Fix crash when transforming vertices in edit mode
The issue was caused by under-allocation of UV islands calculation.
2017-06-09 10:46:00 +02:00
16ecd0b79e Fix T51750: Group selection broken
Proper way, no base is involved.
2017-06-09 10:04:12 +02:00
ab4b7b5368 Fix T51648: Inconsistent edge collapse point depending on orientation
Edge collapse was using bounding box center as the point to collapse to.
When collapsing multiple adjacent edges together, this caused
inconsistencies in placement of the collapsed point, depending on the
orientation of the edges in relation to the space axis.

This makes edge collapse use the mean point instead.
2017-06-09 10:03:46 +02:00
a46a168705 install_depsh: update OpenCollada to 1.6.51, and OIIO to 1.7.15 2017-06-09 09:44:40 +02:00
Dalai Felinto
3a60b4511e Revert "Fix T51750: Group selection broken"
This reverts commit 484e3527d1.
2017-06-09 09:42:08 +02:00
58de2164c9 Fix for fix for bplayer (c) :/ 2017-06-09 09:23:54 +02:00
03a5da0a63 Fix bplayer building (c) 2017-06-09 09:13:54 +02:00
98e50c0881 RNA: Expose face-map manipulator to Python 2017-06-09 16:28:47 +10:00
b93e52d752 Missed last commit 2017-06-09 15:55:27 +10:00
8b91a7e8e9 Rename intersect callback to test_select
Be specific since this isn't for general intersection tests.
2017-06-09 15:51:59 +10:00
3e0a09f604 Cleanup: shorten struct member names
For wmManipulatorMap the its clear from the context we're
operating on manipulators.
2017-06-09 15:40:37 +10:00
48115c08e0 Remove unused widget/operator integration
While this is a useful feature, current integration is untested
and stored the operator in the wmManipulatorGroupType
instead of its instance.
2017-06-09 14:52:48 +10:00
ee36ae1356 Expose wmManipulatorGroupType.setup & refresh callbacks 2017-06-09 14:32:38 +10:00
705c43be0b Cycles Denoising: Merge outlier heuristic and confidence interval test
The previous outlier heuristic only checked whether the pixel is more than
twice as bright compared to the 75% quantile of the 5x5 neighborhood.
While this detected fireflies robustly, it also incorrectly marked a lot of
legitimate small highlights as outliers and filtered them away.

This commit adds an additional condition for marking a pixel as a firefly:
In addition to being above the reference brightness, the lower end of the
3-sigma confidence interval has to be below it.
Since the lower end approximates how low the true value of the pixel might be,
this test separates pixels that are supposed to be very bright from pixels that
are very bright due to random fireflies.

Also, since there is now a reliable outlier filter as a preprocessing step,
the additional confidence interval test in the reconstruction kernel is no
longer needed.
2017-06-09 03:46:11 +02:00
3b9e8b385c Fix compilation issue 2017-06-09 01:28:43 +02:00
67913c603c Probe: Add influence display and rework UI. 2017-06-09 01:15:17 +02:00
e45ebec335 Probes: Add more parameters.
Add Min Max for box, and distance for sphere falloff.
Same for parallax.
Add clip distances.
2017-06-09 01:15:17 +02:00
974c0cc7b6 Eevee: First commit of Probe support. 2017-06-09 01:15:17 +02:00
cadb950490 Draw Manager: Add request redraw method.
This is extremly hacky and against notifier design. This must be revisited later.
We might want to mimic external renderer way of requesting redraw.
2017-06-09 01:15:17 +02:00
1ee5d08c95 Draw Manager: Add support for temporary matrix override.
This allow to specify custom matrices for certain specific passes.
2017-06-09 01:15:17 +02:00
4abb3c1bc4 Draw Manager, GPUTexture: Add support for binding individual cubeface to framebuffer. 2017-06-09 01:15:17 +02:00
c1009af596 Probe: Add panel and "Add-menu" items.
Also revisits defaults.
2017-06-09 01:15:17 +02:00
4df449edd5 Probe: Add initial visualisation 2017-06-09 01:15:17 +02:00
f6898f9ae5 Probe: fix some missing bits / errors in RNA ... 2017-06-09 01:15:17 +02:00
618aef1e58 Eevee: Fix normal orientation on default shader. 2017-06-09 01:15:17 +02:00
73949ffbf3 DNA_ID Fix comment 2017-06-09 01:15:17 +02:00
cc31d7bb49 Probe: Add new object datablock
We went for a new datablock because blending probe functionality with empties was going to be messy.
2017-06-09 01:15:17 +02:00
44a8616084 Rename RNA wrapper calls 2017-06-09 07:39:37 +10:00
346619159a Merge branch 'master' into blender2.8 2017-06-09 07:21:43 +10:00
8a757bf34a RNA: remove static strings from registration
* Static strings aren't needed anymore, use stack memory.
* Fix obscure leak on failed macro registration.
* Use prefix for wrappers exported from bpy module.
2017-06-09 07:20:25 +10:00
46c073e4ac Cleanup: cmake indentation, missing include 2017-06-09 06:45:21 +10:00
3e62e9101c Fix for manipulator identifier string duplication
Also no need for static buffers
2017-06-09 06:03:04 +10:00
ebcde286d8 Expose wmManipulatorGroup.bl_options 2017-06-09 05:24:42 +10:00
409756e65f Cleanup, naming (init and Python's __init__ too similar) 2017-06-09 04:51:05 +10:00
f5a0199a70 Merge branch '28' into custom-manipulators 2017-06-09 04:25:23 +10:00
e9c022b7d3 Using default keymap now works for RNA manipulators
All widget groups must now define a name and idname.

Also fix crash where keymap's wouldnt be initialized for runtime
registered types.
2017-06-09 04:21:45 +10:00
Dalai Felinto
836c3c14cc Remove unused lay value from Dupli object evaluation context 2017-06-08 19:28:54 +02:00
Dalai Felinto
c5daddbef3 Revert "Fix some groups not showing in the viewport"
This reverts commit c19fedf636.
2017-06-08 19:03:42 +02:00
Dalai Felinto
c19fedf636 Fix some groups not showing in the viewport
If the group was freshly created in 2.8 from a new object, this will prevent the object to be shown.
2017-06-08 19:03:38 +02:00
Dalai Felinto
484e3527d1 Fix T51750: Group selection broken
This was introduced in 23c93873f4.

This could be moved to deg_flush_base_flags_and_settings but since we
only need this for duplis I think it's fine to be handled separately.
2017-06-08 19:00:30 +02:00
070dd04a2a Cleanup widget API
Rename handler -> modal (matches operator)
2017-06-09 00:13:32 +10:00
9bcc44d505 Depsgraph: Avoid over-documentation
The comment adds zero information.
2017-06-08 16:12:04 +02:00
2335bfeaa0 Avoid allocation of evaluation context for iterator
Use stack-allocated context when possible.
2017-06-08 16:11:14 +02:00
c71e160c02 Fix T51733: 3d print toolbox checks report false positives.
Colinear vertices in a same face would not be handled correctly.
2017-06-08 14:05:36 +02:00
123af0cd5f Unregister support for manipulator type 2017-06-08 21:32:02 +10:00
6a546fc73e Cycles: Don't leave multiple spaces in the device name 2017-06-08 12:15:24 +02:00
45d3e22204 Cycles: Display optional board name in system info 2017-06-08 12:10:15 +02:00
78c0f09d4f Cycles: Cleanup, indentation 2017-06-08 12:03:08 +02:00
17ff2ab254 RNA: Add registerable wmWidgetType
Works on a basic level - creating Python widgetgroups and widgets, drawing.
Still lots more to do though.
2017-06-08 19:26:21 +10:00
2f9cfda459 Fix compilation error after recent depsgraph cleanup 2017-06-08 10:59:33 +02:00
23c93873f4 Remove selection color from the base
Use indirect access to it via object.

It was already flushing from base to object, now we can avoid such flushing.

Still weird to have selection color filled in by dependency graph, but now
there is no synchronization going on at least.
2017-06-08 10:46:45 +02:00
d675415eef Replace all old DAG calls with direct calls to new DEG and remove BKE_depsgraph.h
This removes BKE_depsgraph.h and depsgraph.c
2017-06-08 10:17:04 +02:00
ff6b249046 Simplify Array modifier 'relative offset' handling.
Was looping three times over the source mesh's vertices to get min/max
along all three axes... Nothing critical, but still!
2017-06-08 09:17:08 +02:00
c7612fca5f Merge branch '28' into custom-manipulators 2017-06-08 08:05:30 +10:00
7f480352ca WM: move manipulator library into editors
As with operators, the window-manager has the API for defining,
the editor can implement and register its own manipulators.

This exposes wmManipulator, keeping it opaque isn't
practical if editors and Python are to implement their own.
2017-06-08 07:42:17 +10:00
bfa5efeebe Fix MSVC compile (T51740)
Gawain doesn't include Blender's cross-platform "inline" definition. This change slipped in as part of D2697.
2017-06-07 16:28:24 -04:00
179bb97740 Gawain: stricter lookup of builtin uniforms
UNIFORM_NONE should never match a valid uniform (builtin or custom).

The logic for UNIFORM_CUSTOM was just wrong, since it returned the first custom uniform. This function should only accept builtin (non-custom) uniforms.
2017-06-07 16:20:37 -04:00
bb3e669d06 Gawain: faster lookup shader attribs by name
Quick hash rejection instead of string comparison. Uniform lookups already work this way. I don't expect a major overall speedup since attributes are looked up less frequently than uniforms.
2017-06-07 16:20:37 -04:00
a5242d08fb cleanup floating point literals 2017-06-07 16:20:37 -04:00
7783645c9f Merge branch '28' into custom-manipulators 2017-06-08 05:36:15 +10:00
575db256db WM: add wmManipulatorType, from wmManipulator
Having the type in mixed in with each instance
made it hard to expose types to RNA/Python.
2017-06-08 05:30:21 +10:00
d0aa8af9c9 Add wmManipulatorType, extract from wmManipulator
Having the type in mixed in with instance
made it hard to expose types to RNA/Python.

This disables face-map select,
we could enable it but it looks like face maps will be made to work
differently.
2017-06-08 05:02:39 +10:00
d25ab3fcc4 Fix: GP Clone brush was not correcting color references for pasted strokes either 2017-06-08 03:23:31 +12:00
2bd49785f9 Fix: Pasting GP strokes files between files (or when the original colors were deleted) would crash
The problem was that the strokes in the copy-paste buffer could be keeping
dangling pointers to colors that were already freed. Therefore, this commit
makes it so that when copying the strokes, we now make copies of the colors
and put them in a hashtable beside the stroke buffer. This is convenient,
as it saves us having to look up what colours need to be copied over each
time when pasting.
2017-06-08 03:23:30 +12:00
7667040dd0 GP Copy/Paste Fix: Paste button doesn't update after copying strokes using Ctrl-C 2017-06-08 03:23:29 +12:00
89d4164f54 GPencil Copy/Paste Fix: Copying/Pasting strokes between datablocks would crash
The problem was that newly pasted strokes were still using colours from
the original datablock. As a result, you'd either get an immediate crash,
or if you managed to save the file before it crashed, each stroke would get
reloaded with a dummy colour.

This commit fixes makes it possible to copy/paste strokes between datablocks
again. However, there are still problems when trying to paste across file
boundaries (i.e. copy strokes in one file, paste in another), which the next
commit will address.
2017-06-08 03:23:29 +12:00
3159f14daa Rename py API files
Will use for manipulator and manipulatorgroup.
2017-06-08 00:20:46 +10:00
99e9e4c5ca Merge branch '28' into custom-manipulators 2017-06-08 00:07:48 +10:00
8ff1bce40f Manipulators: lamp, camera & force-field
From custom-manipulators branch.
These may be improved they work on a basic level.
2017-06-07 23:56:24 +10:00
8d8ae5cb16 Sync with 2.8, various minor redundant changes 2017-06-07 23:28:20 +10:00
ed84388e7d Bevel Op (internal and API) now returns new edges and verts as well as
faces.

This was requested by script writers. Especially needed if beveling
wire edges with vertex_only.
Should be backward compatible as just adds two new keys to returned
dict in python ('edges' and 'verts').
2017-06-07 08:53:10 -04:00
e6b7e9942e sync with 2.8 2017-06-07 22:27:36 +10:00
d68f80182b Merge branch '28' into custom-manipulators 2017-06-07 22:22:09 +10:00
cff176df37 Minor manipulator API changes
Sync up with custom-manipulator branch
2017-06-07 22:13:31 +10:00
3b6facb3d2 Merge branch 'master' into blender2.8 2017-06-07 14:09:53 +02:00
a3bb309275 Depsgraph: Remove modifiers operation code
Was internally a no-op operation, which only caused extra work
to be done during depsgrpah traversal and evaluation, without
making any measurable improvement.
2017-06-07 14:08:11 +02:00
008e16c83e WM: move manipulator API into its own files
Getting to be a hassle to track multiple manipulator classes
and callbacks.
2017-06-07 22:01:30 +10:00
421beeb6e4 WM: add box preset and expose colors 2017-06-07 21:25:16 +10:00
b31e84a4b3 Depsgraph: Remove unused operation codes 2017-06-07 12:53:38 +02:00
8be55193c9 Depsgraph: Remove dead/unused operation codes 2017-06-07 12:47:19 +02:00
00b009ca74 Merge branch 'master' into blender2.8 2017-06-07 12:18:07 +02:00
5489b40a5a Report OpenSubdiv version Blender is compiled against 2017-06-07 12:16:48 +02:00
3fe73c72d6 Collada: Add search path which is used default by it's SCons build system 2017-06-07 11:38:35 +02:00
Dalai Felinto
6fee241db5 Merge remote-tracking branch 'origin/master' into blender2.8 2017-06-07 11:38:03 +02:00
Dalai Felinto
29ace10f7e gcc5 has issues with Wconversion
This leads to a crash in 2.8, but commiting here.
Patch by Campbell Barton.
2017-06-07 11:37:28 +02:00
ce18956d9b Optimization of tangent calculation
Avoid doing string comparison when we already know layer is
to be added to bitfield.
2017-06-07 11:25:05 +02:00
8671b44fe5 Merge branch '28' into custom-manipulators 2017-06-07 15:54:53 +10:00
e17a90074f WM: remove unused return values 2017-06-07 15:49:50 +10:00
560ecfac4e RNA wrap other functions 2017-06-07 03:22:22 +10:00
Dalai Felinto
7f01329a84 Small cleanup: Use ELEM and wrong identation 2017-06-06 18:57:47 +02:00
Dalai Felinto
6d2aabc1d0 CMake: Update clay engine message 2017-06-06 18:57:47 +02:00
46f659ba2d Eevee: Fix shader compilation issue. 2017-06-06 18:27:59 +02:00
81615ddf86 Cycles: Fix infinite update when using duplis
The issue was caused by usage of address of dupli-object (which will vary
from iteration process to iteration process) as something denoting whether
we've got the data synchronized to Cycles or not.

For now solved by using address of original object (the one DupliObject
points to) as a pointer for the map.

Need to do more thoughts about this.
2017-06-06 16:30:14 +02:00
Dalai Felinto
cb97b07e23 Draw Manager: Prevent misuse of static draw context
This is supposed to help catch bugs if referrencing stack data out of
the draw loop context.

No change is suppose to happen for users (specially because the changes
here happens mostly on debug).

It includes a change in the logic for render loop, to make sure DST is
not accessed before we enter it - contribution by Campbell Barton.
2017-06-06 16:20:39 +02:00
ca137a25e8 Merge branch 'blender2.8' into custom-manipulators 2017-06-06 23:08:51 +10:00
ecdd76c91a WM: remove unused return values 2017-06-06 23:04:46 +10:00
ae6bfe9c19 Depsgraph: Cleanup, unused includes 2017-06-06 14:19:25 +02:00
ab1e87260f Merge branch 'blender2.8' into custom-manipulators 2017-06-06 22:19:24 +10:00
e1e41e4447 Cycles: Support rendering objects from dupli-list
This commit extends the work from Dalai made around scene iterators to
support iterating into objects from dupli-lists.

Changes can be summarized as:

- Depsgraph iterator will hold pointer to an object which created current
  duplilist. It is available via `dupli_parent` field of the iterator.
  It is only set when duplilist is not NULL and guaranteed to be NULL
  for all other cases.

- Introduced new depsgraph.duplis collection which gives a more extended
  information about depsgraph iterator.  It is basically a collection on top
  of DEGObjectsIteratorData.

  It is used to provide access to such data as persistent ID, generated space
  and so on.

Things which still needs to be done/finished/clarified:

- Need to introduce some sort of `is_instance` boolean property which will
  indicate Python and C++ RNA that we are inside of dupli-list.

- Introduce a way to skip dupli-list for particular objects.

  So, for example, if we are culling object due to distance we can skip all
  objects it was duplicating.

- Introduce a way to skip particular duplicators.

  So we can skip iterating into particle system.

- Introduce some cleaner API for C side of operators to access all data such as
  persistent ID and friends.

  This way we wouldn't need de-reference iterator and could keep access to such
  data really abstract. Who knows how we'll be storing internal state of the
  operator in the future.

While there is still stuff to do, current state works and moves us in the proper
direction.
2017-06-06 14:17:32 +02:00
d220e54f28 WM: manipulator callback arg order
Use same arg order for C & RNA
2017-06-06 22:16:12 +10:00
Dalai Felinto
d267d76540 Force crash on depsgraph iterator wrong access.
Related to T51718, so it crashes even when no fancy ASAN flags are used.
Patch suggestion by Campbell Barton.
2017-06-06 12:48:12 +02:00
47fd882e79 Merge branch 'master' into blender2.8 2017-06-06 12:17:07 +02:00
58a434b372 Depsgraph: Only use extern "C" when really needed 2017-06-06 12:14:39 +02:00
1846627ae0 BLI: Use C++ guards for stack header
This is handy to have C++ guards for BLI functions so they
can be easily re-used in C++ code. This matches other headers
from this library as well.
2017-06-06 12:13:45 +02:00
058aa20bb1 Merge branch 'blender2.8' into custom-manipulators 2017-06-06 20:11:26 +10:00
Dalai Felinto
a418e269c8 Draw manager: visibility of objects centers to mimic old 2.7x behaviour
We only show object center if object is selected, active or if viewport
has the "All Object Origins" options.

The viewport display options can migrate to renderlayer options.
However, we can mimic 2.7x as a compromise while the final design is
finalized.
2017-06-06 12:00:35 +02:00
28e44da860 Scene object iterator: Replace recursion with loop
This way we are not afraid of recursion being too deep.

That could have happened when having two collections which
are sharing same list of 1000s of objects.
2017-06-06 11:22:13 +02:00
4e1257f2d8 Make particle size follow world space instead of screen space 2017-06-06 09:57:18 +02:00
c681902bc8 PyAPI: Initial manipulator API
Only expose new/remove/clear & manipulator_draw function.
2017-06-06 17:33:35 +10:00
a45ca3c724 Merge branch 'blender2.8' into custom-manipulators 2017-06-06 17:13:58 +10:00
443904f1f4 WM: functions for assigning all manipulator callbacks
- Move callbacks into type struct.
- Rename render_3d_intersection -> draw_select.
- Add header for function signatures (needed for types and api headers).
- Add WM_manipulatormaptype_find
2017-06-06 17:09:01 +10:00
af32502dec Merge branch 'blender2.8' into custom-manipulators 2017-06-06 16:55:50 +10:00
97f023fb2d WM: functions for assigning all manipulator callbacks
- move callbacks into type struct
- rename render_3d_intersection -> draw_select
- add header for function signatures (needed for types and api headers).
2017-06-06 16:53:12 +10:00
2ebde4c82b Eevee: Optimize scene with a large number of objects.
Using a GHash to store the shgroup of every Material. This way we do not duplicates the DRWShadingGroups allocations on every object.
2017-06-05 22:05:37 +02:00
8abe421a0f Merge branch 'blender2.8' into custom-manipulators 2017-06-06 03:56:46 +10:00
6d4f084677 WM: pass manipulator-map when creating wmManipulatorGroup
Also store parent-pointer in wmManipulatorGroup's,
since its not always possible to access the parent pointer.
2017-06-06 03:34:09 +10:00
a28d2a16b7 Use term 'manipulator' for RNA instead of 'widget'
Annoying to have different names for RNA/DNA.
2017-06-05 23:33:32 +10:00
d4c06d6505 PyAPI: postpone initializing widget-group
Py callbacks don't work when class is in middle of registration.
2017-06-05 22:59:43 +10:00
a8b50c1689 PyAPI: widget group (un)register working again
WIP, not yet usable.
2017-06-05 22:11:38 +10:00
f8fe811987 Merge branch 'blender2.8' into custom-manipulators 2017-06-05 18:27:42 +10:00
e83001b782 Merge branch 'master' into blender2.8 2017-06-05 18:11:59 +10:00
cb4f7594a0 WM: add WM_manipulatorgrouptype_append_ptr
Needed for PyAPI registration.
2017-06-05 18:10:52 +10:00
0d428c674a WM: de-duplicate operator append code
WM_operatortype_append(_ptr) functions had diverged.
2017-06-05 17:57:57 +10:00
81d7ff8476 PyAPI: is_staticmethod used for classmethods's too
Add note to investigate this, don't change so close to release.
2017-06-05 16:09:39 +10:00
bd8377cb5a PyAPI: correct exception, expect 'staticmethod' 2017-06-05 15:31:05 +10:00
4ee9016e62 DwM: skip background-set objects w/ selection 2017-06-05 15:02:47 +10:00
f5e1b21895 Merge branch 'blender2.8' into custom-manipulators 2017-06-05 14:53:47 +10:00
7bff00b522 Fix alembic tests not running with debug build on windows 2017-06-04 17:05:59 -06:00
c838dd9de6 Clay Engine: Improve sampling of SSAO
Replace completly random noise by Blue noisen, giving a better aspect.
Also randomize the distance in the sample direction to cover the whole distance even with 1 sample. Using another blue noise for this.
Replace spiral samples (that had tendency to align if the number of samples was near the chosen constant) with Hammersley samples that have good coverage even for low number of samples.
Use a UBO instead of Texture (a bit less latency) making things a tiny bit faster.
Move the noise data to the SceneLayerData, because each render layer can have a different sample count.
2017-06-04 23:11:48 +02:00
288b54b5a7 Eevee: Modify Blue Noise. 2017-06-04 21:45:41 +02:00
819b8adb94 Eevee: Move Spherical Harmonics to a new Probe UBO.
Keep data packing tight to prevent use of padding floats
2017-06-04 16:50:22 +02:00
28b597b6df Eevee: Material code refactor.
Separate material handling inside another file.
Make use of enums to identify shader variations.
Group all 64*64 LUTs into one array texture.
Only update world probe if world changes.
2017-06-04 12:12:58 +02:00
8d1e6d7833 World: Add temporary update flag. 2017-06-04 12:08:34 +02:00
556942ec07 Fix T51587: Blender fails to interpret a specific layer in OpenEXR multilayer file 2017-06-04 00:58:38 +02:00
3fa2409002 Eevee: Fix compilation error 2017-06-03 01:43:25 +02:00
2851e91db4 Eevee: Cleanup. Group data functions into one file. 2017-06-03 00:54:01 +02:00
433bb91a37 Eevee: fix bad eye vector and get rid of two uniform 2017-06-03 00:54:01 +02:00
bc984fd09b Eevee: Reduce shadow map precision.
Since we only store linear distance now we don't need so much bytes per pixels.
2017-06-03 00:54:01 +02:00
403c6b1b8d Eevee: fix shadows artifact by clearing to max depth 2017-06-03 00:54:01 +02:00
d385ad3ce8 Eevee: fix light update when a shadow caster is deleted 2017-06-03 00:54:01 +02:00
0d52f8daea Eevee: Polishing of Exponential Shadow mapping
Added exponent parameter to tweak light bleeding.
Added depth bias to the shadow test.
Added better blurring using 32 samples.
2017-06-03 00:54:01 +02:00
4bd2de2030 UI: Change shadow map bias tooltip 2017-06-03 00:54:01 +02:00
e97085778b Eevee: Update Light data panel 2017-06-03 00:54:01 +02:00
04992a6ffc Object Mode Engine: Fix spot cone shader. 2017-06-03 00:54:01 +02:00
nBurn
420d4a70b8 PyAPI: Cleanup "Python API Overview" doc
Reword to clean up some odd grammar (mostly dangling modifiers) and
improve readability.

Differential Revision: https://developer.blender.org/D2699
2017-06-02 17:22:44 -04:00
68e5c082b8 Fix for crash/error drawing duplis
Drawing object centers used stack memory,
we don't want to draw these anyway so add check.
2017-06-03 02:21:10 +10:00
3db43918d2 Fix from merge 2017-06-03 00:41:15 +10:00
f6b9b452d8 Cleanup: Trailign whitespace 2017-06-02 16:08:53 +02:00
afa27f13e3 Merge branch 'blender2.8' into custom-manipulators 2017-06-03 00:00:17 +10:00
Dalai Felinto
8ff405ebd4 Fix logic for bitwise flags in bases during deg iterator
Spotted/reported by Sergey Sharybin.
2017-06-02 14:30:45 +02:00
Dalai Felinto
c5dccc9734 Fixup for 824bf261f7 so Cycles does not show dupli
Cycles is using rna_depsgraph, not rna_scene. Duplis are still not working there
but now at least it shows it was showing before the commit.

To show duplis in Cycles do:

-       data->flag = DEG_OBJECT_ITER_FLAG_SET;
+       data->flag = DEG_OBJECT_ITER_FLAG_ALL;
2017-06-02 13:05:15 +02:00
863f0434ec Fix T51691: Shear cursor input scales w/ zoom
Use relative value from cursor movement.
2017-06-02 20:40:41 +10:00
Dalai Felinto
9dddd73ee3 Silence annoying rna warnings from Eevee 2017-06-02 11:47:47 +02:00
Dalai Felinto
824bf261f7 Initial implememtation for dupli objects
Now dupli groups, objects, particles, ... are all working.

This introduces a flag for the iterator to determine whether we go over
Set and dupli objects or not.

Important to remember to keep the iteration of DEG_ as readonly.

Cycles is not working well for dupli groups, and it's memleaking
for dupli particles. So for now we iterate over main objects and set
only, not dupli.

To change that go in rna_scene.c and:

-DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_SET)
+DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_ALL)

Review and suggestions by Sergey Sharybin
2017-06-02 10:45:45 +02:00
f8ea2c92db Suppress assert for meshes with no faces 2017-06-02 16:42:39 +10:00
678a6b6c49 Fix T51695: Border select fails w/ lamps
Draw order doesn't match scene order when mixing object types.
2017-06-02 16:38:35 +10:00
eae486f5e6 Merge branch 'master' into blender2.8 2017-06-02 15:39:29 +10:00
0d8bf4bf94 Cleanup: style 2017-06-02 15:38:04 +10:00
cb23927c9b Fix View3D orientation index initial value
Would assert after transform
2017-06-02 15:21:56 +10:00
7beb173d70 Fix crash using non-camera object as camera
Also sync with master to avoid conflicts
2017-06-02 15:12:59 +10:00
nBurn
e1910ac6ed PyAPI: update to bpy.types.Operator.5.py
This is a minor update add more information on how Blender handles modal
operators. The existing docs provide a good overview, but might not be
as helpful to those unfamiliar with modal programming. This patch also
corrects a few small grammar issues.
2017-06-01 21:59:51 -04:00
f59b1179c5 Eevee: Tag shadow maps to update only when necessary.
Shadow maps are now only updated if one shadow casting object inside it's shadow bounds has been updated.
2017-06-01 23:54:36 +02:00
071315e21b DEG: Add per object update flag for Depsgraph.
This is in order to communicate what portion of this object has changed.
For now it's just a bool, but it will be extended later.
2017-06-01 23:54:36 +02:00
Julian Eisel
46fc0bb87e Move custom transform orientations to workspace
This commit moves the list of transform orientations from scenes to workspaces.
Main reasons for this are:
* Transform orientations are UI data and should not be stored in the scene.
* Introducion of workspaces caused some (expected) glitches with transform orientations. Mainly when removing one.
* Improves code.

More technically speaking, this commit does:
* Move list of custom transform orientations from Scene to WorkSpace struct.
* Store active transform orientation index separate from View3D.twmode (twmode can only be set to preprocessor defined values now).
* Display custom transform orientation name in header when transforming in it (used to show "global" which isn't really correct).
2017-06-01 20:46:18 +02:00
Julian Eisel
7f564d74f9 Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)

Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)

== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.

Opening files without UI and commandline rendering should work fine.

Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.

== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.

== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)

== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)

Reviewed By: campbellbarton, mont29

Tags: #user_interface, #bf_blender_2.8

Maniphest Tasks: T50521

Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:59:37 +02:00
Julian Eisel
0af93cf1ac Merge branch 'master' into blender2.8 2017-06-01 19:56:11 +02:00
020bbbb046 Remove comment (missed last commit) 2017-06-02 01:10:34 +10:00
3be073807b Fix T51651: translate w/ individual origins fails
Regression in fix for T46892
2017-06-02 01:04:11 +10:00
237e17a957 Merge branch 'master' into blender2.8 2017-06-01 16:31:56 +02:00
e5d8b04abe Depsgraph: Cleanup, line wraps after shortening API 2017-06-01 16:22:35 +02:00
df7d38c111 Depsgraph: Remove operation types enum
Was only used to indicate entry/exit operation of component,
which is now done explicitly. No reason to keep something which
is unused and confusing.
2017-06-01 16:22:35 +02:00
a72daea36e Depsgraph: use explicit marking of component entry/exit operations
This isn't used too often, and haivng such API will let us to skip
specifying operation type for all oeprations.
2017-06-01 16:22:35 +02:00
3a7361ec39 Depsgraph: Cleanup, use DEG_NODE_CLASS prefix for node classes 2017-06-01 16:22:35 +02:00
6799fb387d Depsgraph: Cleanup, use DEG_NODE_TYPE prefix for depsgraph node types 2017-06-01 16:22:35 +02:00
5bda458bce Depsgraph: Remove unused argument from time source query 2017-06-01 16:22:35 +02:00
a4925b05a7 Depsgraph: Remove subgraph nodes
Those were never finished nor used. Again, starting from clean
state before we go into more complicated details.
2017-06-01 16:22:35 +02:00
d492ae8893 Depsgraph: Remove dead code
Was never used or worked on in ages, if any of this code is
needed in the future it'll need to be redone anyway.
2017-06-01 16:22:35 +02:00
a13aa12d7c Depsgraph: Remove dead code from add_time_source()
This was never finished or done or used, no reason to keep it.
Better to simplify things before adding complexity of overrides
and copy-on-write.
2017-06-01 16:22:35 +02:00
a6bb98aef9 Depsgraph: Cleanup, get rid of relation type
It was never actually used apart from being stored at a construciton time.
This caused some redundancy and ncertanty about which relation type to use
during construciton (often existing types were not close enough to particular
use case).
2017-06-01 16:22:35 +02:00
d5d7455796 Cleanup: use row() sub-layout to expand enum properties horizontaly 2017-06-01 16:54:45 +03:00
3bc8e88643 GPUCodegen: fix missing ViewMatrix in new shading. 2017-06-01 13:23:06 +02:00
Dalai Felinto
7a5098f78e Fix blenderplayer build (ED_object_facemap*) 2017-06-01 12:45:23 +02:00
Dalai Felinto
6b77aba9fc Merge remote-tracking branch 'origin/blender2.8' into custom-manipulators 2017-06-01 12:43:38 +02:00
8c09826d58 Gawain: Optimize shader uniform access
Before this change Gawain was doing list lookup twice,
doing string comparison of every and each input which
is not efficient and not friendly for CPUs with small
cache size.

Now we store hash of input name together with actual
name and compare hashes first. Additionally, we do
everything in a single pass which is much better from
cache coherency point of view.

This brings Eevee cache population time from 80ms to
60ms on my desktop and from 800ms to 400ms for Clement
when navigating in a file from T50027.

Reviewers: merwin, dfelinto

Subscribers: fclem

Differential Revision: https://developer.blender.org/D2697
2017-06-01 12:33:41 +02:00
528ae8885e Fix T51687: GPUmat evaluation of shader tree would crash uppon unknown/unsupported socket types.
Made this resilient to unknown types, for now. Supporting specific INT
sockets (through implicit conversion to GPU_FLOAT ones) is considered nice TODO.
2017-06-01 12:18:57 +02:00
7d903fea7d Merge branch '28' into custom-manipulators 2017-06-01 19:42:08 +10:00
3c703df327 Correct select-similar end value 2017-06-01 19:41:19 +10:00
a0c668d8ed Merge branch '28' into custom-manipulators 2017-06-01 17:43:42 +10:00
8cf5eaa2ba Add Face-Map to select similar
Handy for setting up face-maps,
also allows selecting all faces with no assigned map.
2017-06-01 16:42:14 +10:00
e2b1c70b48 Fix bad index use drawing deformed face centers 2017-06-01 15:04:22 +10:00
e0216ea89b Clear pose draw data in BGE pose copy 2017-06-01 14:57:27 +10:00
ad0690f78f Missed when removing face-map DNA 2017-06-01 14:56:12 +10:00
562d137e39 Merge branch '28' into custom-manipulators 2017-06-01 14:05:44 +10:00
42e336728d Fix custom-bone display-at option 2017-06-01 13:54:29 +10:00
a5783d08f9 Resolve assert in weight paint mode w/ no weights 2017-06-01 13:37:18 +10:00
8b0f968a31 Fix bad handling of 'extra' user for groups at their creation.
Was just keeping the default '1' user from `BKE_libblock_alloc()`,
instead of using correct way to handle extra virtual user needed when we
want to keep unused datablocks around...
2017-05-31 21:24:41 +02:00
f783efd127 Fix T51680: 'Delete Group' from Group view of Outliner does not work.
Do not call invoke ops from outliner's operations menus. Invoke op would
search again for item under mouse coordinates... when it is invoked!
Means often entry menu you would have clicked would not be over target
item, leading to either nothing or operation being applied to wrong item.

Note: about groups, there is another minor annoyance leading to some
assert - groups have an annoying virtual fake user which breaks
usercount, will see whether this is easily fixable. :|
2017-05-31 21:14:08 +02:00
863f389222 Merge branch '28' into custom-manipulators 2017-06-01 02:29:24 +10:00
390648b984 DwM: Show wire only mesh objects 2017-06-01 02:26:24 +10:00
72cc6bea14 Fix manipulator immediate mode use
Needs 3D coords
2017-06-01 02:07:17 +10:00
50081bba77 Face-map bone parent support 2017-06-01 00:43:18 +10:00
f32a18994a Merge branch 'master' into blender2.8 2017-05-31 15:52:11 +02:00
a481908232 Task scheduler: Optimize subsequent pushing bunch of tasks
The idea is to accumulate all new tasks in a thread local queue
first without doing any thread synchronization (aka, locks and
conditional variables) and move those tasks to a scheduler queue
once they are all ready. This way we avoid per-task-pool lock
and only have one lock per bunch of tasks.

This is particularly handy when scheduling new dependency graph
node children. Brings FPS of cached simulation from the linked
below file from ~30 to ~50.

See documentation for BLI_task_pool_delayed_push_{begin, end}
and for TaskThreadLocalStorage::do_delayed_push.

Fixes T50027: Rigidbody playback and simulation performance regression with new depsgraph

Thanks Bastien for the review!
2017-05-31 15:44:08 +02:00
0e7d8ddb1e Merge branch '28' into custom-manipulators 2017-05-31 23:30:56 +10:00
82276d6cf7 Fix bone selection (index can't skip hidden bones) 2017-05-31 23:29:04 +10:00
2ae6973936 Cleanup: Easier to read constant name 2017-05-31 14:52:45 +02:00
a51dccc6f3 Fix T51661: Swaping strips does not refresh sequencer 2017-05-31 14:26:04 +02:00
140d9a9b15 Cleanup: Use more clear parenthesis 2017-05-31 14:25:40 +02:00
4f11ffcce7 Fix outliner crash clicking on pose bones
From 15317775c, we can't assume directdata is a Base.
This matches logic from master.
2017-05-31 22:16:13 +10:00
ec804b1694 Libmv: Re-bundle from upstream to ensure code base is perfectly in sync 2017-05-31 11:43:39 +02:00
8745042282 Fix face-map button being greyed out 2017-05-31 17:02:08 +10:00
6b88a00b24 Fix selecting bones 2017-05-31 16:59:48 +10:00
a1a61547db Ensure pose-mode cache exists
Files that were saved in pose-mode or selecting pose bones,
would have invalid cache.
2017-05-31 16:39:15 +10:00
Pascal Schoen
c91d2d30df Improve backscatter color of subsurface scattering in Principled BSDF
Differential Revision: https://developer.blender.org/D2685
2017-05-31 07:29:17 +02:00
6639765e5e Merge branch 'blender2.8' into custom-manipulators 2017-05-31 15:04:02 +10:00
c2d81f257f Eevee: Put shadows and probes inside SceneLayerEngineData
This remove the duplication of data for each viewport improving memory usage.
2017-05-30 22:30:16 +02:00
e7fb013a60 Draw Manager: Add SceneLayerEngineData and use callbacks to clear runtime engine data 2017-05-30 22:30:16 +02:00
Dalai Felinto
ff02103194 Fix T51667: blenderplayer building (tm)
Broken since 272ec8a7cf
2017-05-30 19:14:16 +02:00
Dalai Felinto
2cd7b80cae Fix T49570: Cycles baking can't handle materials with no images
If users wanted to bake only a few of the mesh materials, they would
still need to create dummy textures for the other parts.

This commit report (as RPT_INFO) the materials with no texture, but move
on to bake the others materials.
2017-05-30 19:06:39 +02:00
Dalai Felinto
9cae631059 Baking: Add logic to get material from API regardless of Mesh/Object ownership 2017-05-30 19:06:39 +02:00
d1d359b792 Depsgraph: Fix missing relations for objects which are indirectly linked
This is a corresponding part of 7dda3cf.
2017-05-30 17:42:38 +02:00
f92fc950c2 Depsgraph: Remove extra modifiers callback loop
Seems to be a copy-paste error from code above.
2017-05-30 17:38:22 +02:00
1dec6bb10b Merge branch 'blender2.8' into custom-manipulators 2017-05-31 01:34:45 +10:00
272ec8a7cf Move ED_object_facemap functions into ED_object.h 2017-05-31 01:31:53 +10:00
fb27bde1c8 Somehow missed this in recent Face Maps commit
Since the previous layer type was for ints too, it worked in tests.
2017-05-31 01:31:53 +10:00
9f43b36f1c Eevee: UI add world and material nodetree layout. 2017-05-30 17:18:00 +02:00
7b379313de Bpy Extras: Port cycles node functions to new node_utils.py 2017-05-30 17:18:00 +02:00
470d66397d Eevee: Fix ggx sun light. 2017-05-30 17:18:00 +02:00
03469d90b2 Displace modifier: Pre-fetch all possible images to image pool prior execution
This way we reduce amount of time wasted in spin-lock later on when all threads
are starting to sample texture.
2017-05-30 15:40:14 +02:00
b62a7767a0 Image pool: Use memory pool for allocating elements
Reduces amount of system-wide allocation calls. Will be
mainly visible when using lots of images in texture nodes
or regular BI rendering.
2017-05-30 15:25:12 +02:00
34cb934343 Depsgraph: Fix object being tagged for data update when it shouldn't 2017-05-30 14:36:50 +02:00
be59428877 Depsgraph: Add missing update tag clear for proxy objects
This was causing proxies updates on every frame, even if they
do not really change. Additionally, it was causing second round
of armature update when used from inside dupligroup (viewport
ensures all objects from dupligroup are up to date before draw).
2017-05-30 14:36:50 +02:00
24a0b332e2 Alembic import: fixed bug interpolating between frames. 2017-05-30 13:47:51 +02:00
35f4abcf53 Alembic: simplified sub-frame sampling
It's now less confusing (for example, using nr_of_samples directly,
instead of using 1 / 1 / nr_of_samples). Might also have fixed a bug.

Also added unittests.
2017-05-30 13:47:51 +02:00
4e5440686d Alembic export: normalise the homogeneous component after scaling
The scale matrix must have its homogeneous 'w' (at mat[3][3]) set to the
scale in order to also scale the translations along with it. However, this
also scales the transform matrix's 'w' component, which is not supposed
to happen.
2017-05-30 13:47:51 +02:00
916eca6a1e Alembic export: make the start/end frame default values less reasonable
The old default values (start/end frame = 1) could have been an actually
desired setting (for example when exporting a non-animated model). To
make this worse, this was only interpreted as "start/end of the scene" by
the export operator when running interactively, but not when run from
Python.

By choosing INT_MIN as default it's highly unlikely that the interval
[start, end) was intended as actual export range.
2017-05-30 13:47:51 +02:00
4aeba3b90d Alembic export: avoid create-and-reset of shared pointer
Constructing the shared pointer where the object is actually allocated
makes the code a bit clearer.
2017-05-30 13:47:51 +02:00
cfce8623a8 Alembic export: prevent rounding error buildup in frame sample time 2017-05-30 13:47:51 +02:00
71dcead790 Move GHash/GSet/LinkList iterators to BLI files
Those are not depsgraph or C++ specific and can be used by everyone.
2017-05-30 12:48:06 +02:00
Dalai Felinto
eed26b25d2 Layer collection doversion: Remove "converted from 2.7" from the name
Followup and partial revert from d78b1147be
2017-05-30 12:30:04 +02:00
82270f208d fmap-only option now only works with active object
This may change but for now match clay/eevee.
2017-05-30 19:55:42 +10:00
aab3a0fda3 Fix UI message (no points and no phrases in tooltips please!). 2017-05-30 11:42:55 +02:00
31bc9beeac Depsgraph: Use own implementation of stack rather than the one from STL
This way we always have predictable behavior, especially from the
performance point of view. Additionally, if some bottleneck is found
in stack implementation it'll be easier for us to address.
2017-05-30 11:41:29 +02:00
7eceb756e4 Tweak UI messgae checking macro, identifiers are not always available... 2017-05-30 11:40:51 +02:00
47aedb97b6 Silence warning in RNA when building without fluidsim. 2017-05-30 11:35:31 +02:00
b7871351f6 Limit only face-map option to active-pose armature 2017-05-30 19:13:19 +10:00
15692c8cfe Move hash_combine utility function to a more generic place
This way everyone can benefit from it, not only dependency graph.
2017-05-30 11:09:44 +02:00
cf170445b8 Show only face-map now works in clay/eevee engines 2017-05-30 19:03:10 +10:00
fb82948043 Fix strict compiler warning in C++ RNA
Hopefully it is supported by all the compilers.
2017-05-30 10:58:12 +02:00
6c16130356 ImBuf: Fix strict compiler warning in Cineon image IO 2017-05-30 10:58:12 +02:00
2c515df83d Audaspace: Don't use strict flags 2017-05-30 10:58:12 +02:00
46da985c8e Cycles: Cleanup, trailing whitespace 2017-05-30 10:58:12 +02:00
138e821f64 Merge branch 'blender2.8' into custom-manipulators 2017-05-30 18:30:55 +10:00
Dalai Felinto
59429dbaf9 Fix typo 2017-05-30 10:19:40 +02:00
d888453244 Face Maps: custom-data, UI and RNA API
Add face maps, needed for face-map widgets,
only data structure, widgets will be separate commit.

This comes from 'custom-manipulator' branch with only minor changes.
2017-05-30 18:05:59 +10:00
76c97aaff9 Fix T50775: Missing parenthesis on fluid bake button.
Yep, that got reported... Was slightly more involved than UI message
fixing though: RNA string length getter shall return exact lentgh of
string (same as strlen), not size of allocated buffer to contain it!
Otherwise, NULL final char leaks in and...
2017-05-30 09:46:53 +02:00
2045b4b5ef Sync with 2.8 2017-05-30 17:40:38 +10:00
79d34f4fde Minor edits 2017-05-30 17:36:05 +10:00
e109fdea5a Missed while updating custom-data again! 2017-05-30 17:30:22 +10:00
44b99ba9b0 Rename object_fmap -> object_facemap_ops
Also ED_fmap -> ED_object_facemap
2017-05-30 17:23:13 +10:00
fc24b039db Remove face-maps from GPU buffer
We wont use this long-term so remove to make merge easier.
2017-05-30 17:03:23 +10:00
e32e317a61 Missed CD update re-using PolyIndex 2017-05-30 16:51:35 +10:00
8c8d752f96 Cleanup: use BKE_object_facemap_* prefix for face-map operations 2017-05-30 16:38:03 +10:00
42160fd180 Rename facemaps -> object_facemaps
Since face-maps are just a property of objects, like BKE_object_deform.h
2017-05-30 16:29:43 +10:00
4d71af8bc4 Re-use poly-index layer for face-map
Poly index was used for a short time when switching to BMesh.

This is practically the same kind of data,
any inconsistency between object face-maps will need to be supported
anyway - since object & mesh might span blend-files.
2017-05-30 16:10:26 +10:00
ca87117afe Add missing NULL check (face-map might not have a bone) 2017-05-30 16:10:13 +10:00
02bed8fcbf Accidentally removed last commit 2017-05-30 15:55:58 +10:00
65b374087a Remove face-map DNA from pose-channels
Manually setting up links per bone to an object & facemap is tedious.

It's also going to cause quiet a bit of book-keeping internally to
ensure its always valid (linking, adding removing objects proxies).

Instead match the face-maps names to bones (as with vertex groups).
The DNA members have been moved into runtime cache.

This also adds an option for bones to use facemaps,
to avoid excessive searching on heavy armatures that might use very few
(if any) face-maps.
2017-05-30 15:46:20 +10:00
9b914764a9 Fix T51652: Cycles - Persistant Images not storing images
Denoising was setting session parameters for every frame, which was detected as
a change and therefore caused a resync.

Since the parameter modification change is only needed for viewport rendering
(which doesn't support denoising anyways) and resyncing after a frame change
(which isn't affected by denoising settings), an easy fix is to just ignore
the denoising parameters like it's currently done with the samples.
2017-05-30 06:34:53 +02:00
21ebc593f2 Merge branch 'blender2.8' into custom-manipulators 2017-05-30 12:35:44 +10:00
d321ed62b8 Revert "Revert "Remove MTexPoly layers""
I reverted this commit by mistake. Sorry :/

This reverts commit 9caf328a7c.
2017-05-30 01:29:03 +02:00
5773f58762 Eevee: Replace Cubemaps by octahedron maps for env. probes.
This enables us to use 2D texture arrays for multiple probes.
There is a little artifact with very high roughness caused elongated pixel due to the projection (along every 90° meridian).
2017-05-29 22:04:30 +02:00
6757ca8b40 NDOF: clean up after MinGW removal
Follow up to 9f044cb422

These comments described the difference between Microsoft & MinGW's struct definition. Now that we dropped MinGW we don't need to go into these details.
2017-05-29 14:04:46 -04:00
1fa216487d Gawain: update comments to match latest API 2017-05-29 13:37:02 -04:00
538fe7d48e Fix T50906 and T49361, bevel didn't curve in plane sometimes. 2017-05-29 13:32:57 -04:00
f2d7356f16 Background Fit could set inf zoom 2017-05-30 02:39:07 +10:00
704b1bf7f0 Use face-group color 2017-05-30 01:49:06 +10:00
f212bfa3cd Fix T51657: ID user count error when deleting a newly created object with an assigned dupli_group
Stupid RNA accessor was not handling usercount at all on Object.dupli_group...
2017-05-29 17:44:39 +02:00
0ed4570bad Basic face-map drawing
No alpha yet, need to investigate
2017-05-30 00:43:20 +10:00
818268b394 Fix own mistake with NULL materials in particles 2017-05-29 16:30:56 +02:00
Dalai Felinto
30278342d1 Rename Eevee post process effects
No need to have "Enable" in their names.
2017-05-29 16:29:45 +02:00
ec90780767 Gawain: Add support for rendering using an instance batch (for particles) 2017-05-29 16:28:54 +02:00
06ca2c9d03 Fix T51390: Blender 2.78c will freeze or force close when adding particles at random.
DM evaluation code was simply never clearing the `deformedOnly` flag
when evaluating a generative modifier...

Quite astonishing this never got catched before, a lot of particle code
relies on valid value of this flag!!!
2017-05-29 16:05:35 +02:00
97e89027fc Eevee : fix light colors 2017-05-29 15:52:27 +02:00
dbed33479a Eevee: Remove non-ltc area light code + optimisation.
Reduce size ShadingData struct leads to some improvement even with more computation.
2017-05-29 15:52:27 +02:00
932399612b 3D grid: Fix precision issue 2/2
We now floor the corner position and use this position as origin.
This gives us perfect derivatives in all cases even if very far from the origin.
Unfortunately this won't fix the low precision of coordinates used for computing the actual grid size, resulting in thick, non-smoothed lines.

Also did a bit of refactor how the axes are drawn.
2017-05-29 15:52:27 +02:00
330007f571 3D grid: only draw if needed. 2017-05-29 15:52:27 +02:00
e104d82376 Object Mode Engine: Fixing the 3D grid 1/2
Do not use the inverse perspective matrix inside the shader to recover world positions.
That leads to severe float imprecision leading to nasty artifacts.

Instead we compute the world view vector for each pixels and do a ray to plane intersection.
We are still getting low precision derivatives when going far away from the origin, and thus artifacts.

This commit also fixes the non-appearing negative Z axis in 3D view.
2017-05-29 15:52:27 +02:00
9caf328a7c Revert "Remove MTexPoly layers"
This reverts commit c6e92b4947.
2017-05-29 15:52:27 +02:00
35022d0f63 Move particle cache population to a dedicated function
Should help readability of switch statement which becomes far too big now.
2017-05-29 15:26:52 +02:00
d8bd5217bf Merge branch 'blender2.8' into custom-manipulators 2017-05-29 22:12:40 +10:00
377947342e Node Backdrop Manipulator
From custom-manipulator branch, usable when viewer node is selected.

This might need some changes but works on basic level.
2017-05-29 22:09:57 +10:00
2772fdf402 Merge branch 'blender2.8' into custom-manipulators 2017-05-29 21:06:02 +10:00
9a4ca03cfd Only show backdrop manipulator when its enabled 2017-05-29 21:03:48 +10:00
1f1926e068 Fix leak with texture-paint shaders 2017-05-29 20:48:02 +10:00
08b7955415 Fix T51625: fix impossibility to delete uninstantiated objects from Outliner.
The fact that we can end with uninstantiated objects is not expected
currently, but would rather not start chasing all corner cases that may
lead to that situation.

User shall be able to delete uninstantiated objects from Outliner, though!
2017-05-29 12:27:59 +02:00
51d1e204b8 Fix texture paint crash when there are no UV's
Missing check in own recent commits,
also only use texture-paint drawing on active object.
2017-05-29 20:17:42 +10:00
2fb56e7157 Fix T51520: Broken vertex weights after two mesh joining.
Take Two, did not detect that dynapaint was also creating named vgroup cdlayer!
2017-05-29 12:06:40 +02:00
Dalai Felinto
4e39b31671 Fix crash on rna show diffuse color update
(untested because texture painting is not working)
2017-05-29 11:15:08 +02:00
be31582e3d Fix T51624: Scene Full Copy ignores shader node links.
Properly remap nodes' pointers to copied IDs in copied ntrees.

Note that this only affects root trees, node groups are not concerned
here, since they are assumed to be reusable chunks and hence *not*
duplicated.
2017-05-29 11:02:27 +02:00
Dalai Felinto
05f9155902 Fix crash when setting sculpt settings 2017-05-29 10:54:36 +02:00
ea147e9a28 UI: Make GP "Add Blank Frame" operator name and description fit its behavior.
The operator is indeed not adding frames but inserting them at the current frame (shifting all subsequent ones). Changed the operator name and description.

Approved by Antonio.
2017-05-29 10:51:20 +02:00
ecf2f1593a Fix T51646: Motion Tracker instantly crashes
Was a mistake in previous changes.

Weirdly enough, frame reading assumes cache_key is always non-NULL..
2017-05-29 09:40:43 +02:00
4570d44c4e Fix node backdrop manipulator 2017-05-29 15:17:31 +10:00
acf6db7e2b Update to use GPU matrix 2017-05-29 14:40:36 +10:00
1658b5ef05 Merge branch '28' into custom-manipulators 2017-05-29 14:30:37 +10:00
c0cf767460 Access node backdrop as vector
Minor change from 'custom-manipulators' branch, avoid conflicts.
2017-05-29 14:29:44 +10:00
9f466a4f97 Merge branch 'blender2.8' into custom-manipulators 2017-05-29 12:22:04 +10:00
94a3bc63cc Add some missing VSE tooltips
Part of T51061

Differential Revision: https://developer.blender.org/D2664
2017-05-28 21:45:30 -04:00
5f46374c89 UI correct use of "..." in the VSE 2017-05-28 20:41:23 -04:00
8051f2412e Usual i18n/message tweaks & fixes. 2017-05-28 21:47:16 +02:00
9ba7805a3b Fix T48996, bevel bad for certain in-plane edges. 2017-05-28 14:02:56 -04:00
8ead56c4c9 Merge branch 'master' into blender2.8 2017-05-28 17:48:59 +02:00
b947810291 Make 'set offset from cursor' group operator internal.
This operator relies on a rather specific context setup, so it shall not
be exposed to user in 'operator search' menu etc.

Based on D2528 by Vuk Gardašević (lijenstina).
2017-05-28 17:35:24 +02:00
9f044cb422 Remove MinGW support
The Issue
=======

For a long time now MinGW has been unsupported and unmaintained and at this point,
it looks like something that we should just leave behind and move on.


Why Remove
==========

One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based.
However, now that this is no longer true we have basically stopped updating the need CMake files.
Along with the CMake files, there are several patches to the extern libs needed to make this work.  For example, see:
https://developer.blender.org/diffusion/B/browse/master/extern/carve/patches/mingw_w64.patch

If we wanted to keep MinGW then we would need to make more custom patches to the external libs and
this is not something our platform maintainers are willing to do.

For example, here is the patches needed to build python: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3

Fixes T51301

Differential Revision: https://developer.blender.org/D2648
2017-05-27 15:34:55 -04:00
275e2fb0ff Fix T51637: Mesh Tools - Noise Button Crashes.
Logic behind which mtext to use from material was broken here... Though
ultimately that whole tool could probably be deprecated or reworked!
2017-05-27 14:46:14 +02:00
7df5ed14b1 Release wasn't building, limit debug scope 2017-05-27 20:47:41 +10:00
2eead82ce0 CustomData: assert on bad arguments to free
Assert the index is in-range for the layer type.
2017-05-27 14:05:44 +10:00
19809c8385 Add automated ctest for complex merge in Array modifier.
See also T50851.
2017-05-26 21:58:29 +02:00
4d58080e23 Fix T50851: Array modifier generating invalid geometry.
We had handling of fully duplicated polygons already, but... absolutely
nothing to sanitize partially merged polygons! This were giving us
totally invalid geometry, with duplicated vertices in single poly,
invalid edges, etc.

Now we do check for invalid loops inside polys, and generate new edges
as needed to get only valid polys.

For some reason this was a nightmare to get running fully OK, playing
with old and new indices is really, really mind breaking.
2017-05-26 21:58:29 +02:00
Dalai Felinto
6dfe56f01a Silence warning in draw manager 2017-05-26 17:51:08 +02:00
Dalai Felinto
43badbd631 Rename: FILE_ACTIVELAY > FILE_ACTIVE_COLLECTION 2017-05-26 17:44:00 +02:00
Dalai Felinto
984cd29fda Implement support for Append objects in Blender 2.8
Note for users
==============

The active_layer option used for the filebrowser operators is now called
active_collection.

If there is no collections in the scenelayer or if this option is not selected
we automatically create a new collection for the new objects.

This is the same behaviour of trying to add a new object when there is
no collection.

Note for developers
===================

For those cases I moved the object user count handling from readfile to
the scene collection system. It's working fine for those, but we still
need to re-visit this for Add objects, and Duplicate - In those cases
the usercount is 2 when it should be 1.

Reviewers: mont29, sergey

Differential Revision: https://developer.blender.org/D2686
2017-05-26 17:44:00 +02:00
Dalai Felinto
65a042b273 Rename BKE_layer_collection_active > BKE_layer_collection_get_active 2017-05-26 17:44:00 +02:00
Dalai Felinto
0ab9b943a2 Move util function to add new scene collection when active is not available from object to layer 2017-05-26 17:44:00 +02:00
Dalai Felinto
0c6227ce77 Depsgraph iterator: Add assert for bases not yet evaluated 2017-05-26 17:44:00 +02:00
620516965b Gawain: move convert_prim_type_to_gl to private API 2017-05-26 11:23:23 -04:00
cd8a8a3d1f Fix removing texface layer 2017-05-26 23:37:10 +10:00
7d7c5135d7 Merge branch 'master' into blender2.8 2017-05-26 23:32:56 +10:00
ac66fb193f Fix freeing all custom-data layers
Would crash when the active index was out of range,
since there is no reason to use the active layer when freeing all,
free the first instead.
2017-05-26 23:30:20 +10:00
b0015686e2 Fix T50908: Motion Tracker ignored grease pencil mask
This feature got lost with new auto-track API,

Added it back by extending frame accessor class. This isn't really
a frame thing, but we don't have other type of accessor here.

Surely, we can use old-style API here and pass mask via region
tracker options for this particular case, but then it becomes much
less obvious how real auto-tracker will access this mask with old
style API.

So seems we do need an accessor for such data, just matter of
finding better place than frame accessor.
2017-05-26 15:27:49 +02:00
bddd9d809d Fix integer overflows in meshcache modifier.
Differential Revision: https://developer.blender.org/D2688
2017-05-26 06:26:21 -06:00
3b311b7cb2 Fix uninit shading group in object mode particles 2017-05-26 13:36:12 +02:00
c6e92b4947 Remove MTexPoly layers 2017-05-26 21:04:34 +10:00
ff29914dcc Remove default shading groups from eevee 2017-05-26 12:55:50 +02:00
f75ca733ed Fix indentation in clay_engine.c 2017-05-26 12:55:50 +02:00
f2a8b74c25 Merge branch 'master' into blender2.8 2017-05-26 19:57:28 +10:00
bf5e717ef5 Fix T51609: Bake Texture, Margin crashing Blender
Integer overflow in margin filter code.
2017-05-26 11:28:01 +02:00
Dalai Felinto
3b24ece297 Depsgraph: Rename DAG > DEG functions from depsgraph_query.cc 2017-05-26 11:23:10 +02:00
f78ba0df02 Fix T51350: 2D curve normals flip when deformed
Deforming 2D curves & text with modifiers/shape-keys
could flip the normals.

Now check the back-facing flag instead of `z < 0`.
2017-05-26 19:03:30 +10:00
98df7d778f Fix T51287: Matrix.lerp fails w/ shear
Use interp_m4_m4m4 (wraps Eigen),
`MATH_STANDALONE` will need to be updated to support this.
2017-05-26 17:02:27 +10:00
b5a976ec19 Fix GPencil depth checks
Regression in 195d0fba
2017-05-26 16:16:33 +10:00
4badf67739 Fix T51629: Select w/ object lock fails
Regression in 195d0fba
2017-05-26 16:11:56 +10:00
9158d16219 Cleanup: warning 2017-05-26 14:25:52 +10:00
0021268311 Cycles: Cleanup: Remove semicolons from line endings in Python code 2017-05-26 02:15:09 +02:00
3722ed13cd Cycles: Update compositor when debug or denoising passes are changed 2017-05-26 02:13:21 +02:00
2bc008e8a9 Cycles: Cleanup: b_srlay is always used now, no more need to silence warning 2017-05-26 01:55:32 +02:00
dc23b48101 Cleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData) 2017-05-26 01:52:43 +02:00
1358c39455 [MSVC] Fix build error. linker was searching for a mangled version of versionstr 2017-05-25 15:23:45 -06:00
9179797811 Fix blender player python installation on macOS after recent changes. 2017-05-25 22:18:50 +02:00
2580c3cb82 Fix T50112: Sequencer crash w/ missing proxy data 2017-05-25 20:23:31 +10:00
1ddf67382b Docs: Image.has_data clarification
Resolves T51615
2017-05-25 19:54:54 +10:00
24e3a930f1 Fix T51444: Unit tests don't run on Windows 2017-05-25 18:56:00 +10:00
bdbf4471a6 TexFace removal part 3
- MTexPoly structure & layer type.
- The 'Mesh.uv_textures' layers.
- DerivedMesh TexFace drawing.
- Scripts & UI.
2017-05-25 15:19:58 +10:00
c7c6070a64 Merge branch 'master' into blender2.8 2017-05-25 02:48:14 +02:00
bbce6ce249 Fix macOS python cmake install to work when switching lib directories.
It's a bit ugly but I couldn't find a better way to keep fast installs and
correct handling of switching between master and blender2.8 with different
lib directories.
2017-05-25 02:34:39 +02:00
Julian Eisel
45ff4a807a Merge branch 'master' into blender2.8 2017-05-25 00:43:01 +02:00
aec76fdcc6 Fix compiler error for VS2017
a void function cannot return a value.
2017-05-24 20:13:45 +02:00
a033a7bef9 Fix error accessing tessface color in edit-mode
Was checking for loop-color in poly-layer.
2017-05-25 02:46:30 +10:00
214c42157a Only calc split normals when auto-smooth is enabled
This matches cycles & derived-mesh
2017-05-25 02:31:39 +10:00
154ff1afde Fix/Workaround T51561: Disable split normals 2017-05-25 01:40:15 +10:00
f2cc6c9254 TexFace removal part 2
- Derived-mesh drawing.
- All non UV members of TexFace structs.

MTexPoly is now redundant but keeping with a dummy member,
will check on complete removal later.
2017-05-25 01:40:15 +10:00
55c15ad9de Cycles: Use falltrhough attribute to help catching missing break statements 2017-05-24 17:23:54 +02:00
3de9db9650 Proper fix for crash loading old files with compositor
Now we keep all links around, even for sockets which were
implicitly renamed. And also ensuring new sockets have proper
storage.
2017-05-24 15:39:15 +02:00
7a9ad029dd Remove TexFace, per-face images
TexFace complicates the now more popular shading pipeline by having
per-face images, see: T51382 for details.

To keep the ability to select a per-material edit-image
(used with UV-mapping workflow), the material now stores an image
which will be set when changing images in edit-mode.

This is used as a bake-target when not using Cycles too.
2017-05-24 23:38:15 +10:00
f4074ce8d7 Revert "Fix crash opening really old files with compositor"
This commit broke compatibility with newer files: due to rename
of Speed to Vector the links got lost.

This reverts commit 0e46da76b7.
2017-05-24 15:29:14 +02:00
707340edd7 Cleanup: minor de-duplicate from last commit 2017-05-24 22:54:19 +10:00
429f6bee28 Fix T51561: Normal maps fail w/ quad + eevee
Generalize derived-mesh tangent calculation so
it can be used by Batch cache creation too.
2017-05-24 22:39:50 +10:00
a6c60affff Merge branch 'master' into blender2.8 2017-05-24 21:17:05 +10:00
d252ac6b95 Fix possible invalid normal use w/ tangent calc
Was using MFace normals, not MPoly
2017-05-24 21:15:35 +10:00
6715bfee92 Alembic: Export mesh as mesh, even when it has no vertices.
This makes it possible to have an animated / procedurally generated mesh
that starts empty and obtains data in later frames.

Fixes the export of an empty mesh with an Ocean Modifier, as described in
issue T51351.
2017-05-24 12:39:37 +02:00
e921e0f0af Alembic export: consider mesh with animation data as "animated"
This allows you to put any kind of animation data on the mesh, and its
shape will be exported on each timekey. Note that this timekey is unrelated
to the animation data (so we don't export on each keyframe, for example).

A practical example is the addition of an animated custom property to
trigger the export of animated mesh data. The mesh data can then be created
from any source, like Python scripts.

Not only is this useful in itself, it also provides a workaround for one
of the two issues described in T51351.
2017-05-24 12:38:17 +02:00
eafea25c41 Alembic export: write Blender version to Alembic file
This is written in a custom metadata key, so it isn't shown by utilities
like abcecho or abcls. However, it's still something that's useful to
have available.
2017-05-24 11:45:14 +02:00
d5d9d1fe7d CMake: document that WITH_FFTW3 is also used for the ocean sim. 2017-05-24 11:36:41 +02:00
ad27e97ee7 Fix T51586: Regression: Alembic containing animated curves / hair no longer working
Also fixed the same type of error when reading points.
2017-05-24 10:24:25 +02:00
Pascal Schoen
e20a33b89d Fix T51589: Principled Subsurface Scattering, wrong shadow color
Apply mix of subsurface and base color (wrt subsurface) for rays that
have transmitted the surface.
2017-05-24 07:37:02 +02:00
60a099fb09 Move empty image drawing into its own pass 2017-05-24 14:28:48 +10:00
3c92e6b8f0 Cleanup: bmesh var naming 2017-05-24 13:33:48 +10:00
c9d890585b DwM: avoid indirect edit-mesh conversion
Storing edit-mesh data as indices for passing
only to get back edit-mesh data.

This also complicated checks for real edges in tessellation tris.

Simpler to pass data directly.
2017-05-24 13:27:11 +10:00
c99e70ae6c Fix leak in particle velocity global ramp 2017-05-24 13:27:11 +10:00
eef92770a1 Optimize particle primitive shader 2017-05-23 18:39:22 +02:00
e1c4908771 Temp fix for vertex format with batch instancing
This prevents memory alignment from being screwed up when attributes are
optimized out in shader.
2017-05-23 18:39:22 +02:00
9bc88b69d8 Implement particle velocity and acceleration visualization 2017-05-23 18:39:22 +02:00
99c6601a1f Merge branch 'master' into blender2.8 2017-05-23 17:35:45 +02:00
7b25ffb618 Fix T51534: Alembic: added support for face-varying vertex colours
Houdini writes vertex data in a different format than Blender does; Houdini
uses "face-varying scope", which means that the vertex colours are indexed
by an ever-increasing number over all vertices of all faces instead of the
vertex index.

I've also merged the read_custom_data_mcols() and read_mcols() functions,
because the latter was only called from the former, and the changes in this
commit would add yet more function parameters to pass.
2017-05-23 17:27:15 +02:00
cc0cc880de Alembic: reduced code duplication in read_mcols()
A big chunk of code was copied between the if and else bodies. By using
a boolean to store whether the c3f_ptr or c4f_ptr should be used, the
in-loop condition is kept as simple as possible.
2017-05-23 17:27:15 +02:00
96e068d3aa Alembic: split up read_custom_data_ex() into read_custom_data_{mcols,uvs}()
The read_custom_data_ex() function was basically two functions inside
if/else bodies.
2017-05-23 17:27:15 +02:00
c1b321e1b8 Add PovRay file extensions to our 'textual' file filtering. 2017-05-23 17:09:50 +02:00
116e8933a6 Fix some POV keywords not colored correctly.
We need to ensure longer keywords are catched first, when there are
shorter subsets of them in keywords list as well!
2017-05-23 17:09:50 +02:00
3db15ae23a Eevee: Disable directionnal lamps shadows 2017-05-23 15:12:47 +02:00
6f063bdb1c Use pointers to actual data for particle uniforms
This makes particle color uniforms point directly to material color, and
particle size uniforms point directly to ParticleSettings size.
2017-05-23 14:37:01 +02:00
340e4394d4 Use custom shader for dot particles 2017-05-23 14:25:12 +02:00
b5426b50fb Rename/move particle shaders 2017-05-23 14:20:10 +02:00
49cc78ef18 Fix T48668, bevel mistake on presumed reflex angle.
Note: the angle in bug isn't really reflex - using the vertex normal
for this test isn't always right, but usually is. At any rate,
shouldn't try to put vertex on edge between if a reflex angle.
2017-05-23 07:55:14 -04:00
21857cb081 Create new shading group for each psys 2017-05-23 13:52:50 +02:00
b30cefa650 Revert "Implement UBOs for particles"
This reverts commit 845732652f.
2017-05-23 13:52:50 +02:00
da9c2607c4 DWM: Add short to float / int uniform function.
Short values are common in DNA, this enables using them directly without storing temporary float somewhere.
2017-05-23 13:59:58 +02:00
694bc97768 Draw Manager: Prevent errors when overwritting the instance batch. 2017-05-23 13:59:58 +02:00
b2dc54ffe5 Stupid mistake in material access optimization 2017-05-23 21:52:18 +10:00
72d67ba4c2 Make msvc2015 happy again.
Looks like that wanabe compiler does not support more than a few tens of
if/else conditions...
2017-05-23 13:04:58 +02:00
8d26f2c222 Fix T51319: Alembic export crash w/simple child particles if Display value < 100%
This was two-fold.

1) The export used viewport settings to obtain the particle cache, rather
   than render settings.
2) The child hair writer tried to obtain UV-coordinates from the parent
   chair, without checking whether those were available in the first place.
2017-05-23 12:31:39 +02:00
d859bac9e8 Cleanup: Make Gawain code style more consistent
Not as if i'm totally fine with such style, but i'd better be consistent
with whatever the project is using.
2017-05-23 11:53:47 +02:00
7add6b89bc Fix T51592: Simplify AO Cycles setting remains active while Simplify is disabled 2017-05-23 10:34:03 +02:00
96f7b08aec DwM: optimize material access
- Split BMesh/Mesh loops.
- Loop over faces instead of tris.
- Add out-of-bounds check for material index (rare but can happen).
2017-05-23 18:26:16 +10:00
611779ca96 Cleanup: use more generic naming
Can be used by any user that needs faces split by materials.
2017-05-23 17:48:05 +10:00
f21c235c6f DwM: texture paint support & mask mode
Uses workaround so material slots are used when neither blender-internal
or cycles are enabled.
2017-05-23 17:40:48 +10:00
44f91a9a18 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2017-05-22 22:49:02 +02:00
6cc293a6d9 Gawain: replace switch with lookup table
This function is not performance critical, but I prefer the branch-free code and no hack needed to appease gcc.

Follow-up to recent 23035cf46f and f637145450.
2017-05-22 16:43:33 -04:00
9b29233800 Add PovRay syntax hilghting.
Since we already have a rather advanced PovRay exporter, makes sense to
also nicely display generated 'code'.

Patch by Maurice Raybaud (@mauriceraybaud), thanks!
Cleanup (mostly styling) by @mont29.
2017-05-22 22:08:02 +02:00
8cc4c3da8c Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha
Brightness/contrast node was changing color but did not modify alpha
or ensured colors are premultiplied on the output. This was giving
artifacts later on unless alpha was manually converted.

Compositor is supposed to work in premultiplied alpha (except of
some really corner cases) so it makes sense to ensure premultiplied
alpha after brightness/contrast node.

This is now done as an option enabled by default, so we:

(a) Keep compatibility with old files.
(b) Have correct behavior for newly created files.

Later on we can get rid of this option.
2017-05-22 17:15:45 +02:00
849e77b1f9 Fix T51318: Non-update of preview when switching from world to lamp panel.
Lamp preview panel is in DATA buttons context...
2017-05-22 17:11:55 +02:00
f08f8a2df2 Enhance vgroup handling when merging meshes.
We were looping over all vgroups in destination mesh and making string
comparison, for every vgroup of every vertex of merged mesh! Crazy!

Now we simply create a temp mapping of vgroup indices, seriously
simplifies things (and gives significant speedup when merging huge meshes
with lots of vgroups, here with quick stupid test went from 120ms in
vgroup merging to less than 5ms, 25 times quicker!).
2017-05-22 16:43:46 +02:00
e3d6321530 Fix T51520: Broken vertex weights after two mesh joining.
Root of the issue here was that two stupid modifiers could create named
vgroup CD layers (vgroup editing ones... shame on me :") ).

Fix that, and added some versionning code to also fix 'corrupted' blend
files created by those so far.
2017-05-22 16:43:46 +02:00
81667b770c Fix wrong comment in BLI_findstringindex (returns 0-based index!). 2017-05-22 16:43:46 +02:00
845732652f Implement UBOs for particles
This fixes the issue where all particles were drawn with the colors and
size of the last psys to be drawn.
2017-05-22 16:42:08 +02:00
cedebeb5de Minor cleanup of previous hair commits 2017-05-22 16:42:08 +02:00
f5a9f150dc Fix T51577: ColorBalance strip modifier misses some color input
Was a mistake in recent VSE interface change.
2017-05-22 14:56:08 +02:00
9737401688 Fix T51169: Push/pull fails w/ local lock axis 2017-05-22 21:12:43 +10:00
34b689892b Fix T51568: CUDA error in viewport render after fix for for OpenCL
Seems re-loading module invalidates memory pointers by the looks of it,
which gives an error on the next kernel call.

Not sure how to move memory pointer from one CUDA module to another one,
so for now simply disabling kernel re-load for CUDA devices. Not ideal,
but better than failing render.

Feature-selective option for CUDA is not an official feature anyway.
2017-05-22 12:28:21 +02:00
Dalai Felinto
c0202c0d33 Fix T51578: Blender 2.8 crash when select Dopesheet->Grease Pencil 2017-05-22 12:25:40 +02:00
baf788d7cd Fix T51336: Crash on broken file opening.
`screen_findedge()` is not expected to return NULL in that case, but
checking against that does not hurt (we do it in all its other call
cases anyway), better than crashing.
2017-05-22 12:08:03 +02:00
bd09b51379 Fix/workaround GCC bug about -Wno-implicit-fallthrough
For some reason GCC-6 successfully compiles test program with
-Wno-implicit-fallthrough passed via command line. It just
silently ignores the unknown arguments which are starting with
-Wno-.

The issue is, if some other waning happens in the code, then
GCC will complain about unknown -Wno- argument which is not
supported by current GCC version.

This makes some misleading warning prints about unknown
command line argument when any other warning happens in code
from extern/.
2017-05-22 11:08:10 +02:00
dbb1a692f7 Revert assert, Eevee uses uniforms that might not exist 2017-05-22 17:57:34 +10:00
9efd3a3f63 Cleanup: move custom-data layers into a struct
Changed because the values co-exist with active layers
(Mesh.mloopuv, Mesh.mloopcol).
2017-05-22 17:25:31 +10:00
02cc4d8cec Cleanup: line length 2017-05-22 16:25:27 +10:00
e98652b64f Cleanup: minor edits 2017-05-22 16:21:44 +10:00
f637145450 Fix compilation on gcc 2017-05-22 03:36:05 +03:00
23035cf46f Gawain: remove GLenum from IndexType API
Goal is to make most of the API independent of OpenGL, Vulkan, any other backend.

Able to remove default case from ElementList_size because IndexType only covers index types. Not that and *everything else* like GLenum.
2017-05-21 18:25:30 -04:00
054eb9422c Gawain: use integer math to convert int16 to int10
@fclem does this work for you?
2017-05-21 18:07:23 -04:00
ea31c55b08 Gawain: cleanup code formatting 2017-05-21 17:53:16 -04:00
3f6f02e433 Gawain: drop support for APPLE_flush_buffer_range
Modern GL's glMapBufferRange works the same on all platforms.

Part of T49012
2017-05-21 17:06:42 -04:00
90a1d49180 Gawain: drop support for APPLE_vertex_array_object
Recent versions of OpenGL support VAOs natively.

Part of T49012
2017-05-21 16:48:54 -04:00
68d8618538 Gawain: promote 10_10_10 to first-class vertex format
This format is part of OpenGL 3.3, and one of the reasons for choosing 3.3 over 3.2.

Instead of checking #if USE_10_10_10 just use it wherever needed.
2017-05-21 15:59:34 -04:00
f3d9f0c779 [msvc] Use debug nunmpy archive for debug builds 2017-05-21 09:31:55 -06:00
3bf69b26ef Cycles Denoising: Skip feature pass writing for volume-only shaders
Volume shaders without anything connected to the surface output are treated
as if they had a transparent BSDF as the surface shader in Cycles, so the
denoiser should skip feature pass writing for them just as it does with an
actual transparent BSDF.
2017-05-21 05:40:13 +02:00
96769f3b19 Cycles Denoising: Skip confidence interval test for outlier central pixels
If the central pixel is an outlier, the denoiser is supposed to predict its
value from the surrounding pixels. However, in some cases the confidence
interval test would reject every single surrounding pixel, which leaves the
model fitting with no data to work with.
2017-05-21 05:26:13 +02:00
67b9a5b3d6 Eevee: Initial implementation of exponential shadowmaps
Also fixes the rendering of depth.
2017-05-20 16:58:07 +02:00
d9d65a06d3 Eevee: Move cube shadows to octahedron shadowmaps.
We render linear distance to the light in a R32 texture and store it into an octahedron projection inside a 2D texture array.

This render the sampling function much more simpler and without edge artifacts.
2017-05-20 16:58:07 +02:00
4c3382d55f GPUTexture: Enabling R32 format for linear depth encoding. 2017-05-20 16:58:07 +02:00
3f1a7aec13 Eevee: optimize vertex shader for probe and shadows. 2017-05-20 16:58:07 +02:00
07dd208209 Cleanup: warnings 2017-05-21 09:39:31 +10:00
53d1026f2a DwM: assert when uniforms aren't found
More useful when this error shows up early
2017-05-20 23:54:58 +10:00
8e3cefd0d5 DwM: Object mode empty-image support 2017-05-20 23:17:50 +10:00
38a2bf665b Cycles: Cleanup, style and unused arguments
- Some arguments were inapproriatry tagged as unused
  using (void)foo semantic.

  Only use such semantic in tricky casses, when something
  needs to be ignored in release builds or something is
  dependent on tricky ifndef policy.

  For rest of the cases just use void foo(int /bar*/)
  semantic, which ensures variable is not used. Solves
  confusion and code running out of sync with later
  development.

- Used proper unused semantic to some arguments.

- Added braces to make code easier to follow, tricky
  indentation with ifdef, uh.
2017-05-20 05:21:27 -07:00
65aab6cdae Merge branch 'master' into blender2.8 2017-05-20 14:19:05 +10:00
81e584ed17 CMake: Use GCC7's -Wimplicit-fallthrough=5
Use to avoid accidental missing break statements,
use ATTR_FALLTHROUGH to suppress.
2017-05-20 14:01:03 +10:00
6cd1d34dc1 Cycles Denoising: Prevent overfitting when using a very low radius
For example, when using a radius of 1, only 9 pixels (due to weighting maybe
even less) will be used, but the transform code may still decide to use a
5-dimensional (or even higher) fit.
This causes severe overfitting and therefore weird pixel values.

To avoid this, this commit limits the amount of dimensions to a third of the
pixel number. For a radius of 3 or more, this doesn't change anything, but
for 1 and 2 it can prevent fireflies and/or negative values being produced.
2017-05-19 23:33:22 +02:00
3dee1f079f Fix T51560: Black pixels on a denoising render
Once again, numerical instabilities causing the Cholesky decomposition to fail.

However, further increasing the diagonal correction just because of a few
pixels in very specific scenes and settings seems unjustified.
Therefore, this commit simply falls back to the basic NLM-filtered pixel
if the more advanced model fails.
2017-05-19 23:31:49 +02:00
177385dc43 Cycles: Reload kernels from Session when requested features change
This fixes T49496.
2017-05-19 16:24:19 -04:00
996bf65730 Clay/Eevee: fix more crash when entering edit mode
Shader stages need to agree about interpolation qualifiers. Apparently implicit smooth (the default) and explicit smooth are considered different by some GLSL compilers. Found by @letterrip on Linux + Intel.

Follow-up to 941e739d70
2017-05-19 16:12:13 -04:00
8d7b98bfd3 OpenGL: cleanup material shader GLSL
prefer vector math over scalar
prefer * over /
shorten vec3(x, x, x) to vec3(x)
use clamp, max, etc. instead of custom logic
declare loop vars as part of for loop
spacing
2017-05-19 14:20:37 -04:00
a1c558e19f OpenGL: cleanup edit overlay shaders
Mostly simple fixes to spacing & comments.
2017-05-19 14:20:37 -04:00
941e739d70 Clay/Eevee: fix crash when entering edit mode
vertexColor output was not being written --> shader failed to link --> assert hit while setting that shader's uniforms.

Vertex attribs are smooth by default, so I shortened the declaration.

@fclem or @dfelinto: is color = 0 ok here?
2017-05-19 14:20:37 -04:00
b6f5e8d9a1 Fix T51524: Instantiated Hair Object which has dupligroup children and hidden orig objects of group crash at render.
Note that this is speculative fix, actually precisely understanding what
happens in this code is... not easy.
2017-05-19 19:40:22 +02:00
985574c010 Move particle drawing to object mode 2017-05-19 19:18:34 +02:00
8561a2dda7 OpenGL: remove BIT_OPERATIONS check from GLSL
Since the upgrade we can use bitwise operations without checking. No more lame fallbacks!
2017-05-19 12:36:10 -04:00
5218860607 Fix issue with alpha layering for AA dot drawing 2017-05-19 18:01:24 +02:00
42804d49b5 Implement particle drawing with draw manager
This still has a couple of issues:
* Instancing is not working when multiple particle systems use the same
primitive. Only the last particle system to be drawn with a particular
primitive shows up.

* Because of colors being passed as uniforms with static variables, the
color of the collection of the last object to be evauluated is used for
all particles being displayed.

Also, note that while this is being drawn in the clay engine, this might
be moved to the object mode later intead.

Part of T51378
2017-05-19 17:23:19 +02:00
c62bec8d99 Change particle draw_size default and limits
Particle draw size can now no longer be less than 1px, and the default
value has been changed to 4.
2017-05-19 17:23:19 +02:00
ef3c255457 fix typo in interlace shader
introduced by recent 8adec78ca5
2017-05-19 11:09:12 -04:00
648f2a61ad OpenGL: convert old texture2D calls in built-in shaders 2017-05-19 11:09:12 -04:00
fa47437426 OpenGL: clean up smoke & fire shaders
TODO: swap gl_Vertex for vec3 pos, update smoke setup code
2017-05-19 11:09:12 -04:00
f6ffe12ddb OpenGL: convert old texture2D calls in FX shaders
And one texture1D call.
2017-05-19 11:09:12 -04:00
4c5e9d7c0d OpenGL: convert old texture2D calls in material GLSL
Modern GLSL simplifies texture sampling functions. Info about 1D, 2D, 3D, Cube, etc. comes from the sampler type.
2017-05-19 11:09:12 -04:00
8d4aff31ce Cycles: Fix compilation error after recent changes
Spotted by Steffen Dünner, thanks@
2017-05-19 16:48:42 +02:00
Julian Eisel
b90ad0ded7 Remove redundant workaround for removing collections in outliner
Collections are now identified by their pointer.
Also had to correct TSE_IS_REAL_ID to fix undefined behavior on undo.
2017-05-19 15:51:09 +02:00
Dalai Felinto
3af8f52752 Fix crash when changing Clay "Edge Strength"
This was introduced by a removed line in
rB0eb32ab22809d9c0c41bfff5082f58b1a7aa9965

If we want to change the value to a differen default, it should be done
in a separated commit.
2017-05-19 15:50:30 +02:00
0e46da76b7 Fix crash opening really old files with compositor
There was lack of certain sockets do-versaions: namely the ones
which were added in blender versions after the one used to save
the file.
2017-05-19 15:41:26 +02:00
Dalai Felinto
4525357a3a Fix crash when adding Torus in edit mode 2017-05-19 15:33:50 +02:00
Dalai Felinto
eb90798727 Fix assert on framebuffer binding 2017-05-19 14:39:27 +02:00
a7c4b6f49c Cleanup: add braces for multi-line blocks 2017-05-19 22:18:54 +10:00
Dalai Felinto
8975ad7a88 Remove unused functions after WITH_LEGACY_OPENGL cleanup 2017-05-19 14:16:00 +02:00
Dalai Felinto
2383667a2e Remove reference to WITH_LEGACY_OPENGL
We only keep this as a way to get GPU_stubs to run, in case we want to do a
throughout cleanup in the codebase and want code using legacy calls to
fail to build.
2017-05-19 14:15:49 +02:00
Dalai Felinto
3527739002 Remove reference to SUPPORT_LEGACY_MATRIX
Since the change to core profile this is no longer supported.
2017-05-19 14:14:46 +02:00
Dalai Felinto
60fc04fb9b Remove reference to WITH_GL_PROFILE_CORE
There is no more point of keep those around. ES20 may need special case
when/if we dabble with it again. Meanwhile no point on polluting the
code with this.

(ghost still has reference for the PROFILE, but that's reasonable)
2017-05-19 14:14:46 +02:00
Dalai Felinto
bad8b91fd3 Correct core profile way of getting color depth 2017-05-19 14:14:32 +02:00
ef549b9e55 Cycles: Cleanup, always use parenthesis
Easier to read/follow, and more robust for the further changes.
2017-05-19 12:57:51 +02:00
908bb8bd82 Cycles: Cleanup, indentation in preprocessor 2017-05-19 12:54:46 +02:00
90a62404cb Cycles: Cleanup, variable names
Don't use camel case for variable names. Leave that for the structures.
2017-05-19 12:52:12 +02:00
3a634524e3 Cycles: Cleanup, useless new lines 2017-05-19 12:45:22 +02:00
de86da521c Cycles: Cleanup, braces after function definition
I wouldn't mind switching fully to Google style, but i am against of
mixing two different styles in same project. So just stick to brace
at the new line after function definition.
2017-05-19 12:43:26 +02:00
803337f3f6 \0;115;0cCycles: Cleanup, use ccl_restrict instead of ccl_restrict_ptr
There were following issues with ccl_restrict_ptr:

- We already had ccl_restrict for all platforms.

- It was secretly adding `const` qualifier to the declaration,
  which is quite weird since non-const pointer can also be
  declared as restricted.

- We never in Blender are using foo_ptr or FooPtr type definitions,
  so not sure why we should introduce such a thing here.

- It is absolutely wrong from semantic point of view to put pointer
  into the restrict macro -- const is a part of type, not part of
  hint for compiler that some pointer is never aliased.
2017-05-19 12:41:03 +02:00
8e655446d1 Fix T51537: Light passes are summed twice for split kernel since denoise commit
Denoise commit introduced kernel_write_result() which saves light passes, so
no need to call both kernel_write_result() and kernel_write_light_passes() from
the split kernel.

Weirdly enough. kernel_write_result() does not take care about debug passes.
2017-05-19 12:14:03 +02:00
a5c73129c5 Fix T51556: Sequencer - White Balance Modifier - Masking is not honored 2017-05-19 11:29:18 +02:00
ec051f5103 Fix/workaround T51070: Cannot scale procedural texture in compositor
The issue is coming from some weird semi-finished canvas feature, which
was remapping coordinate without applying any differential on the sampling
ellipse (in fact, there is no ellipse, sampling think is always a single
pixel).

The whole thing is just weak in the compositor, for now just bring behavior
back to how it was prior to optimization (multithreading) commit.
2017-05-19 10:56:26 +02:00
edbd3ebcdc Compositor: Remove unused funciton 2017-05-19 10:55:26 +02:00
c409acd842 Cleanup: removing dummy legacy dashed line shader.
Dashed requires geom shader, which was not available with older OpenGL,
now that we are on 3.3 we do not need that dummy workaround anymore.
2017-05-19 09:42:30 +02:00
1f46da922a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/depsgraph/intern/depsgraph_tag.cc
	source/blender/editors/mask/mask_draw.c
2017-05-19 09:36:14 +02:00
f95828a018 Fix empty-image draw size
Was out of sync with 2.7x.
2017-05-19 16:41:23 +10:00
4a04d7ae89 Fix T51553: Cycles Volume Emission turns black when strength is 0 or color is black
The problem was that Cycles implicitly uses a transparent surface shader when only
volume nodes are used, but since the black emission shader gets optimized away,
it was no longer detected and therefore no transparent surface was used.

Therefore, the shader now stores whether volume nodes were connected before
optimizing.
2017-05-19 04:59:35 +02:00
cf1127f380 Fix T51506: Wrong shadow catcher color when using selective denoising 2017-05-19 04:04:54 +02:00
29f4a8510c Cycles: Fix random noise pattern seen with multiscatter bsdf and split kernel
Differentials were unset if roughness was low giving undefined behavior.
2017-05-18 21:39:23 -04:00
a21277b996 Fix T51555: Cycles tile count is incorrect when denoising is enabled
Now rendered and denoised tiles are counted and displayed separately.
2017-05-19 03:29:18 +02:00
321b98602d Remove use_display_lists option 2017-05-19 10:07:02 +10:00
ffd83a34ab Fix T51502: Cycles denoising not using correctly aligned width for NLM on CUDA 2017-05-19 02:06:54 +02:00
e03e977385 OpenGL: call glProgramUniform only if version >= 4.1
Otherwise crash! Called from OpenSubdiv setup code. Might start using this in more places...
2017-05-18 18:30:24 -04:00
77f8d631b1 OpenSubdiv: insert TODO notes for OpenGL 2017-05-18 18:30:24 -04:00
2e56e1415a OpenGL: remove EXT_geometry_shader4 from OpenSubdiv
Old extension was made obsolete by GL 3.2.
Input/output layout is part of GLSL.
2017-05-18 18:30:23 -04:00
ff8673399e OpenSubdiv: remove legacy support & display queries
OSD display needs more work, since it uses some legacy OpenGL light and material functions.
2017-05-18 18:30:23 -04:00
51278bab5d remove GPU_legacy_support query
In the move to OpenGL 3.3 core profile, we drop support for compatibility profile and older versions.

OpenSubdiv was the only user; I'll update OSD next.
2017-05-18 18:30:23 -04:00
414c1c0e77 OpenGL: remove -noglsl option & GPU_extensions_disable
Also removed a leftover reference to the old basic-shader-glsl option.
2017-05-18 18:30:23 -04:00
5ed0944ce6 GPU: cleanup GLSL version and standard extensions
Now we always use GLSL 3.3, AKA #version 330. Most of the extensions we used are built into OpenGL 3.3 so we don't need them anymore.

Cleaned up comments related to GLSL version.

Part of T49012
2017-05-18 18:30:23 -04:00
7823957455 remove GPU_geometry_shader_support, instanced_drawing_support queries
These are always supported now
- instancing as of GL 3.1
- geometry shaders as of GL 3.2

The change to rna_scene.c could use some cleanup, since we don't really need a runtime query function.
2017-05-18 18:30:23 -04:00
8cb3c7bdec remove GPU_display_list_support query
Display lists are not part of modern OpenGL.

Only BGE used this, and I forced those uses to false. Commented out old BGE logic for reference.
2017-05-18 18:30:23 -04:00
740cd28748 Cycles Denoising: Add more robust outlier heuristic to avoid artifacts
Extremely bright pixels in the rendered image cause the denoising algorithm
to produce extremely noticable artifacts. Therefore, a heuristic is needed
to exclude these pixels from the filtering process.

The new approach calculates the 75% percentile of the 5x5 neighborhood of
each pixel and flags the pixel if it is more than twice as bright.

During the reconstruction process, flagged pixels are skipped. Therefore,
they don't cause any problems for neighboring pixels, and the outlier pixels
themselves are replaced by a prediction of their actual value based on their
feature pass values and the neighboring pixels.

Therefore, the denoiser now also works as a smarter despeckling filter that
uses a more accurate prediction of the pixel instead of a simple average.
This can be used even if denoising isn't wanted by setting the denoising
radius to 1.
2017-05-18 21:55:56 +02:00
b3a3459e1a Cycles Denoising: Fix wrong order of denoising feature passes 2017-05-18 21:55:56 +02:00
9586cc4708 Cycles: Cleanup MultiGGX closure implementation
The implementation originally handled four different cases:
Regular glossy, glass, metallic fresnel glossy and diffuse.

However, only the first two are actually used currently. Therefore, this commit
removes the other two, which allows to simplify the code.

Additionally, due to the Principled BSDF, the function arguments are now
identical for glossy and glass, which allows to get rid of some ugly #ifdefs.
2017-05-18 21:55:56 +02:00
13687e89d8 GPUViewport: Fix huge memory leak. 2017-05-18 20:32:36 +02:00
Dalai Felinto
781e22c2df Remove viewport shading panel
We can remove the RNA options as well, but I wanted to tackled the UI
first.
2017-05-18 18:46:46 +02:00
Dalai Felinto
740f33d8a2 Remove "Modern Viewport"
The "Modern Viewport" was an option in the Viewport panel that would use
the new fancy wire frame code and some depth debugging functionality.

This was introduced as a quick and dirty way to get the new drawing
system showing in the viewport.

Overtime we built a complete Draw Manager system, leaving this original
approach deprecated which adds clutter to Blender code since it would be
removed sooner or later.

Note: The new fancy wireframes and related shaders (white out other
objects) are still in Blender code, though you can't use them anymore.

If we are to have any of those drawing options they should be integrated
in the new draw manager, instead of integrated in the old drawing
pipeline as it was originally coded.
2017-05-18 18:46:46 +02:00
ec774fdb48 Eevee: Fix fresnel factor to match Unreal Engine specular input. 2017-05-18 18:35:55 +02:00
e52a7584be Eevee: Fix GPUShader not free. 2017-05-18 18:35:55 +02:00
d00ab4a507 Fix menu inconsistencies
This commit fixes two issues:

- UV/Image editor uvs menu did not match the 3D View's which was changed in rB2b240b043078
- Circle select tool was missing in particle edit mode

Reviewers: Severin
Differential Revision: https://developer.blender.org/D2329
2017-05-18 18:22:45 +02:00
Dalai Felinto
c9e7a13abb Fix UI button text for Eevee "Use Nodes" 2017-05-18 17:42:25 +02:00
Dalai Felinto
c2191912ca Freestyle is back for 2.8
It works with Cycles and Blender Internal for now.

The Blender Internal support will disappear, but we should be able to
integrate it with the Draw manager and use it with Clay, Eevee, ...
2017-05-18 17:34:03 +02:00
6bf05ab2ca Install_deps: py 3.5.3, collada 22b1f4ff026881b4 (2.6.47), OCIO 6de971097c7f5. 2017-05-18 16:53:07 +02:00
Dalai Felinto
c36eb9b291 Rename Iterator struct to BLI_Iterator 2017-05-18 16:53:02 +02:00
849b26c746 Draw Manager: Fix buffer reuse. 2017-05-18 16:50:48 +02:00
d92a9a5472 Use the correct depsgraph for freestyle
Freestyle itself is still not working, but that's to be addressed
separately.
2017-05-18 16:14:32 +02:00
7490b24241 Draw Manager: Fix instancing. Again. 2017-05-18 16:05:03 +02:00
242a044bd1 GPUMaterial: Add support for tangent node. 2017-05-18 16:05:03 +02:00
49bd3d3a1a Cycles: Fix crash loading single channel texture
Was  typo in recent isfinite check.
2017-05-18 15:49:03 +02:00
Dalai Felinto
c55c2dbfba Make sure external engines also render fine with depsgraph + freestyle wip
There is still a crash when using freestyle and Cycles,
but the changes here present are harmless
2017-05-18 14:48:13 +02:00
00164f3c70 Correct own error using u32 for back-buffer select 2017-05-18 22:33:34 +10:00
1247f609d4 Correct last commit
VERT_VISIT was used in a nested function.
2017-05-18 21:48:52 +10:00
Pascal Schoen
32c9d2322c Fix T51408: Cycles - Principled BSDF Shader - Transparency is not working as expected
Renamed the "Transparency" input of the Principled BSDF to
"Transmission" and "Refraction Roughness" to "Transmission Roughness".
2017-05-18 13:18:19 +02:00
208462e424 Fix T51539: BMesh boolean crash
In some cases the vertex visit queue would exceed its max length,
visiting the same vertex multiple times.
2017-05-18 21:09:06 +10:00
dad10ab118 DwM: Support flat-shaded w/ clay & eevee engines
Needed for sculpt mode drawing w/ engines, see: T51497
2017-05-18 20:43:53 +10:00
5dd9e17266 DwM: Armature: Cleanup envelope bone code a bit.
Mainly adding 'wire' suffix to wire/distance drawing func and shader.

Also, match wire vertex shader behavior with solid one regarding
head/tail only drawing (i.e. alwas expect head bone mat, never tail one,
and assume that if a radius is negative, then we only draw on the other
end of the bone).
2017-05-18 12:13:19 +02:00
23f256b24b DwM: Armature: add solid envelope bone drawing.
Envelope bones are now pretty much identical to old drawing code.

Note that currently new DwM drawing code does not seem to care about
wire/solid drawing modes at all, guess this is still TODO... For now we
hence just get both wire and solid for envelope bones, this can be
refined later.
2017-05-18 12:13:19 +02:00
5919919955 DwM: Armature: refine drawing condition of envelope distance outline.
Should match better original 2.7x behavior now.
2017-05-18 12:13:19 +02:00
c75cde31db Re-use vertex position VBO in weight-paint mode 2017-05-18 14:53:43 +10:00
3900b7b1e7 Cleanup: simplify material checks w/ clay engine
Instead of manipulating args when checking for duplicates,
just convert the material and memcmp.
2017-05-18 13:06:51 +10:00
4047715af3 Cleanup: use pre-defined STRINGIFY macro 2017-05-18 11:22:24 +10:00
102394a323 Fix T51538: Weight-paint circle select w/ clipping 2017-05-18 10:43:34 +10:00
5ec6982a82 Draw Manager: Fix instancing. 2017-05-18 01:50:06 +02:00
11e7e0769a Eevee: fix orco. 2017-05-18 01:50:06 +02:00
00a5885136 Eevee: Refactor shaders defines 2017-05-18 01:50:06 +02:00
af3954fe90 Eevee: fix bug with postprocess buffer sharing. 2017-05-18 01:50:06 +02:00
ecee490d13 Eevee: Some changes to default shader.
Use old BI material prop and use a metallic approach.
2017-05-18 01:50:06 +02:00
Dalai Felinto
60cd996c0a Silence warnings in Mac (based on buildbot build report) 2017-05-17 18:13:10 +02:00
Dalai Felinto
970a7c8bb9 Fix blenderplayer 2017-05-17 17:55:31 +02:00
cd8909fbc9 Fix typo in hair shader view vector 2017-05-17 17:27:48 +02:00
c4d122e305 Cycles: Optimize expansion of headers in the source
Use smarter check of where the file is coming from instead of
attempting to replace same source twice with different settings.

Brings down processing time from 3.6sec to 1.8sec.
2017-05-17 17:26:35 +02:00
9a910443c4 Fix compilation error in Cycles
Was caused by recent fix with finite checks.

Fixes T51536.
2017-05-17 17:23:32 +02:00
f628cfd297 Fix T51535: View vector inverting in pespective/ortho 2017-05-17 16:42:38 +02:00
1d49205b1a Fix T51529: Black boxes on a denoising render when using a .exr image as a environmental texture
It is caused by NaN value in the input texture. Now we check for all the pixels
having proper finite values.

Should also help here in the studio,
2017-05-17 15:29:47 +02:00
a56c80cd45 Eevee: fixed Material UI. 2017-05-17 15:06:26 +02:00
cc2755b443 Revert "Cycles: Fix wrong shading on GPU when background has NaN pixels and MIS enabled"
This reverts commit 581c819013.

Seems we do need to do finite check early on, this is incoming.
2017-05-17 15:06:05 +02:00
47f8459ead Fix T51388: Mask moves when zoom is changed in the movie clip editor
Incorrect matrix space for stabilization.
2017-05-17 14:51:51 +02:00
1693d7d887 Fix annoying warning about unused debug var in release builds. 2017-05-17 14:37:30 +02:00
d0ceb1821b DwM: Armature: fix bone distance outline drawing.
This indeed needed its own draw pass, thank to @fclem for the hints!

Also fixes a stupid mistake in bones head/tail coloring.
2017-05-17 14:33:34 +02:00
3c799ba801 DwM: Armature: Add distance outline and wire drawing of envelope bones.
This is not complete, it does not implement 3D solid drawing of
envelope bones. 2D wire is hence always drawn for now.

Some notes:

I did not try to implement the 'capsule' approach suggested by @fclem, because:
  1. I spent enough time on this already, and finally got something working.
  2. I managed to get rid of geometry shader completely.
  3. Current approach allows us to use same shader for
     distance outline and envelope wire.

It's working fine, except for one glitch - superpositions of envelope
outlines do not work as expected, not sure what's wrong here, tried to
disable zbuff, enable GL_BLEND, no luck so far...
I think we need our own 'background' drawpass to get them working (also
to avoid them drawing over the wire lines).
2017-05-17 12:34:06 +02:00
f674bc90e2 BMesh: remove duplicate argument for wireframe op 2017-05-17 20:31:14 +10:00
Hristo Gueorguiev
40e6f65ea1 Fix T50937: baking with OpenCL and CPU have slightly different brightness
OpenCL baking with SSS and Volume are not supported.
2017-05-17 12:24:16 +02:00
11c167ff76 Fix particle system batch_cache on object duplication 2017-05-17 11:19:36 +02:00
c104b7b0b3 DWM: reuse position VBO for vpaint select overlay 2017-05-17 19:21:16 +10:00
a769c4a3a0 Fix weight-painting out of facemask mode w/ hidden faces
Own error in recent commit
2017-05-17 19:08:09 +10:00
Dalai Felinto
c8e96a8b6b Fixup on weightpaint shader after rBfabd55a5e9 2017-05-17 10:35:36 +02:00
24676b535a Fix T49981: When camera is on inactive layer, it does not evaluate constraints
Second round of fix, was broken by 843be91.
2017-05-17 10:22:40 +02:00
Dalai Felinto
fca52c42ae Clay hair: use builtin reflect function 2017-05-17 10:21:08 +02:00
fabd55a5e9 DWM: hide hidden verts in weight-paint mode 2017-05-17 18:09:40 +10:00
c18c3ff3d5 Cleanup: line length 2017-05-17 17:37:23 +10:00
d41f98406f DWM: minor changes to face-flag use 2017-05-17 17:27:20 +10:00
e74177d3b1 Correct own error in copying vertex color to VBO's 2017-05-17 17:14:10 +10:00
e074ac65a6 DWM: don't use engine drawing for paint modes
Also only use sculpt-mode drawing with the active object.
2017-05-17 17:06:55 +10:00
3926e3ef68 DWM: correct unselected face overlay 2017-05-17 16:41:21 +10:00
9995bd8532 DWM: use DRWContextState.obact 2017-05-17 16:08:36 +10:00
741a4cfc0b DWM: Initial support vert & weight hidden faces 2017-05-17 16:01:18 +10:00
17458c511c Cleanup: quiet warning 2017-05-17 13:38:06 +10:00
aa66f2c7eb Use byte color for selection drawing
Some small advantage to using 1/4 sized data-type.
2017-05-17 13:31:01 +10:00
431b7c8eb1 Correct flag when drawing editmode face select
Own error in updating select code.
2017-05-17 13:26:09 +10:00
b4ec0e8cd5 DWM: use generic header for DRWCall
Avoid alignment mis-match casting between different draw-call types.
2017-05-17 12:58:58 +10:00
5bfeaf6cc1 Cleanup: group VBO attributes in a struct
Some names are a bit arbitrary,
this makes it clear which names are VBO attributes.
2017-05-17 12:36:02 +10:00
3d6361aa9c Cleanup: clarify select terminology
In mesh cache we have select: color, id, bool.
Current naming didn't make this clear.
2017-05-17 11:47:31 +10:00
89483c73fd DWM: write mesh data to the VBO directly
Was using intermediate functions to store each data type.
This is still done in some places (for more involved access).

For basic data: coords, normals, colors..etc this is unnecessarily indirect.
2017-05-17 11:34:42 +10:00
2f6bc53874 DWM: Add obact for convenience
Modes often need to check if the object is the active one.
2017-05-17 11:03:09 +10:00
8adec78ca5 Cleanup: remove GLSL version checks 2017-05-17 10:46:42 +10:00
c8bf3984ee Gawain: Fix crash in release build.
Non-initiliazed var, I thought I was clever than this. :(
2017-05-17 01:43:49 +02:00
0a6c57d3d2 Fix crash from freeing of NULL pointer 2017-05-16 16:29:27 -04:00
966a2681f9 Cycles: Fix building with native only option
Approach suggested by Lukas S.
2017-05-16 16:05:04 -04:00
e14a2e87dc Revert "Cycles: Fix native only kernel since denoiser commit"
Fix didn't work in debug mode due to undefined references.

This reverts commit 5319571511.
2017-05-16 16:03:27 -04:00
58a810e640 Draw Manager: Add support for instance Batch.
Idea is to specify a batch as source of vbo instance attrib.
2017-05-16 20:30:17 +02:00
fa76c69627 Draw Manager: support render only mode. 2017-05-16 20:30:17 +02:00
90aff807ab Draw Manager: Texture Memory usage improvement.
-Use 11_11_10 buffers for hdr content.
-Eevee compositing share 1 buffer if bloom and DOF are both activated.
-Fix slowdown when resizing EEVEE viewport.
-Removed DRW_BUF_*** enums causing confusion.
2017-05-16 20:30:17 +02:00
ddc5896c81 Draw Manager: Improve debug 2017-05-16 20:30:17 +02:00
2e8cb8d836 Draw Manager: Make use of texture reuse. 2017-05-16 20:30:17 +02:00
7a029f4e00 GPUViewport: Add a Texture Pool to reuse textures across engines. 2017-05-16 20:27:52 +02:00
dc01586b40 Fix crash when particle display is below 100% 2017-05-16 17:42:14 +02:00
95547bd750 Minor cleanup in clay_engine.c 2017-05-16 16:43:48 +02:00
Dalai Felinto
15317775c5 Outliner: Bring back "activate" object when selecting from outliner 2017-05-16 16:40:00 +02:00
d59721c2c3 Fix T50673: OpenEXR multilayer image truncated on save
The issue is in OpenEXR itself. See the report fomr some more details.
2017-05-16 16:34:49 +02:00
Dalai Felinto
3826e77593 Draw Manager: Small cleanup on bool and bitwise
We should avoid casting from an int to a flag.

In this case it is probably fine, but if the OB_MODE_SCULPT
was too high it can overflow the bool.

(also adding explicit parenthesis to a flag check)
2017-05-16 16:26:00 +02:00
Dalai Felinto
b11168c8f1 Clay/Hair: Only show hair when in object mode 2017-05-16 16:18:17 +02:00
c6da3c2655 Fix hair drawing with collection clay settings overrides 2017-05-16 16:07:45 +02:00
26b2323189 Fix memory leak when saving OpenEXR files
It is not a good idea to:

1. Duplicate metadata to self
2. Ignore the fact that something might have had metadata already.

Also moved metadata copy to a preparation function, so it is
never lost.
2017-05-16 15:36:29 +02:00
Dalai Felinto
e43597446e Fix hair width changing 2017-05-16 14:55:36 +02:00
8be9d68dd4 Fix T49467: Crash due to assert failure in bevel.
The mesh interpolation code had an edge case where one of two
adjacent edges to a vertex has 0 length. This caused an assert
failure indexing the vertex mesh for splash Blenderman.blend.
2017-05-16 07:19:01 -04:00
Dalai Felinto
c81950fbd5 UI: Expose Views to eevee and clay 2017-05-16 12:58:02 +02:00
Dalai Felinto
1e31127933 Fix info header stats to iterator over layer instead of scene
Although this is working fine, there are two changes expected in the new
future once depsgraph copy on write is implemented:

1) To call ED_info_stats_clear a callback from depsgraph, instead of the
notifier system. (that would also allow us to clear only one
SceneLayer).

2) To store/get stats from the evaluated SceneLayer, as well as iterate
over the evaluated objects as well.
2017-05-16 12:50:23 +02:00
a70a7f9db3 Fix T49864: EnvMap baking crashes 2.78 if 'Full Sample' checked in AA 2017-05-16 12:40:04 +02:00
f89c6e739a Fix memory leak in environment
Found when was looking into T49864. The issue is caused here
by render_copy_renderdata() doing a copy of views with
BLI_duplicatelist() so we can not just zero the pointers out.

Similar thing is happening for layers as well.
2017-05-16 10:57:28 +02:00
9619275729 Correct last commit, missing assignment 2017-05-16 18:47:43 +10:00
027ae0fdef Fix sculpt dyntopo undo leaving PBVH at NULL 2017-05-16 18:38:45 +10:00
Olly Funkster
06ac6ded66 Fix byte-to-float conversion when using scene strips in sequencer with identical color spaces
Fix T50882: VSE: Blend Modes on Scenes do not layer properly
Fix T51002: Scene strip with Alpha over not working as expected

The byte-to-float conversion was being skipped if the color spaces of the sequence and the scene
are the same, which is the default, resulting in any non-float strips becoming invisible.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2635
2017-05-16 10:36:33 +02:00
f6afd1b73c Make imbuf's OIIO bindings to compile with latest OIIO from git 2017-05-16 09:35:46 +02:00
6c951fbd34 GPU: use ifdef for flat shader 2017-05-16 16:57:26 +10:00
2fa2814c82 Fix sculpt drawing with Blender viewport
Would draw without any lighting
2017-05-16 16:38:50 +10:00
cbe97bc50f Fix face-dot's not drawing
regression in d12d8956
2017-05-16 14:57:28 +10:00
a8aebc8dd1 Fix memory leak with mesh cache (w/ select invalidate) 2017-05-16 14:55:29 +10:00
d05d73ae75 Fix memory leak with mesh cache (missed last commit) 2017-05-16 13:06:23 +10:00
57660aac74 Merge branch 'master' into blender2.8 2017-05-16 13:01:26 +10:00
d508b69e44 Cleanup: gcc7.1 warnings 2017-05-16 12:46:52 +10:00
5a90542d3d Fix memory leak with mesh cache 2017-05-16 11:45:23 +10:00
12651aba03 Fix hair_step is a short 2017-05-15 17:28:01 -04:00
15e8fbd549 Fix compile error on gcc after last commit
error: static assertion failed: "invalid limits"
2017-05-15 16:43:33 -04:00
4621583612 Fix T51297: Use A Higher Hair Segment Limit
Normally, segments up to 50 can be quite enough for most cases.
However, when dealing with things like braids,
the current limit can sometimes be quite a pain.
2017-05-15 14:29:59 -04:00
87bbeb2837 Gawain: further cleanup to VertexBuffer_prime
Get buffer size once, use it to both allocate and track VRAM.
2017-05-15 13:08:38 -04:00
30d325c9e6 Gawain: cleanup VRAM usage metric
same functionality
2017-05-15 13:08:38 -04:00
4f7c738a38 Gawain: revert recent VRAM usage metric
Revert 7a18ee62eb and 1ff97bbfff after discussing with @fclem.

VertexBuffer_size should always report the same buffer size, but without asking/calling OpenGL.
2017-05-15 13:08:38 -04:00
5319571511 Cycles: Fix native only kernel since denoiser commit 2017-05-15 18:37:33 +02:00
77d0aec3d1 Mesh Batch Cache: Use compressed format.
We don't compress UV by default because that would mean restricting them to [0, 1]
Leaving all other code for later settings switch.
2017-05-15 17:55:36 +02:00
9035aa9cee Use better prng algo and fix randomness UI 2017-05-15 17:27:15 +02:00
392b5b8212 Implement matcaps for hair 2017-05-15 17:27:14 +02:00
7a18ee62eb Gawain: Fix memory manager. 2017-05-15 16:24:24 +02:00
c28a4eb8cb Eevee: fix some glsl for low quality lamps. 2017-05-15 16:14:18 +02:00
e053fade99 Mesh Batch Cache: get rid of the ORCO VBO data, and reconstruct it in shader.
With only one MADD instruction we recover the orco data and reduce both the storage and the fetching cost of an attrib layer.
2017-05-15 16:14:18 +02:00
ae9da3786a Gawain: Add assert for maximum attribute name. 2017-05-15 16:14:18 +02:00
1ff97bbfff Gawain: Better metric for VRAM usage. 2017-05-15 16:14:18 +02:00
38125d0499 Mesh Batch Cache: Define Compressed format for shading data.
Deactivated by default.
All shading attribs can be packed to take less VRAM at the cost of precision (not noticable in this case).
UVs can be packed into I16 but that limits their positions into the [-1, +1] range.

This could be a setting option in the future.
2017-05-15 16:14:17 +02:00
f83a244749 Mesh Batch Cache: Optimization, make use of gawain attrib aliases. 2017-05-15 16:14:17 +02:00
cfbfa94e6b Gawain: Add support for multiple attrib names.
This adds the possibility to give multiple name to the same attrib.
This allow multiple binding points depending on the shader.
2017-05-15 16:14:17 +02:00
acc5d02f69 Edit Mode Engine: Fix loose edges/verts not displaying. 2017-05-15 16:14:17 +02:00
5a377521aa Mesh Batch Cache: Split Edit Mesh mode Vertex Buffers for faster update. 2017-05-15 16:14:17 +02:00
b3e62a8aa2 Gawain: add short vector conversion to 10_10_10 2017-05-15 16:14:17 +02:00
1c21e088f2 Fix T50109: Blender crash when a "Render Result" as a Texture
This commit fixes crash, but user feedback can be improved here to
inform artist that one can't use Render Result as a texture since that
will cause feedback loop.
2017-05-15 15:59:47 +02:00
ef8ad66aa2 Fix T49324: True displacement crashes when shader returns NaN 2017-05-15 15:45:19 +02:00
1f96dd2e0b Fix T51348: Node highlighting is broken
This feature was disabled in the code but not in the interface.

Removing the code, since it needs full re-implementation anyway.
2017-05-15 13:52:17 +02:00
Dalai Felinto
b60f80e9b3 Fix T51501: Cycles baking cancel affects baking script
Basically upon invoking cycles baking we could canell it which would
leave G.is_break hanging as true. Since we were not setting is_break to
false before exec baking, it would misbehave.
2017-05-15 13:04:44 +02:00
b43f66bcb6 Add show-weights to edit-mode UI 2017-05-15 17:56:22 +10:00
df94f2f399 Fix T51180: BMesh crash using calc_uvs=True
Don't assume UV layer exist.
2017-05-15 16:53:57 +10:00
0d65dda147 Merge branch 'master' into blender2.8 2017-05-15 15:51:54 +10:00
b5b72a3f29 PyAPI: don't re-register add-ons on 'New File'
Some add-ons have bugs with re-registration,
they should be fixed, but no need to exacerbate the problem.
2017-05-15 15:33:01 +10:00
687ff699e9 Cleanup: warnings, style 2017-05-15 14:58:55 +10:00
Julian Eisel
77a90f7666 Fix crash when using template_search with non-ID data 2017-05-13 19:48:04 +02:00
Julian Eisel
2d22092230 Merge branch 'master' into blender2.8 2017-05-13 19:35:54 +02:00
890d871bc3 Fix T51314: crash cancelling Cycles bake during scene sync and update. 2017-05-13 07:15:25 +02:00
41c4c3f8fd remove unused #includes 2017-05-12 23:34:21 -04:00
6deaab207c remove old PBVH VertexBufferFormat struct
Follow-up to 0722e41f9e which removed all uses of this struct. Gawain VertexFormat auto aligns attributes as described in @nicholasbishop's performance note.
2017-05-12 23:32:37 -04:00
1bcbad446e Fix ogl deprecated calls. 2017-05-12 18:02:31 +02:00
7d12d8956d Sculpt: Move sculpt drawing to engines.
Only mask are handled by sculpt mode engine and are multiplied on top of the render.
There is room for improvement:
 - Shaded meshes don't have correct tangents or uvs.
 - Masks are in range 0.8 - 0.2 thus always darkening at least 20% the render.
 - It only uses the first material slot of the mesh.
2017-05-12 17:54:14 +02:00
Dalai Felinto
2eff390e13 UI: Expose more UI settings to CLAY and EEVEE
Physics panels are not all back, and the material related panels (e.g.,
hair render panel) should go be changed since there should be no
material for those.
2017-05-12 16:45:51 +02:00
8ca9fa5fd3 Fix T51153: Video duration is detected wrong after FFmpeg update
The issue was caused by stupid workaorund for libav. Now things works for
FFmpeg. There might need some tweaks needed for Libav, but that one is
not really priority for support.
2017-05-12 16:43:36 +02:00
dbd3bf5ed2 Fix memleak in previous hair commit 2017-05-12 16:34:33 +02:00
c986b07e4d Draw Manager: Fix crash when saving file. 2017-05-12 16:31:12 +02:00
5aca575d85 Eevee: Add Rotation and ratio parameters to DoF. 2017-05-12 16:31:12 +02:00
0eb32ab228 Implement hair drawing with Draw Manager in Clay engine
Part of T51378
2017-05-12 16:14:55 +02:00
bd31b1f182 Clay: Use switch statement instead of if-else chain 2017-05-12 15:47:33 +02:00
Dalai Felinto
24168f72c3 Fix for edit modes (sculpt, weight paint) menus not showing in header
But introduced on 2b0f02057f
2017-05-12 15:46:54 +02:00
Julian Eisel
18a96e39ea Merge branch 'master' into blender2.8 2017-05-12 15:36:52 +02:00
Dalai Felinto
56859ae7fd Startup.blend: set EEVEE as the default engine
The original idea was to use Clay as the default. But since clay may not
even be in the final release, we can't afford to have a startup.blend
that doesn't deliver a reliable result regardless of build options.
2017-05-12 13:54:48 +02:00
3a5501d168 Use static assert in Clay engine to ensure struct alignment 2017-05-12 12:02:45 +02:00
20881a7794 Some minor cleanup. 2017-05-12 11:57:15 +02:00
3394f7c74b Fix again DwM bbones drawing.
Stupid mistake in rB6824ee0595c9dd7d1c18864f2 fix, again reported by
@campbellbarton, thanks.
2017-05-12 11:56:26 +02:00
37bc3850ce Mesh Center: improved center-of-mass calculation
Previous method was based on face-area, giving un-even results
based on topology and gave issues with zero area faces.

This method gives matching results for concave ngons and the same geometry triangulated.
2017-05-12 11:04:38 +10:00
Julian Eisel
c20c203b82 UI: Add template_search (version of template_ID for non-IDs)
Adds a version of template_ID that can be used for non-ID properties.
The property to search for and the collection to search in has to be
passed to it.
Like template_ID it also takes arguments to define a 'new' and 'unlink'
operator. They will be displayed as icon-only buttons then.
Also added a version that can display preview thumbnails.

Had to do some additional changes to make text-buttons support
displaying/modifying empty RNA properties.

This will be needed for workspaces, see D2451.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D2666
2017-05-12 01:47:55 +02:00
868678c85f Fix T51449: empty node editor continuously redrawing and using CPU. 2017-05-11 20:32:19 +02:00
Dalai Felinto
c8ab7d4656 Force core profile as main profile
This removes a few options from CMake:
* WITH_LEGACY_OPENGL
* WITH_GL_PROFILE_COMPAT
* WITH_GL_PROFILE_CORE

We still have WITH_GL_PROFILE_ES20. So you can still alternate between
ES20 and CORE profile (when es20 is disabled).

If you want to explicitly see the stubs errors just define
WITH_LEGACY_OPENGL.
2017-05-11 16:47:46 +02:00
9c102f339d Merge branch 'master' into blender2.8 2017-05-11 16:47:21 +02:00
77d633399c BGE: Use BLI's stringify instead of implementing it again
Will solve compilation error in 2.8.
2017-05-11 16:46:43 +02:00
ef3aaa3269 Eevee: Small Dof upsampling blur.
This soften the low res buffer so that jaggies are less perceptible.
Also soften the nearplane transition.
2017-05-11 16:29:35 +02:00
3fbafaffa1 Eevee: Add tonemapping using ocio.
Actually it's done by the Draw Manager, so other engines can use it.
2017-05-11 16:29:35 +02:00
3341c11bcc Eevee: Disable motion blur if camera is different from its animated pose. 2017-05-11 16:29:35 +02:00
2e39a27e3b Eevee: Fix light color being non-linear. 2017-05-11 16:29:35 +02:00
c8d8f04746 Eevee: Fix motion blur when not having set another key. 2017-05-11 16:29:35 +02:00
6fb568af79 Eevee: Add render properties and scene panel. 2017-05-11 16:29:35 +02:00
4edee280e4 Merge branch 'master' into blender2.8 2017-05-11 16:28:58 +02:00
8eeb610832 Depsgraph: Fix/workaround crahs when fcu->rna_path is NULL 2017-05-11 16:28:21 +02:00
Dalai Felinto
2f8a5ed985 Remove warnings after CDDM fix 2017-05-11 16:15:26 +02:00
Dalai Felinto
4f96c24af2 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-11 16:11:02 +02:00
Dalai Felinto
bde45b5ae7 Allow building the game engine with core profile
Note: This is not about functionality, but about using the same stub file
we are using in Blender for the game engine.
2017-05-11 16:10:53 +02:00
Dalai Felinto
6b9ab1f7a2 Unifying access to GLEW from the Blender Game Engine
Note: This is not about functionality, but about using the same stub file
we are using in Blender for the game engine in blender2.8.
2017-05-11 16:08:03 +02:00
d58310fe37 Support drawing of solid mode CDDM with core profile
Nothing terribly exciting, just a hackish implementation of solid mode CDDM
drawing for cases when we are building with core profile.

The goal is to be able to see SOMETHING with new OpenGL for thew guys who
tests alembic and friends in blender2.8 branch. This is a temporary solution,
the whole drawing will be reworked. Limited to hardcoded material and lighting.
Selection outline color is also hardcoded because of lack of glColor() in the
core profile.

After this commit there is no big stoppers from stop worrying about legacy
OpenGL, so we can go core profile as the only way for Blender.

While some areas will become broken after that, we'd better just fix them
after that and for now just focus on more important design work.
2017-05-11 16:00:47 +02:00
f129e48993 Merge branch 'master' into blender2.8 2017-05-11 22:16:23 +10:00
4e7eafb86f Eevee: Fix motion blur. 2017-05-11 14:17:38 +02:00
0e0888970d Merge branch 'master' into blender2.8 2017-05-11 22:07:00 +10:00
15038975a3 Cleanup: GPU PBVH naming
Use GPU_pbvh prefix.
2017-05-11 22:05:19 +10:00
5ae58f8ab8 DWM: Use draw manager for sculpt PBVH drawing
Add a shader-group type to draw
generated geometry by running a callback.
2017-05-11 21:27:33 +10:00
f1242ea93b Fix bug in copying VertexFormat
Pointer-offsets need updating on copy,
seems VertexFormat's were being made static to avoid this bug?
2017-05-11 21:05:49 +10:00
Hristo Gueorguiev
90b9467861 Cycles: fix AO approximation for split kernel 2017-05-11 11:58:25 +02:00
0ffb19ca64 Revert "DWM: remove redundant state reset"
Enable this for now, needs some investigation.
2017-05-11 18:56:41 +10:00
2a2b23c142 Fix typo in the CMakeFile message 2017-05-11 10:06:12 +02:00
bb376c6693 Ammend last commit: add missing align for row props 2017-05-10 23:53:03 -04:00
c95a8bc68f UI: Follow up on recent VSE work
Fix a few more columns that should be rows
2017-05-10 23:53:03 -04:00
58a0c27546 Cycles: Fix occasional black pixels from denoising with excessive radii
Numerical inaccuracies would cause the XtWX matrix to be no longer
positive-semidefinite, which in turn caused the LSQ solver to fail.
2017-05-11 03:21:54 +02:00
f4b7c33c1a update new 2.79 themes: T50869 2017-05-11 10:27:16 +10:00
edd7c55796 Fix Blenderplayer stubs
The change from 62aa925c11 wasn't included.
2017-05-11 01:13:32 +02:00
3465f80319 DWM: remove redundant state reset 2017-05-11 08:36:17 +10:00
1e9f922c9e Merge branch 'master' into blender2.8 2017-05-11 07:53:03 +10:00
891159cea0 Merge branch 'master' into 28 2017-05-11 07:42:35 +10:00
722bcb554f Sculpt Drawing: reduce redundant color conversion
Also replace macro with for loop.
2017-05-11 07:39:56 +10:00
b82954f6f4 Fix T51455: Render Layers in compositor from a different scene not working
The code only updated nodes in the nodetree of the scene to which the render layer belongs. Therefore, when using scene B in the compositor setup of scene A, A's node wouldn't be updated.
With this fix, the update function loops over all scenes and checks them for relevant nodes.
2017-05-10 22:39:43 +02:00
50b67d83a9 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/makesrna/intern/rna_space.c
2017-05-10 20:40:31 +02:00
Dalai Felinto
f305aba868 Make sure 'use_property_button_exec' can deal with arrays as well 2017-05-10 20:36:11 +02:00
42c346028f Fix missing relation in new DEG between World and its NodeTree.
Was preventing update in 3DView etc. when changing something in the
World's NodeTree, especially annoying in blender2.8 branch (since legacy
depsgraph has been removed there), but also affecting master.
2017-05-10 20:35:59 +02:00
Dalai Felinto
4f80260f11 Expand the collection settings RNA API for arrays 2017-05-10 20:04:50 +02:00
Dalai Felinto
4240b67e4c Expand the collection settings API to support float arrays
We still need to update the RNA interface to access those. But since
there is no RNA_def_property_float_array_funcs I'm not sure how many
changes this will require.
2017-05-10 19:25:39 +02:00
8246246bda UI: editor menu, swap Text and node editors
Proposed by @sebastian_k and approved by @severin over IRC.

Follows up on rB0f561da5fb77540626aec7a995314271a91acdf6
2017-05-10 12:20:57 -04:00
Dalai Felinto
e5ec386803 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-10 17:03:27 +02:00
Dalai Felinto
62aa925c11 Fix T51354: Final take on multi-view (single view) issues
We now handle selection and transform manipulators
(kudos to Julian Eisel to help hunting down the latter).
2017-05-10 16:54:57 +02:00
45207bf3ce Eevee: Post process parameters.
-Display almost all parameters.
-Made some small adjustment to motion blur to support FOV motion blur.
-Made DOF max radius a parameter.
2017-05-10 16:03:25 +02:00
fdf2d8bb95 Eevee: Support for light path node "is camera ray" output. 2017-05-10 16:03:25 +02:00
da8b34e527 Eevee: Fix some issues
Fix issue with manipulator contributing to depth.
Fix blender internal shader.
2017-05-10 16:03:25 +02:00
Dalai Felinto
7902e3f1c8 Fix multi-view (single camera) selection 2017-05-10 16:00:42 +02:00
Dalai Felinto
a438750cad Fix multi-view (single camera) manipulators selection 2017-05-10 15:54:23 +02:00
Dalai Felinto
1a6b97e98f Merge remote-tracking branch 'origin/master' into blender2.8
Note: Depth placement was working already for BI, and althugh this
commit breaks it for it, it makes it work for the draw manager engines.
2017-05-10 15:40:08 +02:00
Dalai Felinto
90997710cc Merge commit 'origin/master (9395646c2c)' into blender2.8 2017-05-10 14:21:14 +02:00
Dalai Felinto
195d0fbae3 Fixup for multi-view single eye viewport issues
In d2f1f80a6f I was always calling view3d_main_regio_setup_view with
NULL matrices, which is not always correct.
2017-05-10 13:13:55 +02:00
0722e41f9e DWM: Use Gawain for sculpt drawing
Currently only uses the simple shader.
2017-05-10 20:35:51 +10:00
Dalai Felinto
d2f1f80a6f Partial fix to Multi-View single eye issues in viewport
Handling depth loop for now (3d cursor positioning). Selection is a bit
more tricky.

Reported on 51354
2017-05-10 12:21:51 +02:00
1c18d07a1c Eevee: Make Depth of field zoom invariant.
Multiply the sensor size by the viewcamtexcofac which is basicaly how scaled is the viewport relativly to the camera frame.
2017-05-10 00:57:53 +02:00
965571cca7 Draw Manager: Handle negative scaled meshes. 2017-05-10 00:47:27 +02:00
707756d277 Draw Manager: Extend simplification to UBOs & fix a context error. 2017-05-09 23:55:19 +02:00
8277609810 Small cleanup 2017-05-09 23:55:19 +02:00
e32ec677c3 Draw Manager: Simplify usage and check for errors. 2017-05-09 23:55:19 +02:00
9075f934aa Eevee: Initial Depth Of Field commit. 2017-05-09 23:55:19 +02:00
435f5017fa GPUCompositing: Fix comment and component count. 2017-05-09 23:55:19 +02:00
1413bee158 Draw Manager: Add additive blending. 2017-05-09 23:55:19 +02:00
26b6bd6e90 Object Mode Engine: Fix grid distance if view is camera view. 2017-05-09 23:55:19 +02:00
306603ae76 GPUTexture: Add support for 32bit textures. 2017-05-09 23:55:19 +02:00
6dc8368b8f Draw Manager: Add Triangle batching and empty batch.
This is usefull for Depth Of Field because we don't need to store data for each sprites and just generate them when rendering.
2017-05-09 23:55:19 +02:00
bf0ebfca1a Draw Manager: Fullscreen triangle
Used a triangle instead of a quad for fullscreen passes.
2017-05-09 23:55:19 +02:00
9395646c2c Fix errors in vse ui commit
- Fixes double labels
- Fixes an aligned layout when un-needed
- Fixes an error were a layout can become disabled but never enabled again
2017-05-09 14:46:29 -04:00
894513c7fd Fix (unreported): Crash if a right click is performed on an image datablock (open btn f.e.).
Only access/insert the button_pointer if it's not null...
2017-05-09 20:12:25 +02:00
Dalai Felinto
75ba1826c8 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-09 17:56:16 +02:00
4d38932cb4 Cycles: Use more stable version of integer square root function
Old code was working quite unreliable in combination with fast math
flag, especially when compiling with Clang. It seems we were hitting
result of the following bug submitted to Clang [1].

Basically, it was happening so that (int)sqrtf(64) was 7 when Cycles
is built with Clang but was correct 8 when built with GCC.

This commit works this around. Annoying, but don't see other way to
keep sampling pattern the same for Clang and GCC.

[1] https://bugs.llvm.org//show_bug.cgi?id=24063
2017-05-09 17:07:17 +02:00
e20eb2dec0 Cycles: Properly free memory used by KernelGlobals
Previous logic did not free memory used by vector classes
which were storing images, causing memory leaks.
2017-05-09 17:07:17 +02:00
24a64cb414 Fix shadow shader to support core profile. 2017-05-09 16:30:40 +02:00
Dalai Felinto
65ebb668ec glPushAttrib/Pop change implementation to use a stack
The original implementation (cbd78c8126) broke depth of field.
2017-05-09 15:23:33 +02:00
98ab2c682d Fix denoiser tooltip 2017-05-09 14:44:59 +02:00
86c299c6a4 Merge branch 'master' into blender2.8 2017-05-09 14:33:05 +02:00
Dalai Felinto
dad797d037 Expose camera stereo settings in Clay engines 2017-05-09 12:33:13 +02:00
ffc95a33b6 Fix T51434: Module math operation is wrong in GLSL shading
Based on patch from @lazydodo.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2661
2017-05-09 12:32:47 +02:00
06b2f10ad1 Cycles: Enable BPT for NVidia OpenCL 2017-05-09 11:44:18 +02:00
378d44daef Fix assert failure caused by bug in sequencer interface script
If icon_only is True then one must not pass text attribute.
2017-05-09 10:44:31 +02:00
586ab120e5 Libmv: Fix strict compiler warnings, unused variables 2017-05-09 10:16:42 +02:00
382c38efae Fix T51439: Object not updated when particle system settings change in 2.8
A bit too early to disable workaround for particles.

Guess it was commented out after particles removal but was not brought back
after particles restore commit.
2017-05-09 10:05:54 +02:00
0f561da5fb UI: Editor menu, move VSE below MCE
The idea here is to keep things in a logical order to match the order of ones worflow.
This concept can be seen in Graph > Dope Sheet > NLA. This issue is mainly affecting the manual.

Fixes T50709

Differential Revision: https://developer.blender.org/D2630
2017-05-08 23:38:31 -04:00
f7ce1be694 DWM: share positions & normals in shading VBO. 2017-05-09 10:56:22 +10:00
e35e23c72c Cleanup: rename layer-names -> layer-uuid
These names are created from a hash,
don't confuse with actual layer names.
2017-05-09 10:38:52 +10:00
faba1e7d6e DWM: Tangent support for editmesh 2017-05-09 10:26:36 +10:00
54af61440e Merge branch 'master' into blender2.8 2017-05-08 17:44:17 +02:00
717d85fb1c Fix missing render update when building without OCIO but having GLSL image draw method 2017-05-08 17:43:32 +02:00
a04c29e8ab Fix crash and assert failure when using OCIO GLSL draw mode and color management disabled
The issue was happening when display device is set to None, which makes it so
all the color transformation is a no-op which does not really require any LUT.

This is something we can not know from Blender side easily, because LUT sampling
and related logic is fully done in OCIO library itself. The following happens:

- OCIO sees that no LUT is needed and uses simple pass-through logic in the
  color conversion function.

- GLSL compiles sees that uniform used for LUT is unused in the GLSL code and
  strips it out.

We can not know this from Blender side because technically any conversion to
the same space might be a no-op and that we wouldn't know without some tricky
parse of the OCIO configuration.

So for now we simply avoid crash but are disabling checks for existence of the
uniform.

Ideally would be nice to have some GLSL-code parses which gets the uniforms
from the code itself, so we can distinguish between typo in the uniform name
and uniform being optimized out.
2017-05-08 16:45:07 +02:00
883c62d5d3 Add comment about vertex format created in OCIO 2017-05-08 16:40:59 +02:00
6aa7843de7 Fix wrong attributes and shader binding in sequencer when using OCIO 2017-05-08 16:38:49 +02:00
907135011a Fix hardcoded attribute locations used in image draw 2017-05-08 16:31:10 +02:00
81ecd3f938 Fix OCIO shader being attmepted to be unbound twice 2017-05-08 15:59:00 +02:00
0719a1bce0 Merge branch 'master' into blender2.8 2017-05-08 15:51:17 +02:00
49523c4d0e Cycles: Fix compilation error with gcc-6.3.0 and debug mode 2017-05-08 15:41:28 +02:00
a1442b7cea Fix capitalization in some particle panels 2017-05-08 15:24:31 +02:00
5e82981f47 Sequencer: Fix broken interface script since 415ff74 2017-05-08 14:54:49 +02:00
2fed99ad9f Fix T51379: Entering particle edit crash (temporary)
Disabled particle edit mode for now, as there's no point in fixing it
before refactor.
2017-05-08 11:47:47 +02:00
0dd766b043 DWM: Share VBO positions & normals for mesh cache
Select, weight & color cache included redundant position and normals.

Use multiple VBO's per batch for more efficient storage.
2017-05-08 17:39:41 +10:00
6f1a8739a0 DWM: Fix face center's not working w/ hidden faces 2017-05-08 16:16:28 +10:00
ce30ab1e02 Accidentally left show_weight enabled 2017-05-08 14:44:13 +10:00
d8bf5c1378 Cleanup: use struct for custom-data offsets 2017-05-08 13:00:44 +10:00
1a869fb6b9 DWM: show weights in edit-mode
Engine collection settings aren't currently flushed,
once they are this will work as expected.
2017-05-08 13:00:43 +10:00
0927748624 Vertex color access for edit-mode
Currently not used, adding since legacy drawing can display this.
2017-05-08 13:00:43 +10:00
d94e7936ee Cleanup: style & header guards 2017-05-08 13:00:43 +10:00
d2bd9195d4 Cleanup: naming 2017-05-08 13:00:43 +10:00
1cfc48192c Fix T51432: Find Files case sensitive on win32 2017-05-08 09:44:11 +10:00
Julian Eisel
9181f13af7 Merge branch 'master' into blender2.8 2017-05-08 00:19:22 +02:00
415ff7467c UI: Cleanup VSE Properties Shelf
The goal is to reduce wasted space and improve clarity in the 'N' panel of the VSE through layout changes.
The changes are intentional conservative to avoid making people re-learn anything.

Author: @mpan3

Differential Revision: https://developer.blender.org/D2439
2017-05-07 18:13:50 -04:00
ce28025eaf Remove unused node socket flag that was added in the render pass commit 2017-05-07 20:32:51 +02:00
e518ea9b5e Cycles: Fix transform addressing in the denoiser code 2017-05-07 18:50:24 +02:00
c9451f1cff [Cycles] Fix math problems in safe_logf
log(0) is undefined and should not have been included
log(1) == 0, dividing by zero is not recommended
2017-05-07 09:16:14 -06:00
3cd27374ee Color management: add Filmic view transform to Blender configuration.
* "Filmic" and "False Color" view transforms added (sRGB display device only).
* "Very Low/Low/Base/High/Very High Contrast" looks added.
* Added filtering so that Filmic only shows look names prefixed with "Filmic - ".

Filmic Dynamic Range LUT configuration created by Troy James Sobotka with
special thanks and feedback from Guillermo, Claudio Rocha, Bassam Kurdali,
Eugenio Pignataro, Henri Hebeisen, Jason Clarke, Haarm-Peter Duiker, Thomas
Mansencal, and Timothy Lottes.

Differential Revision: https://developer.blender.org/D2659
2017-05-07 16:41:38 +02:00
c47926542a GPUMaterial: Fix regressions concerning background texco 2017-05-07 15:51:54 +02:00
2a0c91b70c GPUViewport: Make Depth texture not depth testable. 2017-05-07 15:51:54 +02:00
104e6a7b8a GPUMaterial: Make background not transparent 2017-05-07 15:51:54 +02:00
0aa2a662b9 Eevee: Add Bloom post process.
Based on Kino/Bloom v2 - Bloom filter for Unity
MIT license.
2017-05-07 15:51:54 +02:00
29c5692eba Draw Manager: Fix multiple timer query issued for one pass. 2017-05-07 15:51:54 +02:00
43b374e8c5 Cycles: Implement denoising option for reducing noise in the rendered image
This commit contains the first part of the new Cycles denoising option,
which filters the resulting image using information gathered during rendering
to get rid of noise while preserving visual features as well as possible.

To use the option, enable it in the render layer options. The default settings
fit a wide range of scenes, but the user can tweak individual settings to
control the tradeoff between a noise-free image, image details, and calculation
time.

Note that the denoiser may still change in the future and that some features
are not implemented yet. The most important missing feature is animation
denoising, which uses information from multiple frames at once to produce a
flicker-free and smoother result. These features will be added in the future.

Finally, thanks to all the people who supported this project:

- Google (through the GSoC) and Theory Studios for sponsoring the development
- The authors of the papers I used for implementing the denoiser (more details
  on them will be included in the technical docs)
- The other Cycles devs for feedback on the code, especially Sergey for
  mentoring the GSoC project and Brecht for the code review!
- And of course the users who helped with testing, reported bugs and things
  that could and/or should work better!
2017-05-07 14:40:58 +02:00
Julian Eisel
cbdaa47abb Fix unfreed render-layer properties memory after loading file
Would cause pointer to allocated memory to be overridden.
Steps to recreate were:
* Start Blender
* Save
* Open saved .blend
* Close Blender -> should report unfreed memory
2017-05-07 00:30:33 +02:00
bca6978347 Cleanup: use index syntax instead of addition
Harmless but made accessing the first element read strangely.
2017-05-07 03:21:27 +10:00
ce31a892db Cleanup: use uint/ushort for polyfill2d 2017-05-07 02:19:56 +10:00
bdb4ecfbdd Cleanup: use const pointers where possible 2017-05-07 02:12:35 +10:00
5cdd94a58e Fix PyAPI crash assigning/deleting id-properties
Caused by D113.
2017-05-06 23:30:21 +10:00
90ebf4832f Merge branch 'master' into blender2.8 2017-05-06 22:54:28 +10:00
0eef40ed51 Cleanup: unused return, redundant assignments 2017-05-06 22:43:32 +10:00
a9572c2820 PyAPI: Remove bpy.app.handlers.scene_update
This is routinely mis-used to continuously run scripts,
causing performance problems.

This should be replaced with more specific handlers, or possibly timers.
See: T47811
2017-05-06 22:24:12 +10:00
5221093512 Cleanup: naming 2017-05-06 22:23:59 +10:00
89120cd241 bmesh: use 'uint' instead of 'unsigned int'
no functional changes.
2017-05-06 14:19:08 +10:00
b85f7e288e Cleanup: line length, use const struct members 2017-05-06 11:13:14 +10:00
317544455e Add missing weight paint vertex shader 2017-05-06 01:34:43 +02:00
Julian Eisel
cffe15e9c9 Fix all objects being selected when opening pre-2.80 files
Caused by rBe87ddda149b. Selecting objects shouldn't be done in such a
low level function anyway (IMHO).
Made sure duplicating objects still works correctly.
2017-05-05 19:32:06 +02:00
d9949c351d Pass selection to weight paint vert overlay instead of colors 2017-05-05 18:23:27 +02:00
5539544958 Update paint wire when changing modes 2017-05-05 18:23:27 +02:00
Dalai Felinto
8d9c484152 Implement overridable scene render settings
This add a new set of (possible) render settings that can be defined at
the scene level and overridable at the scene layer level.

Once we get workspaces we can either add workspace inbetween scene and
scene layer evaluation. Or to replace layer settings, to avoid extra
confusion to users.

An example of this setting is "samples", as implemented now for the clay
engine.
2017-05-05 18:08:24 +02:00
741d848cf8 Fix crash with no active object 2017-05-05 17:59:08 +02:00
2eb906e1b4 Cycles: Fix access array index of -1 in SSS and volume split kernels 2017-05-05 17:54:03 +02:00
850bb7a50b Cycles: Cleanup, indentation 2017-05-05 16:54:37 +02:00
622ce5672a MakeLocal: fix bad (missing) handling of proxy_from uglyness.
Those shall not be considered while checking whether a to-be-made-local
ID will end up fully local, or still be partially used by linked data...
Even less since we already do have special handling of proxies later.

Fixes main remaining issue found with 04_01_H.lighting.blend Agent327
file, and allows us to switch back to optimized post-processing in
make_local code.
2017-05-05 16:19:16 +02:00
198248fa3d Add a new LOOPBACK flag to libquery's callbacks.
That one tags those ugly little 'from' ID pointers (shape keys and
proxies), which point back from used to user ID, and require a lot of
special care in data-block management...
2017-05-05 16:19:16 +02:00
872d8993dd Clean up weight/vertex painting code
Now passing selection state instead of colors for the wire/face mask
overlay thing. Also added masking indication on the faces in vertex
paint.
2017-05-05 15:53:37 +02:00
294ffa0d49 Masks: Fix broken animation after adding primitives
Was missing mask shape initialization.

Not ideal from the CPU ticks point of view, but will work for now.
2017-05-05 13:50:18 +02:00
Hristo Gueorguiev
8b97e42eca Cycles: Split kernel SSS & Volume data definitions cleanup 2017-05-05 13:42:26 +02:00
Hristo Gueorguiev
b9fda4480f Cycles: Show samples progress for OpenCL split kernel 2017-05-05 13:37:21 +02:00
Julian Eisel
14bf4ed194 Fix Blenderplayer linking error 2017-05-05 13:11:44 +02:00
31f2f1b5f2 Eevee: Fix compilation issue on certain driver. 2017-05-05 13:07:11 +02:00
Hristo Gueorguiev
f3c3483242 Cycles: Workaround for AMD GPU OpenCL compiler
Fix for SSS in BPT.
2017-05-05 13:00:43 +02:00
Julian Eisel
8b8792e7b8 Merge branch 'master' into blender2.8 2017-05-05 12:44:52 +02:00
a7388d650a Fix empty struct errors in paint_vertex_mode.c 2017-05-05 11:38:15 +02:00
5b6838129f Fix (unreported) memleak in Warp modifier copying. 2017-05-05 10:36:23 +02:00
52e6a6c5ef MakeLocal: switch back to secure, slightly slower final steps.
Again, Agent327's 04_01_H.lighting.blend shows some problem here, it
triggers several times the 'not used at all' assert in step 5 of secure
code, and with optimized version we lose the connection between
rigs and the main characters!

Will keep investigating on this, but for now let's try to give something
working to the studio.
2017-05-05 09:56:17 +02:00
d2cd27a39d MakeLocal: forcefully recalc affected armatures' poses.
This should not be needed imho, we already set POSE_RECALC flag
correctly there, but it still is missing actual update of poses in some
(complex and convoluted) cases. So at least for now, let's go with this
hack, it's not really harming anyone anyway.

Fixes crash in Agent327's 04_01_H.lighting.blend when making all local.
2017-05-05 09:56:17 +02:00
fbf4b2f17a Add check (error message + assert) that pose is valid in armature evaluation.
Not sure how this happens, but in some cases we can evaluate
deformations of an armature which pose is not valid, at least put a
warning here to help identifying the issue quickly.
2017-05-05 09:56:17 +02:00
ce04c7e9f6 Use immediate mode for back-buffer selection
Needed so selection works with core profile.
2017-05-05 10:37:12 +10:00
Julian Eisel
839bf119c1 Revert "Add red alert in UI controls for datablock pointer properties"
This reverts commit f5bc8ad4ce.

We agreed there needs to be a better solution for this, see comments in
rBf5bc8ad4ce87165.
2017-05-05 00:44:06 +02:00
1c2b5430ca Merge branch 'master' into blender2.8 2017-05-05 08:23:59 +10:00
57bcc19bb3 Fix reading past bounds removing from color ramp 2017-05-05 07:41:12 +10:00
97caad858f Remove redundant backbuffer/transform check
Transform no longer uses backbuffer for snap.
2017-05-05 07:06:15 +10:00
ef746be982 Cleanup: include the type of data in function name
Was confusing, some functions return vert or triangle data
but naming wasn't very clear.
2017-05-05 06:42:53 +10:00
Dalai Felinto
129355c80a Multiline support for ED_region_info_draw
Many thanks for Campbell Barton for the help here and the idea to
implement the multi-line as a new function with array as arguments.
2017-05-04 22:24:38 +02:00
d29e3ebcc6 Typo: 'Signle program' -> 'Single program' 2017-05-04 22:15:53 +02:00
6f5307e74d Draw Manager: Add a memory stats to debug view.
Adds 2 static unsigned int to Gawain and GPUTexture to roughly keep track of the memory stats on the GPU.

Stats can be view at the bottom of the GPU stats with debug value > 20.
2017-05-04 21:26:54 +02:00
4bd2429f35 Use mesh draw cache for back-buffer selection
Vertex/weight paint now work with core profile, resolves T51380.
2017-05-05 05:17:31 +10:00
9869436b89 Cleanup: use doxy categories 2017-05-05 05:07:52 +10:00
c6800dd65b Missed last commit 2017-05-05 05:06:57 +10:00
83d43a0e0b Cleanup: de-duplicate mesh data calculation 2017-05-05 04:56:28 +10:00
ed688e4843 Cycles: Fix crash when assigning KernelGlobals
The memory isn't initialized during allocation, so calling the assignment operator is a bad idea.
2017-05-04 20:49:04 +02:00
3103b819aa Vertex paint with draw manager
Reviewers: fclem

Subscribers: campbellbarton, dfelinto

Differential Revision: https://developer.blender.org/D2658
2017-05-04 20:05:59 +02:00
Dalai Felinto
b5b9b2d04d Draw Manager: Combine multiple engines info texts
This join them with \n separators.(right now they clash on top of each
other).

Note: We still need to change "ED_region_info_draw" to accept multi-line strings.
2017-05-04 19:38:16 +02:00
5b70283717 Draw Manager: Fix debugging output. 2017-05-04 19:38:03 +02:00
550b0a22ad GLSL Materials: Fix envmap node artifacts. 2017-05-04 19:12:19 +02:00
665296e6f9 Eevee: Motion blur switch 2017-05-04 19:11:20 +02:00
fbfa53ae1d GPUMaterial: Remove unused Normal input. 2017-05-04 17:42:22 +02:00
4ef0513aab Eevee: Draw background shader.
Also fixes some remaining errors caused by some matrices not updated.
2017-05-04 17:42:22 +02:00
5601a62179 Eevee: Simple Camera Motion Blur.
Disabled by default. Set ENABLE_EFFECT_MOTION_BLUR to 1 to enable.
No fancy motion blur. Use depth and camera matrix to get the motion vectors. Then blur in this direction.
Only available in camera view.
Only Camera animation is supported, does not take into account the parents motion
2017-05-04 17:42:22 +02:00
Dalai Felinto
a3d8ef059c Draw Manager: Implement render info for external engines
This can be used by any engine actually. For example to give feedback
regarding probe caching in Eevee, ....

Unline master, we try to conciliate both the original viewport info
(FPS, view name) and the render info.

Note: I had to split the function in two because the camera alpha
passepartout is handled inside the view3d_draw_region_info function.

Review: Campbell Barton and Clement Foucault.

Thanks to Sergey Sharybin and Pablo Vazquez for some of the design
discussions.
2017-05-04 16:59:58 +02:00
a523dfd2fd Fix T51412: Instant crash with texture plugged into the Displacement output
The issue was caused by unlimited textures commit, root of the issue is that
displacement code updates some of the image slots directly, so it needs to
ensure device vectors are all proper size.
2017-05-04 16:28:22 +02:00
6ea45da05c Cleanup: rename ct -> len
Also use 'defgroup' instead of 'index' for passing weight arg.
2017-05-04 23:37:03 +10:00
b180900e52 Fix missing usercount update of poselib when copying Object.
Still finding such missing cases... :(
2017-05-04 15:08:57 +02:00
e3bc021079 Add debug/timing prints in MakeLocal and remapping code. 2017-05-04 15:08:57 +02:00
Dalai Felinto
77cb570e72 Cycles: Remove "Preview active layer"
In Blender 2.8 we always only preview active layer
Also remove use_viewport_visibility since it's no longer required.

Reviewer: Sergey Sharybin
2017-05-04 13:04:07 +02:00
002b2066ac Remove cpack
Places where it's removed are already replaced by newer logic.
2017-05-04 20:50:03 +10:00
ffa31a8421 Fix use after free of new render layer ID properites after copying scene 2017-05-04 12:27:28 +02:00
0f4de9336a Fix memory leak of ID properties after recent render passes commit 2017-05-04 12:18:39 +02:00
f3550242ed Remove visibility check for project paint
This is such a corner case, and currently there is no way to paint on a
hidden object, removing.
2017-05-04 19:59:57 +10:00
Dalai Felinto
e778be9e20 Fix "doversion" of collection settings for collections
For collections we do not need a doversion as granular as the scene one.
However if a new engine settings is added we need to take care of it.
2017-05-04 11:26:29 +02:00
930f0ba702 Fix passing object to BKE_mesh_batch_cache_dirty 2017-05-04 19:31:05 +10:00
c8d45a7e97 Merge branch 'master' into blender2.8 2017-05-04 10:05:01 +02:00
Dalai Felinto
55ae54c469 Fix relationship lines in draw manager [*]
This fix doesn't really fix the situaion now because at the moment we
only flush the evaluated flags at DEG_OBJECT_ITER time, which is silly.

But it's all we can do until we have CoW.

So the parent visibility flag is not flushed. And even if we flushed its
visibility flag, we would need to rely on having the parent flag flushed
before we get to the object in question.

Anyways, take this commit as a future fix for when depsgraph comes to
rescue all our souls.
2017-05-04 09:57:20 +02:00
Dalai Felinto
b2e908f929 Fix relationship lines visibility test for legacy viewport 2017-05-04 09:47:17 +02:00
5fde78dcad Cycles: Fix unused argument warning when building without debug passes 2017-05-04 09:33:51 +02:00
Dalai Felinto
e87ddda149 Better fix for duplicate objects not moving them
(original fix on 51a977a86f)
2017-05-04 00:21:49 +02:00
Dalai Felinto
b1858b4d2f Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-03 23:55:29 +02:00
ad8587b798 [msvc/make.bat] Limit the amount of simultaneously compiled projects.
This was set to maxcpu which in an 8 core box would be 8, each project would then spawn
8 instances of cl.exe, making a possible of 64 simultaneously running compiler instances
slowing the compile down instead of speeding it up.
2017-05-03 15:15:35 -06:00
Dalai Felinto
c171f0b3c9 Fix Cycles build on Windows 2017-05-03 21:16:45 +02:00
606d1f2b6e Fix projection paint initialization failing 2017-05-04 05:09:05 +10:00
51a977a86f Select new object bases using object's base flag
This fixes object duplicate operator.
2017-05-04 05:09:05 +10:00
Dalai Felinto
628dad4f01 Fix building on Windows and blenderplayer linking after weightpaint engine
Those problems were introduced on 20f95de6ba.
2017-05-03 20:24:42 +02:00
Dalai Felinto
62189a5ab7 Fix potential crash introduced by weightpaint engine when no active object 2017-05-03 20:10:54 +02:00
8c2b98ffa5 Cleanup: line length 2017-05-04 03:35:01 +10:00
d96171ab53 Correct struct type (harmless) 2017-05-04 03:17:05 +10:00
6abcd6cfd5 Fix error in node flag check 2017-05-04 02:57:39 +10:00
20f95de6ba Weight painting with draw manager
This implements weight rendering with the draw manager, with all drawing
options (Shading, wire, face masking, vertex masking).

This is part of T51208

Reviewers: campbellbarton

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D2654
2017-05-03 18:57:35 +02:00
b9451c0493 Merge branch 'master' into 28 2017-05-04 02:58:26 +10:00
82e242cc72 Merge branch 'master' into blender2.8 2017-05-03 18:33:02 +02:00
2564d929fc Correct over-alloc struct declaration 2017-05-04 02:15:50 +10:00
Dalai Felinto
673e6fc535 Draw Manager: Bring pose bones to the pose engine
Note: We should test if the armature is the "armature modifier" parent of the
object.

If any good samaritan feels like tackling this, the function to change
is: DRW_pose_mode_armature
2017-05-03 18:06:47 +02:00
3bf31c6d23 Move pose-bone colors into draw_data
Also only allocate necessary number of bone segments.
2017-05-04 01:32:16 +10:00
15189baa52 "Fix" root cause of T51260 Forward compatibility crash fter adding new IDProp type.
We unfortunately cannot fix this for previous versions of Blender, but
at least the issue (Blender crashing on unknown IDProp types) should now
be addressed for future.

Simply reset unknown IDProp types to integer one, and reset its value to zero.
2017-05-03 17:05:28 +02:00
4cf7fc3b3a Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.

To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.

To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.

From a user perspective, nothing should change with this commit.

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

Differential Revision: https://developer.blender.org/D2444
2017-05-03 16:44:52 +02:00
1f16703792 Error in last commit 2017-05-04 00:43:54 +10:00
827818d37d Rename bPoseChannel's temp/cache pointer for DrawManager to draw_data.
More generic name, this remains a temp solution anyway, until we have
proper handling of temp data from 'magic DEG'! ;)
2017-05-03 16:18:03 +02:00
6824ee0595 Fix bad scaling of BBone single-segment bones in new Armature drawing code.
Reported by @campbellbarton over irc, thanks.
2017-05-03 16:18:03 +02:00
3c91fbf6be Draw Manager: Use color-sets for solid pose-bones 2017-05-04 00:16:31 +10:00
e0722a2c07 Draw Manager: use pose bone theme and constraint colors 2017-05-04 00:01:10 +10:00
Hristo Gueorguiev
6bf4115c13 Cycles: Split kernel - sort shaders
Reduce thread divergence in kernel_shader_eval.

Rays are sorted in blocks of 2048 according to shader->id.

On R9 290 Classroom is ~30% faster, and Pabellon Barcelone is ~8% faster.

No sorting for CUDA split kernel.

Reviewers: sergey, maiself

Reviewed By: maiself

Differential Revision: https://developer.blender.org/D2598
2017-05-03 15:30:45 +02:00
Dalai Felinto
2bec7c6070 Code Style: Don't add padding in a function call 2017-05-03 14:32:29 +02:00
60886670cd Move GPU compositing out of draw-manager off-screen drawing
Also no need to use VP_legacy_ prefix here.
2017-05-03 22:17:07 +10:00
6f9c839f44 Cycles: Fix OpenCL compilation failure after recent color changes
It is really confusing to have some functions available in some devices
and not on another devices.
2017-05-03 14:11:19 +02:00
825430c589 Cleanup: move off-screen drawing to view3d_draw.c
Since offscreen drawing now uses draw engine, this doesn't need to be
considered legacy.

Note that there are some calls into view3d_draw_legacy.c from view3d_draw.c
this is generally not accepted, so its only dont where there are checks
for new/old engine.
Functions exposed to do this use a VP_deprecated prefix.
2017-05-03 22:03:48 +10:00
a2a436bba3 Update comment 2017-05-03 22:03:48 +10:00
Dalai Felinto
5f38a4a238 Draw Manager: Enable Pose engine as part of the weight paint mode
We still need to bring pose bone drawing for the pose engine.

Note: In the future, once we get face-widget selection, we will need to
make sure the pose engien only draws then if "weight paint mode" is not
enabled too.
2017-05-03 12:41:58 +02:00
Dalai Felinto
50a7d104d2 Draw Manager: Fix pose mode not working well.
In the future this will allow us to implement things like face manipulators.

For now however, this is getting on the way of using pose mode
(mesh objects are drawn green).

NOTE: pose engine should also be the one taking care of pose bones

(and for that matter, X-Ray armature option should/could be a property
of the Pose engine even).
2017-05-03 12:16:40 +02:00
44991a0132 Cycles: Use render visibility for duplis when Render Layer option in viewport is used
Previously the logic was different for duplis and regular objects: regular objects
were using render visibility when Render Layer option is enabled which duplis were
always using viewport visibility when rendering from the viewport.

This was quite confusing because caused different results in viewport and render
when artists were expecting them to match 1:1.
2017-05-03 12:14:05 +02:00
b08fc83d1d Eevee: Fix Lamp Roughness. 2017-05-03 12:08:56 +02:00
e0fded5d3a GPUMaterial: Force old outputs to fail with EEVEE.
Workaround waiting for compatibility bit / or PyNodes.
2017-05-03 12:08:56 +02:00
5570ba9c4f NodeTree: Add eevee default shader tree. 2017-05-03 12:08:56 +02:00
a740495814 Eevee: Add "uber" Shader Output Nodes.
Include Metallic and Specular workflow.
Clearcoat and are not implemented yet.
2017-05-03 12:08:56 +02:00
54bde82445 Draw Manager: Introduce a foreach function for all shgroups in a pass. 2017-05-03 12:08:55 +02:00
bde4499496 Fix draw manager w/ cycles
8b2640f08 introduced the error,
caused by external-engine needing depth mask to be disabled,
which happened to be the case before changing state changing logic.
2017-05-03 20:12:31 +10:00
Dalai Felinto
2a86082945 Validate collection properties at readile
The alternative would be to do version bump + doversioning every
time a new property is added.
2017-05-03 11:51:49 +02:00
Dalai Felinto
66c74242bb Make IDP_MergeGroup recursive
With this we also do not need IDP_MergeGroupValues anymore.
If this causes problems in the future we can always make recursion an
option (like overwrite is).
2017-05-03 11:51:49 +02:00
cea0236026 Cycles: Simplify code in SVM image by using new utility function
Can not measure any performance difference, so seems the code is identical
and just shorter.
2017-05-03 11:22:48 +02:00
e616cd5706 Cycles: Add utility function to convert float4 color from srgb to linear
It will use SSE2 optimized version when is possible.
2017-05-03 11:19:40 +02:00
bf0ac873ba Fix crash loading files where outliner treestore isn't set 2017-05-03 18:13:09 +10:00
d116932f3a Add BBone and Wire Armature draw types to DrawManager.
Most of this was copying/adapting code from octahedral existing draw
code, tough part was to get BBone matrices to behave as expected, they
are using a fairly specific setup...

Addresses T51365 and T51362.
2017-05-03 08:37:24 +02:00
8b2640f088 Draw Manager: fix draw-state switching logic
Changing states didn't properly reset between shading groups
causing the GL state to be wrong based on draw order.

States are now only set when changed.
2017-05-03 08:24:50 +10:00
85ca3156fc Cleanup: typedef for empty list
Without this the intent isn't clear.
2017-05-03 05:21:55 +10:00
1b6c21c03b Workaround external engines with OpenGL rendering
For now just do the OpenGL render and don't render using the engine.
This is a slightly odd-use case since it makes more sense to do a regular render.
2017-05-03 05:06:13 +10:00
d187014675 Cycles: Remove extra clFinish from driver workaround
These were causing problems with Nvidia OpenCL.
2017-05-02 14:26:46 -04:00
299d839dc5 Cycles: Output split state element size 2017-05-02 14:26:46 -04:00
915766f42d Cycles: Branched path tracing for the split kernel
This implements branched path tracing for the split kernel.

General approach is to store the ray state at a branch point, trace the
branched ray as normal, then restore the state as necessary before iterating
to the next part of the path. A state machine is used to advance the indirect
loop state, which avoids the need to add any new kernels. Each iteration the
state machine recreates as much state as possible from the stored ray to keep
overall storage down.

Its kind of hard to keep all the different integration loops in sync, so this
needs lots of testing to make sure everything is working correctly. We should
probably start trying to deduplicate the integration loops more now.

Nonbranched BMW is ~2% slower, while classroom is ~2% faster, other scenes
could use more testing still.

Reviewers: sergey, nirved

Reviewed By: nirved

Subscribers: Blendify, bliblubli

Differential Revision: https://developer.blender.org/D2611
2017-05-02 14:26:46 -04:00
89b1805df6 BGE: Fix silly typo that invalidates negative scaling camera feature.
Negative scale on camera is a nice trick to invert render image on one
axis at no extra CPU cost. It was implemented in the Decklink branch but
I introduced a typo when porting it to master. It is now fixed.
2017-05-02 20:11:02 +02:00
075638f85c Cleanup: consistent arg order 2017-05-03 03:06:37 +10:00
3f567535da Draw Manager: OpenGL render support
Works for clay-engine but doesn't draw objects with eevee.
2017-05-03 02:52:39 +10:00
2b0f02057f Draw Manager: split DRW_draw_view into 2 functions
Needed for offscreen render
2017-05-03 00:45:10 +10:00
47239b4041 Cleanup: use depsgraph for scene/layer access 2017-05-03 00:14:54 +10:00
22855f1a60 Merge branch 'master' into blender2.8 2017-05-02 15:41:15 +02:00
4846184095 Cycles: Fix missing type declaration in OpenCL image
Spotted by Mai in IRC, thanks!
2017-05-02 15:39:33 +02:00
143d7ad40f Revert "Depsgraph: Link from material to object shading"
The change was initially needed for Blender 2.8 branch but the actual
function was reverted in there. So no reason to keep dead unused
placeholder in the dependency graph.

This reverts commit fd69ba2255.
2017-05-02 15:31:49 +02:00
7f833c0da8 Merge branch 'master' into blender2.8 2017-05-02 15:29:00 +02:00
Dalai Felinto
ec9ce9e118 Draw Manager: No need of glScissor for external engines 2017-05-02 15:26:18 +02:00
Dalai Felinto
8c660c7801 Cycles integration with Draw Manager
We can now use object and other modes on top of Cycles.
Since we are now always on "render_to_view" (old Rendered mode), the
pause button is always visible.
2017-05-02 15:13:50 +02:00
61b77d8948 OCIO: Fix crash cause by bad IMM usable. 2017-05-02 15:13:12 +02:00
4384a7cf46 Cycles: Fix CUDA split kernel
Global size y needs to be a multiple of 16.
2017-05-02 15:03:51 +02:00
4174e533c0 Cycles: Cache split kernels in CUDA device
This way we don't re-load kernels for every sample in the viewport.
Additionally, we don't risk global size changed inbetween of samples.
2017-05-02 15:03:12 +02:00
Dalai Felinto
d3964db5bd RNA: Remove remaining relevant scene->basact and BaseLegacy
Note: In one case (rna_Scene_editmesh_select_mode_set) I had to resort
to the temporary solution of BKE_scene_layer_context_active.

This is fine for now, but it will be a problem once workspaces are
introduced. In this case the fix is to use a temporary value in the set
routine, and actually only set the active object in the update function
(which can take bContext).
2017-05-02 12:59:07 +02:00
a9d6a07d78 Add scene argument for notifiers
From workspaces branch
2017-05-02 09:58:01 +10:00
7eebc5113c Eevee: Add support for legacy materials node. (not PBR) 2017-05-01 18:11:21 +02:00
62ea911e1a GPUMaterial: Making material node tree compatible with new drawmanager.
- code_generate_fragment : Making sure that shaders uses the new uniforms.
- code_generate_vertex_new : create require attribute based on their names and not their id (see draw_cache_impl_mesh.c).
- add support for ramp textures.
2017-05-01 18:11:21 +02:00
19f86a3d5f Mesh Batch Cache: Add support for uv/vcol/tangent data layers.
This is a bad implementation waiting for some improvement that are :
- Gawain support for multiple names. -> will remove duplication of attribute alloc
- Glsl safe name string escaping. -> will remove any risk of hash colision.

Old glsl drawing was relying on attribute being choosen by DerivedMesh at drawing time.
For this reason, we declare all possible attrib "name" for each data layer inside the batches.
In the glsl code, we declare required data by type and name.
Then Gawain only bind vbos if names correspond.
This is way cleaner as we do not need to access the CD itself when drawing.

One other problem is that the hash maybe 11 caracters long and rapidly overload gawain's attrib name buffer.
2017-05-01 18:11:21 +02:00
27fc8ae1cb Eevee: Change MAX2 to max_ff 2017-05-01 18:11:21 +02:00
e868b459bb Eevee: World nodetree gpumaterial compatibility.
- Unify GPUMaterial creation (world/mesh).
- Support for multiple shader variations (not used for now).
- Convert GPUInputs to DRWUniforms to be used with the draw manager.
- Nodetree Update is not supported. The only way to refresh the shaders is to change render engine.
- Cleanup in GPUPass.
- Add new temporary Node Compatibility type. Compatibility types should be removed in the future.
2017-05-01 18:11:21 +02:00
2f100c13ee Getting rid of setlinestyle: FCurves drawing. 2017-05-01 17:43:51 +02:00
9c73cead49 Getting rid of setlinestyle: last bit in NLA.
Note that smooth-shaded outlines of muted NLA strips should also be
dashed, not sure how to do that currently (in a simple way), so kept
them solid for now.
2017-05-01 17:43:51 +02:00
Dalai Felinto
d5acf4f467 Fix for issue when duplicating text objects
The crash happens with Cycles and Font objects if we get Cycles working
with draw manager.
2017-05-01 16:48:09 +02:00
bb5f4a1f67 Cleanup/followup to previous commit: get rid of dashed-specific helpers.
Those are no more needed.
2017-05-01 16:32:55 +02:00
d7d4bca23b Reworked version of dashed line shader.
Using geometry shader allows us to get rid of the 'line origin' extra
vertex attribute, which means dashed shader no longer requires fiddling
with those vertex attributes definition, and, most importantly, does not
require anymore special drawing code!

As you can see, this makes code much simpler, and much less verbose,
especially in complex cases.

In addition, changed how dashes are handled, to have two 'modes', a
simple one with single color (using default "color" uniform name), and a
more advanced one allowing more complex and multi-color patterns.

Note that since GLSL 1.2 does not support geometry shaders, a hack was
added for now (which gives solid lines, but at least does not make
Blender crash).
2017-05-01 16:32:55 +02:00
Dalai Felinto
6ef497d401 WITH_CLAY_ENGINE: Should be used for CLAY only, not drawmanager 2017-05-01 15:44:50 +02:00
Dalai Felinto
22be057e37 Draw Manager: Fix copy-paste harmless comment "typo" 2017-05-01 15:44:50 +02:00
ea9d163644 Blender 2.8: Update arc config 2017-05-01 15:20:19 +02:00
c899c7c9e1 Check we've got GLEW version 2 when building with core profile
There was a bug in older GLEW version which kept glGenVertexArrays as NULL
when 3.2 core context is requested [1].

Didn't find a way to check GLEW version from CMake, it seems the version
is not really exposed to the header.

[1] https://sourceforge.net/p/glew/bugs/124/
2017-05-01 10:37:04 +02:00
fc8f428224 fix typo in WITH_SYSTEM_GFLOG in CMakeLists.txt 2017-04-30 10:52:38 -06:00
c4491d76ed Getting rid of setlinestyle: sample line in Image space. 2017-04-29 20:41:57 +02:00
74f9d31409 Getting rid of setlinestyle: UV editor drawing. 2017-04-29 20:12:30 +02:00
785950c18a Getting rid of setlinestyle: remove gpencil's debug-only dashed line drawing.
No need to add extra complexity of conditional dashing here for now!
2017-04-29 19:42:04 +02:00
c5fd6acfce Getting rid of setlinestyle: ed_util's pos-to-mouse dashed line. 2017-04-29 19:40:32 +02:00
b1b8ce0bbf Getting rid of setlinestyle: GPencil eraser.
Note the ugly hack on number of segments for outline dashed circle, to
get an OK-ish rendering of dashes...
2017-04-29 19:31:36 +02:00
45eaad88e2 Getting rid of setlinestyle: add imm_draw_circle_wire_dashed() util.
Needed a bit of twisting in generic private func behind the imm_draw_circle
helpers, but think it's fine.

Note that this demonstrate yet another downside of new dashed shader
compared to olde line style: not only does it needs more complex setup,
and can only work with PRIM_LINES type of primitives, but it also
behaves totally wrong with chained short segments!

We really need to find a better way to do this effect at some point. :(
2017-04-29 19:31:36 +02:00
8f5f4241c0 Cleanup: comment blocks 2017-04-30 03:14:57 +10:00
fbd172a00a Merge branch 'master' into blender2.8 2017-04-30 03:06:42 +10:00
0fbce637b3 Cleanup: comment blocks 2017-04-30 02:58:36 +10:00
a1164eb3dd View3D: support both orbit select & depth
When using both preferences, use cursor depth when nothings selected.
2017-04-30 02:41:25 +10:00
47769b5f40 Curve Fitting: minor change to re-fitting method
Avoid calculating a new split-index when re-fitting.

While checking if a knot can be removed, the index with the highest error
can be used as a candidate to replace the knot
(in the case it can't be removed).
2017-04-30 00:01:16 +10:00
b0a72c98bb Getting rid of setlinestyle: NLA (part I).
Also restore drawing of local action markers in NLA strips...

Note: there is another usage of setlinestyle in this file, not sure how
to hanlde it for now, so will leave it for later...
2017-04-29 13:19:17 +02:00
56e10c1997 Getting rid of setlinestyle: Color ramp markers. 2017-04-29 12:57:14 +02:00
d2589b0a31 Getting rid of setlinestyle: Text space margin line. 2017-04-29 12:43:37 +02:00
8f028ec840 Cleanup: rename struct for private engine data
Also remove from pass list (there were some duplicate unused entries).
2017-04-29 16:52:12 +10:00
33a5248b6c Merge branch 'master' into blender2.8 2017-04-29 16:32:30 +10:00
6d73e2d3cf Cleanup: unused includes 2017-04-29 16:27:29 +10:00
b5298bf819 Cleanup: menu example
remove some redundant checks, imports
2017-04-29 16:20:06 +10:00
Dalai Felinto
de9e45a88b blenderplayer: fix warnings in stubs 2017-04-29 02:07:39 +02:00
8f66d6826b Cycles: Fix crashes after recent image changes
Not sure if this is a proper fix, but was getting frequent crashes, so
committing this real quick just to make master sable again. Can be
reverted later if there's a better fix. The changes to images really
need a closer look...
2017-04-28 18:54:18 -04:00
Dalai Felinto
e702b391ed Draw manager: Style cleanups 2017-04-29 00:54:11 +02:00
d6963630dc Implementation of custom python entries in all right click menus
Hi Guys,

as one of my clients needs the possibility to have custom menu entries in the general right click menu (all over Blender: in the node editor, properties, toolbars,..) I talked with Campbell about expanding our hard coded menu a bit. This is the outcome. As I only need those two, I support currently a button_prop and a button_pointer.

{F540397}

I tested the changes with a custom script where I added a custom entry and executed an operator on click - it seems to work exactly how it's intended to. The script: {F540435}

As I'm not too experienced in rna stuff I would really appreciate any review.
Thanks very much Campbell for his open ears & help on this issue!

Reviewers: campbellbarton, mont29

Reviewed By: campbellbarton, mont29

Subscribers: sybren, mont29

Tags: #addons

Differential Revision: https://developer.blender.org/D2612
2017-04-28 23:44:52 +02:00
b2178472e9 Disable custom armature colors 2017-04-29 04:26:31 +10:00
04f43d4cdf Merge branch 'master' into blender2.8 2017-04-29 03:39:24 +10:00
Dalai Felinto
b868f43fd3 Cycles support for preview on viewport with core profile
This upgrade the drawing code to use latest opengl calls.
Also, it adds a fallback shader for opencolorio.

Reviewers: sergey, brecht
Subscribers: merwin, fclem

Differential Revision: https://developer.blender.org/D2652
2017-04-28 19:25:57 +02:00
ba4f47ce8e Getting rid of setlinestyle: Clip drawing code.
This one has been painful, it's doing lots of nifty conditional drawing
of all kind... Also, very nice illustration of how cumbersome it is to
use dashed shader currently, we really need to find a simpler way at
some point imho. But this is not critical issue either, for now we can
live with some uglyness like that. :/
2017-04-28 19:22:45 +02:00
9fe19437e9 Getting rid of setlinestyle: markers' dashed line in VSE. 2017-04-28 19:22:45 +02:00
5e04e4eb0d Merge branch 'master' into blender2.8 2017-04-29 03:24:03 +10:00
af3f7db4ec Fix T51324: Auto-Depth fails rotating out of camera 2017-04-29 03:21:03 +10:00
9ebd737df3 Cycles: Use relative path for #line directives
This way moving Blender bundle around doesn't re-trigger kernels compilation.
2017-04-28 17:46:11 +02:00
b46aad19c0 Libmv: Make ERROR a default printing severity 2017-04-28 16:47:35 +02:00
c648ddb9a1 Cycles: Correct comment after previous commit 2017-04-28 16:47:24 +02:00
9ff88a596c Cycles: Lower default severity level to ERROR 2017-04-28 16:46:30 +02:00
074c5f0d26 Merge branch 'master' into blender2.8 2017-04-28 15:52:07 +02:00
08142dde2c Hide object center and other info when drawing sets 2017-04-28 23:52:02 +10:00
aa88796a6c Alembic: use object-oriented approach in ABC_read_mesh()
This is easier to extend than the if/else if/else chain that was in place,
and allows for somewhat more granular error messages.
2017-04-28 15:33:57 +02:00
2e67a20045 Alembic: Construct ISampleSelector once and pass along 2017-04-28 15:33:57 +02:00
1e8d7f3b25 Fix T51331: fixes for Alembic unit tests on Windows 2017-04-28 15:28:41 +02:00
f383c926b4 Cycles: De-duplicate bit magic for decoding image options in OpenCL kernel 2017-04-28 15:20:34 +02:00
f8d0b27d9d Cycles: Simplify code around maximum OpenCL info size allocation 2017-04-28 15:15:15 +02:00
407fd66d0a Cycles: Cleanup, de-duplicate image packing of various types 2017-04-28 15:08:54 +02:00
886966aa38 Correct comment, we need wire_outline data in this case 2017-04-28 23:04:29 +10:00
0f339a748e Cycles: Quick (real) fix for broken textures on OpenCL
Previous fix did not work for mixed textures. This one will over-allocate
information array, but it's better than not being able to render at all.

Some more cleanup and improvement is coming.
2017-04-28 14:56:22 +02:00
1ec59c8e06 Revert "Cycles: Fix image textures were completely broken since recent unlimited textures commit"
This reverts commit 8f4166ee49.

The fix was not correct for cases when we've got float textures.
2017-04-28 14:48:40 +02:00
0e94d91048 Draw Manager: pose-mode custom bone display 2017-04-28 22:31:58 +10:00
06034b147a Cycles: Cleanup, spelling and braces 2017-04-28 14:10:21 +02:00
8f4166ee49 Cycles: Fix image textures were completely broken since recent unlimited textures commit
The indexing was totally wrong in both image packing code and image sampling in kernel.

Fixes T51341: Cycles OpenCL corruption in todays buildbot
2017-04-28 14:04:27 +02:00
e3fc945fe2 Cycles: Cleanup, always use braces for blocks 2017-04-28 13:39:14 +02:00
82e5f60302 Cycles: Cleanup, indentation in preprocessor 2017-04-28 13:24:09 +02:00
20ebeb1a15 Cycles: Cleanup, use ccl::vector instead of std::vector 2017-04-28 13:22:07 +02:00
4245ed360e Cycles: Cleanup, indentaiton and trailing whitespace and wrapping 2017-04-28 13:21:17 +02:00
cc43dd054f Recent commit state broke lattice vertex drawing
e4d856e3 caused lattice vertices not to draw in editmode.
2017-04-28 18:43:46 +10:00
226b6e60b9 Fix draw manager draw-modes interfering with eachother 2017-04-28 05:22:30 +10:00
a680bcd13b Draw Manager: basic text overlay support 2017-04-28 04:54:04 +10:00
e4d856e31b OpenGL: manage legacy state only when WITH_LEGACY_OPENGL=ON
- enabled lights
- alpha test
- texture environment
- point sprites (always enabled in modern GL)

Moved is_clip_plane for better struct packing, no functional change there.

Part of T51164
2017-04-27 14:32:47 -04:00
079e0b5943 OpenGL: don't set texture LoD bias via glTexEnvf
Not supported in core profile. We could do this in GLSL if it's really needed.

Part of T51164
2017-04-27 14:24:32 -04:00
0d5c5a8438 OpenGL: early exit from functions that don't mix with core profile
These parts will not be part of final viewport, but are called indirectly during the transition. To avoid runtime errors on core profile, exit early -- functions effectively do nothing.

I put the early exits inside the functions to avoid cluttering the code that calls these. But (long term) the calling functions need to change.

Basic shader's detect_options function was unused and full of old, so I deleted it.

Part of T51164
2017-04-27 14:21:12 -04:00
99fde39f49 OpenGL: fix color logic op
GL_LOGIC_OP is a synonym for GL_INDEX_LOGIC_OP, from OpenGL 1.0's indexed color drawing. It's not part of modern GL and causes an error in core profile.

GL_COLOR_LOGIC_OP is still supported in the latest GL. It's the last stage before writing to the framebuffer.

Part of T51164
2017-04-27 14:19:03 -04:00
87a66864bc Add back text color for legacy drawing 2017-04-28 03:05:24 +10:00
75fac519c0 Gawain: safely orphan immediate mode's VBO
There are multiple ways to orphan a buffer resource, and this code picks the oldest/safest way no matter which OpenGL version we're running.

TODO: use other (more recent) methods after thorough testing

Follow up to 8e0c57a812
2017-04-27 11:43:25 -04:00
741ed16d13 OpenGL: don't glGet(GL_RED_BITS) in core profile
or GREEN or BLUE. These are deprecated and cause errors under core profile.

TODO: get color depth value another way

Part of T51164
2017-04-27 11:43:25 -04:00
bfaf7a3eb1 OpenGL: stop enabling GL_TEXTURE
Texturing is always enabled in GLSL. Simply use a sampler in the shader.

Replaced gpu_generate_mipmap with glGenerateMipmap since the former just Enabled/Disabled the texture target and called the latter.

Part of T51164
2017-04-27 11:24:35 -04:00
a49708a691 OpenGL: stop using GL_NORMALIZE
With GLSL there is no need for GL_NORMALIZE. We explicitly normalize in the shader, or (better) send in unit vectors.

Part of T51164
2017-04-27 10:35:12 -04:00
34c808287e Gawain: fix pointer arithmetic warning
void* + offset = ???

This Mac-only code works, but wasn't strictly correct. clang doesn't warn about this, gcc does.
2017-04-27 09:59:19 -04:00
9a193a28c4 fix Clay compatibility comment
When building WITH_LEGACY_OPENGL, Mac uses GL 2.1, Mesa uses GL 3.0. Has nothing to do with Intel!

Clay assumes GL 3.3 is available.
2017-04-27 09:30:49 -04:00
1dbb41f195 OpenGL: restore all 8 lights
fixes a copy/paste mistake
2017-04-27 09:30:48 -04:00
5c7b8cfffa OpenGL: remove GL_MAP1_VERTEX_3
This is related to OpenGL evaluators (old feature). From my understanding, we don't seem to be actually using it.

Part of T51164
2017-04-27 09:30:48 -04:00
6f0cf4a804 support OpenGL 3.0 on Linux only when WITH_LEGACY_OPENGL=ON
Part of T49012
2017-04-27 09:30:48 -04:00
cbaacc08dc Getting rid of setlinestyle: transform code.
Note that I also made 'dash anchor point' consistent (the static one,
not the mouse one), in previous code somtimes dashed were anchored to
the static center point, in others, to the moving mouse position, the
later was rather disturbing imho...
2017-04-27 15:28:30 +02:00
a85f457195 Fix: T50271: Bilateral/Directional blur's iterations is zero by default
Differential Revision: https://developer.blender.org/D2632
2017-04-27 09:00:11 -04:00
b649f53a62 Error in last commit 2017-04-27 22:01:31 +10:00
23b8fa5299 Cleanup: split cmake source/headers 2017-04-27 21:58:43 +10:00
e9ccc98877 Revert "Fix T51328: Add note to cmdline help that threads must be first"
The help message already notes that argument order matters,
and this doesn't need to be the first.
2017-04-27 21:48:06 +10:00
98b6c6f2c0 Merge branch 'master' into blender2.8 2017-04-27 21:42:08 +10:00
bdf8ad6c4e Cleanup: spelling 2017-04-27 21:41:03 +10:00
ed14c15b7a Cleanup: remove unused matrix arg 2017-04-27 21:41:03 +10:00
21d31f8f58 3D widgets were obscured by view geometry 2017-04-27 19:43:27 +10:00
acec2a92ef Pose-mode drawing used alpha where it shouldn't 2017-04-27 19:31:19 +10:00
a00f54332d Cleanup: Some style and code tweaks to Image Code after changes.
Whitespace and order of switch/case etc. Let's try to stick to float4/byte4/half4/float/byte/half order as defined in "ImageDataType".
2017-04-27 11:11:08 +02:00
a845fc0d39 Fix gpuScaleUniform (caused strange pose-bone size) 2017-04-27 18:44:57 +10:00
f4c548ce2b Use pose-mode colors for pose-bone drawing
Also move static vars into structs
2017-04-27 18:17:47 +10:00
Stefan Werner
ec25060a05 Unlimited number of textures for Cycles
This patch allows for an unlimited number of textures in Cycles where the hardware allows. It replaces a number static arrays with dynamic arrays and changes the way the flat_slot indices are calculated. Eventually, I'd like to get to a point where there are only flat slots left and textures off all kinds are stored in a single array.

Note that the arrays in DeviceScene are changed from containing device_vector<T> objects to device_vector<T>* pointers. Ideally, I'd like to store objects, but dynamic resizing of a std:vector in pre-C++11 calls the copy constructor, which for a good reason is not implemented for device_vector. Once we require C++11 for Cycles builds, we can implement a move constructor for device_vector and store objects again.

The limits for CUDA Fermi hardware still apply.

Reviewers: tod_baudais, InsigMathK, dingto, #cycles

Reviewed By: dingto, #cycles

Subscribers: dingto, smellslikedonkey

Differential Revision: https://developer.blender.org/D2650
2017-04-27 09:35:22 +02:00
2d11d7c570 Cleanup: use doxy groups for armature 2017-04-27 17:06:52 +10:00
a4b97390d9 Fix basic pose-mode select drawing 2017-04-27 16:57:11 +10:00
58e61446df Fix wrong scene assigned when using sets
Depsgraph was left with wrong set-scene.
2017-04-27 16:21:56 +10:00
4afbd08941 Fix/workaround crash with non mesh geometry
eevee was crashing on curve grometry, draw without material for now.
2017-04-27 15:56:04 +10:00
a6b9bd023b Fix T51328: Add note to cmdline help that threads must be first 2017-04-26 22:48:18 -04:00
d8ce3ed140 Cycles: Allow samples to finish in split kernel to avoid artifacts when canceling
Previously canceling a render done by the split kernel could cause artifacts
such as very bright or dark tiles. This was caused by unfinished samples
being included in the output buffer. To avoid this we now wait till all the
currently rendering samples have finished, up to a limit of twice the
expected time for them to finish (currently this is no more than 20 seconds,
but usually its much less). If samples still haven't finished by then we
stop anyways in case there's an endless loop occurring.
2017-04-26 21:28:16 +02:00
c6bf5d4724 Cycles: Change OpenCL split kernel to use single program by default
Single program builds twice as fast as multi programs, so its better for
users to have it as the default.
2017-04-26 21:28:16 +02:00
38563bad9d Cycles: Enable Correlated Multi Jitter for OpenCL and split kernel
Testing showed no issues so there's no reason to not have this.
2017-04-26 21:28:16 +02:00
25b2dfcbf0 [msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds. 2017-04-26 21:28:16 +02:00
4b682fa3e7 Getting rid of setlinestyle: Paint 'line' strokes. 2017-04-26 21:22:05 +02:00
cf959dc03a Getting rid of setlinestyle: armature drawing code.
Firts usage of 3D version of new dashed line shader... Though not sure
whether that code will be kept for long?
2017-04-26 20:57:18 +02:00
bb43dff935 Add 3D version of dashed line shader.
This is actually nearly same code as 2D version, maybe we can
deduplicate that later?
2017-04-26 20:57:18 +02:00
224f148e22 2D dashed line shader: changed to use viewport side instead of scale.
The scale version was working(ish), but it was not really extendable to
a 3D line version of the shader.

Also note that sequencer view still keeps its 'UI scale' adaptation
(dashes grow together with UI scale setting). Would be nice to do that
everywhere ultimately imho, but nothing urgent here.
2017-04-26 20:57:18 +02:00
795e839d3b Cleanup: rename select engine -> basic
This is used by depth drawing too and had no selection specific code.
2017-04-27 02:51:07 +10:00
a7c5d2e159 Pass graph to depth functions 2017-04-27 02:36:56 +10:00
edd1512741 Draw Manager: cleanup, use doxy categories
Also add DRW_state for accessing current draw state.
2017-04-27 02:04:56 +10:00
7631f4bf6d Draw Manager: use engine drawing for depth drawing 2017-04-27 01:43:05 +10:00
f59d3a7b0c View3D: move depth drawing into own function
No functional changes
2017-04-27 01:01:43 +10:00
c9d4a0930b Merge branch 'master' into 28 2017-04-27 00:58:28 +10:00
dc27d31a21 Merge commit 'master@6ed15c5a41130b55cb57a43a8a9470a91d38c3d5' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.cc
2017-04-26 16:50:29 +02:00
7c1263c1ee Cycles: Allow samples to finish in split kernel to avoid artifacts when canceling
Previously canceling a render done by the split kernel could cause artifacts
such as very bright or dark tiles. This was caused by unfinished samples
being included in the output buffer. To avoid this we now wait till all the
currently rendering samples have finished, up to a limit of twice the
expected time for them to finish (currently this is no more than 20 seconds,
but usually its much less). If samples still haven't finished by then we
stop anyways in case there's an endless loop occurring.
2017-04-26 10:48:15 -04:00
90b2539248 Cycles: Change OpenCL split kernel to use single program by default
Single program builds twice as fast as multi programs, so its better for
users to have it as the default.
2017-04-26 10:48:15 -04:00
fe81a32f69 Cycles: Enable Correlated Multi Jitter for OpenCL and split kernel
Testing showed no issues so there's no reason to not have this.
2017-04-26 10:48:15 -04:00
c13acebd61 [msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds. 2017-04-26 08:46:35 -06:00
be60e9b8c5 Cycles: Fix over-allocation of triangles storage for triangle primitive hair
Was also causing some bad memory access caused by read data from non-initialized
arrays.

Repoted by bzztploink in IRC, thanks!
2017-04-26 16:00:02 +02:00
e6954a5a7c Fix race condition invalidating object data's bounding box 2017-04-26 16:00:02 +02:00
e61ba39e7c Ensure task scheduler exists before any threading starts in Blender 2017-04-26 16:00:02 +02:00
e2f8bb56d6 Avoid race condition copying Scene for off-thread OpenGL image save 2017-04-26 16:00:02 +02:00
c0f555905d User preferences: Use checkbox for Cycles device selection
It was totally unclear whether the device is enabled or disabled.
Lots of people got fully lost in the current interface.

While the solution is not fully ideal, it is at least solves
ambiguity in the interface.
2017-04-26 16:00:02 +02:00
146db944e5 Threading: Remove thread lock which seems useless
Render data is never guarded by image drawe lock.
2017-04-26 16:00:02 +02:00
449ad35093 Move depth select loop into its own function
Useful for splitting out draw logic in 2.8x
2017-04-27 00:01:23 +10:00
6ed15c5a41 Alembic export: support simple child hairs (Fix T51144)
Simple child hairs don't have a face index number assigned, so the
call to dm->getTessFaceData(dm, num, CD_MFACE) would cause a crash. To
work around this, UV and normal vectors are copied from the parent
hair.

I've also removed an unnecessary call to dm->getTessFaceArray(dm);

Reviewers: kevindietrich

Differential Revision: https://developer.blender.org/D2638
2017-04-26 15:31:03 +02:00
51e3a184ea Alembic: fixed indentation 2017-04-26 15:19:37 +02:00
ef80164e1c Alembic: fixed memory leaks 2017-04-26 15:19:37 +02:00
20621d46d1 Alembic: fixed refcount issue when duplicating imported objects
Duplicating an imported object didn't increment the cache reader's refcount,
whereas removing the duplicate did decrement it. This caused problems.
2017-04-26 15:19:37 +02:00
ff1f115706 Fix T51280: Alembic: Crash when removing cache modifier
The calls to id_us_plus/min were unnecessary (and caused assertion
failures) as this is already taken care of by transformcache_id_looper().
2017-04-26 15:19:37 +02:00
7517cf6bbb Getting rid of setlinestyle: 3DView ruler. 2017-04-26 15:19:03 +02:00
318216e677 Gawain: add immAttrib2fv helper. 2017-04-26 15:19:03 +02:00
75e9d59b96 Getting rid of setlinestyle: non-camera 3DView render border.
Also fixed wrong color for in-camera render border, and added a comment
to imm_cpack about expected color components order in integer parameter.
2017-04-26 15:19:03 +02:00
Dalai Felinto
e791e01c0b Fix material preview for Cycles and BI
I had to update the .blend files too, and get them to use collections over the nameless old layers.
2017-04-26 14:37:18 +02:00
b38d87fbaf Last commit broke object-armature select 2017-04-26 22:39:12 +10:00
aca6a12330 Draw Manager: pose-bone selection 2017-04-26 22:28:42 +10:00
87f483debb OSX buildbot: remove redundant option 2017-04-26 14:28:36 +02:00
c1aea353ae OSX buildbot: disable unsupported calls for now and use quicktime off default 2017-04-26 14:04:09 +02:00
f351cb5479 Avoid platform dependant PATH_MAX 2017-04-26 21:06:00 +10:00
ec442224df Getting rid of setlinestyle: Squencer space.
Not much to add here, except that it needs the scale of its MVP matrix
to be taken into account here...

Reviewers: merwin, dfelinto

Differential Revision: https://developer.blender.org/D2647
2017-04-26 12:26:30 +02:00
9b3e3d4def Alembic export: also export empties
Exporting an empty creates an Alembic XForm object. The empties can also
be animated.
2017-04-26 12:26:21 +02:00
afe1c25d06 Alembic export: renamed func object_is_shape → object_type_is_exportable
The function doesn't return whether the object is a shape at all, since
it also returns true for camera objects (and soon also for empties). It
returns true when objects of this type can be exported to Alembic at all.
This is now reflected in the name.
2017-04-26 12:25:45 +02:00
8de3778d11 Getting rid of setlinestyle: 3DView camera view.
Use new 2D dashed line shader in 3DView camera view.

Note that this also involved converting UI_draw_safe_areas() to this
dashed shader, which means it cannot be used anymore with other shaders.

Part of D2647.
2017-04-26 12:17:46 +02:00
88a7d3438d Move imm_draw_line_box_dashed to GPU_immediate_util. 2017-04-26 12:11:40 +02:00
621b8bdf86 Tweak 2D line dashed shader to take a scale parameter.
Even though in some cases this does not seems useful, in others (like
zommed 2D views) we have to correct MVP matrix scaling to get fixed
dashes size.

Note that we could do that differently (commented about it in shader),
would also have been cleaner to extract that MVP scale from within the
shader, but there does not seem to be a way to initialize uniform values
from within a shader, and would rather avoid recomputing the scale for
every run (especially since 3DViewport does not need it e.g.).

Part of D2647.
2017-04-26 12:04:35 +02:00
80b49c1521 UI utils: add helper to get float3 blended color from theme. 2017-04-26 12:00:15 +02:00
2387ba93d2 BLI_math: add helper function to extract XY 2D scale from a 4D matrix. 2017-04-26 12:00:15 +02:00
Dalai Felinto
b2fde7b1ee Silence eevee warnings 2017-04-26 11:25:43 +02:00
Dalai Felinto
c2e91bcfc4 Proper fixup for selection and core
That still not ideal, but so be it. IS_VIEWPORT_LEGACY should be
removed anyways, this is code from pre-draw manager and the
"modern viewport" as well as legacy will go away entirely once the draw
manager is feature complete.
2017-04-26 11:21:55 +02:00
Dalai Felinto
8b4941b7c5 Revert "Fixup for "always use selection in core""
This reverts commit 535cf2c714.
2017-04-26 11:19:15 +02:00
Dalai Felinto
535cf2c714 Fixup for "always use selection in core"
In my previous commit [1] I forgot one of the if() calls. Handled it
differently now.

[1] dc1f491a50
2017-04-26 11:13:22 +02:00
Dalai Felinto
b27775138b Pass depsgraph via Context to selection code 2017-04-26 11:05:04 +02:00
Dalai Felinto
dc1f491a50 Selection: Always use new selection code when building with using core profile 2017-04-26 10:42:40 +02:00
Dalai Felinto
f88e6763d6 Depsgraph and selection: Flush selcol on Depsgraph
Selection code needs to iterate over DEG_OBJECT_ITER otherwise we won't
get modifiers, dupli objects, ...

Also make selection respect selectability flag.

Review by: Sergey Sharybin
2017-04-26 10:42:40 +02:00
edc9f8b766 Alembic: shortened CacheFile.filepath to 1024 bytes again
As per discussion on 3128600a8a
2017-04-26 10:42:20 +02:00
268cb5fbd3 Alembic: fixed C++98 compatibility 2017-04-26 10:42:20 +02:00
dba6e170c4 Alembic import: added unit test for mesh deformation. 2017-04-26 10:42:20 +02:00
3dc6528cd4 Merge branch 'master' into blender2.8 2017-04-26 10:11:03 +02:00
ab168f63f6 Remove show_backface_culling check in select engine
May add back so selection engine can read backface cull state
from from different engines.
2017-04-26 18:08:49 +10:00
9623d93f14 Cycles: Fix access undefined macro on non-MSVC compiler
Also rremove trailing whitespace.
2017-04-26 10:00:31 +02:00
3f91567052 Cleanup: draw engine
- use DRW_engine prefix for engine types.
- use engine suffix for files that define a draw engine.
- remove engines from include path (they're only referenced once)
2017-04-26 17:42:39 +10:00
bfc2043332 Draw Manager: add select engine
This does very little currently, but allows changing behavior for
selection drawing in the future.
2017-04-26 17:25:41 +10:00
de0d3ec457 Allow new selection in eevee & blender draw modes 2017-04-26 16:52:02 +10:00
5634763e5e Draw Manager: armature editmode selection 2017-04-26 16:12:01 +10:00
82686f0a0c Eevee: World default shader.
- Use uniform color world for the world probe.
- Refactored the Fresnel expression to be better with Area Lights.
- Squared the roughness for default materials.
2017-04-25 23:51:05 +02:00
bb75b0bcbc Eevee: Disable shadow rendering until we get proper update scheduling.
Performance is quickly getting poor when you have lights otherwise.
2017-04-25 23:51:05 +02:00
7bc637a40d Eevee: Fix Square light with non uniform scale. 2017-04-25 23:51:05 +02:00
0f2d0ff124 workaround for T50176
This works around a long outstanding issue T50176 with cycles on msvc2015/x86 . root cause is still unknown though,feels like a game of whack'a'mole

Reviewers: sergey, dingto

Subscribers: Blendify

Tags: #cycles

Differential Revision: https://developer.blender.org/D2573
2017-04-25 14:21:46 -06:00
d8e83516e2 Draw Manager: support for selection using engines
Needed to remove old draw code entirely.

Object mode selection support, pose and armature still need to be added.
Enabled when 'use_modern_viewport' is set.
2017-04-26 04:59:18 +10:00
Hristo Gueorguiev
e91dc3a97c Cycles: use safe compiler flags for OpenCL.
Using -cl-fast-relaxed-math assumes no NaN/Inf values in any expression.
This causes problems on overflow, division by zero, square root of negative number.
Comparisons with NaN or infinite value are affected as well.

This patch causes <2% slowdown on benchmark scenes.

Fix T50985: Rendering volume scatter with GPU OpenCL comes to an halt after a few seconds
2017-04-25 20:10:51 +02:00
Hristo Gueorguiev
9d26e32ea2 Workaround for AMD GPU OpenCL compiler. 2017-04-25 20:08:14 +02:00
041a50291b Eevee: Make default shaders works.
- Added New Batch cache routine to get the split mesh for each material. (optimization needed)
- Did some shader modifications to create default_frag and support a somwhat correct fresnel for lamps (to finish)
2017-04-25 18:47:20 +02:00
Dalai Felinto
00f5c621a6 Outliner: Re-build depsgraph when reordering collections
Otherwise if we create a new collection, and drag a collection into it we either
get a crash, or at the very least we dont get the visibility flags correct.
2017-04-25 18:44:17 +02:00
Dalai Felinto
973f4944e0 Render API: Rename render > render_to_image; view_draw > render_to_view
This is part of the new draw manager design. Any engine (even clay, eevee, ...) should be able to draw to the viewport, as well as render to an image directly.
Changing the API names to conform to that.
2017-04-25 18:03:13 +02:00
Dalai Felinto
4122eeb09a Cycles: Use depsgraph instead of layers 2017-04-25 18:03:13 +02:00
Dalai Felinto
05243a633a Depsgraph: Store Scene in depsgraph struct
This way we can retrieve the scene from depsgraph that were not created from a G.main (e.g., when doing material thumbnail preview render).
2017-04-25 18:03:13 +02:00
Dalai Felinto
b43200a120 Cleanup: Line-width 2017-04-25 18:03:13 +02:00
6822e353ff Merge branch 'master' into blender2.8 2017-04-25 17:04:17 +02:00
99d2d6f387 Alembic import: don't use global main 2017-04-25 17:03:15 +02:00
2aa4f8ab92 Alembic import: removed BaseLegacy from BKE_cachefile_clean
Now we just iterate over all objects. It may be a better idea to use a
smarter approach for performance. However, since this function is not
called regularly (only when changing Alembic file paths), it's not a very
big deal.
2017-04-25 16:59:36 +02:00
7cf7b3b7e5 Draw Manager: clear draw global data after use 2017-04-26 00:39:53 +10:00
acf07e7366 Draw Manager: store context vars per draw
Was performing context access per object for scene, region etc.
While not very slow they don't change during drawing so cache in a struct.

This also makes it possible to draw in views besides the current context.
2017-04-26 00:35:08 +10:00
9dadd5ff93 Fix T51292: Alembic import, show notification when trying to load HDF5
HDF5 Alembic files are not officially supported by Blender. With this
commit, the HDF5 format is detected even when Blender is compiled without
HDF5 support, and the user is given an explanatory error message (rather
than the generic "Could not open Alembic archive for reading".
2017-04-25 14:30:09 +02:00
ab4f6f01a6 Cycles: Fix strict compiler flags 2017-04-25 14:12:14 +02:00
0b84f21b08 Fix OSX buildbot 2017-04-25 14:05:03 +02:00
3128600a8a Fix T51262: Blender CRASH with alembic file
Also added a unit test for exporting & importing very long names.
2017-04-25 12:06:03 +02:00
1f85a35a3d Cycles: Cleanup, mainly line length in random module
Was doing lots of investigation recently, with need to have lots of things
side by side.
2017-04-25 11:43:20 +02:00
e353cf8705 Revert "Alembic: Construct ISampleSelector once and pass along"
This reverts commit 099816587a. It had some
unforseen side-effects that should be investigated first.
2017-04-25 10:45:26 +02:00
0a07cdbe80 Cycles: Split vectorized math utilities to a dedicated files
This file was even a bigger mess than vectorized types header,
cleaning it up to make it easier to maintain this files and
extend further.
2017-04-25 10:33:26 +02:00
51ec9441b7 Cycles: Split vectorized types into separate files
The final goal to reach is to make vectorized types much easier to maintain
and the previous design had following issues:

- Having all types and methods implementation made the source file rather
  bloated and unfun to navigate in.

- It was not possible to quickly glance available API for the type you are
  interested in.

- Adding more vectorization types will bloat the file even more, making
  things even more tricky to follow.
2017-04-25 10:33:26 +02:00
b06cd746ce Cycles: Cleanup, preprocessor indentation 2017-04-25 10:33:26 +02:00
573f6d1ec4 Fix T51284: Mesh not skinned 2017-04-25 10:01:34 +02:00
7398b3b71b WM: don't search for app-template when its empty
Changing from a loaded app-template back to Default (none set)
would scan paths for a file with no name. Harmless but silly.
2017-04-25 17:15:23 +10:00
75a759ea5e OpenGL: better context creation on Windows
Compatibility profile was working fine, this is mostly to get the highest GL core profile version available.

Our minimum requirement is 3.3 core profile.  When we request a specific GL version:
 - AMD and Intel give us exactly this version 
 - NVIDIA gives at least this version <-- desired behavior 
so we ask for 4.5, 4.4 ... 3.3 in descending order to get the best version on the user's system.

Accept OpenGL 3.0 on Mesa instead of 3.3+ compatibility profile. (requested by @LazyDodo) This will be removed after we finish moving to core profile.

Part of T49012 and T51164
2017-04-24 22:30:17 -04:00
9c87bb124a group WITH_LEGACY_OPENGL with the other GL options
Blender subsystems that care about OpenGL use GL_DEFINITIONS, which now includes the newest (temporary) WITH_LEGACY_OPENGL.

Also updated Gawain's CMake to use this instead of its own logic.
2017-04-24 17:41:26 -04:00
d8661ee2d5 Cycles: Remove re-hashing done in BPT volume code
Since 9d50175 this is no longer needed, at least not with the current
sampler we are using.
2017-04-24 21:48:01 +02:00
Dalai Felinto
0f143627d2 Collection: __FUNCTION__ > __func__ 2017-04-24 18:15:37 +02:00
Dalai Felinto
9f074444ad Layer cleanup: Rename _Iterator_ > _iterator_ 2017-04-24 18:14:41 +02:00
Dalai Felinto
9b94e2a743 Bring back outliner hierachy delete 2017-04-24 18:08:08 +02:00
Dalai Felinto
8c7e0f23c2 Fix view local not working 2017-04-24 18:06:48 +02:00
Dalai Felinto
a8fd510bd5 Outliner: Bring back bases when pertinent
This partially reverts c4e34a84e0

Note: This is necessary for the "delete hierarchy" functionality
2017-04-24 18:06:48 +02:00
Dalai Felinto
1ffdffc699 FOREACH_SELECTED_BASE iterator 2017-04-24 18:06:48 +02:00
2f2e2bae8d Fix own mistake in smoke.c 2017-04-24 17:15:17 +02:00
913e9350a5 Convert BaseLegacy to Base (part) 2017-04-24 16:09:04 +02:00
69a216d343 Cleanup: remove unnecessary texface checks 2017-04-24 22:45:40 +10:00
2010dbe8a5 Merge branch 'master' into blender2.8 2017-04-24 22:11:05 +10:00
aff30aaf2d Cleanup: style 2017-04-24 22:00:46 +10:00
50bfaffc6b Cycles: Cleanup, space after keyword 2017-04-24 11:23:19 +02:00
d67609697e Add C internal version of msgfmt (similar to makesrna/dna binaries).
Fixes performance issues of C++ one with Windows MSVC debug builds...

Merely a translation from msgfmt.cc code by @sergey, using BLI libs intead of C++'s stdlib.

Reviewers: sergey, campbellbarton, LazyDodo

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2605
2017-04-24 10:49:54 +02:00
6d9a223c90 BLI_dynstr: add memarena-based version, and helper to clear without freeing. 2017-04-24 10:42:10 +02:00
5a232039d5 Usual i18n/UI messages fixes and cleanup. 2017-04-24 09:33:49 +02:00
f1ada2e719 [msvc/make.bat] Add convenience option to turn off game engine+player 2017-04-23 14:46:33 -06:00
da82f65424 CMake: Fix CMake for non Apple systems
Follow up to https://developer.blender.org/rB14a4ce6d7fb4dcf3d1aa5b58f9a543549df6d5dc
apple_check_quicktime() macro is only defined for apple, so ignore it otherwise.
2017-04-23 19:10:04 +02:00
14a4ce6d7f CMake: move some Apple specific code into platform_apple_xcode.cmake. 2017-04-23 18:24:47 +02:00
Romain Foyard
a192d5b81c CMake: disable WITH_CODEC_QUICKTIME for macOS > 10.11 for configurations.
QtKit was removed in macOS Sierra, this patch disables WITH_CODEC_QUICKTIME
in Sierra and greater versions of macOS.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2645
2017-04-23 18:24:47 +02:00
cedb1915fe CMake: fix wrong alembic test name on Windows. 2017-04-23 18:24:43 +02:00
4a9e546fed [msvc/make.bat] Allow override of the build folder name 2017-04-23 10:10:57 -06:00
f93f4169cb Merge branch 'master' into blender2.8
Conflicts:
	build_files/cmake/platform/platform_apple.cmake
2017-04-23 10:49:39 +02:00
79fd8eeb0e missing from last commit 2017-04-23 04:06:45 +10:00
2acb5d1e38 Fix armature drawing ignoring object matrix
Looks like name-space collision.
2017-04-23 04:03:13 +10:00
23c4f01fb4 Draw Manager: hide 2d curves normals 2017-04-23 03:28:53 +10:00
20c9c1b44e OSX: satisfy macro to also apply alembic tests 2017-04-22 19:03:59 +02:00
517bd13baa Disable breaking alembic test for osx 2017-04-22 18:39:11 +02:00
4ee36a2aea Cleanup: line length 2017-04-22 16:13:18 +10:00
36b29c05db Cleanup: use DRW_shgroup_call prefix for dynamic and fixed
More useful for completion since an 'shgroup_dynamic' is not a thing
(would be confusing if other dynamic functions are added).
2017-04-22 15:53:11 +10:00
9fe9cf8261 fix omission from previous commit
Missed one old call on Linux/X11.
Follow-up to ef640ecf10
2017-04-22 00:58:42 -04:00
ef640ecf10 OpenGL: remove use of GLEW MX
MX (Multiple conteXt) support was dropped from the GLEW 2.0 library to make core profile support cleaner.

Our WITH_GLEW_MX build option was OFF by default already; this commit removes the inactive code paths.

I'm working on a plan for multiple GPUs, contexts, resource sharing, etc. This commit gives us a cleaner starting point for that upcoming work.

Tested on Mac, will test on Linux & Windows immediately after pushing.
2017-04-22 00:35:04 -04:00
1beed61b76 OpenGL/GHOST: don't request accum buffer on Mac
This was blocking core context setup on Mac, since accumulation buffers are obsolete. With this (and appropriate CMake options) I now get

renderer:	'Intel HD Graphics 4000 OpenGL Engine'
vendor:		'Intel Inc.'
version:	'4.1 INTEL-10.24.45'

in system-info.txt intead of 

version:	'2.1 INTEL-10.24.45'
2017-04-21 16:04:03 -04:00
12261aa047 fix unitizialized use warning
The code would only use 'type' uninitialized in error conditions, but it's still better to avoid that.

caught by clang
2017-04-21 15:51:08 -04:00
dcda9b4136 Eevee/OpenGL: fix shader for core profile 2017-04-21 15:48:56 -04:00
dc5bd2784f [cmake] Fix Alembic build errors with msvc 2017-04-21 12:18:19 -06:00
8ac1f03f41 Eevee: Cascaded Shadow Maps, follow up.
- Compute coarse bounding box of split frustum. Can be improved
- Make use of 4 cascade.
- View dependant glitches are fixed.
- Optimized shader code.
2017-04-21 16:43:35 +02:00
cc2d501642 Merge branch 'master' into blender2.8 2017-04-21 16:30:24 +02:00
Dalai Felinto
111a53f74c Fix crash when duplicating objects by tagging depsgraph
This may change once depsgraph becomes aware of workspaces.
For now this is the best we can do.
2017-04-21 16:25:20 +02:00
7e977470f3 Alembic unit tests: Removed trailing spaces 2017-04-21 16:20:35 +02:00
e6ee3fd924 Alembic unit tests: don't depend on ALEMBIC_ROOT_DIR being defined by user
By mistake, the code relied on ALEMBIC_ROOT_DIR being defined by the user
running the tests. Now CMake macros are used to correctly find the Alembic
root directory.
2017-04-21 16:20:01 +02:00
Dalai Felinto
e6f073fe41 Re-enabling Alembic test
(disabled because of bug fixed on 19548040d9)
2017-04-21 16:07:53 +02:00
349cafac52 Matrix.decompose(): changed terminology, "location" → "translation"
Matrix.decompose() should either return "location, orientation, size" or
"translation, rotation, scale". Since there are constructors for the former,
I've replaced "location" in the documentation with "translation".

The code is still the same, I just changed the documentation.
2017-04-21 15:51:35 +02:00
Dalai Felinto
19548040d9 Fix T51261: New objects aren't selected
The original code was failing because the base to object flushing was
only happening as part of the depsgraph. However we can use the
evaluated values to set the initial values of the base.

In this particular case, we couldn't set the new object visible because
its selectability flag was not set yet.
2017-04-21 15:27:32 +02:00
Dalai Felinto
2f506b9458 Fix objects visibility evaluation bug
This was introduced on 4b77fb3075 no idea how I left this in, shame on me
2017-04-21 15:27:02 +02:00
Dalai Felinto
cc8f104098 Tag depsgraph update when hide and hide_select are changed
We were not updating depsgraph when collection just "became" selectable,
but although this doesn't change object selection, it change its
selectability.
2017-04-21 14:42:45 +02:00
9781139590 Cycles: Solve speed regression of classroom scene after principled commit
This way we can skip it from compiling into OpenCL kernels by making
this shader compile-time feature.
2017-04-21 14:41:42 +02:00
b6da2a6a86 Cycles: Make it a generic base class for all types of closure nodes
The idea is to have osme geenric BSDF node which is subclassed by
"regular" BSDF nodes and uber shaders.

This way we can access special type and closure type for making
decisions somewhere else.
2017-04-21 14:36:56 +02:00
e4ab70da86 CMake: Add option to build against system-wide Glog
Similar to previous commit for Gflags.
2017-04-21 14:36:34 +02:00
81011679dd Merge branch 'master' into blender2.8 2017-04-21 14:19:05 +02:00
9c02990ac1 Alembic import: changing cache modifier path no longer discards object paths
This allows, for example, the path of an Alembic file to be changed from
absolute to relative, without having to reconstruct all object paths.
2017-04-21 14:11:49 +02:00
9d819775b7 Alembic: properly initialising cachefile object paths list. 2017-04-21 14:11:49 +02:00
45b9ee525d Alembic: fixed memory leak 2017-04-21 14:11:49 +02:00
099816587a Alembic: Construct ISampleSelector once and pass along
No longer passing time as float and constructing ISampleSelectors all
over the place. Instead, just construct an ISampleSelector once and
pass it along.
2017-04-21 14:11:49 +02:00
bfa888cef2 Cleanup: move draw-cache creation from BKE to DRW
Creating draw-cache should only ever be used by the draw-manager.
2017-04-21 22:06:06 +10:00
Dalai Felinto
c7f00feaba Unify RNA and core depsgraph.objects
Note: Since this is not listbase nor array I'm also expanding
RNA_types.h to allow for custom data.
2017-04-21 13:00:40 +02:00
Dalai Felinto
4b77fb3075 Move DEG_OBJECT_ITER inside depsgraph 2017-04-21 13:00:40 +02:00
df84082c70 Cycles: Cleanup, indentation in preprocessor 2017-04-21 12:26:04 +02:00
470b54a37a Cycles: Cleanup, indentation inside preprocessor 2017-04-21 12:01:27 +02:00
aa2cff4509 Cycles: Fix regression in SSS rendering after principled commit 2017-04-21 12:01:27 +02:00
7a59d381ce Cycles: Cleanup, indentation of comment
Was broken after principled commit.
2017-04-21 12:01:27 +02:00
c7a5c48cba CMake: Add option to link against system-wide Gflags library
It is disabled by default, so should not affect existing configurations.

Main benefits of this goes as:

- Linux distros can use that to avoid libraries duplication and link
  blender package against gflags package from the system.

- It it easier to test whether Blender works with updated version of
  Gflags prior to re-bundling the library.
2017-04-21 12:01:27 +02:00
3540b50780 Cleanup: use id-property access macros 2017-04-21 19:47:01 +10:00
Dalai Felinto
6294bd1b8b Depsgraph: Move DAG_get_object function
BKE_depsgraph.h will be deprecated eventually, so moving it to DEG_depsgraph_query.h
2017-04-21 11:33:15 +02:00
3e7968c35f Draw Manager: don't assign bool from flags
Some MSVC versions don't support this.
2017-04-21 18:43:54 +10:00
15d73e53c3 Gawain: fix for building empty element list 2017-04-21 18:33:44 +10:00
Dalai Felinto
dafdf72904 Rename: Alembic job struct sl > scene_layer 2017-04-21 10:03:44 +02:00
Dalai Felinto
01a627dac9 Include the set in the depsgraph objects iterator
Pending: Include the set in the rna depsgraph.objects

In fact it would be nice to unify them both. However this will likely
change once Depsgraph incorporate this iterator, so I'm not sure we
should bother with that.

Related to T51203
2017-04-21 09:56:26 +02:00
3a75e84376 Draw Manager: edit-mode 3d text drawing
Draw cursor and selection, also support for fast-display.
2017-04-21 17:58:18 +10:00
55a3d48046 Docs: diagram for reflect_v3_v3v3 2017-04-21 17:27:20 +10:00
2b9738b7f8 Merge branch 'master' into 28 2017-04-21 17:14:13 +10:00
13ee5ba467 Store edit-font select-box length
A little awkward to calculate when drawing.
2017-04-21 17:12:43 +10:00
Stefan Werner
aeda1a16f3 D2607: Switch eye dropper to use linear color space internally
This switches the internal color representation of the eye dropper from display space to linear. Any time a linear color is requested and the color is picked from a linear object, the result is now precise to the bit as the color gets patched through directly. Color space conversion now only happens when a color is picked from non-linear display space objects or when the color is requested to be returned in non-linear space.

In addition, this patch changes the DifferenceMatte node to interpret a tolerance of 0.0 to accept colors that are identical bit by bit, as apposed to simply refusing all colors.
2017-04-20 22:41:26 +02:00
Stefan Werner
b628f765b0 D2608: Allow HDR picking from Compositor background
Replaced some STREQ(snode->tree_idname, ...) calls with ED_node_is_*() calls for improved readability, fixed one case where the STREQ was used the wrong way
2017-04-20 22:32:00 +02:00
c4780ee459 Cleanup: redundant struct qualifier & long lines 2017-04-21 04:40:44 +10:00
d21a4407dc Cleanup: rename & change order of declaration 2017-04-21 04:29:33 +10:00
677aa36632 Curve: draw curve/surface/text geometry
Note that displists will be removed, but this wont be hard to replace.

Signed-off-by: Campbell Barton <ideasman42@gmail.com>
2017-04-21 04:23:28 +10:00
ca958642fa Fix Surface Deform not unbinding if target is removed 2017-04-20 17:49:45 +02:00
Dalai Felinto
9d1421c069 RNA: depsgraph.objects
Iterator to return the objects evaluated from depsgraph. The
iterator itself will change once CoW is implemented.

This reproduces the behaviour of DEG_OBJECT_ITER but for Python.
2017-04-20 17:21:06 +02:00
Dalai Felinto
f2a2adc910 RNA: bpy.context.depsgraph 2017-04-20 17:20:56 +02:00
74023d46ce Implement DAG_get_scene_layer
Even though this will have to change once we get workspaces, we will
still have a depsgraph for the Scene.

This is required for the upcoming depsgraph.objects RNA iterator.
2017-04-20 17:18:31 +02:00
52295dd480 Alembic export: don't show warning for every exported frame
The warning about not having a UV map is now only shown once per hair
system.
2017-04-20 15:30:13 +02:00
ee3faddfaa Fix T45350: Cache not being recomputed with "Bake All Dynamics" 2017-04-20 15:01:21 +02:00
66377b89da Fix T51251: Armature/Normal-button scaled twice 2017-04-20 22:12:08 +10:00
afc885cd13 Draw Manager: round vertex size up
Without this assigning `gl_PointSize = sizeVertex`
made vertices too small.
2017-04-20 21:16:37 +10:00
84c464a4b8 Use theme vertex size for lattice & curve vertices 2017-04-20 21:16:37 +10:00
3d17ece539 Eevee: Start Implementation of Cascaded Shadow Maps 2017-04-20 13:07:51 +02:00
b386828671 Eevee: Do shadow cube render in one pass. 2017-04-20 13:07:51 +02:00
3fa665f56d Draw Manager: Fix Gradient Background 2017-04-20 13:07:51 +02:00
6028ff2736 Correct error drawing curve normals 2017-04-20 21:01:23 +10:00
aa4102a441 Merge branch 'master' into blender2.8
Disabled a unittest, to be re-enabled when T51261 is fixed.

# Conflicts:
#	source/blender/alembic/intern/alembic_capi.cc
2017-04-20 12:50:20 +02:00
8e0c57a812 Gawain: fix immediate mode drawing exceeding IMM_BUFFER_SIZE
Would cause crazy colors in file selector.
2017-04-20 20:43:56 +10:00
ae79eb2105 Alembic import: select imported objects
When the Alembic import is finished, all imported objects are selected.
2017-04-20 12:01:31 +02:00
28ed66552b Fix debug checks were enabled for release builds only
NDEBUG meanse Not DEBUG.
2017-04-20 11:03:55 +02:00
Dalai Felinto
913472165b Fix T51215: depsgraph evaluation of collection properties (overrides) 2017-04-20 11:00:32 +02:00
Dalai Felinto
3cb0e8e1af IDProperty: New util function to merge groups recursively 2017-04-20 11:00:32 +02:00
Dalai Felinto
53d59af364 Corrections for layers unittest based on design change
Example, imagine an object Cube in collections 1 and 2 where both
collections are nested to A. Now we set a "color" property as follow:

```
Scene -> GREEN
--
A     -> RED
↳ 1   -> BLUE
↳ 2   -> -
```

In this case the object will be RED, because of A↳ 2.

Now if we have:

```
Scene -> GREEN
--
A     -> RED
↳ 1   -> -
↳ 2   -> PINK
1     -> -
--

The object will be PINK because of A↳ 2.

Note that the (top level) collection 1 doesn't influence the object color
because there are no overrides on it. The scene render settings (GREEN
in this case) are only used as fallback if an override is not set at
all.
2017-04-20 11:00:32 +02:00
b5b0fc9c94 Cleanup: Use explicit unsigned int type
This is as per our code style states ans as majority of the team
prefers types to be used.
2017-04-20 10:56:08 +02:00
09bf8f4a69 Use reflect for calculating second normal 2017-04-20 18:56:53 +10:00
31c644b657 Fix T51198: Crash with new Datablock ID Properties 2017-04-20 11:40:31 +03:00
d8bf090090 Merge branch 'master' into 28 2017-04-20 18:16:01 +10:00
6da53e46c9 Use reflect for calculating second normal 2017-04-20 18:08:05 +10:00
9bb8e46460 Docs: move note (was mixed up) 2017-04-20 17:11:12 +10:00
462d9e37ea Cleanup: remove type prefix from render-data vars
Render data is never mixed with other object types,
no need to make a distinction.
2017-04-20 16:25:20 +10:00
6c26911c3d Fix T51248: user preferences window size not adapted to DPI. 2017-04-20 01:19:47 +02:00
c7c162e2e0 Fix merge of master (no more base...). 2017-04-19 22:13:57 +02:00
6a5b53fe6f Merge branch 'master' into blender2.8 2017-04-19 22:11:53 +02:00
1873ea337c Fix T51243: Delete Globally won't work with Datablock ID Properties.
That's a quick hack to address that specific case, new pointer IDProp
actually enlights a generic problem - datablocks using themselves - which
is not really handled by current code, would consider this not-so-urgent
TODO though.
2017-04-19 22:07:57 +02:00
a738e985c6 Fix update drawing curve editmode 2017-04-20 05:55:48 +10:00
1c28e12414 Fix (unreported) missing handling of GPencil Layer's parent Object pointer in BKE_library_query.
Grrrr... still finding missing pointers here... :/
2017-04-19 21:47:01 +02:00
72efee07ff Draw Manager: draw curve normals 2017-04-20 05:33:52 +10:00
896d62d1c2 Fix error disabling curve handles 2017-04-20 04:53:55 +10:00
43a273616b No need for while-loop counting curve-normals 2017-04-20 03:01:13 +10:00
e28a92bacb Cleanup: put overlay & wire in own structs 2017-04-20 02:53:33 +10:00
c0f9d962f0 Merge branch 'master' into blender2.8
Updated tests/python/bl_alembic_import_test.py to be 2.8-compatible.
2017-04-19 17:33:22 +02:00
307059ed61 Alembic import: correctly linking objects to scene layer.
The import is always performed on the active LayerCollection. If there
is none, a new one is created.
2017-04-19 17:30:06 +02:00
aaec934096 Alembic import: added simple unit test for importer.
It only tests the presence of the objects and their parent/child pointers.
Matrix and animated properties should be done in a later test.
2017-04-19 17:28:25 +02:00
8accea07f7 UI: Reorganize the UV/Image "Game Properties" Pannel
This uses the same amount of room while giving it a more clean look and adds a label for the mapping options so users can tell the purpose.
2017-04-19 11:15:41 -04:00
248946542d Fix alpha overlay for sculpt/paint when using core profile
Same fundamental problem as fonts -- there is no longer GL_ALPHA format.
2017-04-19 16:57:44 +02:00
e708f45eab Cleanup: Remove executable flag from GLSL shaders 2017-04-19 16:57:44 +02:00
553d820b80 Remove basic shader from paint cursor overlay
Immediate mode built-in shader is used for this drawing already.
So there is no reason to try building basic shader which is not
supported in the core profile.
2017-04-19 16:57:44 +02:00
4bee5b80d4 Convert direct usages of base defines
This replaces all direct usage of:
- FIRSTBASE
- LASTBASE
- BASACT
- OBACT

Some usages still remain in legacy utility functions which are called
all over the place.
2017-04-19 16:52:27 +02:00
2f2420709c Remove local view toggle operator 2017-04-19 16:52:27 +02:00
1427765ec5 Cleanup: remove redundant assignments
Return the 'Batch' instead of assigning a variable.
2017-04-20 00:52:53 +10:00
cdba73c8fa Draw Manager: curve support
Draws the curve centerline and editmode verts/handles.

Handle theme colors, and normal display still need adding.
2017-04-20 00:38:44 +10:00
ce6b01f203 Cleanup: move theme-id to shader-group into funcs 2017-04-20 00:26:44 +10:00
d8c698a76d Fix mistake in previous commit 2017-04-19 16:16:30 +02:00
3f11be3f7d Get rid of glMatrixMode calls
With the explicit calls we don't need to worry about current state
outside of the GPU module now. In fact. we don't need to worry about
current matrix mode in core profile at all.

Legacy OpenGL now has some code which ensures current matrix mode
when using explicit calls to push/pop matrix.
2017-04-19 15:22:58 +02:00
288892bf08 Make UI block drawing closer to master
There is no need to break assumptions of what's being modified
by this call and what's restored. The changes in this function
simply spread crappyness outside of the UI block.
2017-04-19 15:22:58 +02:00
ba4d23fe37 Fix node editor drawing when built with core profile
There are two major things in this commit.

First one is to have proper stack for projection matrices. This is
something what OpenGL specification grants to have at least 2 elements
for and what is required to have for proper editor drawing without
refactoring the way how we restore projection matrix.

Supporting this stack have following advantages:

- Our GPU stack is closer to OpenGL specs, making it easier to follow
  by other developers who are always familiar with OpenGL.

- Makes it easier to port all editors to a new API.

- Should help us getting rid of extra matrix push/pop added in
  various commits to 2.8 branch.

The new API follows the following convention:

- gpuPushMatrix/gpuPopMatrix ALWAYS deals with model view matrix
  and nothing more.

  While this name does not fully indicate that it's only model view
  matrix operator, it matches behavior of other matrix operations
  such as transform which also doesn't indicate what matrix type
  they are operating on.

- Projection matrix has dedicated calls for push/pop which are
  gpuPushProjectionMatrix/gpuPopProjectionMatrix.
2017-04-19 15:22:58 +02:00
781108cdc6 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.cc
#	source/blender/alembic/intern/abc_exporter.h
2017-04-19 15:07:54 +02:00
b01df8222f Comment out places which are using texture matrix mode for core profile
There is only two places which are using texture matrix mode:

- Tiled tface support.
- Texture shading mode for texture mapping.

Both cases are subject for reconsideration: it is likely that we'll be getting
rid of tface, which means game properties like tiles needs to be revisited
anyway. As for texture shading it is using basic shader which is also not
supported by core profile anyway.
2017-04-19 14:44:42 +02:00
2dac8b3ee0 Alembic import/export: added as_background_job option
The ABC_export and ABC_import functions both take a as_background_job
parameter, and return a boolean.

When as_background_job=true, returns false immediately after scheduling
a background job. This was the old behaviour of this function, which makes
it very hard for scripts to do something with the data after the import
or export completes.

When as_background_job=false, performs the export synchronously, and
returns true when the export was ok, and false if there were any errors.
This allows further processing.

The Scene.alembic_export() function is deprecated, and will be removed from
Blender 2.8 in favour of calling the bpy.ops.wm.alembic_export() operator.
As such, it has been hard-coded to the old background job behaviour.
2017-04-19 14:40:57 +02:00
Dalai Felinto
9c84d99819 Unittests: Layer render settings evaluation
More failing unittests to add to the existing ones.
2017-04-19 14:35:29 +02:00
bca55e7adf Cleanup, indentation of preprocessor 2017-04-19 14:33:34 +02:00
fb2330c1e0 Use model view matrix instead of texture matrix for texture brush overlay
It is required for our new matrix stack to only have projection and model view
matrix modes. This commit ports paint cursor overlay to model view matrix.
2017-04-19 14:13:53 +02:00
b148ac5cf7 Alembic export: made hair/particle export optional.
The export is still slower than needed, as the particle systems themselves
aren't disabled during the export. It's only the writing to the Alembic
file that's skipped.
2017-04-19 13:03:52 +02:00
4b376dbe84 Fix wrong RNA update function declarations
This fixes lots of crashes, especially with painting/brush updates.
2017-04-19 12:23:06 +02:00
0fd53c87de Alembic export: converted some export params to actual bools
The variables were interpreted as booleans, and had a 1-bit width. I don't
see a reason to not just use the bool type instead.
2017-04-19 11:43:43 +02:00
Dalai Felinto
54f03914b0 Fix identation 2017-04-19 11:17:14 +02:00
76ecbd38f2 Edit Mode Engine: Fix shader compilation on AMD. Also fix Bweight display. 2017-04-19 11:09:07 +02:00
b3edd94e42 Eevee: Fix black background 2017-04-19 11:09:07 +02:00
42c8d93c5f Fix 'API defined' ID properties still having 'remove' button in UI.
We could not edit them, but still could delete them, which makes no
sense, API-defined properties are similar to class members, removing
them from single instances is pure garbage. And it was broken anyway.

Found by @a.romanov while checking on T51198, thanks.
2017-04-19 09:54:47 +02:00
9a5b379374 Cleanup: set-but-unused warning 2017-04-19 15:57:37 +10:00
94d5ca7cdb Eevee: Remove last deprecated textureCubeLod 2017-04-18 22:56:55 +02:00
8c584dcb65 Eevee: fix core profile. 2017-04-18 22:46:09 +02:00
0610bc88a3 Eevee: Re fix Compilation on MSVC 2017-04-18 22:34:44 +02:00
5670e4149b Eevee: fix compilation error with MSVC 2017-04-18 22:02:46 +02:00
303a9ae0e8 Eevee: Optimize Spherical Harmonic computation time (17ms -> 1ms) 2017-04-18 21:33:09 +02:00
80db709250 Eevee: Spherical Harmonic diffuse.
For now it's done each frame and it's rather slow (16ms) but result will be cached soon.
2017-04-18 21:33:09 +02:00
5bbc803ff0 Eevee: Fix crash on core profile. 2017-04-18 21:33:09 +02:00
85b4398d90 Draw Manager: Fix uniforms array not been found. 2017-04-18 21:33:09 +02:00
94789e30a5 Gawain: fix building WITH_GL_PROFILE_CORE
I intially hard-coded this for compatibility profile. This commit makes the library respect the main CMake options so they match the rest of Blender.
2017-04-18 14:51:42 -04:00
26e171c4d9 OpenGL: don't require legacy extensions when using WITH_GL_PROFILE_CORE
These checks guarantee we meet the minimum expected GL requirements listed in T49012.
2017-04-18 14:44:57 -04:00
473c2b1c94 Gawain: fix stupid APPLE_LEGACY mistake
@dfelinto caught this while building on Linux

fixes a copy/paste mistake from b0351bd3bd
2017-04-18 12:43:50 -04:00
53c56dcd08 Gawain: enable 10.10.10 vertex format for core profile (any platform)
This is an OpenGL 3.3 feature, currently being used for surface normals. It's 1/3 the size of floating point triples and perfect for normals or colors.

See T49012 for why Windows can use this feature regardless of core vs compatibility.
2017-04-18 12:09:17 -04:00
45b3555cba OpenGL: fix compatibility with Mac & Mesa
This combines the Mesa fix (16e929e6ff by @brita_) with the Mac fix (89e23c743e by @merwin).

And uses the same fix for another call to glFramebufferTexture introduced in f1fb605ec9.
2017-04-18 12:09:17 -04:00
b0351bd3bd Gawain: define feature macros in a more compatible way
Thanks to @sergey for proactively testing clang 4.0, which does not accept defined(FOO) as part of macro definitions.
2017-04-18 12:09:17 -04:00
72fc837d1e Cleanup: replace num/ct/tot with 'len' 2017-04-19 01:04:42 +10:00
989080c4f6 Alembic import: little fix for D2634
Now it doesn't crash any more when the Alembic curves object doesn't
have any user properties.
2017-04-18 17:00:21 +02:00
bb31648b9b Merge branch 'master' into blender2.8 2017-04-18 16:47:25 +02:00
2c29b94384 Fix text drawing with core profile
The issue was going to the fact that GL_ALPHA was deprecated in core profile
and common solution online is to use GL_RED instead. That is what is done in
this commit.
2017-04-18 16:42:16 +02:00
5bdbc88ab8 Alembic import/export: write curve resolution to user property
Curve resolution isn't natively supported by Alembic, hence it is stored
in a user property "blender:resolution". I've looked at a Maya curves
example file, but that also didn't contain any information about curve
resolution.

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

Reviewers: kevindietrich
2017-04-18 16:36:33 +02:00
Dalai Felinto
c9d78b6c43 Merge remote-tracking branch 'origin/master' into blender2.8 2017-04-18 16:30:13 +02:00
Dalai Felinto
bc6a75b405 Revert "Object Info node support for GLSL mode and the internal render"
This reverts commit 76425feed8.

** Note **
This was supposed to be a merge, but it was rebased.
2017-04-18 16:29:42 +02:00
70018eb16e Cleanup: missing headers 2017-04-19 00:25:31 +10:00
b8fd6f94a0 Cleanup: replace num/ct/tot with 'len' 2017-04-19 00:12:12 +10:00
Dalai Felinto
2926675bfd OpenGL: Update GPU_legacy_stubs.c
The list is now re-ordered too.
And we are no longer including the new tokens suggestions here (the ones
defined as USE_ in gl-deprecated.h)
2017-04-18 16:02:17 +02:00
Dalai Felinto
80b6f8b1d8 OpenGL: Comment out the old tokens from gl-deprecated
Those tokens are still valid. Although we should not being using them,
they should not prevent us from building with core profile.

In the future we can have a new flag WITH_GL_CORE_STRICT for those.
But only after we build with core profile by default
2017-04-18 16:02:17 +02:00
Dalai Felinto
e5bf726f44 BGL: Remove deprecated enums
Note: The enums that are deprecated and supported are still there
2017-04-18 16:02:17 +02:00
4778369ee8 Eevee: Fix warning 2017-04-18 15:37:22 +02:00
76425feed8 Object Info node support for GLSL mode and the internal render
Object Info node can be useful to give some variation to a single material assigned to multiple instances. This patch adds support for Viewport and BI.

{F499530}

Example: {F499528}

Reviewers: merwin, brecht, dfelinto

Reviewed By: brecht

Subscribers: duarteframos, fclem, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2425
2017-04-18 15:37:22 +02:00
8fdd568343 Draw Manager: T51218 Support edit-mesh hide 2017-04-18 23:33:50 +10:00
3922d5194f Fix install_deps.sh for new Ubuntu 17.04, which does not have libopenjpeg! 2017-04-18 15:24:09 +02:00
1129fd1c51 Use better workaround ofr getting scene layer for Derivedmesh's mask
This replaces access to the first scene layer (which was wrong) with a linear
lookup of scene layer by it's active index.

This seems to be a better temporary solution to have things working for until
we've got proper workspace, depsgraph and it's per-layer storage in place.
2017-04-18 15:06:41 +02:00
363ea3a1ce Remove deprecated GL_LIGHTING chunk from manipulator draw code.
This is new feature, will likely need own shader to get same result.
Just commented it as TODO, though, this is not high priority.

Part of T51164.
2017-04-18 14:58:45 +02:00
2836003f6b Fix T51187: Memory leak when exporting OpenEXR monochrome animation 2017-04-18 14:28:13 +02:00
b27a98df1d Merged master@e12c3110024dc4b62ffefa739288218b04e39f71 into blender2.8
This doesn't merge entire master into blender2.8, but at least solves
one conflict.
2017-04-18 14:18:06 +02:00
a229ca8f48 Garwain: fix ShaderInterface buffer shrinking 2017-04-18 22:04:00 +10:00
7d5a1c0c4c Alembic unittest: pass unknown CLI arguments to unittest.main()
This allows specifying test names on the CLI, in order to run only one
of the tests.
2017-04-18 13:57:04 +02:00
86288725df Alembic import: fall back to linear when variable order array is invalid.
This seems like more sane behaviour than to keep the orderu at the
invalid default value 0.
2017-04-18 13:57:04 +02:00
d24578b676 Alembic export: fixed curve type and order.
The order number written to Alembic is the same as we use in memory, so
the +1 wasn't needed, at least according to the reference Maya exporter
maya/AbcExport/MayaNurbsCurveWriter.cpp, function
MayaNurbsCurveWriter::write(), in the Alembic source code.

Furthermore, when writing an array of nurb orders, the curve type should
be set to kVariableOrder, otherwise the importer will ignore it.
2017-04-18 13:57:04 +02:00
edcf128ce2 Eevee: Introduction of world preconvolved envmap.
For now only compute GGX convolution. The GGX LUT used for the split sum approximation (UE4) is merged with the LTX mag LUT that uses the same parameters (theta and roughness)
2017-04-18 13:10:17 +02:00
f1fb605ec9 GPUFramebuffer: Allow to bind a specific texture mip to framebuffer. 2017-04-18 12:52:29 +02:00
40e69ad6df GPUTexture: Fix Cubemap upload 2017-04-18 12:50:28 +02:00
eda0ebc7b3 GPUTexture: Add Mipmap Control functions. 2017-04-18 12:50:28 +02:00
Dalai Felinto
7bf8ab3c49 Remove 4.1 pseudo-deprecated calls from gl-deprecated
First: we settle on core profile 3.3, not 4.1. Second, GL_CURRENT_PROGRAM still exists in 4.1 and 4.2. But it is recommented to use GL_ACTIVE_PROGRAM instead.

Following the logic of gl-deprecated.h we should define it to USE_GL_ACTIVE_PROGRAM instead. That said, removing it for now.
2017-04-18 12:09:32 +02:00
Pascal Schoen
8825a8e951 Squashed commit of the following:
commit 90778901c9
Merge: 76eebd9 3bf0026
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Mon Apr 3 07:52:05 2017 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 76eebd9379
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Thu Mar 30 15:34:20 2017 +0200

    Updated copyright for the new files.

commit 013f4a152a
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Thu Mar 30 15:32:55 2017 +0200

    Switched from multiplication of base and subsurface color to blending
    between them using the subsurface parameter.

commit 482ec5d1f2
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Mon Mar 13 15:47:12 2017 +0100

    Fixed a bug that caused an additional white diffuse closure call when using
    path tracing.

commit 26e906d162
Merge: 0593b8c 223aff9
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Feb 6 11:32:31 2017 +0100

    Merge branch 'master' into cycles_disney_brdf

commit 0593b8c51b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Feb 6 11:30:36 2017 +0100

    Fixed the broken GLSL shader and implemented the Disney BRDF in the
    real-time view port.

commit 8c7e11423b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Feb 3 14:24:05 2017 +0100

    Fix to comply strict compiler flags and some code cleanup

commit 17724e9d2d
Merge: 379ba34 520afa2
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jan 24 09:59:58 2017 +0100

    Merge branch 'master' into cycles_disney_brdf

commit 379ba346b0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jan 24 09:28:56 2017 +0100

    Renamed the Disney BSDF to Principled BSDF.

commit f80dcb4f34
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Dec 2 13:55:12 2016 +0100

    Removed reflection call when roughness is low because of artifacts.

commit 732db8a57f
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Nov 16 09:22:25 2016 +0100

    Indication if to use fresnel is now handled via the type of the BSDF.

commit 0103659f5e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Nov 11 13:04:11 2016 +0100

    Fixed an error in the clearcoat where it appeared too bright for default
    light sources (like directional lights)

commit 0aa68f5335
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Nov 7 12:04:38 2016 +0100

    Resolved inconsistencies in using tabs and spaces

commit f5897a9494
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Nov 7 08:13:41 2016 +0100

    Improved the clearcoat part by using GTR1 instead of GTR2

commit 3dfc240e61
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 31 11:31:36 2016 +0100

    Use reflection BSDF for glossy reflections when roughness is 0.0 to
    reduce computational expense and some code cleanup

    Code cleanup includes:
    - Code style cleanup and removed unused code
    - Consolidated code in the bsdf_microfacet_multi_impl.h to reduce
      some computational expense

commit a2dd0c5faf
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Oct 26 08:51:10 2016 +0200

    Fixed glossy reflections and refractions for low roughness values and
    cleaned up the code.

    For low roughness values, the reflections had some strange behavior.

commit 9817375912
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Oct 25 12:37:40 2016 +0200

    Removed default values in setup functions and added extra functions for
    GGX with fresnel.

commit bbc5d9d452
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Oct 25 11:09:36 2016 +0200

    Switched from uniform to cosine hemisphere sampling for the diffuse and
    the sheen part.

commit d52d8f2813
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 16:17:13 2016 +0200

    Removed the color parameters from the diffuse and sheen shader and use
    them as closure weights instead.

commit 8f3d927385
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 09:57:06 2016 +0200

    Fixed the issue with artifacts when using anisotropy without linking the
    tangent input to a tangent node.

commit d93f680db9
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 09:14:51 2016 +0200

    Added subsurface radius parameter to control the per color channel
    effection radius of the subsurface scattering.

commit c708c3e53b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 08:14:10 2016 +0200

    Rearranged the inputs of the shader.

commit dfbfff9c38
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Oct 21 09:27:05 2016 +0200

    Put spaces in the parameter names of the shader node

commit e5a748ced1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Oct 21 08:51:20 2016 +0200

    Removed code that isn't in use anymore

commit 75992bebc1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Oct 21 08:50:07 2016 +0200

    Code style cleanup

commit 4dfcf455f7
Merge: 243a0e3 2cd6a89
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Thu Oct 20 10:41:50 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 243a0e3eb8
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Thu Oct 20 10:01:45 2016 +0200

    Switching between OSL and SVM is more consistant now when using Disney
    BSDF.

    There were some minor differences in the OSL implementation, e.g. the
    refraction roughness was missing.

commit 2a5ac50922
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 09:17:57 2016 +0200

    Fixed a bug that caused transparency to be always white when using OSL and
    selecting GGX as distribution of the Disney BSDF

commit e1fa862391
Merge: d0530a8 7f76f6f
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 08:59:32 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit d0530a8af0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 08:53:18 2016 +0200

    Cleanup the Disney BSDF implementation and removing unneeded files.

commit 3f4fc826bd
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 08:36:07 2016 +0200

    Unified the OSL implementation of the Disney clearcoat as a simple
    microfacet shader like it was previously done in SVM

commit 4d3a0032ec
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Sep 26 12:35:36 2016 +0200

    Enhanced performance for Disney materials without subsurface scattering

commit 3cd5eb56cf
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Sep 16 08:47:56 2016 +0200

    Fixed a bug in the Disney BSDF that caused specular reflections to be too
    bright and diffuse is now reacting to the roughness again

    - A normalization for the fresnel was missing which caused the specular
      reflections to become too bright for the single-scatter GGX
    - The roughness value for the diffuse BSSRDF part has always been
      overwritten and thus always 0
    - Also the performance for refractive materials with roughness=0.0 has
      been improved

commit 7cb37d7119
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Thu Sep 8 12:24:43 2016 +0200

    Added selection field to the Disney BSDF node for switching between
    "Multiscatter GGX" and "GGX"

    In the "GGX" mode there is an additional parameter for changing the
    refraction roughness for materials with smooth surfaces and rough interns
    (e.g. honey). With the "Multiscatter GGX" this effect can't be produced at
    the moment and so here will be no separation of the two roughness values.

commit cdd29d06bb
Merge: 02c315a b40d1c1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 6 15:59:05 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 02c315aeb0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 6 15:16:09 2016 +0200

    Implemented the OSL part of the Disney shader

commit 5f880293ae
Merge: 630b80e b399a6d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Sep 2 10:53:36 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 630b80e08b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Sep 2 10:52:13 2016 +0200

    Fresnel in the microfacet multiscatter implementation improved

commit 0d9f4d7acb
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Aug 26 11:11:05 2016 +0200

    Fixed refraction roughness problem (refractions were always 100% rough)
    and set IOR of clearcoat to 1.5

commit 9eed34c7d9
Merge: ef29aae ae475e3
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Aug 16 15:22:32 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit ef29aaee1a
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Aug 16 15:17:12 2016 +0200

    Implemented the fresnel in the multi-scatter GGX for the Disney BSDF

    - The specular/metallic part uses the multi-scatter GGX
    - The fresnel of the metallic part is controlled by the specular value
    - The color of the reflection part when using transparency can be
      controlled by the specularTint value

commit 88567af085
Merge: cc267e5 285e082
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Aug 3 15:05:09 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit cc267e52f2
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Aug 3 15:00:25 2016 +0200

    Implemented the Disney clearcoat as a variation of the microfacet bsdf,
    removed the transparency roughness again and added an input for
    anisotropic rotations

commit 81f6c06b1f
Merge: ece5a08 7065022
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Aug 3 11:42:02 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit ece5a08e0d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 16:29:21 2016 +0200

    Base color now applied again to the refraction of transparent Disney
    materials

commit e3aff6849e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 16:05:19 2016 +0200

    Added subsurface color parameter to the Disney shader

commit b3ca6d8a2f
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 12:30:25 2016 +0200

    Improvement of the SSS in the Disney shader

     * Now the bump normal is correctly used for the SSS.
     * SSS in Disney uses the Disney diffuse shader

commit d68729300e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 12:23:13 2016 +0200

    Better calculation of the Disney diffuse part

    Now the values for NdotL und NdotV are clamped to 0.0f for a better look
    when using normal maps

commit cb6e500b12
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Jul 25 16:26:42 2016 +0200

    Now one can disable specular reflactions again by setting specular and
    metallic to 0 (cracked this in the previous commit)

commit bfb9cb11b5
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Jul 25 16:11:07 2016 +0200

    fixed the Disney SSS and cleaned the initialization of the Disney shaders

commit 642c0fdad1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Jul 25 16:09:55 2016 +0200

    fixed an error that was caused by the missing LABEL_REFLECT in the Disney
    diffuse shader

commit c10b484dca
Author: Jens Verwiebe <info@jensverwiebe.de>
Date:   Fri Jul 22 01:15:21 2016 +0200

    Rollback attempt to fix sss crashing, it prevented crash by disabling sss completely, thus useless

commit 462bba3f97
Author: Jens Verwiebe <info@jensverwiebe.de>
Date:   Thu Jul 21 23:11:59 2016 +0200

    Add an undef for sc_next for safety

commit 32d348577d
Author: Jens Verwiebe <info@jensverwiebe.de>
Date:   Thu Jul 21 00:15:48 2016 +0200

    Attempt to fix Disney SSS

commit dbad91ca6d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Jul 20 11:13:00 2016 +0200

    Added a roughness parameter for refractions (for scattering of the rays
    within an object)

    With this, one can create a translucent material with a smooth surface and
    with a milky look.

    The final refraction roughness has to be calculated using the surface
    roughness and the refraction roughness because those two are correlated
    for refractions. If a ray hits a rough surface of a translucent material,
    it is scattered while entering the surface. Then it is scattered further
    within the object. The calculation I'm using is the following:

    RefrRoughnessFinal = 1.0 - (1.0 - Roughness) * (1.0 - RefrRoughness)

commit 50ea5e3e34
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jun 7 10:24:50 2016 +0200

    Disney BSDF is now supporting CUDA

commit 10974cc826
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 31 11:18:07 2016 +0200

    Added parameters IOR and Transparency for refractions

    With this, the Disney BRDF/BSSRDF is extended by the BTDF part.

commit 218202c090
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 15:08:18 2016 +0200

    Added an additional normal for the clearcoat

    With this normal one can simulate a thin layer of clearcoat by applying a
    smoother normal map than the original to this input

commit dd139ead7e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 12:40:56 2016 +0200

    Switched to the improved subsurface scattering from Christensen and
    Burley

commit 11160fa4e1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 10:16:30 2016 +0200

    Added Disney Sheen shader as a preparation to get to a BSSRDF

commit cee4fe0cc9
Merge: 4f955d0 6b5bab6
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 09:08:09 2016 +0200

    Merge branch 'cycles_disney_brdf' of git.blender.org:blender into cycles_disney_brdf

    Conflicts:
    	intern/cycles/kernel/closure/bsdf_disney_clearcoat.h
    	intern/cycles/kernel/closure/bsdf_disney_diffuse.h
    	intern/cycles/kernel/closure/bsdf_disney_specular.h
    	intern/cycles/kernel/closure/bsdf_util.h
    	intern/cycles/kernel/osl/CMakeLists.txt
    	intern/cycles/kernel/osl/bsdf_disney_clearcoat.cpp
    	intern/cycles/kernel/osl/bsdf_disney_diffuse.cpp
    	intern/cycles/kernel/osl/bsdf_disney_specular.cpp
    	intern/cycles/kernel/osl/osl_closures.h
    	intern/cycles/kernel/shaders/node_disney_bsdf.osl
    	intern/cycles/render/nodes.cpp
    	intern/cycles/render/nodes.h

commit 4f955d0523
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 24 16:38:23 2016 +0200

    SVM and OSL are both working for the simple version of the Disney BRDF

commit 1f5c41874b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 24 09:58:50 2016 +0200

    Disney node can be used without SVM and started to cleanup the OSL implementation

    There is still some wrong behavior for SVM for the Schlick Fresnel part at the
    specular and clearcoat

commit d4b814e930
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:22:29 2016 +0200

    Switched from a parameter struct for Disney parameters to ShaderClosure params

commit b86a1f5ba5
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:19:57 2016 +0200

    Added additional variables for storing parameters in the ShaderClosure struct

commit 585b886236
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 12:03:17 2016 +0200

    added output parameter to the DisneyBsdfNode

    That has been forgotten after removing the inheritance of BsdfNode

commit f91a286398
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 10:40:48 2016 +0200

    removed BsdfNode class inheritance for DisneyBsdfNode

    That's due to a naming difference. The Disney BSDF uses the name 'Base Color'
    while the BsdfNode had a 'Color' input. That caused a text message to be
    printed while rendering.

commit 30da91c9c5
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 16:08:10 2016 +0200

    disney implementation cleaned

commit 30d41da0f0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 13:23:07 2016 +0200

    added the disney brdf as a shader node

commit 1f099fce24
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 3 16:54:49 2016 +0200

    added clearcoat implementation

commit 00a1378b98
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Apr 29 22:56:49 2016 +0200

    disney diffuse und specular implemented

commit 6baa7a7eb7
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 15:21:32 2016 +0200

    disney diffuse is working correctly

commit d8fa169bf3
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 08:41:53 2016 +0200

    added vessel for disney diffuse shader

commit 6b5bab6cec
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:22:29 2016 +0200

    Switched from a parameter struct for Disney parameters to ShaderClosure params

commit f6499c2676
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:19:57 2016 +0200

    Added additional variables for storing parameters in the ShaderClosure struct

commit 7100640b65
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 12:03:17 2016 +0200

    added output parameter to the DisneyBsdfNode

    That has been forgotten after removing the inheritance of BsdfNode

commit 419ee54411
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 10:40:48 2016 +0200

    removed BsdfNode class inheritance for DisneyBsdfNode

    That's due to a naming difference. The Disney BSDF uses the name 'Base Color'
    while the BsdfNode had a 'Color' input. That caused a text message to be
    printed while rendering.

commit 6006f91e87
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 16:08:10 2016 +0200

    disney implementation cleaned

commit 0ed0895914
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 13:23:07 2016 +0200

    added the disney brdf as a shader node

commit 0630b742d7
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 3 16:54:49 2016 +0200

    added clearcoat implementation

commit 9f3d39744b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Apr 29 22:56:49 2016 +0200

    disney diffuse und specular implemented

commit 9b26206376
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 15:21:32 2016 +0200

    disney diffuse is working correctly

commit 4711a3927d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 08:41:53 2016 +0200

    added vessel for disney diffuse shader

Differential Revision: https://developer.blender.org/D2313
2017-04-18 11:43:09 +02:00
f970e859cf Cycles: Cleanup, style 2017-04-18 11:39:21 +02:00
968d86afc3 Depsgraph: Use proper scene to get frame from for pose constraints evaluaiton
Spotted by Luca, thanks!
2017-04-18 11:31:45 +02:00
dd356ec08d Cycles: Remove meaningless volume shaders
This is possible to use surface-only nodes and connect them to volume output.
If there was something connected to surface output those extra connections
will not change anything visually but will force volume features to be included
into feature-adaptive kernels.

In fact, this exact reason seems to be causing slowdown of Barcelone file
comparing AMD OpenCL to NVidia CUDA.

Currently only supported by the final F12 renders because of the current design
of what gets optimized out when and how feature-adaptive kernel accesses
list of required features.

Reviewers: dingto, nirved, maiself, lukasstockner97, brecht

Reviewed By: brecht

Subscribers: bliblubli

Differential Revision: https://developer.blender.org/D2569
2017-04-18 11:20:39 +02:00
bb8f7784ce Fix strict compiler compilation 2017-04-18 09:41:15 +02:00
554277986d Gawain: fix missing NULL check
Also shadowed variable warning
2017-04-18 15:04:01 +10:00
8d78df315c Fix UI: double separator in Movie Clip Editor's view menu 2017-04-17 23:54:19 -04:00
157a8727b5 Fix brush menu broken before adding uv and texture data
To reproduce: 1) go to texture paint mode 2) go into the brush menu

Pointed out by @lijenstina on IRC also fix is authored by him.
2017-04-17 23:42:17 -04:00
4d0d1b5936 Fix T51150: user_remap on itself changes users to 0.
Remapping to itself is nonsense here (was triggering an assert in
BKE_library code actually), just make it a bail out early in RNA
callback in that case.
2017-04-17 22:33:07 +02:00
16e929e6ff OpenGL: Fix crash on start with Mesa drivers
glFramebufferTexture() is only available from OGL 3.2, it is also not part of the ARB_framebuffer_object extension.
I don't know if there is a better way to check for mesa drivers or if using the 2D version will have issues with f2f16a256, but so far I had no problems
2017-04-17 22:31:56 +02:00
4621392353 Fix T51176: Cache file location can be blank and prevent fluid simulation from reading baked data
Sanitize a bit how cache path is handled by fluidsim (there is much more
to be done here though :( ), and forbid empty path (we reset to default
path relative to current .blend file in case it's empty).

If people really, really want to use current OS-wise directory, they can at
least use '.' as path. ;)
2017-04-17 17:35:53 +02:00
819064154c BLI: make BLI_make_existing_file() return true on success, and false on failure... 2017-04-17 17:35:53 +02:00
c89ed72048 Fluidsim cleanup: get rid of magic numbers! 2017-04-17 17:35:53 +02:00
11f4b407d4 Fix build error on Windows introduced in D2425 2017-04-17 13:41:05 +03:00
c6e8a004a1 Gawain: fix for last commit
Follow-up to 3bc6b831d8

Initial code was getting the number of ShaderInterfaces that could fit between two pointers (which makes no sense). I really meant number of bytes.

Surprised it worked on Mac, glad I tested on Windows before bed  :D
2017-04-17 04:01:46 -04:00
3bc6b831d8 Gawain: shrink ShaderInterface name buffer
ShaderInterface stores names of custom uniforms and all attributes in an internal buffer, but it doesn't know how large to make this buffer until all inputs are scanned.

This commit shrinks the buffer to the exact size needed.
2017-04-17 01:45:21 -04:00
b3e38cfc6b Gawain: look up uniforms by name quicker
ShaderInterface_uniform searches custom uniforms first, then builtin uniforms if needed.

This reduces the amount of string matching since you're almost certainly looking for one of those custom uniforms. Otherwise you would've called ShaderInterface_**builtin**_uniform.
2017-04-17 01:19:28 -04:00
57d31171d0 Object.raycast: more minor improvements ...
- if it is to check a bool, let it be local;
- removes gotos;
2017-04-16 18:50:06 -03:00
47e0d2b235 OpenGL: tweak GPU_texture_create_nD
- test for 2D textures first since it's the most common case
- declare variables close to where they're used
- fix compiler warning for proxy (uninitialized use)
- safe return if n != 1, 2, 3 (should never happen)
- white space
2017-04-16 15:11:38 -04:00
8dcf7a46a2 OpenGL: fix GPU_SHADER_SIMPLE_LIGHTING_SMOOTH_COLOR
The fragment shader expects a normal, but the vertex shader was not providing one.

Fix: added a new vertex shader that has normals + smooth color interpolation.

I also split gpu_shader_3D_vert in two:
- one with just position
- one with position + normal

For each of the builtin shaders, we should be able to look at the GLSL and tell exactly what it's doing. Using #defines and #ifdefs for rendering options makes the shaders hard to read and easy to break.
2017-04-16 15:04:07 -04:00
6a2c82332b fix mistake from last commit
I didn't build this BGE-related code before pushing. My bad!

fix for af61b5eb0c
2017-04-16 13:57:16 -04:00
af61b5eb0c cleanup use of immUniformColor
- use best function for the job
- don't specify alpha if 100%
- 'f' for floating point literals
2017-04-16 13:44:34 -04:00
ae07130540 Gawain: add immUniformColor3ubvAlpha
Convenience function for specifying colors with separate RGB and alpha. Alpha ranges from 0 to 255.
2017-04-16 13:33:21 -04:00
7041b99b5a use immUniformColor instead of immUniform("color"
The specialized color functions are better in every way:
- faster lookup (don't have to match "color" string)
- flexible inputs (RGB with separate alpha)
- automatic alpha = 1.0 if not specified

Sort of related to T49043
2017-04-16 12:25:42 -04:00
15215652e1 Fix T49617: Grease Pencil Stroke Placement regression
When moved the options to toolsetting, this part was missing. The problem was not the pointer as suggested in D2629.

Thanks Arvīds Kokins for his help fixing this bug
2017-04-16 17:52:39 +02:00
bf441fcfac Gawain: move AttribBinding funcs to private interface
Other parts of Gawain uses these internally, but they're not part of the public API.

Part of T51219
2017-04-16 11:21:45 -04:00
4a41bc8cea Gawain: fix compiler warnings
vertex_format.c implements both public and private functions, so needs to include the private header.

Follow-up to 7c57ca5109
2017-04-16 11:08:26 -04:00
30249499c4 Gawain: fix compilation on MSVC 2013
attrib_binding.c uses NULL, so include stddef.
Also swapped stdlib for stddef in vertex_format.c, since it only needs NULL.

Not sure why MSVC 2017 and clang/Mac work without this...

Thanks to @youle for reporting!
2017-04-16 11:00:59 -04:00
888e742f84 OpenGL: minor cleanup & TODO
Just clearing out some old git stashes.

No point getting old GL light model to work on old Intel GPUs (both are obsolete for 2.8)
2017-04-15 19:43:56 -04:00
da17928fd5 Gawain: look up builtin uniforms by enum, not by name
This speeds up color and transformation matrix lookups at draw time (used by almost all shaders).
2017-04-15 19:19:00 -04:00
abd1934be6 Gawain: use ShaderInterface to manage vertex attribs
This eliminates tons of glGetAttribLocation calls from the drawing loop. Vast majority of code can keep making the same function calls. They're just faster now!
2017-04-15 18:06:54 -04:00
2593ce9c33 Gawain: remove 2D matrix uniforms from ShaderInterface
- remove 2D-specific variants of BuiltinUniform enum
- rename remaining builtins to exclude "_3D" since they can be used by 2D or 3D shaders

Follow up to D2626
2017-04-15 17:07:29 -04:00
ea105bab2b Gawain: fix header comments
Missed this when splitting VertexBuffer from Batch -- they used to live in the same file.
2017-04-15 15:42:58 -04:00
7c57ca5109 Gawain: move some VertexFormat funcs to private interface
Other parts of Gawain uses these internally, but they're not part of the public API.

Part of T51219
2017-04-15 13:10:14 -04:00
16f08b08fc Gawain: rename AttribBinding clear for consistency
AttribBinding is only used internally by Gawain.

Part of T51219
2017-04-15 13:06:43 -04:00
Julian Eisel
b92b250b08 Fix missing manipulator update after undo
Steps to recreate the error were:
* Enter edit mode
* Change Vertex positions
* Undo -> Manipulator position isn't updated
2017-04-15 15:58:49 +02:00
2f78d58681 Cleanup: lattice drawing had mesh include & names 2017-04-15 17:52:42 +10:00
376d05bf30 Cleanup: GPU header guards 2017-04-15 17:51:08 +10:00
8c0864b5ed GPU matrix: add back type checks
Without this gpuGet functions would cast everything
(no type or size checks and override const variables).
2017-04-15 17:45:20 +10:00
ce1dc55453 Remove redundant declaration 2017-04-15 17:17:09 +10:00
97c9c6a3f3 Fix T51149: Joining curves allows 2D curves in 3D 2017-04-15 16:55:08 +10:00
00ad259939 Object.raycast: error in previous commit
This is taking longer than I expected.
2017-04-15 02:31:33 -03:00
4b043994e8 GPU Matrix API: clean up after 2D-3D unification
See GPU_matrix.h & gpu_matrix.c for the important changes. Other files are mostly just updated to use the latest API.

- remove unused functions, defines, enums, comments
- remove "3D" from function names
- init to Identity transform (otherwise empty stack)
- gpuMatrixReset lets outside code return to initial state

Part of T49450
Follow up to D2626 and 49fc9cff3b
2017-04-15 01:29:56 -04:00
34ea8058b9 Fix: Object.raycast: error to free treedata 2017-04-15 02:24:04 -03:00
97d2f63bfe Object.raycast: Also test distance from BoundBox
If `isect_ray_aabb_v3_simple` provides this information, why not take advantage of it?
2017-04-15 01:31:24 -03:00
ff3942505a Cleanup: Use doxy-groups for draw-cache 2017-04-15 14:24:30 +10:00
608b711beb Cleanup: explicit names for return arguments and position last 2017-04-15 14:07:57 +10:00
480473f1f1 Object.raycast: Test the hit on the BoundBox first
This avoids the unnecessary creation of bvhtree, which can be highly inefficient in some cases
(for example: in the `operator_modal_view3d_raycast.py` template)
2017-04-15 00:44:05 -03:00
718fb3167d Fix Player stubs (tm) 2017-04-15 01:09:44 +02:00
e280c70aa9 Fix T51216: SSAO attenuation not being scale invariant.
Unfortunately this does break compatibility in that the viewport will look a
bit different depending on the settings, but the old behavior was simply not
usable for higher distances.
2017-04-15 00:43:22 +02:00
5fa4f397c2 Alembic import: fixed dupligroup export when the dupli-empty has a parent 2017-04-14 18:20:28 +02:00
4d117f2fd2 Alembic export: fixed flattened dupligroup import 2017-04-14 18:20:28 +02:00
Dalai Felinto
49fc9cff3b GPU Matrix API: Remove ModelView/Projection 3D suffix 2017-04-14 18:07:16 +02:00
Dalai Felinto
cb2c4bfb74 GPU Matrix API refactor: Stick to a single 4x4 stack for 2D and 3D
* Brings us closer to core profile, all matrices are working, and apart
from a problem with text drawing, Blender is working fine.

* Reduce the coding overhead of having to setup/teardown when
alternating between 2D and 3D drawing sessions.

* Gives us fewer modes and states we need to keep track of.

Unfortunatelly this also "rejects a fundamental change" the original
design was trying to make - that 2D is different from 3D and
deserves its own best implementation.

That said, it is still aligned with the function API design as
originally implemented (i.e., it still uses gpuTranslate2D, ...).

Finally, if you build with core profile and this patch you get:
https://developer.blender.org/F545352

[The text glitch is an unrelated issue].

Reviewers: merwin, sergey, brecht

Differential Revision: https://developer.blender.org/D2626
2017-04-14 18:07:16 +02:00
e7c4eddace Add fatal error in CMake when trying to build WITH_GAMEENGINE but without WITH_LEGACY_OPENGL
This won't work currently.
2017-04-14 17:16:15 +02:00
78b5d66af8 Object Info node support for GLSL mode and the internal render
Object Info node can be useful to give some variation to a single material assigned to multiple instances. This patch adds support for Viewport and BI.

{F499530}

Example: {F499528}

Reviewers: merwin, brecht, dfelinto

Reviewed By: brecht

Subscribers: duarteframos, fclem, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2425
2017-04-14 18:15:57 +03:00
89e23c743e OpenGL: fix Mac crashing on startup
On Apple we use OpenGL 2.1 + an ARB extension for framebuffers.

The glFramebufferTexture function is part of OpenGL 3.0 but not part of the ARB extension. This commit fills that gap.

All other platforms are using GL 3.0+ already so it's not an issue there. All platforms (Mac too) will use GL 3.3+ soon so this workaround will be removed.
2017-04-14 10:35:30 -04:00
6fc7521ade Fix T49429: incorrect Blender internal viewport border render with DrawPixels method. 2017-04-14 16:26:10 +02:00
e12c311002 Alembic import: greatly improved curve/hair import performance
The U-resolution of the imported curves was kept at the default value
of 12, which is way too high for imported hair. We export hair at a
fairly high resolution already, so it's not needed to subdivide even
further when importing.

Of course this may have an impact on other curves that do require this
U-resolution to be higher. In that case the resolution can be
increased after importing.

I removed the default nu->orderu = num_verts, as that allowed every
point to influence the entire spline, which was more expensive for the
CPU, and unlikely to be needed. The orderu computations had off-by-one
errors in the curve importer, which are now also fixed. The correct
values are:

    - Linear: orderu = 2
    - Quadratic: orderu = 3
    - Cubic: orderu = 4

These values are also what is stored in the Alembic file for curves of
type kVariableOrder, according to the reference Maya exporter
maya/AbcExport/MayaNurbsCurveWriter.cpp, function
MayaNurbsCurveWriter::write(), in the Alembic source code.

The result is a frame rate increase of roughly 100x (tested with one
100-hair test on one machine, so take with grain of salt).
2017-04-14 15:26:45 +02:00
Dalai Felinto
bef2aab862 Gawain: fix crash when drawing batches (e.g., scale manipulator)
Introduced in b02786ae6b
2017-04-14 14:33:29 +02:00
6af131fa5c Added simple unittests for Alembic exporter
This test checks that a set of cubes are exported with the correct
transform, both with flatten=True and flatten=False.

This commit also adds an easy to use superclass for upcoming Alembic
unit tests.
2017-04-14 12:54:20 +02:00
95b3632112 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/alembic/intern/abc_exporter.cc
2017-04-14 12:39:54 +02:00
6cda217a82 Fix Blenderplayer (c) 2017-04-14 12:14:47 +02:00
0b55b8cc6a Cleanup: triple quotes for docstrings 2017-04-14 20:01:43 +10:00
6a8a679037 BLF: avoid glyph cache use-after free
Causes crash if the font size isn't set after clearing (see T51200)
2017-04-14 19:54:09 +10:00
7cfabcef5c Buildbot: Fix typos 2017-04-14 10:03:51 +02:00
b354c15805 Buildbot: Attempt to fix CUDA compilation on OSX
Stupid toolkit is really fragile about CLang version.
2017-04-14 10:01:28 +02:00
0393e6b08d Merge branch 'blender2.8' into custom-manipulators 2017-04-14 17:21:26 +10:00
26f25b1b27 OpenGL: use ShaderInterface to look up uniforms
These were the last few glGetUniformLocation calls in source/blender.

The new system gets uniform information once when a shader is created, then uses this cached info every time after that.
2017-04-13 18:37:26 -04:00
Dalai Felinto
532532afc7 Revert "OpenGL core: add some missing gpuBegin to allow clay with no UI"
This reverts commit 1c01811cce.

It broke everything.
2017-04-13 18:24:04 -04:00
ac880b67c3 UI: Add/Improve a few tooltips
See T51061
2017-04-13 18:07:50 -04:00
02273441dc Draw Manager: lattice editmode drawing 2017-04-14 04:34:12 +10:00
Dalai Felinto
1c01811cce OpenGL core: add some missing gpuBegin to allow clay with no UI 2017-04-13 19:18:42 +02:00
Dalai Felinto
fe559d0659 OpenGL: do not support legacy matrix when using core profile 2017-04-13 18:45:17 +02:00
257e6c0c7d Remove deprecated opengl stuff from opensubdiv
This removes glGetBooleanv queries for GL_LIGHTING. This has been #ifdef'd
out with legacy opengl disabled. Thus a false positive still shows up in
the gl queries. Also, note that this removes support for wireframes in
opensubdiv, when desabling legacy opengl, which should be fixed later.

Part of T49043
2017-04-13 16:57:53 +02:00
8458ffcf5b Remove some elbeem debug functions
Some elbeem debug functions had old gl drawing calls. I removed the
functions instead of converting, because Blender doesn't even build
with them enabled anymore, because some elbeem debug libs got removed
at some point.

Part of T49043
2017-04-13 16:57:53 +02:00
3906e5939a Alembic export: unified code of exploreTransform and exploreObject. 2017-04-13 16:34:37 +02:00
ebb3045114 Alembic export: added support for writing dupli-groups
This supports our common character animation workflow, where a character,
its rig, and the custom bone shapes are all part of a group. This group
is then linked into the scene, the rig is proxified and animated. Such
a group can now be exported. Use "Renderable objects only" to prevent
writing the custom bone shapes to the Alembic file.
2017-04-13 16:34:37 +02:00
Dalai Felinto
5a5f1dc8e4 Unittests for depsgraph layer collection render settings evaluation
Some of the tests are failing at the moment.
Those problems were introduced in eba09b1520
2017-04-13 16:28:50 +02:00
0a032ce83b Fix Surface Deform crash with missing or freed DM 2017-04-13 15:40:50 +02:00
Dalai Felinto
9b53bab0b7 Update despsgraph when set/unset variables 2017-04-13 15:38:35 +02:00
Dalai Felinto
368b3c145b Layer collection settings API
This way we can set a property via RNA, and also force an update of scene layer (which I am using for unittesting)
2017-04-13 15:38:15 +02:00
360cf8393a Cycles: Make vectorized types constructor from register explicit
This is not a cheap operation which we dont' want to happen silently.
2017-04-13 15:08:00 +02:00
e6392458d3 Cycles: Remove unused function
It was quite wrong actually by doing some __m128 to flaot4 round trips.
2017-04-13 15:08:00 +02:00
0706b908db Alembic import: fixed off-by-one error in start/end frame
static_cast<int> truncates, so a computed end frame of 99.999999999998
would result in 99, instead of the correct 100.
2017-04-13 14:50:02 +02:00
2128e26d86 Draw Manager: initial lattice support
Still misses support for edit-mode selection & weight drawing.
2017-04-13 22:09:59 +10:00
b96777b3e1 Cleanup: minor changes to logic for outline drawing
Use brace placement following code-style too.
2017-04-13 21:46:18 +10:00
575d6415fb Task scheduler: Fix typo in TLS for pools created from non-main thread
Did a mistake which started to use same TLS for all threads for such pools.

Also added some extra asserts to help catching the bugs.
2017-04-13 13:34:07 +02:00
544df54f3c Fix Blenderplayer (c) 2017-04-13 12:36:19 +02:00
102c331146 Fix RNA LayerCollectionEngineSettingsClay not inheriting from LayerCollectionSettings.
Was hence missing the 'name' property, which broke the 'dict-like'
behavior of Scene.collection_properties.
2017-04-13 12:17:50 +02:00
6f268ac55d Merge branch 'master' into blender2.8 2017-04-13 13:02:39 +03:00
f5bc8ad4ce Add red alert in UI controls for datablock pointer properties 2017-04-13 12:59:04 +03:00
0a62e971b2 Draw Engine: Draw sets recursively
Matchers regular viewport behavior
2017-04-13 19:42:59 +10:00
a7b3047cef Datablock ID Properties
The absence of datablock properties "will certainly be resolved soon as the need for them is becoming obvious" said the [[http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.67/Python_Nodes|Python Nodes release notes]]. So this patch allows Python scripts to create ID Properties which reference datablocks.
This functionality is implemented for `PointerProperty` and now such properties can be created with Python.

In addition to the standard update callback, `PointerProperty` can have a `poll` callback (standard RNA) which is useful for search menus. For details see the test included in this patch.

Original author: @artfunkel

Alexander (Blend4Web Team)

Reviewers: brecht, artfunkel, mont29, campbellbarton

Reviewed By: mont29, campbellbarton

Subscribers: jta, sergey, campbellbarton, wisaac, poseidon4o, mont29, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov, fjuhec, sharlybg, cardboard, duarteframos, blueprintrandom, a.romanov, BYOB, disnel, aditiapratama, bliblubli, dfelinto, lukastoenne

Maniphest Tasks: T37754

Differential Revision: https://developer.blender.org/D113
2017-04-13 12:33:05 +03:00
f90a243d9c Cycles: Header cleanup in BVH: move self header to be the first one
This makes us more sure that header files are more self-sufficient.
2017-04-13 11:28:02 +02:00
ffa63d2de6 Use regular header guards in GPU 2017-04-13 19:11:55 +10:00
0097f9b298 Cycles: Split BVH implementations into separate files 2017-04-13 10:55:46 +02:00
c8548871ac Cycles: Use more explicit and commonly used names for BVH structures
This renames BinaryBVH to BVH2 and QBVH to BVH8. There is no user measurable
difference, but allows us to add more types of BVH trees such as BVH8.
2017-04-13 10:29:14 +02:00
1c426d5b6c OpenGL: implement 2D with 4x4 matrices
... even though 3x3 feels better.
 
This is a compromise to get core profile up & running sooner. Eventually I'd like to finish the original 3x3 plans, but this commit will let us get on with other tasks.

External API stays (almost) the same. Our GLSL shaders can use this without any changes.

Part of T49450 and T51164
2017-04-13 04:00:19 -04:00
fae01c3a54 use new 3D matrix impl in draw manager
These functions mark the beginning and end of 3D drawing, causing the matrix API to use our own implementation instead of legacy OpenGL.

Part of T49450
2017-04-13 01:07:52 -04:00
56e9629d96 Gawain: look up array uniforms correctly
Look up "name[0]" when asked for "name", since that marks the beginning of the array.

We're comparing to the name stored in ShaderInterface which comes from glGetActiveUniform.
2017-04-13 01:07:51 -04:00
f7087109ce cleanup image drawing setup 2017-04-13 01:07:51 -04:00
b02786ae6b Gawain: use ShaderInterface to manage uniforms
This eliminates tons of glGetUniformLocation calls from the drawing loop. Vast majority of code can keep making the same function calls. They're just faster now!

- Batch_Uniform*
- immUniform*
- gpuBindMatrices
- and others
2017-04-13 01:07:51 -04:00
6bfb9b7b5f Gawain: add immUniform4iv
Needed soon by OCIO.
2017-04-13 01:07:50 -04:00
c61b7b0263 Gawain: add (temp) legacy GLSL support to ShaderInterface
A temporary measure needed by GPU_basic_shader.

Part of T51164
2017-04-13 01:07:50 -04:00
02fd9a1aaf Gawain: improve ShaderInterface
- builtin uniforms match what Blender needs
- set input counts in struct (stupid mistake)
- look up uniforms by name
- look up builtin uniforms by enum
- check attrib/uniform locations for error
2017-04-13 01:07:49 -04:00
c0a9e388b3 GLSL: rename edit_overlay -> edit_mesh_overlay
Avoid confusion with overlays with non-mesh types
2017-04-13 14:13:46 +10:00
64660b902c Use 'safe' macros for common free operation
Same as MEM_SAFE_FREE macro,
checks for NULL, runs free then sets NULL.

Blocks of code that do this many times are noisy and likely
errors here wouldn't be noticed immediately.

Also NULL's static vars which were being left set.
2017-04-13 13:37:27 +10:00
c080702e73 fix drawing file column dividers (T51189)
Problem was an edge case where vertex_ct logic and draw logic disagreed on how many dividers to draw.

Fix: copy draw logic to earlier vertex_ct

I also skip any drawing or setup if vertex_ct = 0, and set color attribute only for each line's provoking vertex. Small optimizations but these things add up.
2017-04-12 14:20:55 -04:00
Dalai Felinto
2871bad8ea Fix T51188 compilation errors in Windows 2017-04-12 18:58:38 +02:00
ed5c3121f5 Task scheduler: Prevent race condition for the pools created from non-main thread
We can not re-use anything for such pools, because we will know nothing about whether
the main thread is sleeping or not. So we identify such threads as 0, but we don't
use main thread's TLS.

This fixes dead-locks and crashes reported by Luca when doing playblasts.
2017-04-12 18:20:17 +02:00
Dalai Felinto
6e4cc26265 Layer / Outliner / Depsgraph: update depsgraph when running outliner operators 2017-04-12 16:55:04 +02:00
699a3e2498 Fix T50227: Alembic uv export/load issue
Previously only a CD_MLOOPUV custom data layer was created. Now we also
create the accompanying CD_MTEXPOLY layer too.
2017-04-12 16:33:47 +02:00
6b815ae55d Fix T51184: Crash of Blender when I try to join an object with one that has booleans modifiers 2017-04-12 16:12:50 +02:00
Julian Eisel
428e07a9f7 Outliner: Draw nested collections before objects of a collection
Collections may contain a huge list of objects, would be annoying having
to scroll over it all the time to get to the nested collections.
2017-04-12 14:47:54 +02:00
Julian Eisel
64905c4c77 Outliner: Fix objects of master collection not showing up in 'Master Collection Tree' 2017-04-12 14:45:42 +02:00
7f753eadb4 Merge branch 'blender2.8' into custom-manipulators 2017-04-12 21:06:25 +10:00
af2fc7b637 Merge branch 'master' into 28 2017-04-12 20:23:44 +10:00
642728b339 Alembic export: fixed exporting as "flat"
This exports all objects in world coordinates without parenting.
2017-04-12 12:21:08 +02:00
de3c98d62b Alembic export: removed superfluous export_object() check.
The exploreTransform() function already does this check, and the check
isn't necessary when the object type isn't exported anyway.
2017-04-12 12:21:00 +02:00
4560f0b007 Cleanup: use lowercase gpu prefix for static funcs
This was mostly followed already.
2017-04-12 20:19:55 +10:00
0c9a2def8b Draw Engine: remove hard coded limit on array sizes
This removes MAX_STORAGE, MAX_BUFFERS, MAX_TEXTURES, MAX_PASSES limits.

Actual memory saving isn't so important, it just means we don't need to
manually bump these based on changes to engines.
2017-04-12 19:51:14 +10:00
b380f4927e Remove bool -> int cast
Wont work as expected on big endian systems
2017-04-12 18:23:40 +10:00
c29bc61829 Color management: Avoid memory copy into same buffer 2017-04-12 10:23:38 +02:00
208f25d626 Cleanup: naming & line length 2017-04-12 18:23:17 +10:00
cc0c5dbd91 Cleanup: use DRW_cache_mesh prefix w/ mesh objects
Avoid confusion for non mesh types where verts/wire/surface might apply.

Other object types use this convention already.
2017-04-12 18:11:10 +10:00
9e94479359 EditMesh Render: remove edges-of-vert loop
Replace topology check which checked edges twice
with a loop on the edge array.
2017-04-12 15:43:20 +10:00
dc1499ba1c Merge branch 'master' into 28 2017-04-12 14:23:47 +10:00
0ebe08af34 Docs: minor improvement to code example 2017-04-12 14:21:59 +10:00
ed8c71da1c Cleanup: replace char array with struct 2017-04-12 14:08:44 +10:00
5cf090ffec EditMode: remove edge-hash from MeshRenderData
LoopTri's can access this data.
2017-04-12 13:45:56 +10:00
e78412c905 Cleanup: use const pointer for view access API 2017-04-12 12:10:01 +10:00
95dd478e47 Cleanup: line length
Avoid right-shift
2017-04-12 12:05:11 +10:00
42349f6efd fix compile warnings 2017-04-11 19:35:30 -04:00
e8ddd258ef Correct own error in adding colors
Make comment regarding GLSL more clear.
2017-04-12 00:56:19 +10:00
5a4fceff1b Make image drawing code working with core profile
The issue was caused here by usage of deprecated GL_CURRENT_PROGRAM
which was returning rubbish value.

Now we use imm API and create vertex format prior to immBindProgram.
This made us required to have some sort of state passed from setup
function to actual drawing.
2017-04-11 16:49:39 +02:00
Dalai Felinto
35ee9db1e2 Renaming: sl > scene_layer 2017-04-11 16:49:32 +02:00
Dalai Felinto
4fe4c82dbd Fix blenderplayer(tm) 2017-04-11 16:24:59 +02:00
70e4f1e003 Draw Manager: Fix blended color. 2017-04-11 16:13:29 +02:00
181c8f8ccd Draw Manager: Fix Background sets not being drawn. 2017-04-11 16:13:29 +02:00
Dalai Felinto
aef4519c8a Renaming: sl > scene_layer 2017-04-11 16:09:30 +02:00
Dalai Felinto
6f8c838b78 Cleanup: remove no longer needed BASE_ defines 2017-04-11 15:51:18 +02:00
Dalai Felinto
9a303d5db7 Bring snapping back (Base / BaseLegacy) 2017-04-11 15:46:01 +02:00
513aacbdb6 Use immediate mode API for OpenColorIO 2017-04-11 15:39:04 +02:00
fd5b882a67 Move cage_manipulator.c to new GL code.
Note: I’d assume gawain equivalent to glDrawArrays would be batches? But
for two lines drawn twice this looks totally overkill anyway, so
switched back to basic immediate-mode-like API.

A bit frustrating to work on this code, since afaict you cannot check
the results in Blender, being mostly unused currently...
2017-04-11 15:19:00 +02:00
b8c4be0844 FIx copy/paste mistake in own previous commit. 2017-04-11 15:19:00 +02:00
85f81293c4 GL/WIP: fix crash drawing text object
Note that this doesn't set the normal as it should (noted as a TODO),
just committing to avoid the crash.
2017-04-11 22:46:56 +10:00
88fddd118f Draw Manager: replace varargs with a pointer array
Allows to ensure correct number of args
2017-04-11 21:20:18 +10:00
7c4e164ff3 Get rid of last deprecated OpenGL calls in arrow_manipulator.c
Hope that makes sense...
2017-04-11 12:47:38 +02:00
633a2a3592 Move arrow2d_manipulator to new immediate mode GL. 2017-04-11 12:46:49 +02:00
31bdb31ecf Fix: width of UILayout.prop_enum() buttons 2017-04-11 13:25:46 +03:00
d097c72f81 Cycles: Only calculate global size of split kernel once to avoid changes
Global size depends on memory usage which might change during rendering.
Havent seen it happen but seems possible that this could cause the global
size to be different than what was used for allocating buffers.
2017-04-11 03:26:18 -04:00
1e6038a426 Cycles: Implement automatic global size for CUDA split kernel
Not sure this is the best way to do things for CUDA but its much better than
being unimplemented.
2017-04-11 03:11:18 -04:00
9d00b7680f Uncomment deselected center point color 2017-04-11 15:48:54 +10:00
e199eae39d Draw Manager: Add center-color for linked/multiuser objects
Draws a blue center circle for library objects.
As with regular drawing, this uses a hard-coded color.
2017-04-11 14:05:39 +10:00
3722da3b4e Cleanup: quiet harmless but annoying overflow
Caused asan to print warnings generating RNA
2017-04-11 11:49:21 +10:00
c8e2436734 Merge branch 'master' into blender2.8 2017-04-11 11:01:16 +10:00
532b2786e2 Remove redundant glColor call 2017-04-11 10:47:00 +10:00
ef816f9cff Cycles: Fix the AO replacement option in the split kernel
Currently the code for it was inside the hair-specific part, so it wouldn't be enabled in hairless renders.
2017-04-11 01:07:49 +02:00
8b0fbb909b UI: Add missing UV tools in the UV/Image Editor Window > Tools tab
Original Author: @xrg
Changes By @blendify

Image of patch: {F284237}
2017-04-10 18:37:03 -04:00
8ac7510a4d UI: Do not put walk navigation settings inside an if statement
The issue here is that the preferences are still used because both can be accessed from the 3D View, view menu. In the future, it is likely that the old mode will be removed (maybe 2.8?) but for now we want to keep both operational.

Differential revision: https://developer.blender.org/D2320
2017-04-10 17:44:03 -04:00
016790b3b0 Object Engine: Fix Selected Group Objects color. 2017-04-10 22:23:50 +02:00
4f063dc4dd Object Engine: Ported Force Field object drawing. 2017-04-10 22:23:50 +02:00
fb1ecbc2da Gawain: remove PRIM_QUADS_XXX
Thanks @mont29 for finishing off the last few QUADS in blender.
2017-04-10 16:20:24 -04:00
f0404c3382 Get rid of last PRIM_QUAD usage, in blf_font.c/blf_glyph.c. 2017-04-10 21:21:38 +02:00
c9685a148f Nuke three remaining uages of PRIM_QUAD in drawobject.c
This was slightly less obvious, especially particle billboard drawing.
That one now requires 1.5 times more space in VBOs and ParticleDrawData
buffers, since we have to draw two triangles per particle, instead of a
single quad... And diagonal of each quad is now drawn in wire mode, not
sure how much we consider this an issue (as in, will this particle draw
code change a lot in future?).

From quick check on the web seems there is no other way to do anyway. :/
2017-04-10 20:33:09 +02:00
490fea6107 Minor cleanup/fix for own rB45f3150c9844326 merge. 2017-04-10 18:52:35 +02:00
d8fa3dd7c3 GL: use imm* module for 2D cage manipulator 2017-04-11 02:32:53 +10:00
304935e02a GL/playanim: use immediate mode wrapper, replace glDrawPixels 2017-04-11 02:05:53 +10:00
45f3150c98 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2017-04-10 17:34:31 +02:00
2ad1124372 Fix stereoscopic camera volume drawing.
Not sure how we got to that point, but code was drawing twice one side
of the camera volume, and not at all another side!
2017-04-10 17:31:39 +02:00
5f70116030 OpenGL: Fix textureXd deprecated calls. 2017-04-10 16:59:20 +02:00
01bd6da68f Draw Manager: Add Manipulator Back. 2017-04-10 16:59:20 +02:00
9a38a6bdab GPencil 2D Drawing: get rid of PRIM_QUAD_XXX.
Here we can easily use a PRIM_TRIANGLE_STRIP instead!
2017-04-10 16:54:21 +02:00
346964eb3f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/gpencil/drawgpencil.c
2017-04-10 16:53:12 +02:00
c8e764ccbf Cycles: Fix race condition in shader attribute for real now
Ended up moving lock in the more centralized space since multiple shaders
can access this map.
2017-04-10 16:53:01 +02:00
fd203a0933 GPencil 2D drawing code: minor optimization.
Do not recompute both points's 2D coordinates for each segments, we can
copy over from previous one... Does not gives any measurable speedup off
hands, though.
2017-04-10 16:30:05 +02:00
39451ac712 Fix compilation error with strick flags caused by missing abort() 2017-04-10 16:20:18 +02:00
a40f15d04f Fix T51158: Motion Tracking Movie clip editor graph 2017-04-10 16:16:12 +02:00
58f3b3c6d1 Tracking: Fix use-after-free bug 2017-04-10 16:02:14 +02:00
358def15a3 Install deps: Fix compilation error of Alembic
Couple of things here:

- Boost is not necesserily compiled into your /opt/lib and system-wide
  version might have been used. The recent change in Alembic did not
  take this into account.

- Alembic needs some extra component of Boost.
  This part might be missing now for other distros than DEB.
2017-04-10 15:55:25 +02:00
Dalai Felinto
e68b808564 Fix glCheckFramebufferStatusEXT 2017-04-10 15:53:08 +02:00
9539cfacca Cycles: Apparently board name could be an empty string 2017-04-10 15:31:21 +02:00
9fd3435a93 First batch of PRIM_QUAD_XXX replacement by PRIM_TRIANGLES. 2017-04-10 15:17:26 +02:00
Dalai Felinto
2d158a425d Upgrade glew to v2.0 2017-04-10 14:53:32 +02:00
3b4cc5dfed Cycles: Workaround cubic volume filtering crashing on Linux
The issue was caused by recent change in inline policy.

There is some sort of memory corruption happening here, ASAN suggests
it's stack overflow issue. Not quite sure why it is happening tho and
was not able to solve anything here yet in the past hours.

Committing fix which works with a big TODO note.

The issue is visible on AVX2 machine when rendering cycles_reports_test.
2017-04-10 14:44:07 +02:00
90d85c7975 Cycles: Fix compilation error of AVX2 kernels with SSE optimization disabled 2017-04-10 14:44:04 +02:00
c3d393c1df Cycles: Cleanup, indentation and trailing whitespace 2017-04-10 14:44:04 +02:00
73a9ff0d2d PyAPI: Fast buffer access to id property arrays
Support Python's buffer protocol for ID-properties.
2017-04-10 21:12:02 +10:00
f2f16a2568 Eevee: First Shadows implementation
Using Texture Arrays to store shadow maps so less texture slots are used when shading. This means a large amount of shadows can be supported.

Support Projection Shadow Map for sun like in old BI/BGE.

Support Cube Shadow Map for Point/Spot/Area lights. the benefit of using it for spot light is that the spot angle does not change shadow resolution (at the cost of more memory used). The implementation of the cubemap sampling is targeted for 3.3 core. We rely on 2D texture arrays to store cubemaps faces and sample the right one manualy. Significant performance improvement can be done using Cubemap Arrays on supported hardware.

Shadows are only hardware filtered. Prefiltered shadows and settings comming next.
2017-04-10 12:36:32 +02:00
0811d089b4 Draw Manager: Use Texture flag in Framebuffer init. 2017-04-10 12:36:32 +02:00
fad3fe4ed1 GPUTextures: Work on cubemap support and array textures 2017-04-10 12:36:32 +02:00
da082a095b Eevee: Fix spot lights 2017-04-10 12:36:32 +02:00
Dalai Felinto
f87815705b Make build with GL 3.3 again
This is a workaround while the PRIM_QUADS_XXX are still in the code
2017-04-10 12:21:13 +02:00
Dalai Felinto
b6ba507c1b Layers unittest: layer_cyncing test was not being called 2017-04-10 10:08:29 +02:00
Dalai Felinto
90b2b99505 Unitettesting: Force python errors to show as error 2017-04-10 10:03:02 +02:00
Dalai Felinto
29c738258b GL stubs: no need to assert when calling deprecated calls 2017-04-10 09:33:57 +02:00
Dalai Felinto
2482f94706 Expand OpenGL stubs to allow for breakpoints 2017-04-10 09:15:59 +02:00
Dalai Felinto
91056337a8 Add stubs to build WITH_GL_PROFILE_CORE
This is an auto-generated list, crossing gl-deprecated.h, glew.h and the
Blender code. It allows Blender to build with core profile.

WITH_OPENGL_LEGACY=ON: nothing changes

WITH_OPENGL_LEGACY=OFF and WITH_GL_PROFILE_CORE=OFF:
It stubs deprecated legacy calls.

WITH_OPENGL_LEGACY=OFF and WITH_GL_PROFILE_CORE=ON:
It stubs deprecated legacy calls thus allowing Blender to build with
core profile only.

Technically you only want to use WITH_OPENGL_LEGACY=OFF when
WITH_GL_PROFILE_CORE=ON. But it doesn't hurt to have it working for both
scenarios.

Reviewed by: merwin

Differential Revision: https://developer.blender.org/D2610
2017-04-10 08:45:00 +02:00
Julian Eisel
15bcfaa36b Merge branch 'master' into blender2.8 2017-04-09 22:51:38 +02:00
928f5df1b4 Cleanup: glsl indentation 2017-04-09 16:36:39 +10:00
5b873c8c24 Cleanup: use doxy code block 2017-04-09 16:26:04 +10:00
d982ab4260 Merge branch 'blender2.8' into custom-manipulators 2017-04-09 16:15:22 +10:00
c800ee6bfe Merge branch 'master' into blender2.8 2017-04-09 16:09:12 +10:00
162e184ffd ListBase: Add insert-replace function
Handy to replace an existing link
(without having to store before/after links)

Use for id-props
2017-04-09 16:07:09 +10:00
b60d4800c6 Cycles: Fix building of CUDA kernels with compilers where C++11 is disabled 2017-04-08 07:12:04 -04:00
1cd54ec225 Add helpers in bpy_extras.keyconfig_utils for addons to (un)register their keymaps.
Doing this in a fully 'clean' way is far from obvious, especially
unregister, you often end up leaving nasty 'orphanned' keymap items
referring to unregistered operators...
2017-04-08 11:09:11 +02:00
79e862ad6b GPU lib support for WITH_LEGACY_OPENGL
For early testing of core profile:
- GPU_legacy_support = false
- GPU_display_list_support = false
- GPU_geometry_shader_support = true

Relates to T49012
2017-04-08 02:34:30 -04:00
f60626e3a6 OpenGL: drop support for EXT_geometry_shader4
See gpu_shader.c for the main changes.

EXT_geometry_shader4 brought this feature to GL versions < 3.2, but now it's just cluttering up our code.

Soon all platforms will be on version 3.3 so we won't even have to check support at runtime!
2017-04-08 02:21:13 -04:00
d5883bb1ba Gawain: remove GL enum from primitive API
Callers now have to use Gawain's PRIM enum to specify geometric primitives.

This makes the API more bullet-proof (at least less vulnerable) since GLenum covers waaay more than GL_POINTS, GL_LINES, etc.

Also prepares us for Vulkan.
2017-04-08 01:19:48 -04:00
0947c97fad OpenGL: use PRIM instead of GL enum everywhere else
Well, everywhere that uses Gawain for drawing. Places that call OpenGL directly still use GL enums.

Part of T49043
2017-04-08 01:19:48 -04:00
a1a4f58726 Add back widgets accidentally lost in merge (facemaps usable again) 2017-04-08 12:33:18 +10:00
51223284e1 Merge branch 'blender2.8' into custom-manipulators 2017-04-08 12:10:36 +10:00
1de61696fd Correct constraint manipulator colors
Widget show as color of constrained axis
2017-04-08 12:08:51 +10:00
039fcb524e Merge branch 'blender2.8' into custom-manipulators 2017-04-08 12:02:44 +10:00
8205a19323 Fix WITH_LEGACY_OPENGL=ON
This wasn't working outside of gpu module.
2017-04-08 12:01:29 +10:00
f4a3689492 Merge branch 'blender2.8' into custom-manipulators 2017-04-08 11:33:24 +10:00
bd3a1b9490 OpenGL: use PRIM instead of GL enum for immBegin
Getting ready for a Gawain API change...

Part of T49043
2017-04-07 16:31:26 -04:00
c1dc078840 Gawain: remove GL enum from vertex format API
Callers now have to use Gawain's COMP enum to specify vertex attributes.

This makes the API more bullet-proof (at least less vulnerable) since GLenum covers waaay more than component types.

Also prepares us for Vulkan.
2017-04-07 16:00:03 -04:00
1ad5287260 use COMP instead of GL enum to construct vertex format
I converted all other files a day or two ago; this file was part of a recent merge.
2017-04-07 15:51:39 -04:00
da24848fb4 OpenGL: remove UI_reinit_gl_state function
All line & point drawing is responsible for setting its own state (as of January 2016) making this redundant.
2017-04-07 15:10:48 -04:00
7a75581d92 OpenGL: transition away from GL_QUADS
Single quads are drawn as a TRIANGLE_FAN, with 4 verts in the same order.

Multiple quads now use PRIM_QUADS_XXX and will need further work. Only 8 places still use this.

Part of T49043
2017-04-07 15:03:24 -04:00
d6ae3789a1 Gawain: append XXX to PRIM_QUADS to make it scary
Quads are not part of modern GL or Vulkan, so we should avoid them. XXX makes coders think "hmm how could I draw this without using quads?"

Quads will be removed during the transition to core profile.

Part of T49043
2017-04-07 14:21:10 -04:00
23b10b549a fix use of uninitialized variable
Bug crawled in via 2944438e9a as part of custom manipulators.
2017-04-07 13:48:11 -04:00
3f6d25f4eb shrink fixed-size internal GLSL string buffers
We concatenate #defines and #extensions into these, and can count the max string lengths needed. 256 is enough to hold today's strings; we can adjust later if needed.
2017-04-07 13:28:42 -04:00
1a156f7103 use best GPU matrix function for the job
Follow-up to 204e067111 which coverted manipulators' legacy GL matrix calls to new ones.

part of T49450
2017-04-07 13:24:00 -04:00
f0ce39ab16 OpenGL: support GLSL 3.3 core profile
When WITH_LEGACY_OPENGL = OFF.

This is our final target for Blender 2.8, all previous versions will be dropped in the future. GLSL 3.3 is richer so we don't require as many extensions.
2017-04-07 12:51:11 -04:00
867d311307 Cycles: Fix warning with MSVC 2017-04-07 18:28:38 +02:00
7d77b3e813 Cycles: Fix compilation error with certain CUDA and host compiler configuration
This seems to happen on Windows only, happened to Thomas and Nathan already.

Similar patch Thomas was showing, but i do not see it committted. So comitting
now in order to get more developers and users happy.
2017-04-07 18:28:38 +02:00
8c22a974d6 Tests: Compare vectors with epsilon
SOlves the test false-positively failing in 32 bit environment.
2017-04-07 18:28:38 +02:00
b332fc8f23 [Cycles/msvc] Get cycles_kernel compile time under control.
Ever since we merged the extra texture types (half etc) and spit kernel the compile time for cycles_kernel has been going out of control.

It's currently sitting at a cool 1295.762 seconds with our standard compiler (2013/x64/release)

I'm not entirely sure why msvc gets upset with it, but the inlining of matrix near the bottom of the tri-cubic 3d interpolator is the source of the issue, this patch excludes it from being inlined.

This patch bring it back down to a manageable 186 seconds. (7x faster!!)

with the attached bzzt.blend that @sergey  kindly provided i got the following results with builds with identical hashes

58:51.73 buildbot
58:04.23 Patched

it's really close, the slight speedup could be explained by the switch instead of having multiple if's (switches do generate more optimal code than a chain of if/else/if/else statements) but in all honesty it might just have been pure luck (dev box,very polluted, bad for benchmarks) regardless, this patch doesn't seem to slow down anything with my limited testing.

{F532336}

{F532337}

Reviewers: brecht, lukasstockner97, juicyfruit, dingto, sergey

Reviewed By: brecht, dingto, sergey

Subscribers: InsigMathK, sergey

Tags: #cycles

Differential Revision: https://developer.blender.org/D2595
2017-04-07 10:26:55 -06:00
Dalai Felinto
db444fc783 Workaround for weightpoint not working
Kudos to Germano Cavalcante for spotting the issue, the real fix is to pass SL to the function though
2017-04-07 18:00:54 +02:00
8e0cdfd0c9 Libmv: Correction to previous commit
We do need to make a copy of the values.
2017-04-07 17:57:48 +02:00
31c272e840 Simplified some test code in render_layer_common.py 2017-04-07 17:51:23 +02:00
ad60283bc8 No more need to alter sys.path in each and every render_layer unit test.
I tried the clean way, by setting the PYTHONPATH environment variable for
CTest, using SET (CTEST_ENVIRONMENT blablab), but that didn't seem to
work.
2017-04-07 17:50:47 +02:00
6cf3fa9ff0 Tests: import blendfile without modifying sys.path 2017-04-07 17:29:14 +02:00
063bae4fcc Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.h
#	source/blender/alembic/intern/abc_util.cc
2017-04-07 17:28:22 +02:00
a1f8755d32 Libmv: Fix crash of keyframe selection on 32bit linux 2017-04-07 17:10:44 +02:00
Julian Eisel
711ac03fa1 OpenGL: Get rid of PRIM_QUADS usage in manipulators code 2017-04-07 17:05:33 +02:00
eae691f89e Buildbot: List freetype for OIIO libraries
OIIO in release environment is compiled with Freetype support.

This fixes compilation error of static unit tests.
2017-04-07 17:01:07 +02:00
07708b85b4 Buildbot: Link statically against freetype 2017-04-07 17:00:43 +02:00
4360a74715 CMake: Fix detection of idiff program 2017-04-07 17:00:06 +02:00
Dalai Felinto
4e09533f8c OpenGL / Outliner: QUADS are not supported in core 2017-04-07 16:43:05 +02:00
c637e749b2 Tests: Fix compilation error with static OpenMP 2017-04-07 16:06:28 +02:00
Julian Eisel
204e067111 Fix drawing of planar transfrom manipulators, update matrix code 2017-04-07 16:04:04 +02:00
43a910abce Alembic import: prevent crash when cancelling import.
It's possible that cancellation occured between the creation of the reader
and the creation of the Blender object, in which case reader->object()
returns a NULL pointer.
2017-04-07 16:03:29 +02:00
3748ca432d Alembic import: prevent double user decrement when cancelling import.
BKE_libblock_free_us() was called on the object data, which decrements
its user count, after which the same function was called on the object,
which decrements the user count of the object data again. This double
decrement was too much.
2017-04-07 16:03:29 +02:00
fd08570665 Cycles: Fix access of NULL pointer as array
Was confusing guarded allocator for some reason.
2017-04-07 15:08:00 +02:00
7fee1af6c8 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 23:04:10 +10:00
2dd84c9570 3D Manipulator: add back protected flags check
This used to be a separate pass
2017-04-07 23:01:20 +10:00
d30f313141 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 21:44:21 +10:00
ddb42076c9 Alembic: synced gather_objects_paths with visit_objects
This was necessary, but was only mentioned at gather_object_paths (which
I didn't see earlier). That's now also fixed.
2017-04-07 13:41:34 +02:00
2944438e9a 3D View: manipulator from custom-manipulators branch
Original code from @Severin with changes from @dfelinto & @hypersomniac.

This doesn't cause many functional changes
besides using new transform manipulators.

Submitted as D2604
2017-04-07 21:23:32 +10:00
Dalai Felinto
8ec1a05ef5 Replace CGSubSurf direct includes to GL/glew.h 2017-04-07 13:03:31 +02:00
1d9f369824 Cleanup: Unused function 2017-04-07 12:55:04 +02:00
9706bfd25d Cycles: Fix corrupted mesh render when topology differs at the next frame 2017-04-07 12:49:10 +02:00
Dalai Felinto
0887703616 OpenGL: Port wm_manipulator_geometryinfo_draw
Thanks to Clément Foucault for the help with the Batch API!
2017-04-07 12:33:00 +02:00
Dalai Felinto
3b3901a964 Fix wm_manipulators.c wrongly include of GL/GLEW.h 2017-04-07 12:32:11 +02:00
Dalai Felinto
70391ff991 OpenGL: Port arrow_manipulator.c to gawain
The conversion of wm_manipulator_geometryinfo_draw is still pending.
2017-04-07 12:28:42 +02:00
91b9db0724 Cycles: Change work pool and global size of split CPU for easier debugging 2017-04-07 06:06:08 -04:00
8f85ee2fc9 Cycles: Fix indentation 2017-04-07 06:06:08 -04:00
5b45fff136 Cycles: Add missing flush 2017-04-07 06:06:08 -04:00
d66ffaebef Cycles: Check ray state properly to avoid endless loop
The state mask wasnt applied before comparison giving false results. It
shouldnt really happen that a ray state contains any flags that need to
be masked away, but if it does happen its better to not get stuck.
2017-04-07 06:06:08 -04:00
e8e341b585 Alembic: documented use of CacheReader struct 2017-04-07 11:06:50 +02:00
df7d5382d3 Alembic: just pass NULL when we know mcmd->reader is NULL.
More explicit, easier to read & understand.
2017-04-07 11:03:26 +02:00
102966b12e Fix building alembic gtest with buildinfo... 2017-04-07 10:44:13 +02:00
d649f26858 Fix compilation error after recent changes 2017-04-07 09:58:54 +02:00
9c01aaa3dd OpenGL: disable rotate manipulator clipping on Mac
This fixes T51143.

gl_ClipDistance is part of GLSL version 1.3 but Mac is stuck on 1.2 for now.

This workaround uses GPU_SHADER_3D_UNIFORM_COLOR for the entire rotation widget, ignoring any clipping plane. The CLIPPING shader only works on GLSL 1.3+ so I removed its 1.2 cruft.

A legacy implementation using gl_ClipVertex might be possible, but is not worth the effort. This problem (and workaround) goes away when all platforms move to 3.3 core profile.
2017-04-07 03:08:00 -04:00
c986a2c7aa fix rotation manipulator's Push/PopMatrix balance
Was popping out the bottom of the stack.
2017-04-07 03:51:10 -04:00
a814294044 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 14:38:23 +10:00
a0799ce336 Fix T51137: Edge Rip Hangs 2017-04-07 11:47:28 +10:00
115a889bd7 OpenGL: refactor ui_panel_category_draw_tab
changes:
- exact vertex count
- take bool (filled vs outline) instead of GLenum

This function has some flexibility that is not currently used. I left that in.
2017-04-06 19:37:50 -04:00
f69678482c OpenGL: refactor UI_draw_roundbox functions
Each function takes a bool (filled vs outline) and a color. We already had multiple ways of passing color in; these are still here. Special variant for anti-aliasing.

- took GLenum out of interface
- removed UI_RB_ALPHA flag (only one place really used it)
- use exact vertex count
- removed redundant state changes (BLEND, LINE_SMOOTH)
2017-04-06 19:15:26 -04:00
Dalai Felinto
934dfc4200 New build option WITH_LEGACY_OPENGL
This introduces a new CMake option - WITH_LEGACY_OPENGL. Without this option
things may not draw perfectly, however, we should soon be able to build with
OpenGL core profile.

The matrix-related api calls are (still) not handled here (glTranslate, ...).

There seems to be no consensus on whether to make this build option the
default. We can talk about this later. For now two things are the
priority:

(1) To get rid of deprecated calls when WITH_LEGACY_OPENGL is ON
(2) To make core profile work for Mesa/Mac when WITH_LEGACY_OPENGL is OFF

Reviewers: merwin, sergey, campbellbarton

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

Many thanks for Sergey Sharybin for the help.
2017-04-06 18:46:33 +02:00
d426c335c5 Fix T51135: Cylinder primitive generated bad UVs 2017-04-06 12:20:22 -03:00
820961d4ed Remove redundant headers 2017-04-07 01:02:51 +10:00
843922a480 Depsgraph: Prefer use anonymous structs for unused arguments 2017-04-06 16:58:19 +02:00
c684fab8a6 Alembic: rewrapped some lines to fit within 80 chars. 2017-04-06 16:47:01 +02:00
98329a5760 Alembic import: compatibility with pre-C++11 compilers. 2017-04-06 16:47:01 +02:00
8e3676d533 Alembic import: restructured the importer w.g.t. parenthood
Previously, a GHash was used to store a flattened mapping of parent
information based on the Alembic hierarchy, and then that hash was used to
set parent pointers on Blender objects. This resulted in errors and
some duplicate objects. The new approach stores parent pointers while
traversing the Alembic hierarchy, which means that there is much more
information about the actual context of the Alembic object itself,
producing a more stable import.
2017-04-06 16:47:01 +02:00
fa827374a7 Alembic: rotation mode issue in copy_m44_axis_swap, and added unit tests. 2017-04-06 16:47:01 +02:00
b6775cd684 Added float[][] comparison macros to testing.h
I've moved EXPECT_M3_NEAR from abc_matrix_test.cc to testing.h, as that's
a more suitable location.
2017-04-06 16:47:01 +02:00
c2fec0f1b0 Alembic: Renamed create_rotation_matrix to create_swapped_rotation_matrix and more:
Also replaced the bool param "to_yup" with "AbcAxisSwapMode mode", so that
it's more explicit that axes are swapped.

Also added unittests for create_swapped_rotation_matrix.
2017-04-06 16:47:01 +02:00
8ae656bf22 CMake: Fixed order of bf_alembic in SETUP_BLENDER_SORTED_LIBS
bf_alembic depends on bf_bmesh, and should therefore be above it.
2017-04-06 16:47:00 +02:00
bc55c19807 Alembic import: fixed crash on more complex model
There was a problem with parent-child relations not getting set up
correctly when an Alembic object was both the transform for a mesh object
and the parent of other mesh objects.
2017-04-06 16:47:00 +02:00
42cd2719ec Alembic: comment typo/error fixes 2017-04-06 16:47:00 +02:00
6c37a53a2e Alembic import: prevented unnecessary vector scaling 2017-04-06 16:47:00 +02:00
5e86144cd3 Alembic import: moved import-time scaling to different function
convert_matrix() now only converts from Imath::M44d to float[4][4] (taking
different camera orientations into account). Import-time scaling is now
performed by the caller.
2017-04-06 16:47:00 +02:00
4cb5114e13 Alembic: removed unnecessary matrix copy 2017-04-06 16:47:00 +02:00
aaa88fac76 Alembic: simplified AbcEmptyReader::readObjectData 2017-04-06 16:47:00 +02:00
8b2555e798 Alembic: added some r_ prefixes for return parameters 2017-04-06 16:47:00 +02:00
f226b808ff Alembic: code style 2017-04-06 16:47:00 +02:00
3735065d22 Alembic: don't use m_shapes_type 2017-04-06 16:46:51 +02:00
035b340f48 Depsgraph: Remove old depsgraph header from window manager 2017-04-06 16:44:32 +02:00
ec178b861c Depsgraph: Remove print dependnecies operator
This is not really supported with the new depsgraph.
2017-04-06 16:43:09 +02:00
ed1ef06199 Depsgraph: Remove old depsgraph header from blender internal 2017-04-06 16:38:43 +02:00
2d80f37bce Depsgraph: Remove old depsgraph header from python 2017-04-06 16:36:15 +02:00
05ffca5c8a Depsgraph: Remove old depsgraph header from modifiers 2017-04-06 16:34:38 +02:00
1165027308 Depsgraph: Remove old depsgraph header from freestyle 2017-04-06 16:32:59 +02:00
35db70a466 Depsgraph: Remove olde depsgraph header from new depsgraph 2017-04-06 16:18:42 +02:00
e9e703f0dd Depsgraph: Remove old depsgraph header from collada 2017-04-06 16:17:21 +02:00
7da2379124 Depsgraph: Remove old depsgraph header from blenloader 2017-04-06 16:13:57 +02:00
7b45edacab Depsgraph: Remove old header from blenkernel 2017-04-06 16:11:50 +02:00
4d3efa6419 Merge branch 'blender2.8' into custom-manipulators 2017-04-07 00:05:32 +10:00
8fe3f47596 Alembic: more lenient check on absence of sheer & homogeneous scaling
Checking precise values of floats is not a good idea.
2017-04-06 16:04:31 +02:00
a9504580b3 Alembic: simplified conditional statements 2017-04-06 16:04:31 +02:00
997ff4bdc4 Alembic import: nicer progress updates 2017-04-06 16:04:31 +02:00
d1696622b7 Alembic import: fixed bug where local matrix from Alembic was used as object matrix
Also renamed AbcObjectReader::readObjectMatrix to
setupObjectTransform, as it does more than just reading the object
matrix; it also sets up an object constraint if the Alembic Xform is
animated.
2017-04-06 16:04:31 +02:00
818ee188e7 Alembic import: separated reading matrix and getting the appropriate Xform object
Also added a bit better error reporting, instead of silently ignoring
invalid Alembic data.
2017-04-06 16:04:31 +02:00
e4367ccb78 Alembic import: be more lenient towards unknown object types.
Alembic is an interchange and caching format, that can contain custom
object schemas. Blender shouldn't crash (because of failing asserts) just
because it doesn't know such an object type.
2017-04-06 16:04:31 +02:00
aba7759992 Alembic: don't call object.getFullName() multiple times. 2017-04-06 16:04:31 +02:00
2c688bac19 Alembic: Renamed parent_map to reader_map
It's a mapping from full path of an Alembic object to an AbcObjectReader*.
The fact that at some point it is used to construct parent-child relations
doesn't matter.
2017-04-06 16:04:31 +02:00
152ec791ad Alembic: use typedefs to make it easier to handle maps/vectors 2017-04-06 16:04:31 +02:00
85672d29f2 Alembic: more const-ness 2017-04-06 16:04:31 +02:00
02d6df80aa Alembic: fixed importer
The importer was guessing whether an Alembic IXform object was part of a
child object, or should be represented as an Empty in Blender. By reversing
the order in which objects are visited, the children can now claim their
parent as part of the same object (so IPolyMesh claims its parent IXform
as part of the same Blender object). This results in much less guesswork.

I've also removed similar guesswork from the code that sets parent pointers,
by simply searching for the parent in a hierarchical way, instead of trying
to predict (again) which IXforms were turned into empties.

Also, visit_object() now actually visits the object -- previously it only
visited its children, and assumed the object it was called on was already
handled by a previous call.
2017-04-06 16:04:31 +02:00
76ca6ed26e Alembic: prevent a couple of unnecessary multiplications 2017-04-06 16:04:31 +02:00
e0bf97d8b4 Alembic: be more explicit in y-up versus z-up variables. 2017-04-06 16:04:31 +02:00
06c25ace7b Alembic: removed a lot of unnecessary & duplicate code from abc_util.cc
create_transform_matrix(float[4][4]) did mostly the same as
create_transform_matrix(Object *, float[4][4]), but more elegant.
However, the former has some inconsistencies with the latter (which
are now merged and made explicit, turned out one was for z-up→y-up
while the other was for y-up→z-up), and was renamed to
copy_m44_axis_swap(...) to convey its purpose more clearly.

Furthermore, "loc" has been renamed to "trans", as matrices don't
store locations but translations; and more variables now have a src_
or dst_ prefix to denote whether they contain a matrix/vector in the
source or destination axis orientation.
2017-04-06 16:04:31 +02:00
1c3b6e042a Alembic: added note 2017-04-06 16:04:31 +02:00
b0967e9d42 Alembic: allow copy_{z,y}up_from_{y,z}up() to be called with yup=zup
This allows in-place conversion between z-up and y-up, by passing the
same variable to both arguments.
2017-04-06 16:04:31 +02:00
00e0a94b3c Alembic: import empties under their own name in Alembic, not their parent's
Before this commit something strange happened, as the m_data_name of
an inherit data-less object was used.
2017-04-06 16:04:31 +02:00
cbe0709db2 Alembic: Don't compute world matrix when it's not necessary. 2017-04-06 16:04:31 +02:00
62a47f9660 Alembic: cleaned up hack in AbcObjectReader::read_matrix() 2017-04-06 16:04:31 +02:00
347a4956a0 Alembic: added some clarification 2017-04-06 16:04:31 +02:00
c0ec0a19da Alembic: added some getter functions to help debug prints etc. 2017-04-06 16:04:31 +02:00
5f23f5b516 Alembic: do not presume to predict the parent name
AbcExporter::createTransformWriter() tries to predict the parent Xform
name, but if it cannot be found has multiple ways of creating it, possibly
under a different name than originally searched for.
2017-04-06 16:04:31 +02:00
56cfd3d5a7 Alembic: Removed AbcTransformWriter::m_parent
It was set, but never read anywhere.
2017-04-06 16:03:59 +02:00
2613ad64c5 Depsgraph: Remove old depsgraph header from alembic files 2017-04-06 15:49:56 +02:00
ae33f78229 Depsgraph: Remove old depsgraph header from game engine 2017-04-06 15:40:53 +02:00
d36fb4f08f Depsgraph: Remove old depsgraph headers from creator 2017-04-06 15:40:08 +02:00
a1b8c0bca2 Depsgraph: More type definitions to new depsgraph header 2017-04-06 15:37:46 +02:00
d8f931c9b7 Changes from custom-manipulators branch
Minor changes from custom-manipulators branch,
before larger changes are applied.
2017-04-06 22:10:09 +10:00
212c57c1c7 remove unused var 2017-04-06 20:52:35 +10:00
0feca278a4 Merge branch 'master' into blender2.8 2017-04-06 12:31:26 +02:00
Dalai Felinto
967b04cb07 Layer unittesting: pep8 touch up on test_evaluation_selectability_f.py 2017-04-06 12:22:21 +02:00
42467c884f Merge branch 'blender2.8' into custom-manipulators 2017-04-06 20:21:07 +10:00
8c01b2da98 Minor sync with master 2017-04-06 20:12:55 +10:00
5e2c9e87cb revert file rename (since these are in 2.8x already) 2017-04-06 19:48:59 +10:00
ae76a90593 Buildbot: Correct previous release
Seems CMake is not happy about changing compiler from script.
2017-04-06 11:39:06 +02:00
97300a3beb Buildbot: Force build environment to use latest GCC 2017-04-06 11:21:07 +02:00
7be09871d3 Update widget exporter 2017-04-06 17:29:11 +10:00
cf1d476a10 Accidentally left this in last commit 2017-04-06 17:26:07 +10:00
6444572c46 Cleanup: only expose base struct for manipulator geometry 2017-04-06 16:33:06 +10:00
ccc5a8757b Cleanup: rename file 2017-04-06 15:43:59 +10:00
e1567156c5 Merge branch 'blender2.8' into custom-manipulators 2017-04-06 15:22:16 +10:00
0debbe2b7f Gawain: VertexFormat_add_attrib (function name change)
See intern/gawain for the API change. Other files are updated to use the new name. Also updated every call site to the recommended style:
unsigned int foo = VertexFormat_add_attrib(format, "foo", COMP_ ... )
2017-04-06 01:18:12 -04:00
c2f5cd8f64 Gawain: add VertexBuffer prefix to functions
See intern/gawain for the API change. Other files are updated to use the new names.
2017-04-06 01:18:12 -04:00
957b408458 Fix manipulator showing in pose & editmode 2017-04-06 15:17:38 +10:00
0899b4bb3f Fix building without clay engine 2017-04-06 15:17:38 +10:00
ff3880ff93 Initialize immediate mode in Animation Player
PS. With this solution, immediate mode can be initialized and finalized consecutively if you drop a video

part of T49043
2017-04-06 01:54:10 -03:00
c320172a8b Remove redundant includes 2017-04-06 13:12:50 +10:00
c49a84e48d Remove manipulator_drawflags_refresh
This decoupled setting draw flags from calculating the manipulator center.

I can't see any advantage to doing this with the current code
It just increases the chance the two get out of sync.
2017-04-06 13:02:07 +10:00
c301dc445a Use obmat for manipulator center instead of 'loc'
Would show wrong location with parenting.
2017-04-06 12:47:00 +10:00
89c8d3cd45 Remove BKE_pose_where_is from protectflag_to_drawflags_pchan 2017-04-06 12:41:02 +10:00
dbccccc0a5 Merge branch 'blender2.8' into custom-manipulators 2017-04-06 12:32:44 +10:00
9f72580d07 Merge branch 'master' into blender2.8 2017-04-06 12:26:55 +10:00
f74b4a010d Cleanup: function naming for manipulator
Rename 'stats_*' to 'protectflag_to_drawflags_*' (was too vague).
Also remove NULL check from gimbal_axis
2017-04-06 12:26:07 +10:00
e34540a674 Merge branch 'blender2.8' into custom-manipulators 2017-04-06 12:16:58 +10:00
13f77de214 Merge branch 'master' into blender2.8 2017-04-06 12:04:48 +10:00
5e3b6e951b Cleanup: minor changes to transform-manipulator
Match stats_editbone & stats_pchan behavior to avoid confusion.
2017-04-06 12:02:32 +10:00
a29fb3945f Sync with 2.8 2017-04-06 11:52:18 +10:00
365546a662 Add null check to gimbal_axis (sync with 2.8) 2017-04-06 11:35:04 +10:00
e63ba6d0f4 Remove NULL check from gimbal_axis 2017-04-06 11:32:45 +10:00
d4bd16b30d Merge branch 'blender2.8' into custom-manipulators 2017-04-06 11:20:51 +10:00
Dalai Felinto
40cb5a067b Immediate Mode: missing ALPHA_TEST in gpuRestoreState
Missed in rBcbd78c81268f06e7b658ae042f3ab6a3816149b0
2017-04-05 21:46:08 +02:00
7ae9d092d0 Fix alembic build error with MSVC 2017-04-05 10:59:29 -06:00
cf1287308f Disable depth test for scale widget 2017-04-06 00:44:39 +10:00
37176c7acb Merge branch 'blender2.8' into custom-manipulators 2017-04-06 00:21:23 +10:00
fa5e5f898e Cleanup: Remove depsgraph stubs 2017-04-05 15:57:36 +02:00
1980f3d3b8 Motion paths: Switch to a slower evaluation which does not need bases to be sorted
New dpesgtraph does not ensure bases are sorted by the evaluation order
any more, so motion paths update might go horrribly wrong.
2017-04-05 15:56:27 +02:00
5b386270a5 Cleanup: Get rid of legacy depsgraph header file 2017-04-05 15:50:45 +02:00
a13878b9af Cleanup: Remove legacy depsgraph private header from modifiers 2017-04-05 15:46:56 +02:00
70aa5f97f2 Cleanup, remove unused function 2017-04-05 15:45:54 +02:00
3bb88a7807 Merge branch 'master' into blender2.8 2017-04-05 15:36:55 +02:00
f921442a44 Depsghraph: Remove unused function 2017-04-05 15:36:17 +02:00
Dalai Felinto
929c45b7d4 Paint cursor changes, so it save/load only the required flags 2017-04-05 15:02:31 +02:00
Dalai Felinto
cbd78c8126 Immediate Mode: replacing glPushAttrib/glPopAttrib
Reference document: http://docs.gl/gl3/glPushAttrib

This patch only tackles the bits that are set by Blender with the
following exceptions:

1) Deprecated states (e.g., GL_STIPPLE) are not saved/restored

2) The exception being GL_ALPHA_TEST, which will be removed, but it may
affect drawing too much now. To be removed once we no longer set GL_ALPHA_TEST
elsewhere.

3) paint_cursor will be tackled separated, since it was abusing
glPush/PopAttrib in the first place.

4) Despite what the glPushAttrib page above may suggest, GL_DEPTH_WRITEMASK needs glGet, not glIsEnabled

5) BGE is still a problem since it relies on GL_ALL_ATTRIB_BITS which
would lead to a way more complete/lenghty solution. Since the BGE has
other (OpenGL deprecated) problems anyways, it can be handled on its own
time.

Finally, the original design for 2.8 was to implement a proper stack
system. However we need to move to core profile sooner than later. So
this is a pragmatic temporary (that may be permanent) solution.

Reviewers: merwin, campbellbarton

Differential Revision: https://developer.blender.org/D2600
2017-04-05 15:02:31 +02:00
Dalai Felinto
bbfa1a8639 Viewport: 3D cameras don't need glPushAttrib/glPopAttrib 2017-04-05 15:02:31 +02:00
52029e689c Cycles: Fix race condition in attributes creation during SVM compilation 2017-04-05 14:57:54 +02:00
3ce30823ff Cycles: Add utility class to simplify scoped spin locks 2017-04-05 14:57:34 +02:00
424901ad7b Cycles: Guard global write access in SVM compilation code 2017-04-05 14:21:49 +02:00
0b6876d1e9 Remove USE_IMM ifdefs 2017-04-05 19:41:16 +10:00
ba5b792dd9 Depsgraph: Remove all layer bit flags related checks
These bits became obsolete with the new layer system, so we can
simplify some code around them or avoid existing workarounds which
were trying to keep things working for them.

There are still work needed to be done for on_visible_change to
avoid unnecessary updates, but that can also happen later.
2017-04-05 11:39:30 +02:00
9f643efc66 Finish of removal of GLU deps
Will commit full removal next
2017-04-05 19:31:05 +10:00
e4c5441286 Locales: Some optimization work
Mainly visible for MSVC debug builds and gives about 2x speedup.
2017-04-05 11:25:58 +02:00
124b21f200 Merge branch 'blender2.8' into custom-manipulators 2017-04-05 19:08:52 +10:00
1f6037c887 Fix T50976: Blender UI problems with certain theme files.
Core of the issue was that some of our Theme colors are RGB-only, but
were loaded as RGBA.

Note that tracking all possible cases is pretty impossible, so we'll
have to tackle those as they get reported am afraid.
2017-04-05 11:01:27 +02:00
2f700b8280 GPU_immediate_util: missed last commit 2017-04-05 18:53:34 +10:00
a4fac21fc5 Cleanup: Move imm_draw utils into own file
These were in BIF_glutil which is documented to be removed,
so best not define new API's there.
2017-04-05 18:43:59 +10:00
e9bb018a4a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/alembic/intern/abc_exporter.h
2017-04-05 10:02:25 +02:00
4dadb6d445 Naming constancy for 'imm' utility functions
- use 'imm_draw_' prefix for functions that draw.
- use '_3d' suffix for 3d functions, no suffix for 2d functions.
- use terms fill/wire (shorter than filled / lined).

Also add `imm_draw_circle_fill_3d` (only had wire version)
2017-04-05 17:46:25 +10:00
8647d5af90 InstallDeps: Raise minimal & official version of OIIO to 1.7.13.
As requested by @sergey.
2017-04-05 09:26:41 +02:00
bfe7546f88 Support clipping for dial widgets
Apply changes from @Severin's recent commit ebe1b4f1 to dial widgets.
2017-04-05 13:16:10 +10:00
6d55dcf4dd Alembic: addition of a simple logging class.
The idea is to have a system where we properly log error messages and
let the users know that errors occured redirecting them to the console
for explanations. This is only implemented for the exporter since the
importer already has similar functionalities; however they shall
ultimately be unified in some way.

Reviewers: sybren, dfelinto

Differential Revision: https://developer.blender.org/D2541
2017-04-05 04:56:38 +02:00
6c84d67d9f Merge branch 'blender2.8' into custom-manipulators 2017-04-05 11:43:16 +10:00
bcd95dbdbb Merge branch 'master' into blender2.8 2017-04-05 11:40:17 +10:00
064eba208e revert recent cleanup, keep useful changes
Don't want to annoy module owner.

What is kept:
- UI_view2d_scale_get with unused y scale
- corrected comment
- unsigned --> unsigned int
2017-04-04 19:36:32 -04:00
Julian Eisel
ebe1b4f11f Fix rotation manipulators not clipping
Added new shader for clipping, also cleaned up rotation manipulator
drawing code a bit.
This code should be replaced by new transform manipulators soon, just
keeping this working in the meanwhile.
2017-04-05 01:33:10 +02:00
Julian Eisel
dd4de189dd Fix blenderplayer compilation 2017-04-04 21:52:28 +02:00
125ce644f2 cleanup
I started cleaning up UI_view2d_scale_get where the y scale was unused, then got carried away...

- for loop scope
- declare variables closer to where they are used
- move early exits closer to function start
- unsigned --> unsigned int
2017-04-04 15:40:21 -04:00
Dalai Felinto
db0f67f464 Collada export cleanup 2017-04-04 20:44:22 +02:00
9ecb196237 fix: Collada export selected worked only for the very first export (needs further testing and cleanup, see comments) 2017-04-04 19:17:52 +02:00
Dalai Felinto
f10219a977 Immediate Mode: handle other cases of glPop/glPushClientAttrib
Those cases were not using ClientAttrib but they should :)
Rather use a OpenGL3.3 alternative anyways.
2017-04-04 18:43:01 +02:00
Dalai Felinto
fa317eb69c Fix collada exporting for Blender 2.8
Instead of exporting all the scene objects, I'm exporting the scene
layer objects instead.
2017-04-04 17:45:55 +02:00
411e7abe94 Cleanup: redundant casts 2017-04-05 01:08:19 +10:00
Dalai Felinto
69f7b513b5 Immediate Mode: removing unecessary comment on gpencil (false positive) 2017-04-04 17:04:03 +02:00
Dalai Felinto
a0ef482124 Image Draw: remove unused code since 2009
(removing false positive deprecated OpenGL calls)
2017-04-04 16:47:09 +02:00
9170e49250 Fix missing protection of RNA_pointer_as_string() against NULL pointers.
Odd that issue was never reached before? Looks like it hit in
datablock_idprops branch though...
2017-04-04 16:04:13 +02:00
7fc84d4e32 Merge branch 'master' into blender2.8 2017-04-04 15:47:58 +02:00
92aeb84fde Cycles: Tag shaders for update after the threading part is over
This avoids write access happening in non-atomic manner in
Shader::tag_update which modifies the global managers. Even
for 1 byte data types it's quite dangerous.
2017-04-04 15:43:12 +02:00
7b149bfde6 Depsgraph: Use atomic operation to tag the changed ID 2017-04-04 15:43:12 +02:00
5ce95df2c6 Cycles: Fix uninitialized memory access when comparing curve mapping nodes
The issue is coming from the fact that float3 is actually 16 bytes aligned
data type and the "padding" was not initialized. This caused memcmp() to
access non-initialized memory.
2017-04-04 15:43:12 +02:00
ec12951262 Merge branch 'blender2.8' into custom-manipulators 2017-04-04 23:18:22 +10:00
a63a31dd12 install_deps: removed leftover compile_HDF5 command
It was a leftover from when Alembic with HDF5 was still officially
supported.
2017-04-04 14:50:58 +02:00
Dalai Felinto
c8cff31922 UV editor using new depsgraph for shadow uv 2017-04-04 14:31:01 +02:00
Dalai Felinto
c87bfb1f7d Immediate Mode / DerivedMesh: Handle UV Shadow 2017-04-04 14:31:01 +02:00
Dalai Felinto
0e95270eb7 Depsgraph: placeholder function for COW objects query 2017-04-04 14:31:01 +02:00
Dalai Felinto
1baa236acb CTX_data_depsgraph(bContext *C); 2017-04-04 14:31:01 +02:00
Dalai Felinto
5eac4e3057 Immediate Mode: glPop/glPushClientAttrib 2017-04-04 14:31:01 +02:00
8a60d84327 Bumped Alembic library version to 1.7.1
This provides us with a clearer API (so I don't have to use const_cast<>
in upcoming code). It also allows layering of different Alembic files,
so you can have a base file and load a separate file containing overrides.

Verbally approved by Dr. Sergey.
2017-04-04 12:55:38 +02:00
ffac92e385 Buildbot: Update master config 2017-04-04 12:52:54 +02:00
b93ddfd8ac Alembic: force ALEMBIC_LIB_USES_BOOST=ON when not using C++11
Alembic requires one of ALEMBIC_LIB_USES_BOOST, ALEMBIC_LIB_USES_TR1, or
C++11, and silently defaults to the latter if the former two are OFF.

Before this change, Alembic was only built without C++11 of OpenEXR
was built at the same time. This dependency was both unnecessary and
undocumented.
2017-04-04 12:41:44 +02:00
ca5ccf5cd4 Task: Remove non-atomic pool suspended flag assignment
This was done some lines above by atomic fetch and and.
2017-04-04 12:32:15 +02:00
4f7eb3ad12 Buildbot: Update master config 2017-04-04 12:15:35 +02:00
373d362e4a Fix bad level call. 2017-04-04 11:04:00 +02:00
4fe8395215 Cleanup: avoid long lines (search tools complain!) 2017-04-04 17:38:51 +10:00
0c68c92840 fix node editor drawing (T51086)
Fixed a few issues
- wrong transform matrices
- assert on node with no sockets
- color of collapsed nodes, some title areas

Also includes minor cleanup.
2017-04-04 01:15:35 -04:00
e9944fee33 Draw Manager: Fix engine_type not set 2017-04-03 22:30:34 +02:00
ccaa21df6d Infinite Grid: View angle fade
and show Z axis in special persp views
2017-04-03 21:52:42 +02:00
4a8aaab0b2 Draw Manager: Use engine type pointer instead of engine name.
Faster search
2017-04-03 21:52:42 +02:00
ccd8353d58 Object Engine: Fix multi user lamp data display bug.
Objects that were using the same lamp data were having the same display matrices.
This is fixed by allowing engine to store a memory block inside the object itself.
2017-04-03 21:52:42 +02:00
682c4dcd1e Draw Manager: Fix Cache timers
Also expand the timer average range.
2017-04-03 21:52:03 +02:00
eca256bc32 GPULamp: Separate GPULamp from GPUMaterial
Since we need GPULamps for draw engines, it makes sense to separate them.
2017-04-03 21:52:03 +02:00
8e0bfee1e5 Draw Manager: Fix glBlitFramebuffer error 2017-04-03 21:52:03 +02:00
46cd87f5da Eevee: LTC area lights
Using Linear Transform Cosines to compute area lighting. This is far more accurate than other techniques but also slower.

We use rotating quad to mimic sphere area light. For a better approximation, we use a rotating octogon.
2017-04-03 21:52:03 +02:00
Dalai Felinto
a78e97b206 Layer/Depsgraph: Update depsgraph for new objects 2017-04-03 18:47:50 +02:00
Dalai Felinto
d31c4c5666 Layer/Depsgraph: Fix selectability issues 2017-04-03 18:05:06 +02:00
Dalai Felinto
db6b4639fc Layer: Adding unittest for a problem with selectability evaluation
This is currently failing (and causing the object_delete test to fail). To be fixed separately
2017-04-03 17:46:03 +02:00
Dalai Felinto
ee6f858c91 Layer: Small refactor on layer_collection_add 2017-04-03 17:45:59 +02:00
728f75c6a7 Buildbot: Some more twqeaks to master config 2017-04-03 15:51:31 +02:00
e741804ce3 Buildbot: Update bundled vetrsion of server configuration 2017-04-03 15:36:52 +02:00
5884c9f1ba Merge branch 'master' into blender2.8 2017-04-03 15:15:56 +02:00
cc93a66e71 Buildbot: SPecial branch trickery for linux slaves 2017-04-03 15:04:16 +02:00
c81fd28116 Merge branch 'master' into custom-manipulators 2017-04-03 22:56:51 +10:00
2aa0215ec5 Point all submodules to master branch
This way it should be safe to use `git submodule update --remote`.
2017-04-03 14:54:51 +02:00
8042d05c5b Work in progress move from GLU to IMM
Drawing rotation widgets now uses IMM, but not arrows
See USE_IMM define.
2017-04-03 22:53:27 +10:00
d27ef3913a Buildbot: Some special tricks for Blender 2.8 slave 2017-04-03 14:49:07 +02:00
3b6eaf8d96 Cleanup: style 2017-04-03 22:10:39 +10:00
fbcb920748 Rename circle_partial -> disk_partial
We may have a 'disk' function (not the partial version).
2017-04-03 22:10:38 +10:00
54a60eff24 Fix blender player 2017-04-03 12:31:33 +02:00
ab347c8380 Fix T51115: Bump node is broken when the displacement socket is used 2017-04-03 10:51:00 +02:00
368b74315a Collada - add flag to limit precision of exported data, mainly to simplify debugging 2017-04-03 10:48:00 +02:00
f65d6ea954 fix: collada - do proper conversion from int to bool (as with other nearby parameters) 2017-04-03 10:45:24 +02:00
0c7d2e499e Merge branch 'blender2.8' into custom-manipulators 2017-04-03 15:27:27 +10:00
d1e55be96e Add gluPartialDisk replacement (imm_draw_filled_circle_partial)
Needed for custom-manipulators branch but generally useful.
2017-04-03 15:25:43 +10:00
9bb9419219 Merge branch 'blender2.8' into custom-manipulators 2017-04-03 13:18:03 +10:00
01a5cd5cec Merge branch 'blender2.8' into custom-manipulators 2017-04-03 13:01:56 +10:00
691df9f29d Merge branch 'blender2.8' into custom-manipulators
Needed to add GLU back for purpose of merging, noted with IMM-FIXME
2017-04-03 13:00:49 +10:00
1dcb15608f Merge branch 'blender2.8' into custom-manipulators 2017-04-03 12:30:55 +10:00
3bf0026bec fix: T50412 - collada: Replaced precision local limit function by blender's own implementation 2017-04-01 15:29:50 +02:00
e1fb080743 Cleanup: style 2017-04-01 12:09:17 +11:00
eba09b1520 Blender 2.8: Hook of layer collections evaluation in DEG
This moves selectability/visibility flag flush from some hardcoded
places in the code to depsgraph. This way it is possible to simply
tag depsgraph to update those flags and rest it'll do on its own.

Using depsgraph for such flush is an overkill: those flags are fully
static and can not be animated, so it doesn't really make sense to
hook only those to depsgraph.

However, in the future we will have overrides on collections, which
ideally would need to be animatable and drivable and easiest way
to support this is to do this on depsgraph level, so it ensures
proper order of evaluation for animation and drivers. And it seems
logical to do both overrides and flags flush from depsgraph from
this point of view.

This commit also includes the evaluation of IDProperty for collections,
which basically are just another form of override. So once we implement
the other kind of overrides the flushing and collection evaluation won't
change.

Patch by Sergey Sharybin and Dalai Felinto
2017-04-01 01:27:08 +02:00
Dalai Felinto
97b9afda37 Layers / Depsgraph: Unittesting for selection and visibility evaluation 2017-04-01 01:22:39 +02:00
Dalai Felinto
5bfa6d8455 Fix crash in draw manager when no object active 2017-04-01 01:01:57 +02:00
Dalai Felinto
4c2f5ab33e Bumping version to 2.80
This should have been done earlier. But now that we may see more activity in master due to bcon3 merges, it is even more important to stress out the separation between master and 2.8.

Also I needed the version bump for idproperties doversion (they needed
to happen in _after_linking, and we don't have access to
DNA_struct_elem_find there).

Last but not least, every time I posted a video or image from 2.80, I
got someone confused about the version showing in the infobar.
2017-04-01 00:04:45 +02:00
Dalai Felinto
b0998df608 Layers: Fix scene copying after IDProperty changes
(also unittest: split scene copy in 4 tests)
2017-03-31 17:37:52 +02:00
Dalai Felinto
d9b89ca0d0 Layers unittest: Fix tests breaking since Folded was removed 2017-03-31 17:37:49 +02:00
Dalai Felinto
1f17b72efe Layers unittest: Breaking pep8, but getting tests to work again
I will investigate this further later.

The big problem is that the way I'm running tests if I have any error
(e.g., ImportError) the pass still pass.
2017-03-31 17:37:45 +02:00
6c42079b78 Depsgraph: Correction for the previous local view commit
Need to flush layers from components back to ID node.
2017-03-31 17:08:18 +02:00
25ab3aac9d Fix threading conflicts in multitex_ext_safe()
This function was modifying texture datablock, which makes the call
unsafe for call from multiple threads. Now we pass the argument that
we don't need nodes to the underlying functions.

There will be still race condition in noise texture, but that should
at least be free from crashes. Doesn't mean we shouldn't fix it tho.
2017-03-31 17:08:18 +02:00
90df1142a3 Cycles: Solve threading conflict in shader synchronization
Update tag might access links (when checking for attributes) and
the links might be in the middle of rebuild in simplification
logic.
2017-03-31 17:08:18 +02:00
27d20a04b5 Fix unreported bug in Blender Render: using unnormalized normal in normal map node in the same way as in baking 2017-03-31 17:53:55 +03:00
Dalai Felinto
d1f402acfd Fix blenderplayer (tm) 2017-03-31 15:02:28 +02:00
70fdf0fe37 Merge branch 'master' into blender2.8 2017-03-31 23:52:22 +11:00
ff693959d8 WM: Previous commit broke common-case loading new file
Handle this in the operator
2017-03-31 23:48:10 +11:00
6005a378d0 Merge branch 'blender2.8' into custom-manipulators
Also remove sequencer widget.
2017-03-31 23:31:11 +11:00
94783a601a Merge branch 'blender2.8' into custom-manipulators 2017-03-31 23:04:56 +11:00
8faeeef2e3 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 22:35:32 +11:00
55fec0582f Merge branch 'blender2.8' into custom-manipulators 2017-03-31 22:32:50 +11:00
d6f394621f Merge branch 'blender2.8' into custom-manipulators 2017-03-31 22:23:14 +11:00
7f7c807a92 Keep current app-template when selecting 'New File' 2017-03-31 22:06:36 +11:00
ff716e3c34 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:41:26 +11:00
38f910f9e2 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:30:26 +11:00
147467d201 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:28:03 +11:00
57146919e0 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:23:09 +11:00
3fe1a05032 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 21:21:47 +11:00
e5fa738ce9 UI cleanup: simplify Icon handling of uiDefAutoButR for PROP_POINTER.
Comes from D113, but really not related to the patch's topic!
2017-03-31 12:14:27 +02:00
abc08c81b5 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:53:13 +11:00
b5ddaa81c8 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:49:53 +11:00
9aa36de62c Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:41:46 +11:00
ae0f75b56d Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:37:32 +11:00
ec312cacca Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:08:17 +11:00
e1fa97f318 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 20:05:20 +11:00
0be064067a Blender 2.8: Cleanup, no need in escape 2017-03-31 10:28:27 +02:00
4b7d95290f Cycles: More fixes after include changes 2017-03-31 10:12:13 +02:00
6fb08f6fb3 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 19:10:28 +11:00
4e999dea52 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:36:34 +11:00
903ebdb96c Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:32:16 +11:00
f046ab9950 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:27:53 +11:00
721ad61f50 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:27:01 +11:00
7cc3c433ed Merge branch 'blender2.8' into custom-manipulators 2017-03-31 18:14:00 +11:00
2b94f1d073 Merge branch 'blender2.8' into custom-manipulators
This removes graph 3d render feature, also use same variables as master
for SpaceNode.

The feature (could be added back if needed),
but didn't get such a positive functionality review, see D1781,
although this is still an open topic.
2017-03-31 18:12:11 +11:00
8336244e38 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 17:32:28 +11:00
6cc9716c15 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 17:19:47 +11:00
6d77187f09 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 17:13:57 +11:00
67685e4b4d Merge branch 'blender2.8' into custom-manipulators
Note, this doesn't use the changes from 2.8x, since the code was so different.
Move to use imm API will need to be done manually.
2017-03-31 17:11:46 +11:00
db428a389a Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:58:22 +11:00
9b61a70f8d Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:52:10 +11:00
fa1198b104 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:49:38 +11:00
fd17d7a864 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 16:45:17 +11:00
b2ad248cdd Merge branch 'blender2.8' into custom-manipulators 2017-03-31 15:26:20 +11:00
6060e86cf2 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 15:14:18 +11:00
5fa7e76d30 Merge branch 'blender2.8' into custom-manipulators 2017-03-31 15:13:42 +11:00
d18ed646ee Add missing header (for abort) 2017-03-31 15:01:44 +11:00
d097c2a1b3 Fix T51072: The reference of a pyobject may be being overwritten in bm_mesh_remap_cd_update
In this case the Pyobject gets lost from pybm, and bm.free() does not invalidate the PyElem.
This will cause the destructor of python to read invalid memory and crash.

The solution is to make a copy of the pyobjects pointers before overwriting.
2017-03-31 01:01:16 -03:00
e254aa8965 Eevee: Codestyle, optimisation and a few fixes
Something is very wrong with the energy factor. For now I tweaked them by hand to fit cycles.
2017-03-31 01:07:51 +02:00
8bd61ea54d Correct string formatting (error in recent change) 2017-03-31 09:48:57 +11:00
14c2083460 Cleanup: warnings 2017-03-31 09:48:57 +11:00
4cfac9edab Cleanup/fix bad code in IDP_SetIndexArray()
Mainly, using index before checking for its validity...
2017-03-30 22:52:53 +02:00
Dalai Felinto
3fdbd78a6b Layer / IDProperty: Prevent previously created demo files from crash 2017-03-30 18:53:46 +02:00
Dalai Felinto
f2c6c831e3 Layer: remove no longer used settings 2017-03-30 18:40:31 +02:00
Dalai Felinto
ce3c7e8ff5 Layers: use IDProperty and override collection properties system
First this replace a custom data struct with IDProperty, and use
IDProperty group merge and copying functions. Which means that a collection
property setting is only created if necessary.

This implements the "Layer Collection settings" override system, as
suggested in the "Override Manifesto" document.

The core is working, with Scene, LayerCollection and Object using a
single IDProperty to store all the render settings data. Next step is to
migrate this to depsgraph.

Note: Clay engine "ssao_samples" was hardcoded to 32 for now. It will come
back as part of "Workspace Settings" later.

Many thanks for Bastien Montagne for the help with the UI template
nightmare ;)

Differential Revision: https://developer.blender.org/D2563
2017-03-30 17:01:23 +02:00
5b3b0b4778 Redraw parent popup when the child popup is closed 2017-03-30 16:48:18 +03:00
843be91002 Depsgraph: Fix missing updates when in local view
This area is a subject of reconsideration, so for now used simplest
way possible -- ensure depsgraph's nodes have proper layer flags
when going in and out of local mode.
2017-03-30 14:42:55 +02:00
Dalai Felinto
98e69631b0 Remove unused variable (warning since recent Scene/SceneLayer change) 2017-03-30 14:33:57 +02:00
a88801b99b Cycles: Fix missing kernel re-compilation after recent changes
Reported by Mai in IRC, thanks!
2017-03-30 11:45:30 +02:00
Dalai Felinto
3f6a74560e Layers: Scene->basact > SceneLayer->basact (more work)
This brings back adding hooks among other areas
2017-03-30 11:41:33 +02:00
ced8fff5de Fix T51051: Incorrect render on 32bit Linux
The issue was apparently caused by -fno-finite-math-only added to kernel.cpp
CFLAGS. For now just removed this flag from the kernel (we don't really want
it there at this point, and we don't have it for SSE/AVX optimized kernels).

But surely more investigation is needed here.
2017-03-30 11:37:31 +02:00
Dalai Felinto
35b731c9c8 Prevent crash on weight paint
Weight painting is still wrong, but it doesn't crash any more.
2017-03-30 11:25:53 +02:00
Dalai Felinto
f4d597efff Fix breakage when using radial control (shift f) with weight paint
This was likely introduced on rBf90b480f957f . Basically the BLF routines have their own shaders, so any previous programs must be unbind before it
2017-03-30 11:20:54 +02:00
9b1564a862 Cycles: Cleanup, rename RegularBVH to BinaryBVH
Makes it more explicit what the structure is from it's name.
2017-03-30 09:47:27 +02:00
9b62d329f4 Merge branch 'blender2.8' into custom-manipulators 2017-03-30 18:11:27 +11:00
10b27bd30a fix screen layout thumbnails (T51078)
GPU_framebuffer no longer handles transform matrices, which this code was relying on. Made screen_preview_draw responsible for its own ModelView matrix.
2017-03-30 03:01:50 -04:00
126ee42a30 fix OpenGL Render to image (T51082)
This restores the feature for legacy viewport only. Modern viewport, Clay, Eevee, etc. will need further work.

Eventually we should rename this something other than "OpenGL".
2017-03-30 02:32:33 -04:00
8190356911 Merge branch 'blender2.8' into custom-manipulators 2017-03-30 17:23:56 +11:00
669104b5da Merge branch 'blender2.8' into custom-manipulators 2017-03-30 17:23:05 +11:00
6c4f3d11aa Merge branch 'blender2.8' into custom-manipulators 2017-03-30 17:08:09 +11:00
0dc30e9dd8 fix build on Mac/clang
Not all code paths returned a value, so we can use a safe default (8-bit RGBA) when the input is bogus.
2017-03-30 01:43:51 -04:00
31e6249256 Mirror Modifier: Add offsets for mirrored UVs
The mirror modifier now has two fields that specify a -1 to 1 offset for
the U and V axes when mirroring their coordinates.

D1844 by @circuitfox
2017-03-30 13:15:02 +11:00
4743fa52ac Eevee: Diffuse Light (2/2) and GGX low quality lights
GGX is missing sun lamps area.
2017-03-29 23:45:44 +02:00
ccb9f683e5 Eevee: fix HDR buffer 2017-03-29 23:45:44 +02:00
Julian Eisel
15336eb262 Merge branch 'master' into blender2.8 2017-03-29 23:01:16 +02:00
Dalai Felinto
e922e42fe6 Remove BASE_VISIBLE, BASE_SELECTABLE, TESTBASELIB (no longer used) 2017-03-29 22:33:09 +02:00
Dalai Felinto
61134dc02c Base: update localview, however ...
Local view will not be supported in 2.8, at least not at first. This updates the code anyways.
2017-03-29 22:33:09 +02:00
Dalai Felinto
08875452b0 Base: update createTransObject
I was hoping this would fix the issue of the object not moving after you copy it (right now you need to manually grab the object afterwards). But unfortunatelly it does not
2017-03-29 22:33:09 +02:00
Dalai Felinto
9571811b5d Base: update (unused) image_aspect function, copy_attr_menu and its sub-functions
Since this is unused, I didn't test the code. It should be fine though.
2017-03-29 22:33:09 +02:00
Dalai Felinto
63bbf753fc Base: update select_group 2017-03-29 22:33:09 +02:00
Dalai Felinto
328dcae3a9 Fix fit camera view frame to selected objects 2017-03-29 22:33:09 +02:00
Dalai Felinto
40f764f922 Fix viewselected (NUMPAD PERIOD) 2017-03-29 22:21:14 +02:00
Dalai Felinto
539e41f226 Fix T51083: View all is broken in 2.8 2017-03-29 21:04:21 +02:00
66ef0b8834 Cycles: Fix compilation error of app after the include directories change 2017-03-29 16:54:41 +02:00
48fa2c83eb Cycles: Attempt to work around compilation errors of CUDA on sm_2x 2017-03-29 16:22:51 +02:00
be17445714 Cycles: Cleanup, indentation 2017-03-29 15:41:56 +02:00
cc7386ec6b Cycles: Remove toolkit-specific workaround from kernel 2017-03-29 15:07:53 +02:00
5af4e1ca15 Cycles: Only use CUDA 8.0 as officially supported one
This deprecates CUDA 7.5.
2017-03-29 15:06:47 +02:00
270df9a60f Cycles: Cleanup, don't use m_ prefix for public properties 2017-03-29 14:45:49 +02:00
30bed91b78 Cycles: Fix compilation error with visibility flag disabled 2017-03-29 14:28:45 +02:00
0579eaae1f Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.

For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.

Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.

This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.

Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.

Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner

Reviewed By: lukasstockner97, maiself, nirved, dingto

Subscribers: brecht

Differential Revision: https://developer.blender.org/D2586
2017-03-29 13:41:11 +02:00
Julian Eisel
b0581cd92c Correct own earlier commit for recursive behavior of property groups 2017-03-29 12:53:38 +02:00
Julian Eisel
ac08482886 Fix glitches caused by new outliner versioning code
Mainly caused by TreeStoreElem.flag not being cleared.
2017-03-29 12:31:27 +02:00
Julian Eisel
38d0ea4f69 Alternative fix for crash displaying 'New Window' keymap item
rB870440dee910c9 just did NULL-check for Main pointer, actual issue is
that bContext pointer was NULL. This can be fixed by ensuring
PROP_ENUM_NO_CONTEXT flag is not set by calling
WM_operator_properties_sanitize when creating RNA buttons. Now, layout
previews are visible in keymap editor too.
2017-03-29 12:27:10 +02:00
61db9ee27a Cycles: Attempt to workaround compilation error on new CUDA toolkit and sm_2x 2017-03-29 11:50:17 +02:00
Dalai Felinto
870440dee9 Prevent crash when seeing the window new on keymaps
CTX_data_main(C) is NULL in those cases :/
2017-03-29 11:39:36 +02:00
2be098a1a0 Merge branch 'master' into blender2.8 2017-03-29 20:20:53 +11:00
c2d3bb7090 Remove non-bmesh case from test 2017-03-29 20:11:54 +11:00
dd662c74ae Fix skin mark operator
Accessed custom-data layer offset before creating.
2017-03-29 20:11:54 +11:00
a7ca991841 Fix crash closing window in background mode 2017-03-29 20:11:54 +11:00
cb6ec44fc7 Fix missing NULL check in gpencil poll
Also de-duplicate poll functions
2017-03-29 20:11:54 +11:00
6332e0e1f7 Use 'empty' option for clearing factory settings 2017-03-29 20:11:54 +11:00
df7f6a3e2e Option to load startup file with empty-data
Useful for batch conversion and tests.
2017-03-29 20:11:54 +11:00
b3f9ae0125 Buildbot: Revert previous change, older toolkit has same exact behavior 2017-03-29 10:48:10 +02:00
15ff75d06b Buildbot: Use older NVCC on 32bit linux
Newer toolkit has some weird issue with cross0-compiling 32bit kernels
from 64bit environment.
2017-03-29 10:21:17 +02:00
ac43e5cc87 Buildbot: Remove global hardcoded NVCC path
This was initially needed for heterogeneous setup of two toolkits which
we no longer need.
2017-03-29 10:16:41 +02:00
286adfde38 Cycles: Bring back preview AA samples when using BPT
This was removed in 93426cb. Please be more accurate when
changing interface.
2017-03-29 09:12:26 +02:00
4c7f4e4662 PyAPI: minor path init simplification 2017-03-29 15:07:41 +11:00
4f69dca547 Fix 'bl_app_override' wrapping multiple times.
Calling `SomeClass.draw(self, context)` instead of `self.draw()`
would try to wrap the argument `self` multiple times, causing an error.
2017-03-29 14:31:14 +11:00
d808557d15 Fix memory leak re-registering operators
Re-registering an operator used by the keymap would lead memory.
Reload scripts for eg leaked over ~1600 blocks.
2017-03-29 13:35:15 +11:00
02b2094847 PyAPI: check modules are registered before unregister
Needed since templates may unregister classes.

Also replace old modules on reloading.
2017-03-29 12:38:02 +11:00
Julian Eisel
ff3e1fa760 Merge branch 'master' into blender2.8 2017-03-28 23:11:10 +02:00
93426cb295 Fix T51068: Place props in their own row
This allows the props to extend into the blank space that is to the right.
2017-03-28 16:33:05 -04:00
6ea54fe9ff Cycles: Switch to reformulated Pluecker ray/triangle intersection
The intention of this commit it to address issues mentioned in the
reports T43865,T50164 and T50452.

The code is based on Embree code with some extra vectorization
to speed up single ray to single triangle intersection.

Unfortunately, such a fix is not coming for free. There is some
slowdown for AVX2 processors, mainly due to different vectorization
code, which caused different number of instructions to be executed
and different instructions-per-cycle counters. But on another hand
this commit makes pre-AVX2 platforms such as AVX and SSE4.1 a bit
faster. The prerformance goes as following:

              2.78c AVX2   2.78c AVX   Patch AVX2         Patch AVX
BMW            05:21.09     06:05.34    05:32.97 (+3.5%)   05:34.97 (-8.5%)
Classroom      16:55.36     18:24.51    17:10.41 (+1.4%)   17:15.87 (-6.3%)
Fishy Cat      08:08.49     08:36.26    08:09.19 (+0.2%)   08:12.25 (-4.7%
Koro           11:22.54     11:45.24    11:13.25 (-1.5%)   11:43.81 (-0.3%)
Barcelone      14:18.32     16:09.46    14:15.20 (-0.4%)   14:25.15 (-10.8%)

On GPU the performance is about 1.5-2% slower in my tests on GTX1080
but afraid we can't do much as a part of this chaneg here and
consider it a price to pay for more proper intersection check.

Made in collaboration with Maxym Dmytrychenko, big thanks to him!

Reviewers: brecht, juicyfruit, lukasstockner97, dingto

Differential Revision: https://developer.blender.org/D1574
2017-03-28 17:26:47 +02:00
69aa6577b3 Forgot those IDP_LibLinkProperty call on node sockets IDProps in previous commit... 2017-03-28 14:38:00 +02:00
855b56b90c Add GL_LINE_STRIP_ADJACENCY support to Gawain
This primitive is used in geometry shaders like new grease pencil stroke shaders
2017-03-28 13:05:45 +02:00
59bb4ca1b0 Fix: Icon offset for pie buttons 2017-03-28 13:44:02 +03:00
3f61280327 Cycles: Pass m128 vectors by const reference 2017-03-28 11:01:11 +02:00
885260117d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/windowmanager/intern/wm_window.c
2017-03-28 10:41:10 +02:00
e1909958d9 Fix lib_link_cachefile.
That one was:
* Resetting non-ID pointers (lib_link_xxx funcs should only affect ID
  pointers, everything else shall be done in direct_link_xxx func).
* Even worse, always calling lib_link_animdata, even when
  LIB_TAG_NEED_LINK tag was unset...
2017-03-28 10:15:52 +02:00
bed327f1ce Bring back lib_link_mesh() in 'order' with other libdata liblink functions.
We do not need any special handling anymore for usercount of images used
by faces/polygons (tpage stuff), since we have the 'real_user' handling,
which will gracefully cope with all possible situations.

So better not keep that ugly confusing useless special case.
2017-03-28 10:10:15 +02:00
39172c6f34 readfile.c: Cleanup lib_link code a bit.
Mainly:
* Add missing `IDP_LibLinkProperty()` calls for many ID types
  (harmless currently, but better be consistent here!).
* Bring lib_link_xxx functions more in line with each other.
* Replace some long if/else by switch.
2017-03-28 10:03:59 +02:00
1b5acbb329 Correct splash size check 2017-03-28 17:07:37 +11:00
6d21970aa0 Eevee: Diffuse Lights (1 / 2)
I added srgb tonemapping for previewing purpose. Also since the color buffer is still not HDR, there is ugly artifacts (fixed in part2)
2017-03-28 00:09:45 +02:00
4d3d10f625 New Outline: Fix warning. 2017-03-28 00:06:14 +02:00
21d0f71963 New Outline: Fix ATI compile error. 2017-03-28 00:05:41 +02:00
5ce120b865 Fix columns with fixed width 2017-03-28 00:07:31 +03:00
6a5e92c022 Cleanup: Use upper case consistently in adaptive feature compile logging. 2017-03-27 22:52:33 +02:00
7a65f9b171 Cleanup: Resolve todo in CUDA voxel image code. 2017-03-27 22:36:26 +02:00
0df33cc52d Cycles UI: Avoid abreviation for Hair Extension.
Since 2.5x we should try to avoid such abreviations in the UI, except for common terms like Min / Max as much as possible.
2017-03-27 21:59:29 +02:00
0cfc557c5d Cycles: Move Shadow Catcher UI option next to Ray Visibility.
Previously it was beneath the Performance UI label, which was incorrect. It's better suited next to Ray Visibility.
2017-03-27 21:51:56 +02:00
6435983876 New Outline: make it countour the screen. 2017-03-27 16:36:13 +02:00
bd053ac7ba Cycles: Correct ifdef around float3 intrinsics 2017-03-27 16:13:07 +02:00
0396a15cbb New Outlines: fix upper edge 2017-03-27 14:09:55 +02:00
b33693cb44 New Grid: small modification
Fix wrong coord picked when display only one axis.
Small optimizations here and there.
2017-03-27 14:01:47 +02:00
deda6a43fc Draw Engines: Make g_data struct part of the viewport storage
This makes viewport cache construction independant from each others and will allow multithread down the road.
2017-03-27 14:01:47 +02:00
7ee41920fa Draw Manager: New debug timers
Both CPU time and GPU time are printed to spot bottlenecks.

GPU Timers works only if cache is enabled.
2017-03-27 14:01:47 +02:00
e54d8eeab2 Draw Manager: Make Viewport Data passed by the manager call. 2017-03-27 14:01:47 +02:00
Dalai Felinto
522ca18281 Keep base layer around for forward compatibility in 2.78 2017-03-27 12:53:16 +02:00
2a05292efa Correct for Py3.5 2017-03-27 21:34:21 +11:00
8d48ea0233 Cycles: Make shadow catcher an optional feature for OpenCL
Solves majority of speed regression on AMD OpenCL.
2017-03-27 10:47:14 +02:00
Hristo Gueorguiev
e07ffcbd1c Cycles: Add OpenCL support for shadow catcher feature
The title says it all actually.
2017-03-27 10:46:59 +02:00
Hristo Gueorguiev
8ada7f7397 Cycles: Remove ccl_addr_space from RNG passed to functions
Simplifies code quite a bit, making it shorter and easier to extend.
Currently no functional changes for users, but is required for the
upcoming work of shadow catcher support with OpenCL.
2017-03-27 10:46:28 +02:00
d14e39622a Cycles: First implementation of shadow catcher
It uses an idea of accumulating all possible light reachable across the
light path (without taking shadow blocked into account) and accumulating
total shaded light across the path. Dividing second figure by first one
seems to be giving good estimate of the shadow.

In fact, to my knowledge, it's something really similar to what is
happening in the denoising branch, so we are aligned here which is good.

The workflow is following:

- Create an object which matches real-life object on which shadow is
  to be catched.

- Create approximate similar material on that object.

  This is needed to make indirect light properly affecting CG objects
  in the scene.

- Mark object as Shadow Catcher in the Object properties.

Ideally, after doing that it will be possible to render the image and
simply alpha-over it on top of real footage.
2017-03-27 10:46:03 +02:00
7979bc4c51 OpenGL: remove gpuMatrixBegin3D_legacy function
It helped during the transition, but we don't need this anymore. Evolution of T49450
2017-03-27 02:06:33 -04:00
ebdff8c3b8 OpenGL: simplify initial state
Client vertex array state is deprecated, and these are the default values anyway.

No need to bind any basic shader. Let drawing code decide which shader it wants to use.

Part of T49165 (general OpenGL upgrade)
2017-03-27 01:49:25 -04:00
8f620f2e85 cleanup unused GPU includes 2017-03-27 01:45:40 -04:00
271471bbe6 OpenGL: remove matrix manip from framebuffer setup
It doesn't really belong here... Any code using framebuffers will set up its own matrices.

Part of T49450
2017-03-27 01:43:12 -04:00
b95ee78ed3 OpenGL: prepare GLSL for version 3.3
- use in/out instead of attribute/varying
- use named output instead of gl_FragColor
- use texture() instead of the multitude of older texture sampling functions

The #if __VERSION__ == 120 paths (needed on Mac) will be removed after we switch to 3.3 core profile.

Part of T49165 (general OpenGL upgrade)
2017-03-27 01:16:18 -04:00
159f56f4ab add missing matrix uniforms to material shader
My bad again! Failed to test this part of 4c08c5b192
2017-03-27 00:28:52 -04:00
2e88237ee6 fix shadow map shader input
My bad! Messed up the conversion from ftransform -- 4c08c5b192
2017-03-26 23:39:17 -04:00
5aaa643947 Cycles: Optimize shaders earlier to skip unneccessary attributes for noninteractive rendering
Before, Cycles would first sync the shader exactly as shown in the UI, then determine and sync the used attributes and later optimize the shader.
Therefore, even completely unconnected nodes would cause unneccessary attributes to be synced.

The reason for this is to avoid frequent resyncs when editing shaders interactively, but it can still be avoided for noninteractive renders - which is what this commit does.

Reviewed by: sergey

Differential Revision: https://developer.blender.org/D2285
2017-03-27 05:36:49 +02:00
086320a62e CMake: WITH_PYTHON_SECURITY=OFF was ignored
Allow auto-execution to be enabled,
also move this to user-prefs versioning code.
2017-03-27 13:02:41 +11:00
8b204831f2 OpenGL: use new matrix implementation in "Modern" viewport
This change looks small, but it switches the entire 3D viewport from legacy OpenGL functions to our own code.

Kept non-modern viewport on legacy path so we can compare easily (via the Modern Viewport checkbox).

Part of T49450
2017-03-26 21:23:55 -04:00
4c08c5b192 OpenGL: use new matrix names in GLSL
Builtin names staring with gl_ will not be available in core profile. Same with the ftransform function. New matrix API provides the same names minus the gl_ prefix.

Part of T49450
2017-03-26 21:23:55 -04:00
2a7e4c3040 OpenGL: fix & enhance new matrix lib
- init projection matrices with identity
- fix copy/paste mistake in GetProjectionMatrix3D
- add extra matrices needed by material GLSL

Working toward T49450
2017-03-26 21:23:54 -04:00
cc53c180ac GPU_shader automatically uses new matrix values
Whether used from Gawain or from traditional OpenGL draw methods.

TODO: make sure we bind matrices only once per shader change.

Part of T49450
2017-03-26 21:23:54 -04:00
a68cc0dc26 OpenGL: use old API for texture matrix
New matrix API does not support texture matrices. Not sure what the final code will look like, but this at least avoids interference with new ModelView matrix.

Marked each line with TEXTURE so they can be disregarded during searches.

Related to T49450
2017-03-26 21:23:54 -04:00
67ffad8cd2 OpenGL: remove several glMatrixMode calls
A few of these were redundant, others could be converted to new matrix API.
Part of T49450
2017-03-26 21:23:54 -04:00
356aacab6b Add back missing include 2017-03-27 09:14:40 +11:00
505b3b7328 Fix padding and align calculation for box layouts 2017-03-26 18:02:11 +03:00
2830f687aa Cleanup: line length, assignment 2017-03-26 21:52:25 +11:00
4bdb2d4885 Fix: Ignore min flag for rows that require all available width 2017-03-26 12:19:01 +03:00
fa63515c37 Fix: Use "round" instead of "floor" in snapping UI to pixels 2017-03-26 12:16:04 +03:00
001fce167a Fix: Button's label can be NULL 2017-03-26 12:04:16 +03:00
ed072e1dcd re-adds the include "BLI_math.h" to custondata
It was removed here rBd52191616b5f
2017-03-26 04:08:16 -03:00
15143a7464 Cleanup: simplify script path assignment 2017-03-26 11:31:39 +11:00
8c0682a93c PyAPI: add missing class registration 2017-03-26 11:28:16 +11:00
f8e02c75ba PyAPI: debug-python check for missing class register
Moving to manual class registration means its easier to accidentally
miss registering classes.

Now detect missing class registration
and warn when running with `--debug-python`
2017-03-26 11:28:10 +11:00
393efccb19 Fix GHOST crash on X11 with recent DPI changes on some systems. 2017-03-25 19:32:50 +01:00
59c5623372 Draw Manager: fix glitches when setting 3d cursor position by click. 2017-03-25 19:11:01 +01:00
0495e689e6 New Grid : Feature parity with old grid.
Removed infinite details and went for decreasing details with the distance instead (like the axis aligned ortho view auto sized grid).
Separate drawing of the Z axis into 2 pass (using shading group) to render ordered transparency with the main grid pass.
2017-03-25 19:11:01 +01:00
d2c94c7873 New Grid: Fix depth fighting and remove some unused variables. 2017-03-25 19:11:01 +01:00
8f4d58de4a Clay Engine: Cleanup
Remove unused code.
Fixed the amount of sample in the noise texture.
Add a small optimisation.
2017-03-25 19:11:01 +01:00
Wouter
fe3fb23697 Automatic DPI for all platforms, per monitor DPI for Windows.
For Windows 8.1 and X11 (Linux, BSD) now use the DPI specified by the operating
system, which previously only worked on macOS. For Windows this is handled per
monitor, for X11 this is based on Xft.dpi or xrandr --dpi. This should result
in appropriate font and button sizes by default in most cases.

The UI has been simplified to a single UI Scale factor relative to the automatic
DPI, instead of two DPI and Virtual Pixel Size settings. There is forward and
backwards compatibility for existing user preferences.

Reviewed By: brecht, LazyDodo

Differential Revision: https://developer.blender.org/D2539
2017-03-25 11:22:16 +01:00
86730f1f35 Remove support for py app-templates
Only zip-files make sense here.
2017-03-25 18:14:00 +11:00
f730e386eb Merge branch 'master' into blender2.8 2017-03-25 13:49:13 +11:00
edd2c556cd Quiet warnings 2017-03-25 13:48:27 +11:00
0c93bc2b63 Merge branch 'master' into blender2.8 2017-03-25 13:39:47 +11:00
7cb2974182 Cleanup: imports, indentation, long lines 2017-03-25 11:07:48 +11:00
a6f74453b6 Fix unreported: inaccuracy of interpolation of custom color layers due to float truncation
Same solution from rBd23459f51640 but now in `layerInterp_mcol`
Also a cleaning was done in the includes
2017-03-24 20:06:43 -03:00
f68145011f WM: Application Templates
This adds the ability to switch between different application-configurations
without interfering with Blender's normal operation.

This commit doesn't include any templates,
so its mostly to allow collaboration for the Blender 101 project
and other custom configurations.

Application templates can be installed & selected from the file menu.

Other details:

- The `bl_app_template_utils` module handles template activation
  (similar to `addon_utils`).
- The `bl_app_override` module is a general module
  to assist scripts overriding parts of Blender in reversible way.

See docs:
https://docs.blender.org/manual/en/dev/advanced/app_templates.html

See patch: D2565
2017-03-25 10:04:04 +11:00
a7f16c17c2 Fix various i18n ambiguous issues reported in T43295. 2017-03-24 20:02:15 +01:00
dab3865c0b Fix UI message issue, and style cleanup (!) 2017-03-24 20:02:15 +01:00
e9770adf63 Cycles: Remove obsolete variable from the TileManager 2017-03-24 19:44:05 +01:00
8e58e197fd Ашч T50995: Wrong freestyle render with new depgraph
The iossue was caused by 0371ef1/
2017-03-24 16:33:26 +01:00
5b45715f8a Cycles: Correct isfinite check used in integrator
Use fast-math friendly version of this function.

We should probably avoid unsafe fast math, but this is to be done with
real care with all the benchmarks properly done.

For now comitting much safer fix.
2017-03-24 15:39:33 +01:00
6aa972ebd4 Fix/workaround T51007: Material viewport mode crash on node with more than 64 outputs
Ideally we need to find a way to remove such a static limit here, but it's not so
trivial to implement for texture nodes. Requires some bigger system redesign there.

Just raising limit for now, which is fine for modern systems.
2017-03-24 14:36:00 +01:00
467d824f80 Fix T50238: Cycles: difference in texture position between OpenGL and Cycles render 2017-03-24 12:24:14 +01:00
e32710d2d7 Buildbot: Use proper NVCC path
In fact, we could probably remove this option all together.
2017-03-24 10:27:41 +01:00
85a5fbf2ce Cycles: Workaround incorrect SSS with CUDA toolkit 8.0.61 2017-03-24 10:08:18 +01:00
a14fb77fee Update CLERW to the latest version 2017-03-24 09:43:03 +01:00
d52191616b Fix for last fix of fix: (unsigned)char is limited to 255
setting char as value outside its range will wrap
2017-03-24 04:35:17 -03:00
178708f142 Fix of last commit. Clamp values that will be used! 2017-03-24 04:13:16 -03:00
d23459f516 Fix T51038: layerInterp_mloopcol was casting instead of rounding the interpolated RGBA channels
Casting to int truncates a floating-point number, that is, it loose the fractional part.
2017-03-24 04:06:30 -03:00
bc0b5d611c Cleanup: minor edits to path test
No need for redundant ID's and correct arg order
2017-03-24 17:48:22 +11:00
50f9fc7a53 BLI_path_util: Add BLI_path_join
There weren't any convenient ways to join multiple paths in C
that accounted for corner cases.
2017-03-24 17:40:35 +11:00
0453c807e0 Add: BKE_appdir_folder_id_ex
Allows getting the path without using a static string.
2017-03-24 10:35:58 +11:00
6a6566a7fc Cleanup: line-length 2017-03-24 10:11:01 +11:00
5d6e9f237b OpenGL: viewport background & depth buffer fixes
Untangling some of the logic in view3d_draw.
2017-03-23 16:28:20 -04:00
096602d3a8 bpy.path.display_name: strip spaces
Useful for Python module paths that can't start with numbers.
2017-03-24 06:55:44 +11:00
05b7591c62 BLI_path_util: Add string versions of SEP, ALTSEP
This allows for adding separators in string literals.
2017-03-24 05:23:03 +11:00
9af6f40e4d addon_utils: add disable_all function 2017-03-24 05:20:26 +11:00
96e1b46791 OpenGL Immediate Mode: finalize image_draw
The directive `#if 0` was ignored.

Part of T49043
2017-03-23 14:56:42 -03:00
a96110e710 Cycles: Remove old non-optimized triangle intersection function
It is unused now and if we want similar function we should use
Pluecker intersection which is same performance with SSE optimization
but which is more watertight.
2017-03-23 17:59:34 +01:00
27248c8636 Cycles: Remove unused macro 2017-03-23 17:59:02 +01:00
ba8c7d2ba1 Cycles: Use SSE-optimized version of triangle intersection for motion triangles
The title says it all actually. Gives up to 10% speedup on test scenes here
on i7-6800K.

Render times on GPU are unreliable here, but there might be some slowdown
caused by watertight nature of intersections.
2017-03-23 17:58:03 +01:00
a1348dde2e Cycles: Fix speed regression on GPU
Avoid construction of temporary array and make utility function force-inlined.
Additionally avoid calling float4_to_float3 twice.

This brings render times to the same values as before current patch series.
2017-03-23 17:45:19 +01:00
2a5d7b5b1e Cycles: Use utility function for SSS triangle intersection
This effectively de-duplicates triangle intersection logic implemented
for both regular triangle and SSS triangle.
2017-03-23 17:45:19 +01:00
a5b6742ed2 Cycles: Move watertight triangle intersection to an utility file
This way the code can be reused more easily.
2017-03-23 17:45:19 +01:00
f8a999c965 Cycles: Move triangle intersection precalc to an util file
This is a preparation work for the followup commit which wil l move
remaining parts of Woop intersection logic to an utility file.

Doing it as a separate commit to keep changes more atomic and easier
to bisect when/if needed.
2017-03-23 17:45:19 +01:00
b797a5ff78 Cycles: Cleanup, move utility function to utility file
Was an old TODO, this function is handy for some math utilities as well.
2017-03-23 17:45:19 +01:00
aa0602130b Cycles: Cleanup, code style and comments 2017-03-23 17:45:19 +01:00
1c5cceb7af Cycles: Move intersection math to own header file
There are following benefits:

- Modifying intersection algorithm will not cause so much re-compilation.
- It works around header dependency hell and allows us to use vectorization
  types much easier in there.
2017-03-23 17:45:19 +01:00
e8ff06186e Cycles: Cleanup, inline AVX register construction from kernel global data
Currently should be no functional changes, preparing for some upcoming refactor.
2017-03-23 17:45:19 +01:00
5c06ff8bb9 Cycles: Cleanup, remove unused function 2017-03-23 17:45:19 +01:00
e04970b392 Fix player stubs (tm) 2017-03-23 15:47:23 +01:00
3de5e71501 GLSL viewport: Fix shader compilation error.
Moved the global lib insertion to the draw manager instead
2017-03-23 15:07:53 +01:00
f98d9baea9 Revert own previous commit, the bug is already fixed a fiew commits before. Sorry for the noise. 2017-03-23 16:36:28 +03:00
2c78b0c71f Collada - Export: now use bind_mat and rest_mat custom properties (when the use_bind_info option is enabled and the properties exist) 2017-03-23 14:14:23 +01:00
b48ba0909a Collada - Import: now add bind_mat and rest_mat as custom properties (when the use_bind_info option is enabled) 2017-03-23 14:14:23 +01:00
476f5c473a Collada - remove no longer used functions (moved to collada_utils) 2017-03-23 14:14:23 +01:00
51d4743033 Collada - Added support for custom bind matrix (using new bind_mat custom property) 2017-03-23 14:14:22 +01:00
6cfa962986 Collada - removed TransformBase baseclass (not needed for anything) 2017-03-23 14:14:22 +01:00
7c094f6079 Collada - Added some helper functions into collada_utils, for common usage in the collada module 2017-03-23 14:14:22 +01:00
092d673689 Added new option for storing bindpose matrix, see T50412 2017-03-23 14:14:22 +01:00
339d0170d1 collada: Simplify reading Node Matrix 2017-03-23 14:14:22 +01:00
1729dd9998 collada: Make sure that bone use_conncet is set to false when connect type is not defined in Import 2017-03-23 14:14:22 +01:00
33e32c341a collada: add extern 'C' for c header includes 2017-03-23 14:14:22 +01:00
ec3989441f fix: collada - Connected bones get their tails set to wrong location when fix leaf nodes option is enabled 2017-03-23 14:14:22 +01:00
1978ac65c4 collada: use local variable to avoid repeated call of bone chain_length_calculator 2017-03-23 14:14:22 +01:00
89631485cc collada: use vector copy function instead of direct assigning 2017-03-23 14:14:22 +01:00
0b9041905f Fix (unreported) assertion in immBegin. Zerro number of points (Ctrl+LMouse without moving in node space) 2017-03-23 15:54:14 +03:00
1600b93fb8 UI: allow to extend camera as a menu
Needed for T46853
2017-03-23 20:45:02 +11:00
4f4a484b9b Cloth refactor: Remove goal springs and some other cleanup
This removes the goal springs, in favor of simply calculating the goal forces on the vertices directly. The vertices already store all the necessary data for the goal forces, thus the springs were redundant, and just defined both ends as being the same vertex.

The main advantage of removing the goal springs, is an increase in flexibility, allowing us to much more nicely do some neat dynamic stuff with the goals/pins, such as animated vertex weights. But this also has the advantage of simpler code, and a slightly reduced memory footprint.

This also removes the `f`, `dfdx` and `dfdv` fields from the `ClothSpring` struct, as that data is only used by the solver, and is re-computed on each step, and thus does not need to be stored throughout the simulation.

Reviewers: sergey

Reviewed By: sergey

Tags: #physics

Differential Revision: https://developer.blender.org/D2514
2017-03-23 03:52:46 -03:00
09ad684249 cleanup use of GPU matrix API
Take advantage of 2D functions, rotation about the X Y or Z axis, uniform scale factors.

We no longer need to call gpuMatrixBegin_legacy() before using the new API locally in functions.

related to T49450
2017-03-23 01:46:14 -04:00
c2366009c0 OpenGL: paint_cursor port to immediate mode (Part 2)
Part of T49043
2017-03-23 01:33:34 -03:00
4d82d525f8 Cycles: Fix building for some compilers 2017-03-23 00:14:48 -04:00
a63ba2739e Cleanup: remove redundant temp dir init
This is already called by wm_init_userdef, in old code
different initialization methods were used but now it's not needed.

Confusing since prefs are loaded in this function that don't initialize temp.
2017-03-23 15:05:42 +11:00
005b7bfbdc remove mention of GLU from comments
related to T49042
2017-03-22 21:33:53 -04:00
b69f0479a4 OpenGL: remove GLU option from build system
Also remove linking in glu libs.

T49042 is now done!
2017-03-22 21:33:53 -04:00
559bfd973e convert last remaining GLU calls in BGE
Focus is on getting rid of GLU. We expect UPBGE to replace current BGE.

Part of T49042
2017-03-22 21:33:53 -04:00
12b62b58e1 Cleanup: minor wm_homefile_read simplification
Logic in this function is a bit scattered,
minor changes to avoid confusion.

Also rename 'from_memory' to 'use_factory_settings'.
2017-03-23 10:42:09 +11:00
cd37248f90 OpenGL: paint_cursor port to immediate mode (Part 1)
Part of T49043
2017-03-22 19:43:06 -03:00
8abc315a23 Object Mode Engine: New grid drawing.
Move the grid drawing to the Object mode engine and implement a new infinite grid.
Everything is done but it needs better parameters to be intuitive.
2017-03-22 21:29:23 +01:00
26c140fbc8 Draw Module: Move the Global Ubo block definition to it's own file. 2017-03-22 21:29:23 +01:00
762319e911 fix redundant assignment
Thanks clang for the warning.
2017-03-22 16:26:53 -04:00
4646ecf749 OpenGL: use new API for persp & ortho projection
Still using legacy GL within the GPU library itself, but we'll be able to switch soon.

Part of T49450
2017-03-22 15:52:48 -04:00
d8b34a17ac Cleanup: remove BLI_getlastdir
Replace with BLI_path_name_at_index
2017-03-23 06:33:30 +11:00
c7a4f96f88 Pydoc: Change Wikipedia links and grammar in mathutils matrix code 2017-03-22 14:54:22 -04:00
98a0dd6888 OpenGL: load projection matrix with new API
New API does not share legacy OpenGL's concept of matrix modes.

Part of T49450
2017-03-22 14:48:47 -04:00
0c2fd1357d OpenGL: fix new projection matrix API
Now using the correct GL enum.
Part of T49450
2017-03-22 14:45:35 -04:00
2ba1868c3f Cleanup/optimization: Simplify some usages of uiItemFullO/_ptr, avoid multiple search of same op. 2017-03-22 19:42:19 +01:00
387ba87ad3 Cleanup: ignore open-blend as startup/prefs basis
No reason startup/prefs would ever be blend-file relative.
2017-03-23 05:24:05 +11:00
Dalai Felinto
505cc694b3 Layer Unittesting: pep8 2/2
Mass replacing the common code of all tests

```
echo "Fixing $1"

ed "$1" <<'EOF'
1,/Testing/d
i

from render_layer_common import *
import unittest
import os
import sys

sys.path.append(os.path.dirname(__file__))

.
w
q
EOF
```

Using line-width of 120
2017-03-22 15:27:47 +01:00
Dalai Felinto
6883a983e6 Layer Unittesting: pep8 1/2
Manual corrections, using line-width of 120
2017-03-22 15:27:20 +01:00
dc5007648c Depsgraph: Fix missing relations update tag when typing #frame
New depsgraph requires relations to be updated after drivers changes.
2017-03-22 14:44:45 +01:00
Stefan Werner
412220c8d3 Cycles: fixed warnings 2017-03-22 12:28:01 +01:00
797b1d5053 Fix T51024: Switch install_deps to set OSL_ROOT_DIR instead of CYCLES_OSL.
Path by @alekulyn, thanks.

Differential Revision: https://developer.blender.org/D2571
2017-03-22 12:05:43 +01:00
2b44db4cfc Fix/workaround T50533: Transparency shader doesn't cast shadows with curve segments
There seems to be a compiler bug of MSVC2013. The issue does not happen on Linux and
does not happen on Windows when building with MSVC2015.

Since it's reallly a pain to debug release builds with MSVC2013 the AVX2 optimization
is disabled for curve sergemnts for this compiler.
2017-03-22 11:37:23 +01:00
8563d3b254 Create correct node after image file drag&drop for Blender Render 2017-03-22 12:00:33 +03:00
d0253b2ea4 BLI_path_util: add BLI_path_name_at_index
Utility to get a file/dir in the path by index,
supporting negative indices to start from the end of the path.

Without this it wasn't straightforward to get
the a files parent directory name from a filepath.
2017-03-22 19:34:43 +11:00
253281f9d6 Fix for splash not opening centered
When the new window didn't end up using the size stored in the preferences
the splash would not be centered (even outside the screen in some cases).

Now centered popups listen for window resizing.
2017-03-22 13:53:54 +11:00
4e92ed87ac Object Mode Outline: Changed algorithm a bit.
First pass find outline pixel.
Second pass expand it by 1px in each direction.
Subsequent passes fade the occluded outlines inward.
2017-03-22 02:17:16 +01:00
c2f3ec4378 OpenGL: convert one more matrix call
Missed this earlier.
Part of T49450
2017-03-21 19:38:00 -04:00
78878a132f fix blenderplayer build
GPU lib should not depend on editor (glutil) code.
2017-03-21 19:36:29 -04:00
0a274df536 OpenGL: add gpuLoadProjectionMatrix3D function
Make an existing 4x4 matrix the current projection.
Found a need for this while converting code to new API.
Part of T49450
2017-03-21 18:10:20 -04:00
6d2aca5a96 OpenGL: convert to new matrix API (part 5)
Pretty sure source/blender is now finished, with all legacy matrix calls confined to gpu_matrix.c.

This was the easy part, but doing it first makes the next part much easier. TODO and XXX notes describe what is left.

glMatrixMode is still in place, since the new API does not share this concept of modes. Similar for glOrtho and glFrustum which I'll tackle very soon.

Part of T49450
2017-03-21 17:49:21 -04:00
7aad5cf573 OpenGL: generic inputs for new matrix API
For functions that expect a 4x4 matrix, you can pass in that, or array[16], or float*, or... Casting at each call site can get annoying, and obscures the logic.

The C11 section still needs work, but the non-C11 macros help on the system I tested on (Mac/clang).

Part of T49450
2017-03-21 17:27:17 -04:00
20d02be6b8 OpenGL: remove fdrawline & other helper functions
Finally, fdrawline is no more!

Part of T49043 & T49450
2017-03-21 16:11:55 -04:00
3bd831d1d6 OpenGL: convert to new matrix API (part 4)
Part of T49450, fixes a Push/Pop mismatch from part yesterday's 3.
2017-03-21 16:11:55 -04:00
7870bde275 Object Outline: trying something new 2017-03-21 19:29:58 +01:00
80e6638ad3 Object Mode Engine: Support for active color. 2017-03-21 17:47:49 +01:00
a0f16e12a0 Cycles: Use more friendly GPU device name for AMD cards
For example, for RX480 you'll no longer see "Ellesmere" but will see
"AMD Radeon RX 480 Graphics" which makes more sense and allows to easily
distinguish which exact card it is when having multiple different cards
of Ellesmere codenames (i.e. RX480 and WX7100) in the same machine.
2017-03-21 12:01:11 +01:00
7780a108b3 Cycles: Simplify some extra OpenCL query code 2017-03-21 12:01:03 +01:00
a41240439b Update CLEW to latest version
Needed to get access to some AMD extensions.
2017-03-21 12:01:03 +01:00
fceb1d0781 Cycles: Cleanup, add some utility functions to shorten access to low level API
Should be no functional changes.
2017-03-21 12:01:03 +01:00
d409c48310 OpenGL: convert to new matrix API (part 3)
Part of T49450
2017-03-21 02:51:02 -04:00
8fe9e94a52 OpenGL: remove 'circ' helper function
This was no longer being used.
Part of T49043
2017-03-21 02:27:58 -04:00
4a01ff278d fix use-before-init error + local cleanup
"path" was being used uninitialized. Thanks for the warning, clang!
2017-03-21 01:41:48 -04:00
bef63acbd6 remove gpuMatrixUpdate_legacy function
No longer needed since 231b5d96bb tracks dirty state of legacy matrix stacks.

Part of T49450
2017-03-21 01:36:51 -04:00
54bed786a6 OpenGL: convert to new matrix API (part 2 of x)
Part of T49450

For this batch I focused on usage of gpuMatrixUpdate_legacy.
2017-03-21 01:32:25 -04:00
231b5d96bb track dirty state of legacy matrix API
This is used to send latest matrix values to shader when drawing.

Previously handled by calling OpenGL matrix functions, followed by gpuMatrixUpdate_legacy. With this change that function is no longer needed.

Part of T49450
2017-03-21 00:25:47 -04:00
0c47923fca OpenGL: remove older matrix macros
Some of these were unused, the others are now handled by GPU_matrix.

Part of T49450
2017-03-21 00:11:17 -04:00
938613f720 OpenGL: convert to new matrix API (part 1 of x)
Part of T49450

For this batch I focused on usage of (now-obsolete) macros in BIF_gl.h
2017-03-21 00:09:40 -04:00
06f7fba6aa add missing gpuRotate2D function
Prototype was there, we just weren't using this yet.

Part of T49450
2017-03-21 00:08:09 -04:00
74434beb1c OpenGL: more legacy support for matrix routines
For the sake of forward progress on T49450

We can now replace legacy gl* matrix function calls with their gpu equivalents. "Inactive" in this code means we're using the legacy matrix stacks, not our own. Setting up the proper gpuMatrixBegin2D/3D/End calls can be done afterward.

Most or all of this will be removed after the transition to core profile.
2017-03-21 00:05:03 -04:00
eb1a57b12c Cycles: Fix wrong vector allocation in the mesh sync code 2017-03-21 04:30:08 +01:00
8fff6cc2f5 Cycles: Fix building of OpenCL kernels
Theres no overloading of functions in OpenCL so we can't make use of
`safe_normalize` with `float2`.
2017-03-20 22:55:52 -04:00
13d8661503 Fix T51012: Surface modifier was not working with curves
This prevented the Force Field Curve Shape of working
2017-03-20 18:51:32 -03:00
3c4df13924 Fix T50268: Cycles allows to select un supported GPUs for OpenCL 2017-03-20 15:37:27 +01:00
d544a61e8a Cycles: Update remaining time once per second without waiting for a tile change
Previously, the code would only update the status string if the main status changed.
However, the main status did not include the remaining time, and therefore it wasn't updated until the amount of rendered tiles (which is part of the main status) changed.

This commit therefore makes the BlenderSession remember the time of the last status update and forces a status update if the last one was more than a second ago.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2465
2017-03-20 15:28:36 +01:00
060243a8ae Edit Mode Engine: Remove unecessary matrix. 2017-03-20 15:19:03 +01:00
9ca0e08236 Object Mode Engine: New outline method.
We render selected meshes into another buffer and use a screen space shader to expand the color out of the mesh silouhette.

Pros: only one additionnal render pass is needed (like old outline code), and we have occluded informations.
Cons: memory usage is a problem. This method needs 2 color buffer to ping pong when expanding the outline and 1 depth buffer to test occluded fragments. This gives a 88 bits/pix memory footprint.

Idea: Since we don't need all color range but only some uniform colors (theme colors) we could manipulate only the color ID instead of the whole color this could cut the color buffer size and lower the memory footprint to 58 bits/pix.
2017-03-20 15:19:03 +01:00
fc72a2ff4b Draw module: code style, encapsulate static vars 2017-03-20 15:19:03 +01:00
a201b99c5a Fix T50975: Cycles: Light sampling threshold inadvertently clamps negative lamps 2017-03-20 14:48:55 +01:00
69a17bce1a Cleanup: remove useless glDisable(GL_LINE_STIPPLE) call.
Note that muted strips have solid border currently, marked as TODO to
add back stippled lines (if with want them back?).
2017-03-20 14:46:26 +01:00
21b361194f Merge branch 'master' into blender2.8 2017-03-20 14:37:44 +01:00
6b86b446d3 Cleanup: useless call to glRasterPos before view3d_cached_text_draw_add()
Probably some leftover from much older code?
2017-03-20 14:36:06 +01:00
18bf900b31 Fix T50990: Random black pixels in Cycles when rendering material with Multiscatter GGX 2017-03-20 12:07:41 +01:00
Dalai Felinto
a6d4ac28f5 Layers unittesting: update after doversion changes
Collections now are called "Collection 1", instead of "1"
2017-03-20 10:30:19 +01:00
Dalai Felinto
01c4e598e5 Silence unused vars warning 2017-03-20 09:50:25 +01:00
06159e6a58 Correct unintended splash on loading startup 2017-03-20 12:46:20 +11:00
dbc8b81ecf User Preferences: Split out addon and keymap free 2017-03-20 12:42:19 +11:00
eaf88f564c Remove register_module use in Cycles 2017-03-20 12:16:51 +11:00
fa11d41113 Cleanup: especially non pep8 parts of Py UI 2017-03-20 09:49:35 +11:00
3f818c7898 Merge branch 'master' into blender2.8 2017-03-20 09:32:40 +11:00
df76616d74 Usual UI/i18n message fixes.
Please provide valid description for SurfaceDeform modifier tooltip.
Such place-holders should not pass final checks before merging in master!
2017-03-19 17:31:07 +01:00
19d493ee10 Moving classes to separate listing broke panel order
Although this wasn't so obvious since it
only showed up for factory settings and in the preferences window.

Panel display order depends on registration order,
Sorry for the noise. On the bright side we no longer need to move
classes around to re-arrange panels.
2017-03-20 02:37:55 +11:00
84935998a7 Add missing classes from recent commit 2017-03-20 02:07:24 +11:00
56d3cc9341 PyAPI: ID Property tests 2017-03-19 03:57:40 +11:00
9bdda427e6 PyAPI: remove bpy.utils.register_module()
In preparation for it being removed, see: T47811
2017-03-18 20:03:24 +11:00
2fbc50e4c1 Alternate fix for T50899
object_get_derived_final shouldn't have been assuming mesh objects.

It's even valid to use a curve as a target for a shrink-wrap modifier.
2017-03-18 18:33:01 +11:00
3ceb68c833 Missing from recent commit 2017-03-18 12:33:59 +11:00
e392bb4937 PyAPI: add BPY_execute_string_as_string
Utility to execute a string and get the resulting string,
matching BPY_execute_string_as_number.

Not used just yet but generally useful function.
2017-03-18 12:19:03 +11:00
4137f30928 Object Mode: Add stencil test to remove object outlines inside the silouhette.
It also adds nice occluded silouhette information for selected objects that are behind visible objects.
This methods is really heavy because it needs to render the wires twices.
2017-03-18 01:56:34 +01:00
cddde85f2c Fix shader compilation. 2017-03-18 01:56:34 +01:00
c4644b484d GPUTexture: Add support for depth_stencil textures. 2017-03-18 01:56:34 +01:00
b7355425cd Eevee: Initial commit
Basic support for lamps. Only diffuse.
2017-03-18 01:56:34 +01:00
8cad48df28 Draw Manager: Created a general fullscreen shader. 2017-03-18 01:56:34 +01:00
d863b5182e Cleanup: use return args last and 'r_' prefix. 2017-03-18 09:39:36 +11:00
cf62424e47 Gawain: remove PER_THREAD macro
This attempt at TLS was leftover from an earlier prototype. It never worked with Blender's build system, and was defined to just exist, not to actually do anything.
2017-03-17 14:14:22 -04:00
Julian Eisel
2977a8cd21 Add tabs as standard button types
NOTE: This is really a backend-only implementation, nothing is changed in the UI

Adds a tab button-type and the basic drawing and handling code for it.
More work needs to be done on it, but idea is to get in ready for usage in the
topbar.

Differential Revision: https://developer.blender.org/D1371
2017-03-17 17:10:05 +01:00
Julian Eisel
a96008f3aa Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
2017-03-17 15:38:45 +01:00
9d873fc3de Various icon adjustments 2017-03-17 16:57:53 +03:00
ea3d7a7f58 Fix T50968: Cycles crashes when image datablock points to a directory
See more details about root of the cause there:

  https://github.com/OpenImageIO/oiio/pull/1640
2017-03-17 14:47:12 +01:00
Dalai Felinto
4b190e312f Remote unecessary call to ces_type->callback 2017-03-17 12:12:41 +01:00
d6b4fb6429 Cycles: Fix mistake in previous split kernel commits
Own stupid mistake. Reported by nirved in IRC, thanks!
2017-03-17 11:55:59 +01:00
502c4be56e fix: redraw dope sheet / action editor when pose bone selection changes 2017-03-17 11:04:13 +01:00
722451e146 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/writefile.c
2017-03-17 11:00:41 +01:00
a8c7152eea Cleanup: Use proper indentation 2017-03-17 10:26:30 +01:00
a58350b07f Cycles: Cleanup, indentation 2017-03-17 10:25:37 +01:00
98b81493f3 Refactor writefile handling of data-blocks.
Instead of calling a function looping over whole list of a given ID
type, make whole loop over Main in parent function, and call functions
writing a single datablock at a time.

This design is more in line with all other places in Blender where we
handle whole content of Main (including readfile.c), and much more easy
to extend and add e.g. some generic processing of IDs before/after
writing, etc.

From user point, there should be no change at all, only difference is
that data-block types won't be saved in same order as before (.blend
file specs enforces no order here, so this is not an issue, but it could
bug some third party users using other, simplified .blend file reader maybe).

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D2510
2017-03-17 10:02:08 +01:00
e361adbca2 Cycles: Fix compilation error of LCG RNG 2017-03-17 09:58:08 +01:00
439a277aa5 Cycles: Silence strict compiler warning 2017-03-17 09:56:44 +01:00
2cae58524c Cycles: Improve memory usage of CPU split kernel by using smaller global size 2017-03-17 01:54:10 -04:00
60a344b43d Cycles: Fix handling of barriers 2017-03-17 01:54:04 -04:00
63fb57fbc6 fix blenderplayer build after moving Gawain to intern 2017-03-16 23:57:36 -04:00
c669bf126c Gawain: fix compiler warning
This function is only used when strict run-time checks are enabled.
2017-03-16 23:51:18 -04:00
4452bea2f1 move Gawain library to intern
Before now it lived in source/blender/gpu for convenience. Only a few files in the gpu module use Gawain directly.

Tested on Mac, time to push and test on Windows.

Todo: some CMake magic to make it easy to
#include "gawain/some_header.h"
from any C or H file. Main problem here is the many editors that include GPU_immediate.h which includes Gawain's immediate.h -- is there a way to avoid changing every editor's CMakeLists?
2017-03-16 23:32:35 -04:00
b27e224276 Mesh Convert: remove meaningless modifier check
Meshes w/o modifiers wouldn't have their derived mesh applied.
Check was to avoid crash but its in fact meaningless,
since the modifier might be disabled, or there may be virtual modifiers.
2017-03-17 10:10:55 +11:00
750c0dd4de Fix T50950: Converting meshes fails w/ boolean 2017-03-17 09:58:05 +11:00
d4d8da28fc Add BKE_blendfile_userdef_read_from_memory
Needed to read user-preferences from in-memory startup.blend

Also skip data-blocks when reading preferences.
2017-03-17 07:01:48 +11:00
b4e8dc8c82 set required MacOS version to 10.9
We could do more to simplify build files, but this is a start.
2017-03-16 15:02:55 -04:00
b2d3956e7b Add support for loading preference struct
Previously it would always load into 'U' global.
Needed for loading & merging template preferences.
2017-03-17 05:20:50 +11:00
db04980678 PyAPI: Menu.path_menu: Add path filter callback
Needed if we want to filter based on filenames (not just extension).
2017-03-17 05:20:50 +11:00
f7793bd53c Correct reading missing property 2017-03-17 05:20:50 +11:00
Julian Eisel
7eecc2e1c4 Fix T50958: template_ID_preview is crashing the blender's UI from branch 2.8
So apparently ID pointer is allowed to be NULL here.
2017-03-16 18:54:11 +01:00
e2df9ab386 Merge branch 'master' into blender2.8 2017-03-16 17:28:04 +01:00
1f65ab606b Fix missing undo pushes in outliner's new datablock management operations.
Not sure why I did not put those from start... Actually *not* having an
undo point here can be problematic, since undoing some previous action
was trying to restore from bad pointer (I think) in UI, generating
asserts.

Note however that it's not a 'pure' undo, in that you may not find your
linked data in exact same state as before deleting it, after an undo,
since it actually implies *reloading* the deleted libraries (and not
restoring from a previously stored memory dump).

Reported by @sergey, thanks.
2017-03-16 17:05:48 +01:00
fa9bd04483 Fix outliner contextual menu allowing to delete indirect libraries.
There is no way currently to prevent the option from showing in menu, so
instead report a warning to user (and curse again current nightmarish
system of operation in outliner...).

Reported by @sergey, thanks.
2017-03-16 17:05:48 +01:00
fc61cdf142 Merge branch 'master' into blender2.8 2017-03-16 15:42:49 +01:00
0434053f13 Depsgraph: Fixed crash with curve bevel indirect dupligroups
Need to expand all object's dupli-groups, not only the dupli-groups
of objects directly linked to the scene.
2017-03-16 15:35:21 +01:00
68e58f1991 Depsgraph: Use string and vector in the DEG namespace only 2017-03-16 15:35:21 +01:00
6d8875bd61 Depsgraph: Don't use explicit values in runtime only enum
Lower risk of forgetting to update some values here.
2017-03-16 15:35:21 +01:00
c4e07dd29b Cleanup: differentiate startup/prefs in home-file reading 2017-03-17 00:42:13 +11:00
aad9dd2f1b Support passing in UserDef for free function
Needed so we can load and free non-global user preferences.
2017-03-17 00:18:20 +11:00
dd3ae7bad7 OpenGL immediate mode: image_draw.c: Draw Sample Line with new imm mode
part of T49043
2017-03-16 10:15:01 -03:00
1cad64900e Cycles: Define ccl_local variables in kernel functions
Declaring ccl_local in a device function is not supported
by certain compilers.
2017-03-16 11:27:17 +01:00
1ff753baa4 Cycles: Workaround for compilation error caused by passing KernelGlobals
Pass globals as a bare pointer, same as it sued to be prior to split kernel rework.

AMD CPU platform and Intel OpenCL were complaining about this.

Perhaps we shouldn't pass globals as pointer at all, this isn't something what is
really portable and can cause issues on 32 bit perhaps.
2017-03-16 11:27:17 +01:00
26620f3f87 Cycles: Avoid some ccl_local in various kernels 2017-03-16 11:27:17 +01:00
4833a71621 Cycles: Adjust global size for OpenCL CPU devices to make them faster 2017-03-16 06:11:42 -04:00
d68a84d1d2 Fix BGE building.
When you use typedef'ed enum, you need to define all supported values
explicitely in enum, else compiler goes grumpy...
2017-03-16 10:30:02 +01:00
dd7b60c638 Adds missing immUnbindProgram() in image_draw
This was interruping the execution of the code (To test: Just left click on the UV editing window to read the pixel)
2017-03-16 01:13:18 -03:00
0fc4cf7637 OpenGL: draw navmesh with new imm mode
This is an old stash. Part of DerivedMesh so the whole thing might be removed soon.

part of T49043
2017-03-16 00:05:05 -04:00
0895550d24 OpenGL: more new imm mode for image_draw
plus some minor cleanup

part of T49043
2017-03-15 16:53:45 -04:00
c5f97dfe59 Gawain: bypass strict error checking for release builds
Now that we're almost done with T49043, let's run immediate mode at full speed. Debug builds will still do strict checks.

Developers should still test their changes before committing! Recommended:
$ make debug (or make lite debug)
$ blender --debug-gpu
2017-03-15 16:53:45 -04:00
Julian Eisel
0d0d68d39d Outliner: Don't show master collection itself in "Master Collection Tree"
It would always be the only highest-level element in the tree, without
serving a real purpose. Even collapsing it wouldn't make much sense.
2017-03-15 21:48:18 +01:00
Julian Eisel
a449214854 Outliner: Rename "All Collections" display mode to "Master Collection Tree"
Also don't show alphabetical sorting option for "Active Render Layer" mode.
2017-03-15 20:50:35 +01:00
375ede0f3f Comments: wmOperator.cancel & modal 2017-03-16 06:39:09 +11:00
Julian Eisel
209d4d6993 Merge branch 'master' into blender2.8
Needed for compile fix.
2017-03-15 20:28:23 +01:00
68496c0b38 Missed BGE in recent commit 2017-03-16 06:28:20 +11:00
Julian Eisel
7f596d39df Outliner: Change default display mode to "Active Layer"
We concluded this is going to be the display mode users will need to work
with the most, so makes sense to make it the default one.
Also, if the opened file only has one collection in the active render
layer, we expand it (almost empty list would be misleading).

What I had to do to make the expanding work is a bit ugly, but didn't
find a better way. During do_version we don't have access to the
TreeElement instances, and including ED_outliner.h to share code here
should be avoided too.
2017-03-15 20:14:26 +01:00
104a03beed Merge branch 'master' into blender2.8 2017-03-16 04:53:07 +11:00
c832354e33 Load user-preferences before startup file
Internal change needed for template support.
Loading the user preferences first so it's possible
for preferences to control startup behavior.

In general it's useful to load preferences before data-files,
so we know security settings for eg.
2017-03-16 04:02:24 +11:00
fce0ff0a31 OpenGL: remove non-GLSL option from basic shader
This code path was only used when Blender was launched with --enable-legacy-basic-shader at the command line.

Part of general OpenGL upgrade (T49165)
2017-03-15 11:53:48 -04:00
Julian Eisel
8892c7869e Fix "search for unknown operator 'WM_OT_window_duplicate'" warning
Mistake in rB7bc76f8a3c1416.
2017-03-15 16:03:01 +01:00
c44cdd5905 Cycles: Allow rendering a range of resumable chunks
The range is controlled using the following command line arguments:

  --cycles-resumable-start-chunk
  --cycles-resumable-end-chunk

Those are 1-based index of range for rendering.
2017-03-15 16:00:01 +01:00
c5dba540d7 Cycles: Use argument parser for resumable render feature
Currently there is no functional changes, but we will be adding
couple more of options here soon.
2017-03-15 16:00:01 +01:00
Dalai Felinto
81dc8dd42a Fix bug on Blender version string
Reported by Pablo Vazquez (venomgfx) over irc.
2017-03-15 15:42:01 +01:00
19b3b11c64 Immediate Mode: Fix text color in iuage info line 2017-03-15 15:04:41 +01:00
e016a29ba0 Blender 2.8: Always prefer Occlusion Queries when using AUTO selection mode
GL_SELECT is really slow in this branch and will be removed.

For now we simply change AUTO behavior to avoid possible conflicts with merges
and upcoming color-id-based selection.
2017-03-15 14:55:46 +01:00
6b720dffc9 Merge branch 'master' into blender2.8 2017-03-15 14:19:53 +01:00
6d71169478 De-duplictae fix for lasso with Dalai
Git silently merged our both fixes together. Sure thing it's double safe this way, but cmon.
2017-03-15 14:18:37 +01:00
Dalai Felinto
d78b1147be Layers: handle doversion naming differently
Talked with Pablo Vazquez (venomgfx) and Julian Eisel (Severin), and we came up with this solution instead.

Basically, if the file has only one layer, it is converted to a collection named "Default Collection". Otherwise we name the collections: "Collection 1 [converted from 2.75]"
2017-03-15 14:12:52 +01:00
Dalai Felinto
c6c85a8c6b Move Blender version string handling to its own function
Planning to use this util function in 2.8 for doversioning (to communicate converted layers)
2017-03-15 14:10:20 +01:00
c10fbc002b Correct assert failure in debug mode with lasso select
Just do early output and don't bother with any GLSL program bind when
there is not enough points of lasso to draw.

This could have happened at the very beginning of the stroke.
2017-03-15 14:04:03 +01:00
Dalai Felinto
c16796089c Remove commented out code from transform_snap.c
Code was commented out in 2012 and it was not working even then. So it makes for an impossible conversion to the new gawain API.
2017-03-15 13:57:52 +01:00
Dalai Felinto
32d90220c2 Remove commented out code from reeb.c
Code was commented out in 2009
2017-03-15 13:57:52 +01:00
Dalai Felinto
f274332bb3 Remove commented out code from pbvh.c
Code was commented out in 2009
2017-03-15 13:57:52 +01:00
Dalai Felinto
6d8a25920d Remove commented out code from editarmature_sketch.c
Code was commented out in 2010
2017-03-15 13:57:52 +01:00
Dalai Felinto
9f366aee3b Immediate Mode: update drawnode.c commented out debug code
It works fine if you uncomment it, it shows a bigger circle around the re-route element, with a different color based on the selection state
2017-03-15 13:57:52 +01:00
Dalai Felinto
e00f52aeab Fix crash on node editor when using lasso to remove nodes connections 2017-03-15 13:57:52 +01:00
Dalai Felinto
279bcd8492 Remove unused code from drawnode.c
The code in question was marked as /* not used in 2.5x yet */.
2017-03-15 13:57:52 +01:00
Dalai Felinto
c72d319b47 Immediate Mode: remove commented out code from drawgpencil.c
Some of this was "tagged" for removal by Dec 2016.
2017-03-15 13:57:52 +01:00
d4b3068f36 Use FTOCHAR rather than CLAMP of uchar output
This makes no sense to clamp after value was assigned to uchar already.
Proper way to do so is to use FTOCHAR.
2017-03-15 13:50:41 +01:00
407f8eed7d OpenGL: Converted gpu_compositing.c to use batches. 2017-03-15 13:17:49 +01:00
79f94674fb Merge branch 'master' into blender2.8 2017-03-15 12:48:48 +01:00
af1d9ecd40 Fix strict compiler warning in the previous commit 2017-03-15 12:48:07 +01:00
9ad252d157 Fix T50938: Cache not being reset when changing simulation settings with new depsgraph
The thing i'm really starting to hate is the requirement to specify both
operation code and node type. Seems to be duplicated enums without real
need for that.
2017-03-15 11:10:42 +01:00
6a5487e021 BGE: Fix blenderplayer stub.
Add dummy definition of WM_operator_is_repeat.
2017-03-14 21:17:40 +00:00
1d5ba269c1 Merge branch 'master' into blender2.8 2017-03-15 06:04:52 +11:00
f13c729b26 WM: free operators when repeating
Needed since the active operator isn't ensured to be the last.
2017-03-15 05:37:42 +11:00
647fb6ef1e fix D2552: Collada - Follow up change to complete the fix in rBda6cd7762810 (use unique id for bones with same name in different armatures) 2017-03-14 19:31:25 +01:00
4877c9362a Collada simplify: avoid duplicate negation in boolean 2017-03-14 19:31:25 +01:00
76ec329dd1 WM: add Operator.is_repeat() check for C & Py
This addresses an issue raised by D2453 -
that there was no way to check if operators are run
multiple times in a row.

Actions are still ignored that don't cause an UNDO event.
2017-03-15 03:57:01 +11:00
1208792adb WM: store operators with undo flag
This is needed so we can tell if operators are executed repeatedly.
2017-03-15 03:57:01 +11:00
582f9ddeb7 Update path_menu for recent API change 2017-03-15 03:57:01 +11:00
5ba51de84a Cycles: Cleanup, indentation 2017-03-14 16:54:16 +01:00
43f7d5643f Fix T50926: python crashes with path containing utf8 characters.
Default text encoding is platform-dependent in python, and windows
usually do not use utf-8 as default...
2017-03-14 16:04:45 +01:00
Jon Allee
da6cd77628 fix D2552: Collada - use unique id for bones with same name but in different armatures. Co-authored-by: Gaia <gaia.clary@machiniamtrix.org> 2017-03-14 14:35:51 +01:00
f3ff03b3c1 CLNor: rework threaded computation.
Was using some threaded queue on top of task pool, tssk...

Now using properly task pool directly to crunch chunks of smooth fans.

No noticable changes in speed.

Tried to completely get rid of the 'no threading with few loops' code,
but even just creating/freeing the task pool, without actually pushing
any task, is enough to make code 50% slower in worst case scenario (i.e.
few thousands of simple cube objects).
2017-03-14 12:54:57 +01:00
284701e371 CLNor code: use averaged debug timing. 2017-03-14 12:54:57 +01:00
1410ea0478 Fix T50876: Cycles Crash - Cycles crashes before sampling when certain meshes have autosmooth enabled.
The root of the issue was in custom normal code, so far it assumed that
we could only have one cyclic smooth fan around each vertex, which is...
blatantly wrong (again, the two cones sharing same vertex tip e.g.).

This required a rather deep change in how smooth fans/clnor spaces are processed,
took me some time to find a 'good' solution.

Note that new code is slightly slower than previous one (maybe about 5%),
not much to be done here, am afraid.

Tested against all older report files I could find, seems OK.
2017-03-14 12:54:57 +01:00
521133682c Fix own mistake in recent 'edge split' refactor.
We do can have some vertices to split, while not having any edge (think
about two cones sharing the same tip vertex e.g.).
2017-03-14 12:54:57 +01:00
8dd0355c21 Cycles: Try to avoid infinite loops by catching invalid ray states 2017-03-14 06:22:57 -04:00
0ee1cdab7e WM: Option to load startup w/o closing the splash
Not user visible, needed for switching templates.
2017-03-14 21:05:00 +11:00
4c5374d46a PyAPI: extend Menu.path_menu
- Add optional 'display_name' callback
  so callers can construct own names.
- Add optional 'prop_filepath' argument
  (for operators that don't use "filepath").
- Add doc-string.
- Use keyword only arguments.
2017-03-14 21:00:55 +11:00
0f13f5a683 CMake: add missing headers 2017-03-14 18:47:26 +11:00
91837cd5b0 Cleanup: warnings 2017-03-14 18:40:23 +11:00
810982a95c Fix T50932: depth picking w/ pose-bone constraints 2017-03-14 18:02:27 +11:00
3ee0723b7d fix warnings from previous commit
Batch struct initializer needed more {{braces}}
2017-03-14 01:41:09 -04:00
225e3a6857 Gawain: multiple VertexBuffers per Batch
So we can store (for example) vertex positions in one buffer and normals + colors in another buffer. Not super exciting right now, but very useful once we start changing some attribute values.

Supports future work by Clément et al. Only tested with one VBO per Batch since that's all our current code uses.
2017-03-14 01:38:42 -04:00
9bf0b246ac OpenGL: remove deprecated calls
glMaterial
glColorMaterial
glPixelTransfer

and glEnable/Disable for
GL_FOG, GL_LIGHTING, GL_COLOR_MATERIAL

All of these were just setting default values, so I don't expect any visible change.

Part of T49165 (general OpenGL upgrade)
2017-03-14 00:44:38 -04:00
ac276e1541 fix "Modern Viewport" regression
GPU_viewport_bind & unbind should be called as pairs. A recent commit -- 3b91989a09 -- called unbind only for some code paths, overflowing OpenGL's matrix & attrib stacks.
2017-03-13 16:10:10 -04:00
b4157dedb0 OpenGL: remove packed imm mode functions from Python API
These are from the ARB_vertex_type_2_10_10_10_rev extension that became part of OpenGL 3.3.

So they are new, but only exist for compatibility with immediate mode, which is old.

Related to T49165 (general OpenGL upgrade)
2017-03-13 14:08:03 -04:00
0e40f1bac4 OpenGL: remove GLU functions from Python API
Part of T49042
2017-03-13 14:08:03 -04:00
Dalai Felinto
ddedcf7ada Outliner/layer: fix users trying to drop a collection into itself (recursion hell) 2017-03-13 17:38:37 +01:00
76acaefdd7 Cycles: Cleanup, wipe obviously outdated parts of split kernel comments 2017-03-13 17:16:16 +01:00
0c72008592 fix msvc warnings about unknown opencl pragmas 2017-03-13 10:08:14 -06:00
aa36c73c33 Cycles: Add missing header in the file 2017-03-13 16:59:09 +01:00
2b3cc24388 Fix T50920: Adds missing edges on return of bisect operator 2017-03-13 09:22:11 -03:00
ecce1fabca Mode Engines: Fix MSVC compilation error. 2017-03-13 11:39:41 +01:00
Hristo Gueorguiev
f169ff8b88 Fix T50925: Add AO approximation to split kernel 2017-03-13 11:15:58 +01:00
Dalai Felinto
7bc76f8a3c New Window Operator (to replace Duplicate Window)
A user doesn't want to necessarily create a new Screen only because she
wants a new window.

This patch allows the user to pick the screen to use for the new Window.
If the screen picked is the active one, it duplicates it (as the old
behaviour in Blender).

Patch with contributions and fixes by Julian Eisel (Severin)

Subscribers: venomgfx

Differential Revision: https://developer.blender.org/D2555
2017-03-13 10:45:15 +01:00
8794a43b68 Cycles: Make MESA compiler more happy
While this compiler is not officially supported yet, getting it to work is
a nice thing because more and more AMD cards will fall under MESA driver.

It's also nice to use explicit comparison with NULL, which makes it more
clear whether variable is a boolean or pointer. Even Rust enforces this!

Patch by Ian Bruce with own modifications.
2017-03-13 09:57:25 +01:00
4dacda58f9 Merge branch 'master' into blender2.8 2017-03-13 07:51:10 +11:00
e8021f5e3b UI: expose mesh conversion in apply menu
The mesh convert operator can 'freeze' a mesh
(WYSIWYG, modifiers, shape keys etc).
However its not very obvious that the way to perform this
operation is to convert a mesh to a mesh.

Expose this as 'Visual Geometry to Mesh' in the 'Apply' menu,
since this is where users might expect to see it.
2017-03-13 07:33:24 +11:00
10404e3e56 Comments: minor clarification 2017-03-13 07:18:28 +11:00
6d3d2b15cb Clay Engine: Fix missing grid 2017-03-12 21:16:19 +01:00
9c6b9e889c Clay Engine: Mode engine templates.
Standard Engine layout easy to extend.

Note that most of the work will also happen in mesh_render.c to create geometry batches.
2017-03-12 21:16:03 +01:00
b759d3c9c5 fix T50923: Inconsistent default values and wrong order of parameters in api call 2017-03-12 20:31:51 +01:00
18ed060bc3 Fix T50930 Typo in 'jpeg2k_codec' description 2017-03-12 13:56:25 -04:00
6521307dcd BMesh: rename cryptic functions
Use expanded names for bmesh primitive operations
(urmv jvke semv jfke).

Use 'bmesh_kernel_' prefix,
these functions aren't intended for wide use so favor readability.

Remove BM_face_vert_separate,
it wasn't used and only skipped step of finding correct loop of face.
2017-03-13 04:39:20 +11:00
f28376d8d9 Cleanup: style 2017-03-13 04:39:20 +11:00
Julian Eisel
8ca11f5b72 UI: Always open enum-search popups with empty search string
It might be useful to keep the search string stored in some cases, but
in most it's not useful but confusing. Especially if the string is taken
from a menu showing a different enum.
2017-03-12 18:14:43 +01:00
3f94836922 Fix T50788: blender startup crash on macOS with some types of volumes available. 2017-03-12 18:03:15 +01:00
68ca973f7f Fix T50628: gray out cycles device menu when no device configured only for GPU Compute. 2017-03-12 18:00:17 +01:00
40532b9c3b OpenGL: Convert drawobject.c (cont)
All remaining 28 deprecated calls are derivedMesh related.
2017-03-11 21:09:15 +01:00
76015f98ae Fix icon alignment for pie buttons 2017-03-11 22:34:09 +03:00
acd4fc3b7a OpenGL: Convert drawobject.c (cont)
Edit Particle mode.
2017-03-11 17:15:40 +01:00
e29e63c0ba OpenGL: Convert drawobject.c (cont)
Particle system (not edit mode)
2017-03-11 17:15:40 +01:00
b90a61917a OpenGL: Convert drawobject.c (cont)
This commit have a serrious perf issue when drawing nurbs (+5 times slower) but it gets rid of deprecated functions.
2017-03-11 17:15:40 +01:00
fbb1b311ea Merge branch 'master' into blender2.8 2017-03-12 03:00:06 +11:00
bcc8c04db4 Cleanup: code style & cmake 2017-03-12 02:47:53 +11:00
98045648ab Add support for Objects in Drive variable Rotational Difference
Thus it is according to the Manual
https://docs.blender.org/manual/en/dev/animation/drivers/drivers_panel.html#driver-variables
2017-03-11 10:43:23 -03:00
304315d181 BMesh: Fix BM_face_loop_separate_multi
When the loop region passed in had no loops to edge-split from,
it was assumed nothing needed to be done.

This ignored the case where loops share a vertex
without any shared edges.

Now BM_face_loop_separate_multi behaves like BM_face_loop_separate.

Fixed error where faces remained connected by verts in BM_mesh_separate_faces.
2017-03-11 23:26:44 +11:00
ce155ad2f6 Correct recent bmesh separate addition
- Was setting flag incorrectly to avoid re-use.
- Check edge has loops before accessing.
2017-03-11 23:26:13 +11:00
96868a3941 Fix T50888: Numeric overflow in split kernel state buffer size calculation
Overflow led to the state buffer being too small and the split kernel to
get stuck doing nothing forever.
2017-03-11 05:39:28 -05:00
5afe4c787f BMesh: add BM_mesh_separate_faces
Fast-path for bmesh split operator which duplicates and deletes.
Use when only separating faces, currently used by the intersect tool.
2017-03-11 20:50:32 +11:00
5be8adf8c0 Makefile: set tab width=4 2017-03-11 20:48:12 +11:00
f667593b6a Fix text and icon positioning issue on high DPI, after recent changes in 32c5f3d. 2017-03-11 04:47:22 +01:00
2d3c44389a Fix OpenCL warnings about doubles on some platforms. 2017-03-11 00:55:23 +01:00
c374e9f1f5 Breakdowner - Constrain Transform and Axis
This commit adds new features to the breakdowner, giving animators more
control over what gets interpolated by the breakdowner. Specifically:

   "Just as G R S let you move rotate scale, and then X Y Z let you do that
   in one desired axis, when using the Breakdower it would be great to be
   able to add GRS and XYZ to constrain what transform / axis is being
   breakdowned."

As requested here:
https://rightclickselect.com/p/animation/csbbbc/breakdowner-constrain-transform-and-axis


Notes:
* In addition to G/R/S, there's also B (Bendy Bone settings and C (custom properties)
* Pressing G/R/S/B/C or X/Y/Z again will turn these constraints off again
2017-03-11 11:53:45 +13:00
Julian Eisel
cdb7498f66 Cleanup: Add comment about use of ID pointer in TreeStoreElem 2017-03-10 23:29:32 +01:00
Julian Eisel
176698b2eb Fix unwanted expanding/collapsing of collections using drag & drop
Turned out to be a quite easy fix. I thought the issue was that we
couldn't identify the TreeStoreElem when (re)creating its TreeElement item
correctly, because for non-ID elements that would be index dependent (=
bad for drag & drop). Turns out that we're actually allowed to store
custom data within the TreeStoreElem, the thing is just that it gets
stored as ID pointer (highly ugly and highly misleading).
Anyway, seems to work now so I won't complain too much :)
2017-03-10 23:18:19 +01:00
Julian Eisel
736a32e7bf Ouliner drag&drop: Correct/increase margin for triggering insert into 2017-03-10 21:06:10 +01:00
Julian Eisel
fcd3bf5275 Insert into master collection when dragging above it 2017-03-10 21:01:10 +01:00
Julian Eisel
0d7dfd9f46 Outliner: Support dragging objects into different collections
Doing so will remove the object from the old collection and insert it
into the new one.
2017-03-10 20:48:39 +01:00
Julian Eisel
0210df079c Outliner drag&drop: Do generic check if no custom poll callback is defined
And quite some cleanup.
2017-03-10 18:24:14 +01:00
Dalai Felinto
e9dd97405e Layers util function to move objects around
This is required for outliner, so we can move an object from a collection into another
2017-03-10 18:13:19 +01:00
b6713dcbe5 rBa81ea408367abe2f33b351ff6dcc6b09170fd088 "object" -> "target" 2017-03-10 13:54:06 -03:00
a81ea40836 fix T50899: Even though the Shrinkwrap options hide the possibility of using a non-mesh target, you can still circumvent this... Causing Crash 2017-03-10 13:51:04 -03:00
Julian Eisel
6730202510 Improve outliner drag&drop feedback by using drop poll callbacks
This way we can ensure the overlay to indicate where the item would be
placed if it was dropped now is always at the correct place and doesn't
mislead the user.
2017-03-10 17:17:13 +01:00
103ae04fbc Correct glPixelTransfer function 2017-03-11 03:03:47 +11:00
Dalai Felinto
1100ddeaa9 Layers: fix bug in move layer collection above/below
Reported by Julian Eisel (Severin)
2017-03-10 16:48:09 +01:00
Julian Eisel
13f5bed32e Gaah, managed to undo a previous fix somehow...
Somehow undid rBc70eb873057 in rB8e303aae255.
2017-03-10 16:03:50 +01:00
Julian Eisel
989632417b Draw drag&drop feedback overlays with element indentation
That way users can see better at which hierarchy level the element will
be inserted into.
2017-03-10 15:58:08 +01:00
Julian Eisel
08cde7c785 Fix incorrect positioning of collection when dropping it after expanded one 2017-03-10 15:56:41 +01:00
15eb83c8b3 Fix T50900: Text-Blocks created from "Edit Source" have zero users. 2017-03-10 15:43:33 +01:00
9d6acc34a1 Fix useless allocation of edge_vectors in threaded case of loop split generation. 2017-03-10 15:43:33 +01:00
59fd21296a Cycles: Cleanup, extra semicolon and space 2017-03-10 15:38:30 +01:00
Julian Eisel
8e303aae25 Support drag & drop of collections across multiple hierarchy levels
Two issues are remaining, they'll be fixed separately:
* Graphical feedback when dragging within the master collection is wrong
* There's some bug where collections swap places instead, Dalai will investigate
2017-03-10 15:24:53 +01:00
b3bb4a6936 Fix lamp draw setting color without checking if its needed 2017-03-11 00:48:56 +11:00
Julian Eisel
c70eb87305 Fix issues in outliner collection reordering function 2017-03-10 13:59:03 +01:00
17b3097205 Adjust kmi header 2017-03-10 15:10:40 +03:00
6038583909 Cleanup: struct flags for select picking 2017-03-10 21:47:43 +11:00
3dbb560331 Cleanup: rename drawObjectSelect
After adding draw_object_select, noticed a similar name.
Rename drawObjectSelect to draw_object_selected_outline.
2017-03-10 21:27:33 +11:00
12e681909f Fix T47690: Connected PET w/ individual origins
- Connectivity length was overwritten by distance to closest selected.
- Vertices used the 'island' center of the closest vertex,
  even if it wasn't connected.

Now optionally keep track of the original index of used as the closest
connected distance.

To support this needed to add optional support for islands of 1 vertex.
2017-03-10 20:27:23 +11:00
4a2cde3f0e Cycles: Enable SSS and volumes for CUDA and Nvidia OpenCL split kernel 2017-03-10 02:09:41 -05:00
17689f8bb6 Fix T50904: Imprecise timeline frame selection using mouse
The changes introduced in rB3e628eefa9f55fac7b0faaec4fd4392c2de6b20e
made the non-subframe frame change behaviour less intuitive, by always
truncating downwards, instead of rounding to the nearest frame instead.
This made the UI a lot less forgiving of pointing precision errors
(for example, as a result of hand shake, or using a tablet on a highres scren)

This commit restores the old behaviour in this case only (subframe inspection
isn't affected by these changes)
2017-03-10 15:07:17 +13:00
6a8cb92404 OpenGL: Convert drawobject.c (cont)
- drawDispListwire_ex()
- removed primitive check in Batch_init()
2017-03-10 01:53:57 +01:00
e37538b472 OpenGL: Convert drawobject.c (cont)
removed draw_box
2017-03-10 00:28:00 +01:00
85fa1403f4 OpenGL: Convert drawobject.c (cont)
-Softbody matrix
-EditCurve/NURBS
2017-03-09 22:10:48 +01:00
6ce1d71914 OpenGL: Convert drawobject.c (cont)
Remove drawcircball
Convert texturespace, editfont, metaball (except for displist usage)
2017-03-09 22:10:48 +01:00
55a56a31a0 Merge branch 'master' into blender2.8
Manually merged viewport xray changes
2017-03-10 06:58:29 +11:00
711ac90481 Merge branch 'master' into blender2.8 2017-03-10 06:11:50 +11:00
Dalai Felinto
4c746bb3b0 Immediate Mode: Updated commented out code from textview.c 2017-03-09 19:21:08 +01:00
Dalai Felinto
aca29bcc65 Immediate Mode: Fix text color for Info and Console editors
Bug introduced in rB4b365064cfbd
2017-03-09 19:20:31 +01:00
62cc226101 3D View: x-ray support for depth picking
Selection loop would draw the selection ignoring xray.
Now draw in a separate pass after clearing the depth buffer,
as with regular drawing.

Also disable depth sorting,
caller can sort the hit-list by depth if needed.
2017-03-10 05:00:49 +11:00
Dalai Felinto
01b2071c14 Immediate Mode: Fix crash on text editor when going over suggestion list 2017-03-09 18:12:38 +01:00
Dalai Felinto
51737a2c8c Immediate Mode: text_draw.c 2/2
Tackle the remaining parts of the code, mainly the commented out
function `draw_documentation`.
2017-03-09 18:02:25 +01:00
Dalai Felinto
fc53c6f953 Immediate Mode: text_draw.c 1/2
Note 1: renamed draw_cursor to draw_text_decoration, since it was drawing
cursor, margin, selection and line highlight

Note 2: commented out code update coming next

Part of T49043
2017-03-09 18:01:56 +01:00
Dalai Felinto
8a6d055f37 Merge remote-tracking branch 'origin/master' into blender2.8 2017-03-09 17:10:06 +01:00
Hristo Gueorguiev
9de9f25b24 Cycles: add single program debug option for split kernel
Single program generally compiles kernels faster (2-3 times), loads faster,
takes less drive space (2-3 times), and reduces the number of cached kernels.
2017-03-09 17:09:37 +01:00
Hristo Gueorguiev
06c051363b Cycles: split kernel_shadow_blocked to AO & DL parts
Reduces memory allocation for split kernel.

This allows for faster rendering due to bigger global size,
specially when GPU memory is limited.

Perfromance results:

                         R9 290 total render time
                        Before    After   Change
BMW                      4:37      4:34   -1.1 %
Classroom               14:43     14:30   -1.5 %
Fishy Cat               11:20     11:04   -2.4 %
Koro                    12:11     12:04   -1.0 %
Pabellon Barcelona      22:01     20:44   -5.8 %
Pabellon Barcelona(*)   15:32     15:09   -2.5 %

(*) without glossy connected to volume
2017-03-09 17:09:37 +01:00
Hristo Gueorguiev
e8b5a5bf5b Cycles: Speedup transparent shadows in split kernel
This commit enables record-all transparent shadows rays.

Perfromance results:

               R9 290 render time (without synchronization), seconds
                        Before    After   Change
BMW                      261.5    262.5   +0.4 %
Classroom                869.6    867.3   -0.3 %
Fishy Cat                657.4    639.8   -2.7 %
Koro                    1909.8    692.8  -63.7 %
Pabellon Barcelona      1633.3   1238.0  -24.2 %
Pabellon Barcelona(*)   1158.1    903.8  -22.0 %

(*) without glossy connected to volume
2017-03-09 17:09:37 +01:00
Hristo Gueorguiev
57e26627c4 Cycles: SSS and Volume rendering in split kernel
Decoupled ray marching is not supported yet.

Transparent shadows are always enabled for volume rendering.

Changes in kernel/bvh and kernel/geom are from Sergey.
This simiplifies code significantly, and prepares it for
record-all transparent shadow function in split kernel.
2017-03-09 17:09:37 +01:00
Dalai Felinto
6c942db30d Remove (ifdef) draw_documentation from text_draw.c
This was no longer supported.
2017-03-09 17:02:35 +01:00
Dalai Felinto
528cb8877f Building 2.8 again after warning cleanup (696ed6d3ca) 2017-03-09 12:08:44 +01:00
88e8e7a074 3D View: wrap GPU_select cache calls
Avoids including GPU_select and makes it more clear that the cache is
needed for view3d_opengl_select calls.

Also use typed enum for select mode.
2017-03-09 20:47:37 +11:00
b40a4f66b2 Merge branch 'master' into blender2.8 2017-03-09 16:47:31 +11:00
696ed6d3ca Cleanup: warnings 2017-03-09 16:44:11 +11:00
a68c631cf8 Merge branch 'master' into blender2.8 2017-03-09 16:41:33 +11:00
8d98362710 OpenGL immediate mode: graph_draw.c
This also fixes a little bug, which caused `draw_fcurve_samples` to
never be called, and thus sampled curve range boundaries were not drawn.

Part of T49043
2017-03-09 01:00:59 -03:00
2a62ec8003 OpenGL: drawobject.c (cont) 2017-03-09 03:21:42 +01:00
49ef1a25b8 Edit Mesh overlay: Ported Display Normals option 2017-03-09 01:30:26 +01:00
4b31f1e591 Edit Mesh overlay: remove sizeNormal from ubo. 2017-03-09 01:30:26 +01:00
3b91989a09 Draw Manager: structural change
All engines are now called by the draw manager. Engines are separate entities that cannot interfer with each others.
Also separated draw_mode_pass.c into the mode engines.
2017-03-09 01:30:26 +01:00
Dalai Felinto
d9f42e5fab Layers: move LayerCollection
This is to be used from the Outliner, when dragging and dropping
collections from the Active Render Layer

It also includes a cleanup on the outliner so it calls the new
functions. Note: the outliner still needs fix to allow all the
functionality here exposed.

But this will be tackled by Julian Eisel later.
2017-03-08 23:35:54 +01:00
Dalai Felinto
3a1748146b Layers: move SceneCollection
This is to be used from the Outliner, when dragging and dropping.
It does not include moving LayerCollection (from Active Render Layer)
2017-03-08 23:35:54 +01:00
Dalai Felinto
9b2877ad88 New util function: BLI_listbases_swaplinks 2017-03-08 23:35:54 +01:00
4ab322fdd2 3D View: use cache for armature select 2017-03-09 09:25:33 +11:00
c837bd5ea5 Cycles: Fix CUDA build error for some compilers
Needed to include `util_types.h` before using `uint`.
2017-03-08 16:44:43 -05:00
45b764e95b 3D View: new nethod of opengl selection
Intended to replace legacy GL_SELECT, without the limitations of
sample queries which can't access depth information.

This commit adds VIEW3D_SELECT_PICK_NEAREST and VIEW3D_SELECT_PICK_ALL
which access the depth buffers to detect whats under the pointer,
so initial selection is always the closest item.

The performance of this method depends a lot on the OpenGL
implementations glReadPixels.

Since reading depth can be slow, buffers are cached for object picking
so selecting re-uses depth data, performing 1 draw instead of 3
(for 24, 18, 10 px regions, picking with many items under the pointer).

Occlusion queries draw twice when picking nearest,
so worst case 6x draw calls per selection.

Even with these improvements occlusion queries is faster on AMD hardware.

Depth selection is disabled by default, toggle option under select method.
May enable by default if this works well on different hardware.

Reviewed as D2543
2017-03-09 06:22:02 +11:00
817e975dee Fix T50849: Transparent background produces artifacts in this compositing setup
The issue was caused by sometimes negative color returned by the filter node.

Seems to be caused by precision issues. Don't see any reason why we would want
negative colors in output. Those only causing issues later on.
2017-03-08 15:56:50 +01:00
a42a0b5ef3 OpenGl: Converted more of drawobject.c 2017-03-08 15:03:03 +01:00
97c4c2689f Cycles: Make it more obvious message which initialization failed 2017-03-08 13:57:21 +01:00
05dfe9c318 Fix T49603: Blender/Cycles 2.78 CUDA error on Jetson-TX1~
Patch by Bruno d'Arcangeli (@arcangeli), thanks!
2017-03-08 13:38:01 +01:00
c24d045a23 OpenGL Select: integer rect for passing region 2017-03-08 23:23:39 +11:00
9af0c8b00a Cleanup: replace short -> int for selection hits 2017-03-08 23:23:39 +11:00
6f3f891c58 Rename BLI_rct*_init_pt_size -> radius 2017-03-08 23:23:39 +11:00
75cb4850f0 Cycles: Use 1-based line number for #line directives
AMD CPU platform was complaining about #line 0 directives in the code.
2017-03-08 12:45:18 +01:00
ecfbfe478b Cycles: Log which device kernels are being loaded for 2017-03-08 12:33:51 +01:00
Dalai Felinto
04a391c2f8 Outliner fix: prevent segfault when there is no active layer collection 2017-03-08 11:27:11 +01:00
712f7c3640 Cycles: Make it possible to access KernelGlobals from split data initialization function 2017-03-08 11:02:54 +01:00
ef7c36f5ed Cycles: Cleanup, remove residue of previous split kernel data
This is all in split data state array.
2017-03-08 10:26:29 +01:00
a095611eb8 Fix T50886: Blender crashes on render
Was a mistake in one of the previous TLS commits.

See comment in the pool_create to see some details why it was crashing.
2017-03-08 09:41:38 +01:00
3505be8361 update theme back to black re: T50869 2017-03-08 18:31:24 +11:00
64751552f7 Cycles: Fix indentation 2017-03-08 01:31:32 -05:00
fe7cc94dfa Cycles: Fix strict warning about unused variable 2017-03-08 01:31:32 -05:00
306034790f Cycles: Calculate size of split state buffer kernel side
By calculating the size of the state buffer in the kernel rather than the host
less code is needed and the size actually reflects the requested features.

Will also be a little faster in some cases because of larger global work size.
2017-03-08 01:31:30 -05:00
997e345bd2 Cycles: Fix crash after failed kernel build
Pointers to kernels were uninitialized leading to freeing of random memory
addresses. Another reason it would be good to use smart pointers.
2017-03-08 01:31:09 -05:00
18e50927f7 Cycles: Faster building of split kernel
Simple change to make it so that only kernels that have been modified are
rebuilt. Might only be useful during development.
2017-03-08 01:31:09 -05:00
223f45818e Cycles: Initialize rng_state for split kernel
Because the split kernel can render multiple samples in parallel it is
necessary to have everything initialized before rendering of any samples
begins. The code that normally handles initialization of
`rng_state` (`kernel_path_trace_setup()`) only does so for the first sample,
which was causing artifacts in the split kernel due to uninitialized
`rng_state` for some samples.

Note that because the split kernel can render samples in parallel this
means that the split kernel is incompatible with the LCG.
2017-03-08 01:31:09 -05:00
cd7d5669d1 Cycles: Remove sum_all_radiance kernel
This was only needed for the previous implementation of parallel samples. As
we don't have that any more it can be removed.

Real reason for removal tho is this: `per_sample_output_buffers` was being
calculated too small and artifacts resulted. The tile buffer is already
the correct size and calculating the size for `per_sample_output_buffers`
is a bit difficult with the current layout of the code. As
`per_sample_output_buffers` was only needed for `sum_all_radiance`,
removing that kernel and writing output to the tile buffer directly
fixes the artifacts.
2017-03-08 01:31:07 -05:00
4cf501b835 Cycles: Split path initialization into own kernel
This makes it easier to initialize things correctly in the data_init kernel
before they are needed by path tracing.
2017-03-08 01:30:43 -05:00
5b8f1c8d34 Cycles: Seperate kernel loading time from render time 2017-03-08 01:24:55 -05:00
b78e543af9 Cycles: Add names to buffer allocations
This is to help debug and track memory usage for generic buffers. We
have similar for textures already since those require a name, but for
buffers the name is only for debugging proposes.
2017-03-08 01:24:55 -05:00
817873cc83 Cycles: CUDA implementation of split kernel 2017-03-08 01:24:53 -05:00
0892352bfe Cycles: CPU implementation of split kernel 2017-03-08 00:52:41 -05:00
352ee7c3ef Cycles: Remove ccl_fetch and SOA 2017-03-08 00:52:41 -05:00
a87766416f Cycles: Report device maximum allocation and detected global size 2017-03-08 00:52:41 -05:00
365a4239c5 Cycles: Workaround for driver hangs
Simple workaround for some issues we've been having with AMD drivers hanging
and rendering systems unresponsive. Unfortunately this makes things a bit
slower, but its better than having to do hard reboots. Will be removed when
drivers have been fixed.

Define CYCLES_DISABLE_DRIVER_WORKAROUNDS to disable for testing purposes.
2017-03-08 00:52:41 -05:00
230c00d872 Cycles: OpenCL split kernel refactor
This does a few things at once:

- Refactors host side split kernel logic into a new device
  agnostic class `DeviceSplitKernel`.
- Removes tile splitting, a new work pool implementation takes its place and
  allows as many threads as will fit in memory regardless of tile size, which
  can give performance gains.
- Refactors split state buffers into one buffer, as well as reduces the
  number of arguments passed to kernels. Means there's less code to deal
  with overall.
- Moves kernel logic out of OpenCL kernel files so they can later be used by
  other device types.
- Replaced OpenCL specific APIs with new generic versions
- Tiles can now be seen updating during rendering
2017-03-08 00:52:41 -05:00
520b53364c Cycles: Add OpenCL kernel for zeroing memory buffers
Transferring memory to the device was very slow and there's really no
need when only zeroing a buffer.
2017-03-08 00:52:41 -05:00
dfd6055eb0 Cycles: Add more atomic operations 2017-03-08 00:52:41 -05:00
bc652766e8 Cycles: Expose passes size to device tasks
This is needed so devices can know the size of a tile buffer before any
tiles are acquired.
2017-03-08 00:52:41 -05:00
0f56f7a811 Cycles: Allow device_memory to be used directly
This is useful for when theres no host side memory attched to the buffer
2017-03-08 00:52:41 -05:00
1345d29806 OpenGL: convert editarmarture_sketch to new imm mode
Part of T49043, T49042

Reviewers: fclem, merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2548
2017-03-07 22:14:27 -05:00
696bb47c6e OpenGL: Converted bit more of drawobject.c. 2017-03-07 18:10:55 +01:00
9e566b06e3 Task scheduler: Add concept of suspended pools
Suspended pools allows to push huge amount of initial tasks
without any threading synchronization and hence overhead.

This gives ~50% speedup of cached rigid body with file from
T50027 and seems to have no negative affect in other scenes
here.
2017-03-07 17:32:01 +01:00
347410a322 Depsgraph: Remove workarounds from depsgraph for keeping threads alive
This is something what should be done in the task scheduler instead
with local thread queues so we handle this in a single place.
2017-03-07 17:32:01 +01:00
55c2cd85f0 Task scheduler: Initial implementation of local tasks queues
The idea is to allow some amount of tasks to be pushed from working
thread to it's local queue, so we can acquire some work without doing
whole mutex lock.

This should allow us to remove some hacks from depsgraph which was
added there to keep threads alive.
2017-03-07 17:32:01 +01:00
2f722f1a49 Task scheduler: Use real pthread's TLS to access active thread's data
This allows us to avoid TLS stored in pool which gives us advantage of
using pre-allocated tasks pool for the pools created from non-main thread.

Even on systems with slow pthread TLS it should not be a problem because
we access it once at a pool construction time. If we want to use this more
often (for example, to get rid of push_from_thread) we'll have to do much
more accurate benchmark.
2017-03-07 17:32:01 +01:00
a07ad02156 Task scheduler: Refactor the way we store thread-spedific data
Basically move all thread-specific data (currently it's only task
memory pool) from a dedicated array of taskScheduler to TaskThread.
This way we can add more thread-specific data in the future with
less of a hassle.
2017-03-07 17:32:01 +01:00
9522f8acf0 Task scheduler: Remove per-pool threads limit
This feature was adding extra complexity to task scheduling
which required yet extra variables to be worried about to be
modified in atomic manner, which resulted in following issues:

- More complex code to maintain, which increases risks of
  something going wrong when we modify the code.

- Extra barriers and/or locks during task scheduling, which
  causes extra threading overhead.

- Unable to use some other implementation (such as TBB) even for
  the comparison tests.

Notes about other changes.

There are two places where we really had to use that limit.

One of them is the single threaded dependency graph. This will
now construct a single-threaded scheduler at evaluation time.
This shouldn't be a problem because it only happens when using
debugging command line arguments and the code simply don't
run in regular Blender operation.

The code seems a bit duplicated here across old and new
depsgraph, but think it's OK since the old depsgraph is already
gone in 2.8 branch and i don't see where else we might want
to use such a single-threaded scheduler.

When/if we'll want to do so, we can move it to a centralized
single-threaded scheduler in threads.c.

OpenGL render was a bit more tricky to port, but basically we
are using conditional variables to wait background thread to
do all the job.
2017-03-07 17:32:01 +01:00
35d78121f0 Fix typo in command line arg list 2017-03-07 09:07:58 -05:00
Julian Eisel
af076031d6 Update keymap presets for recent transform manipulator changes
Part of T50565.
2017-03-07 11:54:40 +01:00
Julian Eisel
ca796f872e Once more T50565: Allow using planar constraints for scale manipulator 2017-03-07 11:23:07 +01:00
76ae10f580 OpenGL immediate mode: finish outliner_draw.c
Part of T49043
2017-03-07 01:44:04 -03:00
78d9a0a563 OpenGL immediate mode: finish file_draw.c
Part of T49043
2017-03-07 01:44:04 -03:00
def4ffd1c5 OpenGL immediate mode: finish node_draw.c
Part of T49043
2017-03-07 01:44:04 -03:00
583373f049 OpenGL: Object bound drawing. 2017-03-06 20:57:16 +01:00
517db46b34 OpenGL: A little bit of drawobject() 2017-03-06 20:57:16 +01:00
aa44b77129 Fix T50841: Scene object iterator did not get data from LinkData for the master collection
Debug session with Dalai Felinto.
2017-03-06 17:56:19 +01:00
15fa806160 Rigid body: fix viewport not updating on properties change. 2017-03-06 16:25:47 +01:00
f1c764fd8f Fix width calculation for split layouts 2017-03-06 16:35:56 +03:00
0e995e0bfe Cycles: Fix strict -Wpedantic warnings with GCC
Patch by Stefan Werner, thanks!
2017-03-06 14:18:26 +01:00
Julian Eisel
a5cba9aab9 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_nla/nla_draw.c
	source/blender/editors/space_view3d/view3d_draw.c
2017-03-06 13:00:46 +01:00
b498db06eb Task scheduler: Cleanup, use BLI_assert() instead of assert() 2017-03-06 11:33:27 +01:00
3623f32b48 FFmpeg: Update for the deprecated API in 3.2.x
Should be no functional changes.
2017-03-06 10:34:57 +01:00
355ad008a2 Surface Deform Modifier: Respect object transforms at bind time
This slightly changes SDef behavior, by now respecting object transforms
at bind time, thus not requiring the objects to be aligned in their
respective local spaces, but instead using world space.
2017-03-06 03:43:26 -03:00
dc9a7f861f Edit Mode overlay: Optimisation
Don't generate more verts than we need if we don't render vertex.
Getting a big boost from 12fps to 20fps on my test scene
2017-03-06 04:07:54 +01:00
d4e7288af9 Edit Mode overlay: Update cache on selection 2017-03-06 03:58:08 +01:00
Julian Eisel
80444effc6 Multi-View: Map cursor coordinates to visual coordinates
When rendering multi-view in side-by-side or top-bottom mode, we squash
the UI to half of its size and draw it twice on screen. That means the
cursor coordinates used for UI interaction don't match what's visible on
screen.
This commit is a little event system hack (tm) to fix this. It has some
small glitches with cursor grabbing, but nothing to bad.
We'll also use it for viewport HMD support.

D1350, thanks for the feedback @dfelinto!
2017-03-06 01:32:35 +01:00
33c093ef70 Clay Engine: Fix shader linking issue 2017-03-05 20:29:21 +01:00
b36f93fa37 Clay Engine: support draw callbacks 2017-03-05 18:10:08 +01:00
ff96f527fd Edit Mode overlay: fix clear color, and possibly a crash. 2017-03-05 18:10:08 +01:00
747ac66800 Clay Engine: More Lamp drawing work 2017-03-05 18:10:08 +01:00
45b42d3fb7 Clay Engine: Make panels compatible with the new engine 2017-03-05 18:10:08 +01:00
608b96c49b Clay Engine: camera drawing 2017-03-05 18:10:08 +01:00
e72af060ab CMake: confine WIN32 options 2017-03-06 04:05:00 +11:00
5f98cd6360 Cleanup: typos 2017-03-05 23:36:49 +11:00
a461216885 BMesh: Add 'cut' separate mode for intersect tool
It was only possible to separate all geometry from an intersection or none.

Made this into an enum with a 3rd option to 'Cut', (now default)
which keeps each side of the intersection separate
without splitting faces in half.
2017-03-05 23:36:46 +11:00
3caeb51d7f Fix T50855: Intersect (knife) w/o separate doesn't select 2017-03-05 22:28:16 +11:00
f75b52eca1 Fix T50843: Pitched Audio renders incorrectly in VSE
There was a bug in the intended code behaviour to always seek with a
pitch of 1.0 regardless of pitch/pitch animation/doppler effects.

Check the bug report for a more detailed explanation of problems
concerning pitch and seeking.
2017-03-05 12:19:32 +01:00
4a4d71414e BLI_rect: add init from point functions
Initialize a rectangle from point+size.
2017-03-05 20:51:23 +11:00
76c9f1a649 OpenGL: remove fdrawcheckerboard
This helper function was marked DEPRECATED since it uses old OpenGL calls.

Switched last 2 uses to imm_draw_checker_box, which does the same thing, only awesome.

Part of T49043
2017-03-04 01:49:07 -05:00
2089a17f7e Fix T50838: Surface Deform DM use after free issue
Implementd fix suggested by @sergey in T50838.
2017-03-04 03:16:50 -03:00
6b9d73e8a7 Cleanup: expose struct for ED_view3d_mats_rv3d_* 2017-03-04 13:32:40 +11:00
a514fea932 OpenGL: remove old DrawPixels util functions
a little bit of T49043, mostly related to T49165

Thx to @fclem for marking these as unused & making shader-based replacements.
2017-03-03 18:18:21 -05:00
87d5f670a0 OpenGL: remove glaDrawBorderCorners
This helper function was marked DEPRECATED since it uses old OpenGL calls.

Part of T49043
2017-03-03 17:55:41 -05:00
0215b3e957 OpenGL: draw image render info with new imm mode (part 1)
Part of T49043

This was the last use of glaDrawBorderCorners.

Plenty more to do in this file, I'll keep working on it...
2017-03-03 17:53:53 -05:00
af1635eeb0 OpenGL: remove stipple pattern defines
GPU_basic_shader handles this internally; no other code depends on it.
2017-03-03 17:36:17 -05:00
29683d623c OpenGL: remove glutil_draw_*_arc (lined, filled)
These helper functions were marked DEPRECATED since they use old OpenGL calls. Now they are marked GONE!

Part of T49043
2017-03-03 17:23:35 -05:00
053589da7d OpenGL: paint_draw_cursor with new imm mode
Part of T49043.

This was the last use of glutil_draw_lined_arc.

Plenty more to do in this file, I'll keep working on it...
2017-03-03 17:21:34 -05:00
3fdffc1e95 Gawain: fix for MSVC 2013
<stddef.h> defines offsetof. For some reason MSVC 2015 does not need this. Mystery!
2017-03-03 14:50:35 -05:00
3381cf98cb OpenGL: remove fdrawbox, sdrawbox, sdrawline
These helper functions were marked DEPRECATED since they use old OpenGL calls. Now they are marked GONE!

Part of T49043
2017-03-03 13:26:43 -05:00
6999e82693 OpenGL: remove last uses of fdrawbox
Part of T49043
2017-03-03 13:22:16 -05:00
b3a4b61a3b OpenGL: remove last uses of sdrawline & sdrawbox
Part of T49043
2017-03-03 13:12:49 -05:00
7b92b64742 Fix own previous commit, sorry about that :( 2017-03-03 17:23:22 +01:00
2e8398c095 Get rid of BLI_task_pool_stop().
Comments said that function was supposed to 'stop worker threads', but
it absolutely did not do anything like that, was merely wiping out TODO
queue of tasks from given pool (kind of subset of what
`BLI_task_pool_cancel()` does).

Misleading, and currently useless, we can always add it back if we need
it some day, but for now we try to simplify that area.
2017-03-03 17:16:39 +01:00
18c2a44333 Fix ugly mistake in BLI_task - freeing while some tasks are still being processed.
Freeing pool was calling `BLI_task_pool_stop()`, which only clears
pool's tasks that are in TODO queue, whithout ensuring no more tasks
from that pool are being processed in worker threads.

This could lead to use-after-free random (and seldom) crashes.

Now use instead `BLI_task_pool_cancel()`, which does waits for all tasks
being processed to finish, before returning.
2017-03-03 17:12:03 +01:00
5f05dac28f Update comment which was remained in an old place 2017-03-03 16:36:21 +01:00
17cf423f30 Cleanup: Indentation 2017-03-03 15:53:55 +01:00
0c5b197447 Edit Mesh overlay: remove one extra buffer. 2017-03-03 13:51:59 +01:00
91ce13e90d Fix T50842: NLA Influence Curve draws out of bounds when it exceeds the 0-1 range 2017-03-04 01:24:21 +13:00
Julian Eisel
2a82162618 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/armature/pose_select.c
	source/blender/editors/include/ED_armature.h
2017-03-03 12:55:35 +01:00
c0d0ef142f Cleanup: GPU_select never took NULL rect 2017-03-03 22:24:08 +11:00
25de610876 Cleanup: redundant header, use const, short -> bool 2017-03-03 22:24:08 +11:00
cdfae957f2 When creating texture/image in Texture Paint mode, both datablocks should get the same name
The paint slot name was not the same as what is displayed on the texture properties panel.
Instead, the slot type (e.g. "Diffuse Color") was used as the name.

Patch by Suchaaver (@minifigmaster125) with minor changes from @mont29.

Reviewers: mont29, sergey

Maniphest Tasks: T50704

Differential Revision: https://developer.blender.org/D2523
2017-03-03 10:50:01 +01:00
810d7d4694 Cycles: Fix possibly uninitialized variable
Hopefully this was a reason of randomly disappearing textures in our renders.
2017-03-03 10:10:26 +01:00
Dalai Felinto
22df0b2fe2 Fix blenderplayer building (tm) 2017-03-03 10:09:42 +01:00
df88d54284 Fix T49655: Reloading library breaks proxies.
Can't say enough how much I hate those proxies... their duality (sharing
some aspects of both direct *and* indirect users) is a nightmare to handle. :(
2017-03-03 08:52:19 +01:00
8cf524cec9 plug ShaderInterface into GPUShader
Renamed existing getter/setter that only FX shaders use. We could convert FX code to use the richer new interface or leave it as is.

Removed unused GPUShader fields. ShaderInterface tracks the same information.
2017-03-02 21:46:54 -05:00
c2baf3e486 OpenGL: draw PBVH bounding box with new imm mode
It wasn't using old immediate mode, but was using
- client vertex arrays (obsolete)
- quads (obsolete)
- state attrib stack (obsolete)
- polygon mode (still allowed, but gross)
2017-03-02 21:40:13 -05:00
e0a2bd43dd Gawain: add ShaderInterface for GLSL introspection
After a GLSL program is linked we can get all its inputs & never have to ask it again.

Several uniforms are considered "built-in". Nothing special about these to OpenGL itself, they just follow conventions of our built-in shaders.

This will help the matrix API, immediate & batch drawing APIs, and allow extra error/compatibility checking.
2017-03-02 21:28:28 -05:00
85945849a9 Edit Mode overlay: backwire "ghost wireframe" with variable intensity 2017-03-03 02:53:16 +01:00
bb8a172dfb Draw Manager: Changed buffer uniform api.
Use a reference to where will the texture be instead of an index.
2017-03-03 02:53:16 +01:00
0c1c646118 clean up clay vertex shader
Clay engine only works on modern GL, so this shader doesn't need compatibility with legacy Mac GL.
2017-03-02 18:11:21 -05:00
33758c7cb8 Gawain: move PRIM types to new file, classify by geometry
PrimitiveClass will help match shaders to draw calls & detect usage errors. For example a point sprite shader only makes sense with PRIM_POINTS.

Updated other files to include new primitive.h
2017-03-02 15:07:14 -05:00
Julian Eisel
a99495d291 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/scene.c
2017-03-02 19:15:32 +01:00
Dalai Felinto
5ce6388f7c Outliner: add hooks for (yet to be implemented) layer reordering routines 2017-03-02 18:12:30 +01:00
42cb93205c Fix own stupid mistake in recent mesh 'split_faces' rework.
Was assigning new edge index to ml_prev->e, and then assigning ml_pre->e
to orig_index...
2017-03-02 17:22:03 +01:00
Julian Eisel
0322700d87 Get UI ready for using drag & drop to nest a collection into another one
Nothing happen yet when it's supposed to insert the collection into
another one, that part will be handled by @dfelinto.

See gif for demo of how it works UI wise: {F500337}

Also fixed off-by-one error in utility function.
2017-03-02 17:15:30 +01:00
Dalai Felinto
146a88dd60 Remove all instance of OBACT from particle_edit.c and related changes 2017-03-02 17:14:59 +01:00
Dalai Felinto
209021a703 Remove all instances of OBACT from drawobject.c and related changes 2017-03-02 17:09:24 +01:00
Dalai Felinto
083bc48816 Remove OBACT from rigidbody_constraint.c and remove uneeded sanity check 2017-03-02 17:09:24 +01:00
Dalai Felinto
aa845eed1e Remove tons of OBACT
There are now only referenced in:
* drawobject.c
* particle_edit.c
* space_image.c (a single case to be handled on workspace branch)
* rigidbody_constraint.c (to be handled in the following commit)
2017-03-02 17:09:24 +01:00
561d11c5e6 Edit Mesh overlay: pack normals with face centers.
Needed for face normals.
2017-03-02 15:03:40 +01:00
0b6fa1a0fb Mesh batch cache: fix memory leak 2017-03-02 14:20:36 +01:00
Julian Eisel
a78717a72d Fix duplicated 'Accurate' property for manipulator keymap item
Is already added through Transform_Properties
2017-03-02 13:39:01 +01:00
Julian Eisel
e7dc46d278 Fix weird "use_planar_constraint" button in redo panel
Issue was that the VIEW_OT_manipulator operator calls the transform
operators and passes them it's own operator properties. That means the
transform operator got properties passed that it doesn't have.
2017-03-02 13:37:42 +01:00
Dalai Felinto
7b1de2b407 Revert "Depsgraph: Add placeholder function to handle objects update"
This reverts commit 9023abbf27.
2017-03-02 13:05:17 +01:00
Dalai Felinto
4bf9a65da9 Fix mesh edit wasn't updating for new objects
The problem was that we were updating the mesh cache on
BKE_object_eval_shading, not on mesh change.
2017-03-02 12:58:30 +01:00
a83a68b9b6 Threads: Use atomics instead of spin when entering threaded malloc 2017-03-02 12:42:34 +01:00
87f8bb8d1d Fix another part of T50565: Planar constraints were always initialized to accurate transform
Now it is defined by keymap.
2017-03-02 12:18:07 +01:00
499faa8b11 Fix second part T50565: Using planar transform once makes it enabled by default
Was caused by property being saved by the operator manager.
2017-03-02 11:20:57 +01:00
Dalai Felinto
007fcfc193 Fixup for layer rename unittest (rB3baa186724) 2017-03-02 09:52:33 +01:00
Dalai Felinto
a65af5d0cf Layers unittest: isolate the depsgraph crash in individual tests
(and re-order the tests alphabetically)
2017-03-02 09:40:17 +01:00
869f2940c2 Gawain: allow use of final 2 bits of 10_10_10_2 format
Requested by @fclem
2017-03-02 03:16:02 -05:00
b463cd2ab8 Edit Mode overlay: Moved Shaders to draw modules and resolved some draw issue.
We don't want to clutter gpu_shader.c with engine specific code
Added face's center dot
Simplified loose vert shader
2017-03-02 01:08:32 +01:00
aa102283da Edit Mode overlay: Added theme color via UBO. 2017-03-02 01:08:32 +01:00
043c90fdcd Edit Mode overlay: fast navigate 2017-03-02 01:08:32 +01:00
26fc6c71c4 Edit Mode overlays: separate multiple shaders for loose edges and verts 2017-03-02 01:08:32 +01:00
856077618a Fix T50830: Wrong context when calling surfacedeform_bind
The custom poll function for surfacedeform_bind seems to have caused
issues when calling it from Python. Fixed by using the generic modifier
poll function, and setting the button to be active or not in the
Python UI code instead. (there might be a better way, but for now this
works fine)
2017-03-01 17:56:10 -03:00
Julian Eisel
3baa186724 Add tests for layer renaming
Could have an own file for each test, but this is good enough.
With great help from @dfelinto, thanks!
2017-03-01 20:14:20 +01:00
Julian Eisel
0f7a664731 Fix collection renaming not checking for unique name in entire hierarchy
Only checked for unique name in direct children of the master
collection.

Also added missing listener for outliner.
2017-03-01 20:13:40 +01:00
193827e59b Correct comment
Thanks to @dingto for noticing.
2017-03-01 14:12:03 -05:00
49c99549eb Cleanup: Use .enabled instead of .active 2017-03-01 13:06:19 -05:00
278fce1170 Fix T50565: Planar constraints don't work properly with non-Blender key configurations
The issue was introduced by 4df75e5 and seems we just need to explicitly
add new keymap item now.

There is still some difference from old behavior, which is planar transform
is using precision movement since e138cde and here i don't see nice solution
currently: the change was requested here in the studio and it's just a
conflict in picking shift key for something which is not supposed to be
accurate.

At least now it's possible to invoke planar constraint and simply unhold
shift.
2017-03-01 18:00:54 +01:00
7fcae7ba60 Task scheduler: Remove query for the pool's number of threads
Not really happy of per-pool threads limit, need to find better
approach to that. But at least it's possible to get rid of half
of the nastyness here by removing getter which was only used in
an assert statement.

That piece of code was already well-tested and this code becomes
obsolete in the new depsgraph and does no longer exists in blender
2.8 branch.
2017-03-01 18:00:54 +01:00
ecee40e919 All drop-down buttons should use the same width 2017-03-01 19:30:18 +03:00
Julian Eisel
18684e546f Outliner: Make sure collection name is unique after renaming 2017-03-01 16:34:16 +01:00
Julian Eisel
b00b9dadd8 Outliner: Support dragging object into collection
Doing this will add the object to the collection.
2017-03-01 15:35:21 +01:00
c1f43c9dc6 Cleanup: warnings 2017-03-02 00:36:33 +11:00
8901263b5f Merge branch 'master' into blender2.8 2017-03-02 00:22:13 +11:00
714e85b534 Cleanup: code-style, duplicate header 2017-03-02 00:16:36 +11:00
32c5f3d772 Fix text and icon positioning issues 2017-03-01 16:11:21 +03:00
f64df0e102 Fix error moving keyframes in graph editor after refactor base 2017-03-01 13:08:15 +01:00
f0cf15b5c6 Task scheduler: Remove counter of done tasks
This was only used for progress report, and it's wrong because:

- Pool might in theory be re-used by different tasks
- We should not make any decision based on scheduling stats

Proper way is to take care of progress by the task itself.
2017-03-01 12:45:51 +01:00
351c9239ed Cleanup: Use explicit unsigned int in atomics 2017-03-01 12:01:19 +01:00
3626521346 Base Refactor Tasks: Fix some legacy bases for dopesheet 2017-03-01 11:41:23 +01:00
e142793815 Base Refactor Tasks: Change selection flags 2017-03-01 11:31:10 +01:00
14627cc2ee Base Refactor Tasks for gpencil filter 2017-03-01 11:21:06 +01:00
Dalai Felinto
6ee70312bb Dopesheet: fix crash when dragging keyframes 2017-03-01 10:43:04 +01:00
Julian Eisel
0b0347dcca Cleanup: Rename outliner enum 2017-03-01 11:28:17 +01:00
Julian Eisel
512fb74980 Outliner: Make deleting collections from "All Collections" mode work 2017-02-28 22:18:11 +01:00
Julian Eisel
fcbae6c3b3 Outliner: Highlight active layer collection in "All Collections" mode 2017-02-28 21:58:07 +01:00
Julian Eisel
f35907444e Cleanup: Add outliner_utils.c, move functions into it 2017-02-28 21:37:15 +01:00
3176bb8346 clean up GL / GPU #includes 2017-02-28 15:30:39 -05:00
2a8dd3c5ff remove GPU_basic_shader calls from wm_gesture
Gestures are drawn with specific built-in shaders now.
2017-02-28 15:30:39 -05:00
7b1e5e8620 remove unused code from interface_icons
No longer depends on basic shader API
2017-02-28 15:30:39 -05:00
2fcdb6df10 remove unused code from uvedit_draw
Keep USE_EDBM_LOOPTRIS code paths, remove not-USE_EDBM_LOOPTRIS paths.

Discussed with @LucaRood in IRC since he worked on this file recently.
2017-02-28 15:30:39 -05:00
Julian Eisel
c0e055fa7e Outliner: Delete all selected collections, not just active one
There were some issues with how we store outliner tree elements:
Apparently the only removable elements have been data-blocks so far.
When recreating the TreeElements, their TreeStoreElem instances were
mainly identified by their ID pointer. However non-data-blocks mostly
depend on an index. For collections, such an index isn't a reliable
measure though if we want to allow removing items. Depending on it for
identifying the TreeStoreElem instance would cause some quite noticeable
glitches (wrong highlights, two elements sharing highlight, etc).

For now I've solved that by actually removing the TreeStoreElem that
represents the removed element. A little limitation of this is that
after undoing the removal, some information might get lost, like
flags to store selection, or opened/closed state.
A better solution that would also fix this issue would be having a real
unique identifier for each non-data-block element, like an idname or even
its data-pointer. Not sure if we can get those to work reliable with
file read/write though, would have to investigate...

Also added a general Outliner tree traversal utility.
2017-02-28 21:15:51 +01:00
5e889ebf19 OpenGL: no more display lists
Part of the OpenGL core profile upgrade (T49165)

Use the Batch drawing API (GPU_batch.h) when you want do draw something multiple times.
2017-02-28 13:15:11 -05:00
c1012c6c3a Cleanup: update copyright and Blender description 2017-02-28 12:04:43 -05:00
87f236cd10 Cycles: Fix division by zero in volume code which was producing -nan 2017-02-28 17:33:06 +01:00
54ed1b7324 Fix Dopesheet and Curve editor to use new bases in SceneLayer instead of old base.
(see D2538)

Thanks to dfelinto for his support.
2017-02-28 17:16:46 +01:00
7175838b61 Draw Manager: Fix ortho grid in front of overlays. 2017-02-28 15:15:34 +01:00
96d63d2232 Edit Mesh overlays: fix half cut vertices.
Artifacts still remained when 2 vertices were linedup in orthographic mode or with very acute vertex angles.

This commit fix that by adding even more geometry.
2017-02-28 15:00:16 +01:00
677f066634 Edit Mesh overlays: added looses edges and verts as triangle.
We loose a bit of memory for (more?) performance.
2017-02-28 14:31:16 +01:00
Julian Eisel
6af21b4e7f Highlight active collection in outliner 2017-02-28 14:11:15 +01:00
efe78d824e Fix/workaround T48549: Crash baking high-to-low-poly normal map in cycles
For now only prevent crash.
2017-02-28 14:08:33 +01:00
a581b65822 Fix T49936: Cycles point density get's it's bounding box from basis shape key 2017-02-28 12:41:56 +01:00
2de9bf1138 skip OpenGL debug logic on Apple
ifdef out most debugging code since Apple does not implement any debug extensions. We can revisit this if they ever do (don't expect that).

Changed output message so Mac users don't think --debug-gpu is broken.
2017-02-28 04:38:30 -05:00
811e90c957 OpenGL: enable use of AMD_debug_output
This extension is the best we have on some older supported GPU + OS combinations.

All the code was in place, just disabled.
2017-02-28 04:05:53 -05:00
08e654935c OpenGL: remove GPU_state_print function
I was removing deprecated/obsolete state from this function. About halfway through I started questioning the need for the whole thing.

GPU_state_print is not called anywhere, but is (was) available as a development aid.

External GL debugging tools are really good these days! We should use those to examine state & not roll our own.
2017-02-28 03:19:53 -05:00
6a3dd21edd OpenGL: remove obsolete GL_POINT_SMOOTH
Was only used in one place, to show the 3D mouse rotation center.
2017-02-28 03:09:44 -05:00
8a76049e84 rename built-in point shaders, SMOOTH --> AA
Updated shader names and code that uses them.

All of these shaders produce round points that are anti-aliased and blended against the background.

These were initially named SMOOTH because they replace glEnable(GL_POINT_SMOOTH). But SMOOTH in shader-land refers to vertex attribute interpolation (like glShadeModel(GL_SMOOTH)).

Using SMOOTH to mean two things is confusing, so we now use AA to mean "the point is anti-aliased".
2017-02-28 02:18:52 -05:00
e7d57628c9 OpenGL: keyframe shape fixes
- Size parameter is total size of the shape, not its radius (half size). Updated hard-coded sizes to match this.
- Shader expands size to include outline.
- Fixed fringe between outline color and transparent background.
2017-02-28 01:21:27 -05:00
6d1ac79514 Cleanup: Grey --> Gray 2017-02-27 19:33:57 -05:00
Julian Eisel
5138fe3c0a Outliner: "All Collections" mode showing the master collection hierarchy
Reordering is disabled for now. Link, unlink and override operators
are only available while in "Active Layer" mode, not in "All
Collections".
2017-02-27 22:24:59 +01:00
Julian Eisel
c24b4e0cd0 Outliner: Rename "Collections" display mode to "Active Render Layer" 2017-02-27 21:15:49 +01:00
6ab9af0083 Merge branch 'master' into blender2.8 2017-02-27 16:08:25 -03:00
Dalai Felinto
bf243752fc Immediate Mode: Lattice drawing
Part of T49043
2017-02-27 18:31:03 +01:00
Dalai Felinto
b5dd04b7e7 Immediate Mode: force fields
Part of T49043
2017-02-27 17:57:07 +01:00
4fa4132e45 Surface Deform Modifier (SDef)
Implementation of the SDef modifier, which allows meshes to be bound by
surface, thus allowing things such as cloth simulation proxies.

User documentation: https://wiki.blender.org/index.php/User:Lucarood/SurfaceDeform

Reviewers: mont29, sergey

Subscribers: Severin, dfelinto, plasmasolutions, kjym3

Differential Revision: https://developer.blender.org/D2462
2017-02-27 13:49:14 -03:00
cd5c853307 Fix memory leak when making duplicates real and parent had constraints
Thanks Bastien for help!
2017-02-27 17:46:41 +01:00
416bd1bbe8 Clay Engine: Edit Mesh overlay fix jaggy edges.
We do a strip of triangles around the triangle of interest and modify the variying vars to "trick" the fragment shader into rendering what we need.
This keeps the compatibility for both shaders.
Vertex still get half displayed when angle at the vertex is very acute.

This patch is only for the simple, no vert clipped case.

This is 2.5x slower than without the trick (on my hardware with 1million tris).
2017-02-27 17:41:35 +01:00
2342cd0a0f Fix/workaround T50677: Shrinkwrap constraint don't get updated when target mesh gets modified
Do a "full" update on leaving sculpt mode, so we are sure scene will be brought
to a consistent state.

Ideally we'll only do that when there are objects which depends on geometry
without re-calculating self geometry, but that's a bit tricky currently.
2017-02-27 16:27:53 +01:00
691ffb60b9 Similar to previous commit, but for object constraints 2017-02-27 16:19:52 +01:00
bf7006c15a Depsgraph: Shrinkwrap constraint actually depends on geometry 2017-02-27 16:00:39 +01:00
5acac13eb4 Cycles: Fix compilation error on vanilla Ubuntu 16.10
Patch by @swerner, thanks!
2017-02-27 15:22:51 +01:00
f1b21d5960 Fix T50634: Hair Primitive as Triangles + Hair shader with a texture = crash
Attributes were not resized after pushing new triangles to the mesh.
2017-02-27 15:21:14 +01:00
209a64111e Fix part of T50634: Hair Primitive as Triangles + Hair shader with a texture = crash
Wrong formula was used to calculate needed verts and tris to be reserved.
2017-02-27 15:21:14 +01:00
00ceb6d2f4 Cycles: Make it more clear values never changes by using const qualifier 2017-02-27 15:21:14 +01:00
f7d67835e9 Cleanup: typo in struct name 2017-02-28 00:38:33 +11:00
cc78690be3 Cycles: Forgot this in previous commit 2017-02-27 12:54:35 +01:00
238db604c5 Cycles: Add more logs about what's going on in shader optimization 2017-02-27 12:38:24 +01:00
845ba1a6fb Cycles: Experiment with replacing Sharp Glossy with GGX when Filter Glossy is used
The idea is to make it simpler to remove noise from scenes when some prop uses
Sharp glossy closure and causes noise in certain cases. Previously Sharp Glossy
was not affected by Filter Glossy at all, which was quite confusing.

Here is a file which demonstrates the issue: {F417797}

After applying the patch all the noise from the scene is gone.

This change also solves fireflies reported in T50700.

Reviewers: brecht, lukasstockner97

Differential Revision: https://developer.blender.org/D2416
2017-02-27 12:33:59 +01:00
Dalai Felinto
35290f5d4e Bring back border selection 2017-02-27 12:16:27 +01:00
Dalai Felinto
edba025c92 Prevent crash when copying object
ob->collection_settings is to be handled by depsgraph, but we may as well make sure things do not crash meanwhile
2017-02-27 11:18:11 +01:00
406398213c Fix missing break setting curve auto-handles 2017-02-27 13:35:03 +11:00
Julian Eisel
aff8ce438a Outliner: Don't use alphabetical sorting for collections
Order of collections matters, so sorting the outliner entries to be
alphabetical is misleading.
2017-02-26 22:34:58 +01:00
16b2005bfb Clay Engine: fix shader :/ 2017-02-26 21:33:29 +01:00
6dabcdf69e Clay Engine: Replace if() by assert() 2017-02-26 21:12:56 +01:00
712530eb93 Clay Engine: Edit mesh overlays
Based on the previous overlay shader from merwin.
This shader takes care of clipped vertex cases and do all edit mode face info in one pass (except face centers).
As the shading is done one the triangle itself the visual can't go beyond the surface of the mesh. That leads to half displayed edges on the outline of the mesh.
This problem can be fixed by a second pass.

This is work in progress.
2017-02-26 21:12:56 +01:00
Julian Eisel
fabde06b37 Fix outliner "Sort Alphabetically" having not working 2017-02-26 19:24:01 +01:00
631ecbc4ca Fix unreported bug: Ensure you have the correct array directory even after the dm->release(dm) 2017-02-26 14:16:54 -03:00
112e4de885 Improve add-on UI error message
Show the paths of the duplicate addons

D791 by @gregzaal
2017-02-27 03:57:11 +11:00
Julian Eisel
20a105d54c Fix errors in new immediate mode for interface_widgets.c
Text editing cursor, text editing selection highlights and pie menu
direction indicator weren't visible.

Caused by rB4f2375b82f72.
2017-02-26 16:53:04 +01:00
0561aa771b Cleanup: minor changes to array_store
- remove unused struct member.
- misleading variable name.
2017-02-26 15:29:09 +11:00
2724fad582 OpenGL: replace gluProject and gluUnProject, and simplify surrounding code.
Part of T49042.
2017-02-26 00:16:46 +01:00
e9011100f7 Fix compiler warnings on macOS / clang / c++11. 2017-02-26 00:16:21 +01:00
3cf2821f2f Merge branch 'master' into blender2.8 2017-02-26 00:15:59 +01:00
5c3216e233 Fix compiling after a0b8a9f 2017-02-25 14:58:08 +01:00
d66d5790e9 Fix (unreported) missing update when adding constraint from RNA. 2017-02-25 11:38:02 +01:00
94ca09e01c Fix rows with fixed last item (D2524) 2017-02-25 13:18:41 +03:00
2c4564b044 Alembic: avoid crashing when reading non-indexed UV params. 2017-02-25 07:08:42 +01:00
a0b8a9fe68 Alembic: addition of a scope timer to perform basic profiling. 2017-02-25 07:08:42 +01:00
8c5826f59a Fix T50698: Cycles baking artifacts with transparent surfaces. 2017-02-25 03:12:53 +01:00
15f1072ee2 Fix build error with macOS / clang / c++11. 2017-02-25 03:12:53 +01:00
bda0456933 OpenGL: wm_gesture uses new imm mode
D2376 by @ianwill, part of T49043
review by @merwin

Box select, circle select, etc. Introducing the dashed-line shader! See D2376 for more info.
2017-02-24 15:33:32 -05:00
caaf5f0a09 Fix T50757: Alembic, assign imported materials to the object data
instead of to the object itself.
2017-02-24 21:19:52 +01:00
9062c086b4 Fix T50676: Crash on closing while frameserver rendering.
Can't see any reason to call AUD exit early in WM_exit, that's a
low-level module that has no dependency on anything else in Blender, but
is dependency of some other parts of Blender, so it should rather be
exited late in the process!
2017-02-24 14:58:38 +01:00
1e29286c8c Cycles: Fix compilation warning with CUDA on OSX 2017-02-24 14:33:10 +01:00
f49e28bae7 Cycles: Fix non-zero exit status when rendering animation from CLI and running out of memory 2017-02-24 14:25:38 +01:00
1f453a8909 OpenColorIO: Update glsl implementation to be ready for ogl 3.3 core 2017-02-24 12:38:50 +01:00
1e7475a5d7 Opengl glaDrawPixels removal: More descriptive setup. 2017-02-24 12:38:50 +01:00
Dalai Felinto
0584c82ad7 Fix break in drawscredge_area_draw when in fullscreen 2017-02-24 11:05:52 +01:00
Dalai Felinto
2f9a0dfe64 Fix T50714: Collections: Adding object to scene without an existing collection
This was causing blender to segfault.

We now add create a new collection and link to the layer before adding
the new object

(also included unittests, and requires updated lib/tests)
2017-02-24 10:10:24 +01:00
Dalai Felinto
8261a84ffb Unittest: split object_add in individual test files
(and small cleanup in unittest)

This is required to the upcoming unittest + bugfix
2017-02-24 10:10:24 +01:00
Dalai Felinto
4c8d8da2e7 Silence warnings in draw_armature.c
Also add note about incomplete functions there
2017-02-24 10:10:24 +01:00
9dd86e2758 OpenGl immediate mode: drawnode.c
Part of T49043
2017-02-24 01:09:51 -03:00
4c6190d08f Add immDrawBorderCorners function
This replaces `glaDrawBorderCorners`.
2017-02-24 01:09:50 -03:00
c2453007f4 Opengl glaDrawPixels removal: #if 0 glDrawPixels... 2017-02-24 01:26:45 +01:00
7b744f9e1a Opengl glaDrawPixels removal: mask_draw.c 2017-02-24 01:26:45 +01:00
ab8958bbd5 Opengl glaDrawPixels removal: image_draw.c
Using float buffer is still laggy because of the data volume we have to transfer to the GC.
2017-02-24 01:26:45 +01:00
2ea5446197 Opengl glaDrawPixels removal: interface 2017-02-24 01:26:45 +01:00
ccec97ea0a Opengl glaDrawPixels removal: editors/spaces 2017-02-24 01:26:45 +01:00
c9e8584e7f Opengl glaDrawPixels removal: windowmanager 2017-02-24 01:26:45 +01:00
6628446bdf Opengl glaDrawPixels removal: editors/render 2017-02-24 01:26:45 +01:00
44ea6fb857 OpenGL: Make glaDrawImBuf_glsl functions compatible with new immDrawPixels
And change relevant function calls.
2017-02-24 01:26:45 +01:00
45711c3fde OpenGL immediate mode: new shader image shuffle color
new shader to draw an image with one isolated channel
2017-02-24 01:26:44 +01:00
071fdfbfb3 OpenGL immediate mode: fix asserts in clip dopesheet 2017-02-24 01:26:44 +01:00
e437841239 OpenGL immediate mode: modifying immDrawPixelsTex
This way OCIO can be used with it.
2017-02-24 01:26:44 +01:00
3d8f4fedd0 Clay Engine: fix format (3D instead of 2D) 2017-02-24 01:26:44 +01:00
e5799d1389 OpenGL immediate mode: gpu_framebuffer.c
I had to make some changes to the sep_gaussian_blur shader to be compliant for gl 3.3 leap
2017-02-24 01:26:44 +01:00
4c164487bc Add "Gravitation" option to "Force" type force fields
This adds an option to force fields of type "Force", which enables the
simulation of gravitational behavior (dist^-2 falloff).

Patch by @AndreasE

Reviewers: #physics, LucaRood, mont29

Reviewed By: #physics, LucaRood, mont29

Tags: #physics

Differential Revision: https://developer.blender.org/D2389
2017-02-23 19:23:39 -03:00
29859d0d5e Fix some more minor issue with updated py doc generation. 2017-02-23 22:31:21 +01:00
34c07c0d6d Fix Py API doc generation - missing new context members definition. 2017-02-23 22:27:49 +01:00
dec323659d Merge branch 'master' into blender2.8 2017-02-23 22:09:09 +01:00
c067f1d0d4 Fix stupid mistake in previous commit for release builds of API doc. 2017-02-23 22:08:01 +01:00
c7ad27fc07 Update py API doc generation tools to comply to new name scheme on server.
- for rc/release: /api/2.79c/, zip file named blender_python_reference_2.79c_release.zip
 - for dev: /api/master/, zip file named blender_python_reference_2_79_4.zip
2017-02-23 21:45:20 +01:00
6a249bb000 Usual UI messages fixes... 2017-02-23 21:10:43 +01:00
2e83814e18 OpenGl immediate mode: clip_draw.c and clip_graph_draw.c fixes
Fixed little typo in clip_draw.c and special case assert in
clip_graph_draw.c (track segments with single point).

Part of T49043
2017-02-23 16:12:08 -03:00
50328b41a7 Cycles: Fix compilation error on 32bit Linux 2017-02-23 17:30:26 +01:00
4e12113bea Cycles: Fix wrong render results with texture limit and half-float textures 2017-02-23 14:46:22 +01:00
13e075600a Cycles: Add utility function to convert float to half
handles overflow and underflow, but not NaN/inf.
2017-02-23 14:42:06 +01:00
ef60979029 Rework of BKE's mesh_render to support BMesh directly.
Note that since there is no (efficient) ways to get arrays of
MVert/MEdge/etc. out of a BMesh, I refactored quite heavily internals of
BKE_mesh_render.

Now, when you do need acess to mesh data to generate cached batches, you
create an abstract struct from mesh (either Mesh or BMesh if available),
and then use advanced helpers to extract needed data, on a per-item
basis (no more handling of arrays of verts/edges/... in batches code).

This allows to:
* Avoid having to create arrays of BMesh elements.
* Take advantage of existing advanced BMesh topology and connectivity data.

Reviewers: dfelinto, fclem, merwin

Differential Revision: https://developer.blender.org/D2521
2017-02-23 11:54:40 +01:00
9eb647f1c8 Fix T50656: Compositing node editor is empty, no nodes can be added 2017-02-23 11:23:49 +01:00
d751676cf3 Fix building full. 2017-02-23 11:03:56 +01:00
b46b2834b9 Merge branch 'master' into blender2.8 2017-02-23 10:56:28 +01:00
60592f6778 Fix T50748: Render Time incorrect when refreshing rendered preview in GPU mode 2017-02-23 10:51:06 +01:00
9dd194716b Fix T50736: Zero streaks in Glare node.
Please never, ever use same DNA var for two different things. Even worse
if they do not have same type and ranges!

This is only ensuring issues (as described in report, but also if
animating both RNA props using same DNA var... yuck).

And we were not even saving any byte in DNA, could reuse some padding
there to store the two new needed vars (yes, two, since we cannot re-use
existing one if we want to keep backward *and* forward compatibility).
2017-02-23 10:39:51 +01:00
Dalai Felinto
53a9dec2bf Silence "defined but not used" warnings 2017-02-23 10:24:59 +01:00
3b3ed19c18 OpenGl immediate mode: remove imm_draw_line
Replaced all calls to `imm_draw_line` by plain `immVertex2f` calls, and
removed `imm_draw_line`, as that function was not supposed to exist in
the first place, and causes unnecessary calls to `immBegin`/`immEnd`.

Part of T49043
2017-02-23 03:21:58 -03:00
30420845b9 OpenGl immediate mode: fix screen_draw.c
* Fix several wrong coordinates, causing things to be drawn in the wrong places.
* Remove unexpected return.
* Slight peformance improvement, by reducing number of shader binds.
* Minor code style stuff.

Part of T49043
2017-02-23 00:27:35 -03:00
Julian Eisel
7359cc1060 Fix possible crash in various 3D View operators
Was actually harmeless and not crashing, but I'd say more or less only
by luck: the NULL-check for region data would only evaluate to true for
the correct 3D View region. However, if we were to add region data to a
different region type in future, this would lead to undefined behavior
if executed in the wrong region.
2017-02-23 02:14:27 +01:00
Julian Eisel
a8d6e41bbc Fix issues when reordering nested collections
Item was inserted at the head of the top-level collection list, instead
of parent-level one.
2017-02-23 00:09:43 +01:00
43299f9465 Columns should be expandable by default 2017-02-23 00:06:54 +03:00
5e1d4714fe Fix T50745: Shape key editing on bezier objects broken with Rendered Viewport Shading
So... Curve+shapekey was even more broken than it looked, this report was
actually a nice crasher (immediate crash in an ASAN build when trying to
edit a curve shapekey with some viewport rendering enabled).

There were actually two different issues here.

I) The less critical: rB6f1493f68fe was not fully fixing issues from
T50614. More specifically, if you updated obdata from editnurb
*without* freeing editnurb afterwards, you had a 'restored' (to
original curve) editnurb, without the edited shapekey modifications
anymore. This was fixed by tweaking again `calc_shapeKeys()` behavior in
`ED_curve_editnurb_load()`.

II) The crasher: in `ED_curve_editnurb_make()`, the call to
`init_editNurb_keyIndex()` was directly storing pointers of obdata
nurbs. Since those get freed every time `ED_curve_editnurb_load()` is
executed, it easily ended up being pointers to freed memory. This was
fixed by copying those data, which implied more complex handling code
for editnurbs->keyindex, and some reshuffling of a few functions to
avoid duplicating things between editor's editcurve.c and BKE's curve.c

Note that the separation of functions between editors and BKE area for
curve could use a serious update, it's currently messy to say the least.
Then again, that area is due to rework since a long time now... :/

Finally, aligned 'for_render' curve evaluation to mesh one - now
editing a shapekey will show in rendered viewports, if it does have some
weight (exactly as with shapekeys of meshes).
2017-02-22 21:56:49 +01:00
b637db2a7a Cleanup: remove unused orig_nu from keyIndex ghash of editcurves. 2017-02-22 21:56:49 +01:00
Julian Eisel
9c106ff211 Cleanup: Style 2017-02-22 18:54:56 +01:00
efc499cb99 OpenGL immediate mode: paint_stroke.c 2017-02-22 18:20:16 +01:00
Julian Eisel
f1d59073cc Disallow renaming master collection from Outliner
Shows warning when trying to do so.
2017-02-22 17:50:10 +01:00
Julian Eisel
910b7dec8d UI: Support drag & drop reordering of collections
This adds initial support for reordering collections from the Outliner
using drag & drop.
Although drag & drop support is limited to collections for now, this
lays most foundations for general drag & drop reordering support in the
Outliner. There are some design questions to be answered though:
* Would reordering of other data types (like objects) be a purely visual change or would it affect the order in which they are stored? (Would that make a difference for the user?)
* Should/can we allow mixing of different data types? (e.g. mixing render layers with objects)
* How could we realize this technically?

Notes:
* "Sort Alphabetically" has to be disabled to use this ("View" menu).
* Reordering only works with collections on the same hierarchy level.
* Added some visual feedback that should work quite well, it's by far not a final design though: {F493806}
* Modified collection orders are stored in .blends.
* Reordering can be undone.
* Did minor cleanups here and there.
2017-02-22 17:25:00 +01:00
e003499f6f OpenGl immediate mode: uvedit_smart_stich.c
This is a quick fix. A better fix should be to store the batches inside the StitchPreviewer struct.
2017-02-22 17:22:28 +01:00
99947e2943 Use new api doc links
Differential Revision: https://developer.blender.org/D2522
2017-02-22 11:19:30 -05:00
3952349a81 OpenGl immediate mode: fix false positive (again) 2017-02-22 14:27:04 +01:00
48752d8802 OpenGL: Fix Object Axes color 2017-02-22 14:24:09 +01:00
d4f0e10cc4 OpenGl immediate mode: Fix false positive 2017-02-22 14:23:20 +01:00
eff5924c75 OpenGl immediate mode: screen_draw.c 2017-02-22 14:05:56 +01:00
75cc33fa20 Fix Cycles still saving render output when error happened
This was fixed ages ago for the interface case but not for the
command line. The thing here is that currently external engines
are relying on reports system to indicate that error happened
so suppressing reports storage in the background mode prevented
render pipeline from detecting errors happened.

This is all weak and i don't like it, but this is better than
delivering black frames from the farm.
2017-02-22 13:06:24 +01:00
cd0d335183 Clay Engine: Started Armature drawing
This should give the overall direction to whom wants to finish it.

- Renamed EDIT mode engine to EDIT_MESH mode engine
- Introduce EDIT_ARMATURE mode engine
- Started to port legacy drawarmature.c to draw_armature.c
2017-02-22 13:00:15 +01:00
48aeb0b640 Clay Engine: Renaming shader. 2017-02-22 12:50:03 +01:00
6dbc6dfc14 Clay Engine: Prepare for Armature drawing.
- Added runtime display matrices to EditBone and bPoseChannel
- Added Object space instance vertex shader and modified the simple lighting shader accordingly
2017-02-22 12:46:27 +01:00
e05d3d5d9b Clay Engine: Fix Memory Leak. 2017-02-22 12:19:10 +01:00
36c4fc1ea9 Cycles: Fix shading with autosmooth and custom normals
New logic of split_faces was leaving mesh in a proper state
from Blender's point of view, but Cycles wanted loop normals
to be "flushed" to vertex normals.

Now we do such a flush from Cycles side again, so we don't
leave bad meshes behind.

Thanks Bastien for assistance here!
2017-02-22 10:54:36 +01:00
2c30fd83f1 Cycles: Additionally report all OpenCL cflags
This way we can control exact spaces and such added to the cflags
which is crucial to troubleshoot certain drivers.
2017-02-22 10:06:02 +01:00
ae1c1cd8c0 Refactor Mesh split_faces() code to use loop normal spaces.
Finding which loop should share its vertex with which others is not easy
with regular Mesh data (mostly due to lack of advanced topology info, as
opposed with BMesh case).

Custom loop normals computing already does that - and can return 'loop
normal spaces', which among other things contain definitions of 'smooth
fans' of loops around vertices.

Using those makes it easy to find vertices (and then edges) that needs
splitting.

This commit also adds support of non-autosmooth meshes, where we want to
split out flat faces from smooth ones.
2017-02-22 09:40:46 +01:00
3622074bf7 Fix Drawing nested box layouts (D2508) 2017-02-21 21:02:56 +03:00
4e9b17da4c Cycles: Speedup by avoiding extra calculations in noise texture when unneeded
Noise texture is now faster when the color socket is unused. Potential for
speedup spotted by @nutel.

Some performance results:

                     Render Time Before    After    Difference
Gooseberry benchmark         47:51.34    45:55.57       -4%
Koro                         12:24.92    12:18.46     -0.8%
Simple cube (Color socket)      48.53       48.72     +0.3%
Simple cube (Fac socket)        48.74       32.78    -32.7%
Goethe displacement           1:21.18     1:08.47    -15.6%
Cycles brick displacement     3:02.38     2:16.76    -25.0%
Large displacement scene     23:54.12    20:09.62    -15.6%

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2513
2017-02-21 07:24:33 -05:00
34a502c16a Cleanup: use proper link to the api 2017-02-20 20:21:57 -05:00
4f2375b82f OpenGL immediate mode: interface_widgets.c
Added rgba_float_args_set_ch to BLI_math_color.h
2017-02-20 21:21:47 +01:00
5c39aad283 OpenGL immediate mode: interface_panel.c 2017-02-20 21:21:47 +01:00
696836af1d Fix T50718: Regression: Split Normals Render Problem with Cycles
The issue seems to be caused by vertex normal being re-calculated
to something else than loop normal, which also caused wrong loop
normals after re-calculation.

For now issue is solved by preserving CD_NORMAL for loops after
split_faces() is finished, so render engine can access original
proper value.
2017-02-20 11:56:02 +01:00
75ce4ebc12 Mesh faces split: Add missing vertex normal copy 2017-02-20 11:47:43 +01:00
333dc8d60f Fix T50719: Memory usage won't reset to zero while re-rendering on two video cards
Was only visible with Persistent Images option ON.
2017-02-20 11:02:19 +01:00
86d8dc12c1 Use Git submodule tracking feature
This way we can point submodules to different branches.

There are two side-effects to this:

- Git 1.8.2 becomes the minimal required version now
  to support this feature.

- Not sure how doing local changes in submodules followed
  by `make update` will behave. We don't use explicit rebase
  now.

  Perhaps this is not so bad, since it was already quite
  dangerous thing to do.
2017-02-20 10:16:58 +01:00
22119f976e Point addons to 2.8 branch 2017-02-20 10:14:25 +01:00
446625c561 Clay Engine: Use G.debug_value to test cache performance
Use debug 666 for cache without instance buffer caching.
Use debug 667 for cache with instance buffer caching.
2017-02-19 14:31:02 +01:00
c8b7e7973a OpenGL immediate mode: transform_manipulator.c 2017-02-19 14:00:21 +01:00
9f839a2ff5 OpenGL: fix MVP matrix order
Numbers were correct but names were mixed up.
2017-02-18 19:53:55 -05:00
9992e6a169 Fix a few compiler warnings with macOS / clang. 2017-02-18 23:59:34 +01:00
3f5b2e2682 Fix T50564: 3D view panning with scroll wheel inconsistent with dragging. 2017-02-18 22:41:56 +01:00
fae895125e fix OpenGL line count in VSE backdrop 2017-02-18 15:39:21 -05:00
Dalai Felinto
ab6993811f Fixup for last commit :/ 2017-02-17 22:29:53 +01:00
Dalai Felinto
b30044d4af Fix crash introduced in engine separation (50fb3ea3)
Basically DEG_OBJECT_ITER (or rather,
BKE_scene_layer_engine_settings_update) wasn't creating
Object->collection_settings data for invisible objects.

Now I'm removing those objects from the loop entirely. If we are to
bring them back we need to either create CollectionEngineSettings dat
from them or to skip them in DRW_mode_cache_populate.
2017-02-17 22:26:40 +01:00
39e212eb05 OpenGL: further mask_draw tweaks
- smooth round points
- fewer state changes
- minor cleanup & warning fix

This is a follow-up to rB84141f27a668
2017-02-17 15:42:11 -05:00
b41c5c81c6 Fix bplayer (c) 2017-02-17 20:07:13 +01:00
a54e461b84 Fix building without Clay engine. 2017-02-17 20:06:31 +01:00
322b1d3187 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/animation/anim_draw.c
2017-02-17 20:03:55 +01:00
Dalai Felinto
cb36dbe606 bug in DEG_OBJECT_ITER 2017-02-17 19:37:11 +01:00
6f1493f68f Fix T50614: Curve doesn't restore initial form after deleting all its shapekeys
Logic of handling shapekeys when entering and leaving edit mode for
curves was... utterly broken.

Was leaving actual curve data with edited shapekey applied to it.
2017-02-17 18:55:52 +01:00
Dalai Felinto
7868c0aa8b Layers: Fix unittest after 65a75e11 2017-02-17 18:27:32 +01:00
Dalai Felinto
df56721931 Layer/Outliner: add a few operators that I need for the video demo 2017-02-17 17:54:05 +01:00
Dalai Felinto
65a75e112c Layer: change default name of doversion layer (Viewport now) 2017-02-17 17:54:05 +01:00
Dalai Felinto
1ed20a692f Follow up on mode engine code separation
The settings initialization belong within the engines
2017-02-17 17:54:04 +01:00
50fb3ea3de Clay Engine: Separate mode drawing to different files/engines. 2017-02-17 17:30:15 +01:00
Dalai Felinto
9cb44cbba1 Layers: Fix visibility evalution + Unittesting
test_evaluation_visibility_a failed before, but it is now fixed
test_evaluation_visibility_b passed before and was used as control to make sure it was not broken
2017-02-17 14:08:31 +01:00
31123f09cd Remove unused functions related to distance between BoundBox and ray 2017-02-17 09:49:20 -03:00
Dalai Felinto
7884406f33 Layers: ob.visible_get()
Similar to ob.select_get(), but for BASE_VISIBLED.
2017-02-17 12:57:14 +01:00
Dalai Felinto
5a14578116 Layers: Fix crash on opening files saved in clay
Basically we were not tagging the layers and bases as dirty. As usual this will likely change once Depsgraph kicks in. But this will do for now.
2017-02-17 11:02:25 +01:00
84141f27a6 OpenGL: mask_draw uses new imm mode
Based on D2371 from @ryry. Mostly T49043, a little T49042.
Deleted some unused drawing code instead of updating it.
I have a few more things in mind for this file... tomorrow!
2017-02-17 03:23:46 -05:00
d41451a0ca Forgotten in last commit: Check the allocation 2017-02-16 23:41:38 -03:00
23e51f4734 OpenGL immediate mode: sequencer_draw.c (finished)
Converted the remaining diagonal stripes thingies...

Part of T49043
2017-02-17 00:07:16 -02:00
ff53949145 Add diagonal stripe shader (GPU_SHADER_2D_DIAG_STRIPES)
Reviewed By: merwin

Differential Revision: https://developer.blender.org/D2512
2017-02-17 00:07:16 -02:00
6c59a3b37a Do not release the arrays used in the parameters of the expanded functions of bvhutils
The release of these arrays should be the programmer's discretion since these arrays can continue to be used.

Only the expanded functions `bvhtree_from_mesh_edges_ex` and `bvhtree_from_mesh_looptri_ex` are currently being used in blender (in mesh_remap.c), and from what I could to analyze, these changes can prevent a crash.
2017-02-16 22:55:01 -03:00
7819d36d4e Make File: Print 'blender.exe' at the end of the path to run from 2017-02-16 17:08:33 -05:00
99a6bbf7dd Cleanup: Spelling, Spaces --> Tabs, Whitespace 2017-02-16 17:06:03 -05:00
077988dd44 blender2.8: New immediate mode for sculpt_uv.c
[Note: this patch functionality was implemented in parallel, independently at bf83f097ad
That said, the original patch was also removing an unnecessary include,
so here it is]

Replaced the one call to `glutil_draw_lined_arc`.
This seems to be the only draw call in this file.

Reviewers: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2497
2017-02-16 22:05:27 +01:00
cbc5388a4a Minor cleanup in sequencer_draw.c
Minor style cleanup, and also replaced manual checker drawing by a call
to `imm_draw_checker_box`.

Part of T49043
2017-02-16 18:48:37 -02:00
34d3ae9d5b OpenGL immediate mode: clip_draw.c
Part of T49043
2017-02-16 18:48:37 -02:00
b5cae50376 Add imm_draw_checker_box function
This replaces `fdrawcheckerboard` in drawing a standard gray
checkerboard for alpha backgrounds.
2017-02-16 18:48:19 -02:00
Dalai Felinto
e3dd2b1591 Doversion: merge collection engine properties
This is a more complex approach, which makes me really want to use
IDProperty instead (assuming we handle their merging nicely).

In fact I would expect this to happen in readfile.c, not during
doversion, but I can revert this later.

For now this allow for demo files saved with 2.8 to keep working even
after we add/remove engine settings properties.

The values are merged. There is no purge though, so
old CollectionEngineSettings and CollectionEngineProperty will live
forever (for the time being).
2017-02-16 20:02:35 +01:00
Dalai Felinto
6d58f1e87d Doversion: reset layer collection properties when needed
This prevents crashes when a file was saved with 2.8, but a new
engine settings property was created.

In those cases any previous collection settings are wiped out. We can do
an elegant merge soon.
2017-02-16 20:02:35 +01:00
Dalai Felinto
9f4004261e Layer: add name to mode engines 2017-02-16 20:02:35 +01:00
21eae869ad UI: Move 'relations extras' right below 'relations'
Differential Revision: https://developer.blender.org/D2218
2017-02-16 12:02:32 -05:00
306acb7dda Fix T50687: Cycles baking time estimate and progress bar doesn't work / progress when baking with high samples 2017-02-16 17:15:08 +01:00
db2a05999a Clay Engine: Fix Cursor too bold 2017-02-16 16:22:44 +01:00
b512c2a794 Clay Engine: Correct Mesh Normals 2017-02-16 16:22:44 +01:00
268670cdee Clay Engine: Fix Axis Name shader 2017-02-16 16:22:44 +01:00
Dalai Felinto
d8df7ce6a4 Outliner collection operators: linking! 2017-02-16 16:02:44 +01:00
26c8d559fe Register test for mesh.split_faces() 2017-02-16 15:36:00 +01:00
Dalai Felinto
011c8c730f Outliner collection operators, all but collection link
Note: It may be missing a notifier to prevent Outliner from crashing
when deleting collections.
2017-02-16 14:39:56 +01:00
3d63b9a88f Clay Engine: Hidden wire 2017-02-16 14:00:55 +01:00
eeeb1aa658 Clay Engine: Wire and Backface cull collection settings. 2017-02-16 14:00:55 +01:00
f5ab4bc339 Clay Engine: Fix grid not showing. 2017-02-16 14:00:55 +01:00
6468cb5f9c Faces split: Don't leave CD_NORMAL after split
This is supposed to be a temporary layer.

If someone needs loop normals after split it should explicitly
ask for that.
2017-02-16 11:00:17 +01:00
5cbaf56b26 Cyctes tests: Commit blender.git side changes 2017-02-16 10:36:22 +01:00
fc185fb1d2 CDDM Copy: Only tag data layers dirty if we ignored tessellation data
This solves assert failure in CustomData_from_bmeshpoly() happening with
broom.blend file from barber shop SVN.
2017-02-16 09:55:44 +01:00
809ed38075 Cleanup: Indentation 2017-02-16 09:16:20 +01:00
781507d2dd Freestyle: Feature edge selection by nested object groups.
A group of object groups can be formed by means of the dupli_group option in
the Object properties window.  The present revision extends the Selection by
Group option in the Freestyle Line Set so as to support not only flat object
groups but also nested groups.
2017-02-16 10:53:11 +09:00
9b3d415f6a Fix more corner cases failing in mesh faces split
Now we handle properly case with edge-fan meshes, which should
fix bad topology calculated for cash register which was causing
crashes in the studio.
2017-02-15 23:09:31 +01:00
40e5bc15e9 Fix wrong edges created by split faces
We need to first split all vertices before we can reliably
check whether edge can be reused or not.

There is still known issue happening with a edge-fan mesh
with some faces being on the same plane.
2017-02-15 21:41:25 +01:00
41e0085fd3 [Alembic] Fix msvc warning - C4138 '*/' found outside of comment 2017-02-15 12:40:41 -07:00
e22d4699cb Cycles: Cleanup, style 2017-02-15 20:33:49 +01:00
dbe23c5456 OpenGL immediate mode: sequencer_draw.c
Other than the general conversion:
* Made some slight aesthetic improvements.
** Removed gradients.
** Replaced stipples with transparency for hidden strips.
** Made strip borders less harsh.
** Removed stripes from offsets and made them brighter.
* Made only the visible parts of waveforms be drawn.
* Fixed a few drawing bugs.
** Background was not being drawn when buffer is NULL, and no
grease pencil is being drawn.
** Offset drawing ignored strip visibility.

Also, note that diagonal stripes for locked and error strips, are still
being drawn with the old api, as they await a new shader in order to
be converted.

Part of 49043
2017-02-15 17:10:19 -02:00
10d2ee6287 Remove redundant draw call (sequencer)
`SEQUENCER_OT_slip` was calling `draw_sequence_extensions` to redraw the
extensions during modal operation, but that is redundant, as it is
already called by the regular draw loop. Because it was called on top of
the draw loop, it was actually obscuring other parts of the strip that
would normally be drawn on top of it.

Somewhat part of 49043
2017-02-15 17:10:19 -02:00
Dalai Felinto
45bebbf5ad Remove "Object List" panel from collection context tab 2017-02-15 19:29:09 +01:00
Dalai Felinto
5a10c64e8c Layers: Show collection objects in Outliner 2017-02-15 19:29:09 +01:00
Dalai Felinto
a428daada0 Layers: Separate between scene render layer (F12) and context render layer (everything else)
For now they are the same. However with workspaces they will be
different, and should be treated differently.
2017-02-15 19:29:09 +01:00
883ef2c9ce Clay Engine: New collection settings (not working yet) 2017-02-15 18:54:31 +01:00
69b96e27ee Collections Settings: Added Bool type. 2017-02-15 18:18:43 +01:00
Dalai Felinto
574d6011f4 Revert "Collection Editor based on patch by Julian Eisel"
This reverts commit 3da834e83c.

We will use the outliner for this now.

I'm also moving the collections_ops.c to outliner_collections.c
2017-02-15 18:17:34 +01:00
Dalai Felinto
a47235f5fd Add note to RNA about layer/engine macros 2017-02-15 18:12:05 +01:00
13d31b1604 Fix T50542: Wrong metadata frame when using OpenGL render 2017-02-15 17:09:49 +01:00
3e628eefa9 Motion blur investigation feature
This commit adds a way to debug Cycles motion blur issues which
are usually happening due to something crazy happening in between
of frames. Biggest trouble was that artists had no clue about
what's happening in subframes before they render. This is at
least inefficient workflow when dealing with motion blur shots
with complex animation.

Now there is an option in Time Line Editor which could be found
in View -> Show Subframe. This option will expose current frame
with it's subframe to the time line editor header and it'll allow
scrubbing with a subframe precision in time line editor.

Please note that none of the tools in Blender are aware of
subframe, so they'll likely be using current integer frame still.

This is something we don't consider a bug for now, the whole
purpose for now is to give a tool for investigation. Eventually
we'll likely tweak all tools to be aware of subframe.

Hopefully now we can finish the movie here in the studio..
2017-02-15 16:19:05 +01:00
Dalai Felinto
bf83f097ad Immediate Mode: sculpt_uv.c 2017-02-15 15:52:28 +01:00
Dalai Felinto
226ba44775 Fix sculpt brush draw crash on Blender2.8
Temporary solution by Sergey Sharybin, it needs further investigation.
This should not be necessary, specially since this works fine in master.
2017-02-15 15:52:28 +01:00
efbe47f9cd Fix T50662: Auto-split affects on smooth mesh when it sohuldn't
Seems to be a precision error comparing proper floating point
normal with the one coming from short.
2017-02-15 15:21:15 +01:00
f9e4d8e93a Clay Engine: Replace Manual depth test by depth copy.
This avoid glitches due to float comparison precision.
2017-02-15 15:16:06 +01:00
fe47163a1e Cycles: Fix CUDA compilation error after recent changes 2017-02-15 15:01:08 +01:00
20283bfa0b Fix wrong loop normals left after face splitting
Let's keep all data in a consistent state, so we don't have any
issues later on.

This solves rendering artifacts mentioned in the previous commit.
2017-02-15 14:58:49 +01:00
dd79f907a7 Mesh: Re-implement face split solving issue mentioned earlier
Now new edges will be properly created between original and
new split vertices.

Now topology is correct, but shading is still not quite in
some special cases.
2017-02-15 14:49:42 +01:00
Dalai Felinto
bdd3fd64e9 Bring rendering back (update all references to SETLOPPER) 2017-02-15 14:40:56 +01:00
Dalai Felinto
c694aedcad Update SETLOOPER to account for layers
The idea is to iterator over the active layer of the current scene and
then over the active layer of the set scenes.

In the future, once we get workspace we will get the initial renderlayer
from context, while the background sets will still use their active
renderlayer.
2017-02-15 14:40:56 +01:00
310593def1 Clay Engine: Support vertex normals (smooth shading), no face normals yet. 2017-02-15 13:32:35 +01:00
8b8c0d0049 Cycles: Don't calculate primitive time if BVH motion steps are not used
Solves memory regression by the default configuration.
2017-02-15 12:59:31 +01:00
6cdc954e8c Cycles: Pass special flag whether BVH motion steps are used
Doesn't currently change anything, but would need for some future
work here.

It uses existing padding in kernel BVH structure, so there is
nothing changed memory-wise.
2017-02-15 12:45:06 +01:00
dc7bbd731a Cycles: Fix wrong hair render results when using BVH motion steps
The issue here was mainly coming from minimal pixel width feature
which is quite commonly enabled in production shots.

This feature will use some probabilistic heuristic in the curve
intersection function to check whether we need to return intersection
or not. This probability is calculated for every intersection check.
Now, when we use multiple BVH nodes for curve primitives we increase
probability of that primitive to be considered a good intersection
for us. This is similar to increasing minimal width of curve.

What is worst here is that change in the intersection probability
fully depends on exact layout of BVH, meaning probability might
change differently depending on a view angle, the way how builder
binned the primitives and such. This makes it impossible to do
simple check like dividing probability by number of BVH steps.

Other solution might have been to split BVH into fully independent
trees, but that will increase memory usage of all the static
objects in the scenes, which is also not something desirable.

For now used most simple but robust approach: store BVH primitives
time and test it in curve intersection functions. This solves the
regression, but has two downsides:

- Uses more memory.

  which isn't surprising, and ANY solution to this problem will
  use more memory.

  What we still have to do is to avoid this memory increase for
  cases when we don't use BVH motion steps.

- Reduces number of maximum available textures on pre-kepler cards.

  There is not much we can do here, hardware gets old but we need
  to move forward on more modern hardware..
2017-02-15 12:45:04 +01:00
088c6a17ba Cycles: Fix missing initialization of triangle BVH steps
Likely was harmless for Blender, but better be safe here.
2017-02-15 12:44:52 +01:00
5723aa8c02 Cycles: Fix wrong pointiness caused by precision issues 2017-02-15 12:40:13 +01:00
b36e26bbce Revert "Mesh: Solve incorrect result of mesh.split_faces()"
The change was delivering broken topology for certain cases.
The assumption that new edge only connects new vertices was
wrong.

Reverting to a commit which was giving correct render results
but was using more memory.

This reverts commit af1e48e8ab.
2017-02-15 12:40:13 +01:00
e813ebab71 Clay Engine: new draw_view.c containing all dynamic drawing routines. 2017-02-15 12:28:26 +01:00
0f7dee19ed Viewport: Ported info drawing to from legacy code. 2017-02-15 12:28:26 +01:00
b0c125bcd3 Clay Engine: draw Speaker 2017-02-15 12:28:26 +01:00
1f139beee3 Clay Engine: Added immUniform functions...
for vec3 arrays and matrix4.
2017-02-15 12:28:26 +01:00
cd472bc7de Clay Engine: Fix Grid depth write. 2017-02-15 12:28:26 +01:00
021f8d56d0 OpenGL immediate mode: Fix assert when using camera.show_sensor 2017-02-15 12:28:26 +01:00
9f03718a5b Clay Engine: drawaxis names drawn with shaders & instance 2017-02-15 12:28:26 +01:00
ee2a718763 Clay Engine: Fix empty drawing 2017-02-15 12:28:26 +01:00
Dalai Felinto
e30bc6f517 Layer Unittest: use macro for tests 2017-02-15 12:12:59 +01:00
384b7e18f1 UI: Wireframe modifier- make crease grayed out when disabled 2017-02-14 23:48:35 -05:00
402b0aa59b Comments: notes on polyfill2d, minor corrections 2017-02-15 14:17:06 +11:00
Dalai Felinto
7e3d2a8baa Sorted BaseLegacy > Base convertions
Including bring back UV Edit show other objects
2017-02-14 18:21:47 +01:00
Dalai Felinto
a76d45cf72 Layer DNA_scene_types _NEW defines, protect macro parameters 2017-02-14 18:21:47 +01:00
Dalai Felinto
1ff3d5bc9a Layer Macros: create the instance as part of the macro
Instead of pre-initializing an instance prior to the macro, we do it as part of the macro itself now.
2017-02-14 18:21:46 +01:00
Dalai Felinto
b9762fed93 Layers: Unittesting - make them granular
Some tests may break Blender, which makes the entire unittest routine to fail.
They are now I isolate the tests into individual files

Kudos to Sybren Stüvel and Sergey Sharybin for the advice.

Note: at the moment test_link.py is failing (since a41bbfb7)
2017-02-14 18:21:46 +01:00
af1e48e8ab Mesh: Solve incorrect result of mesh.split_faces()
This function was keeping original edges and was creating some
extra vertices which is not something we are really looking
forward to,
2017-02-14 17:02:22 +01:00
737a3b8a0a Mesh: Cleanup, use shorter version of loop 2017-02-14 16:27:09 +01:00
324d057b25 Mesh: Use faster calculation of previous loop 2017-02-14 16:27:09 +01:00
Dalai Felinto
6906a884ee Immediate Mode: make triangles smooth again
Instead of bothering with matrix transformations, I am simply adding the jitter to the vertices.

Related to: rB31a21135cf72c8623be7f5aee2bfdac983ceae2e
2017-02-14 14:35:18 +01:00
Dalai Felinto
c80b760d4a Immediate Mode: particle_edit.c 2017-02-14 14:27:31 +01:00
4d325693e1 BKE_boundbox_ensure_minimum_dimensions is no longer necessary
The bug T46099 no longer applies since the addition of `dist_squared_to_projected_aabb_simple`
Has also been added comments that relates to an occlusion bug with the ruler. I'll investigate this.
2017-02-14 10:25:00 -03:00
6c104f62b9 transform_snap_object: Remove do_bb parameter. It is always true 2017-02-14 09:38:20 -03:00
Dalai Felinto
31a21135cf Immediate Mode: area.c and UI_draw_icon_tri, ui_draw_anti_tria
Note: This makes the jittering to not work :/

@merwin, would you know how to use gpuMatrixBegin2D for this case? I
think it must be the reason behind the lack of jittering. But I couldn't
get it to work (the 2D shader is asking for a 3D Matrix).

Part of T49043
2017-02-14 13:02:58 +01:00
Dalai Felinto
9151f12dad Immediate Mode: animation markers 2017-02-14 11:10:51 +01:00
54102ab36e Alembic: fix naming of imported transforms.
When importing an Alembic file with grouped transforms, it would badly name the transforms, taking the name of the parent instead of its own.

Patch by @maxime.robinot

Differential Revision: https://developer.blender.org/D2507
2017-02-14 08:15:13 +01:00
1089294439 OpenGL immediate mode: Remove unecessary light shader 2017-02-14 00:49:16 +01:00
7fc632a856 OpenGL immediate mode: drawarmature.c (end)
No deprecated call left.
2017-02-14 00:35:25 +01:00
22df54acb6 OpenGL immediate mode: drawarmature.c (cont)
All (except for stick and wire) are now rendered using batch or immediate API.
Using simple front facing lighting for now, waiting for gpu_basic_shader.c to be recoded.
2017-02-14 00:35:25 +01:00
0790976b6c OpenGL immediate mode: fix inverted normal in sphere batch 2017-02-14 00:35:25 +01:00
8c09fa3be2 OpenGL immediate mode: added gpuRotate3f to GPU_matrix 2017-02-14 00:35:25 +01:00
9c35907ca2 OpenGL immediate mode: Replacement for gluCylinder 2017-02-14 00:35:25 +01:00
930186d3df Cycles: Optimize sorting of transparent intersections on CUDA 2017-02-13 18:24:45 +01:00
21dbfb7828 Cycles: Fix wrong transparent shadows with CUDA
Was a bug in recent optimization commit.
2017-02-13 18:22:10 +01:00
Dalai Felinto
1634cef2b3 Immediate Mode: timeline cached frames
This involved some refactoring. The original code was relying on a cache of pre-allocated arrays which in turn were still re-populated every redraw loop.

We now ditch those arrays, and make the draw "on the fly".

Part of T49043

@merwin can you just check if you foresee any performance impact with this approach?
2017-02-13 18:10:28 +01:00
581c819013 Cycles: Fix wrong shading on GPU when background has NaN pixels and MIS enabled
Quite simple fix for now which only deals with this case. Maybe we want to do
some "clipping" on image load time so regular textures wouldn't give NaN as
well.
2017-02-13 16:32:55 +01:00
81eee0f536 Cycles: Use fast math without finite optimization
This allows us to use faster math and still have reliable
isnan/isfinite tests.

Only do it for host side, kernels stays unchanged.

Thanks Lukas Stockner for the tip!
2017-02-13 16:25:35 +01:00
Dalai Felinto
d4e9c27e4e Immediate Mode: curve draw stroke
How to test this drawing: create and edit a curve and press shift + drag your mouse (or tablet). The Curve needs a Bevel Depth > 0.0.

Note: The ideal solution would be to use a different shader, that takes
no lighting. However according to Clément Foucault there is an assert preventing the same batch to
me used with different attributes (or something like that). Il wait
until the end of such resolution before revisiting this. That said, it
is working fine.

Part of T49043

Differential Revision: https://developer.blender.org/D2501
2017-02-13 12:41:05 +01:00
37afa965a4 Fix T50655: Pointiness is too slow to calculate
Optimize vertex de-duplication the same way as we do doe Remove Doubles.
2017-02-13 12:00:10 +01:00
Dalai Felinto
4e64151787 Outliner: allow for renaming of collection and small touch ups in the
code

Note: Master Collection should not be renamable, but also, it should be marked as MasterCollection (with an icon probably)
2017-02-13 11:16:23 +01:00
594015fb7e Cycles: Use Cycles-side mesh instead of C++ RNA
Those are now matching and it's faster to skip C++ RNA to
calculate pointiness.
2017-02-13 10:40:05 +01:00
9148ce9f3c F-Curve normalization: Do proper curve min/max instead of handle min/max
Would be cool to find some way to cache the results.
2017-02-13 10:02:04 +01:00
Dalai Felinto
8a92277a31 Layers: Per-Collection edit mode parsing
Note: we are now merging all the collection engines (mode and render), which eventually may get slow. But as stated before, this is to expose the functionality, while waiting for proper depsgraph integrated solution.
2017-02-13 00:25:30 +01:00
Julian Eisel
8e97c6af0d Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/blenkernel/intern/library_query.c
	source/blender/editors/include/ED_transform.h
	source/blender/editors/interface/resources.c
	source/blender/editors/transform/transform_manipulator.c
2017-02-12 21:27:43 +01:00
Dalai Felinto
adf355849f Layers: Per-Collection edit mode settings
I didn't manage to get the proper object context in the collection
properties editor. That said I got it working for now in a temporary way
since this will change once we get workspaces anyways

(see changes in buttons_context.c and
rna_scene.c::rna_LayerCollection_mode_settings_get)

I still need to handle the merging of the settings. I will find a
provisory solution while we wait for depsgraph.

(also layer_collection_create_mode_settings_object and layer_collection_create_mode_settings_edit could probably be elsewhere - under draw/engines likely)
2017-02-12 20:47:34 +01:00
b104057d00 OpenGL: enable program point size for keyframes
Allows vertex shader to determine how large to rasterize each point sprite. Forgot to do this before.
2017-02-12 01:56:08 -05:00
09bfc37889 OpenGL: convert NLA editor to new imm mode
Plus plenty of C99 cleanup.

Part of T49043. Needs more testing, I don't really use the NLA editor.
2017-02-12 01:30:21 -05:00
5552e83b53 Cycles: Don't use built-in API for image sequences in preview mode
Our Python API is not ready for such things at all. Better be slower
but more correct for until we improve our API.
2017-02-11 22:24:59 +01:00
e76364adcd Image: Fix non-deterministic behavior of image sequence loading
The issue was caused by usage of non-initialized image user, which
could have different settings, causing some random image being loaded
or not loaded at all.

This caused non-deterministic behavior of Cycles image loading because
it was querying image information from several places.

This fixes crash reported in T50616, but it's not a complete fix
because preview rendering in material is wrong (same wrong as in
2.78a release).
2017-02-11 22:19:49 +01:00
24703c97a1 GPU shaders / Clay engine : small renaming / cleanup 2017-02-11 21:15:46 +01:00
737d349dbc Clay Engine: fix instancing (again) 2017-02-11 20:36:20 +01:00
e05800d23b Clay Engine: converted Empties to the new instancing method 2017-02-11 20:36:20 +01:00
1abd2f279d Clay Engine: Small instancing fixes 2017-02-11 20:36:20 +01:00
eb473143a8 Clay Engine: Convert Lamp to use new instancing feature. 2017-02-11 20:36:20 +01:00
1976fd7af1 Clay Engine: Fix instance attrib. 2017-02-11 20:36:20 +01:00
08c1afb088 Clay Engine: Separate batch for Z straight line 2017-02-11 20:36:20 +01:00
fc0797142d Clay Engine: Refactoring of the dynamic batches
Support more attribs for interesting instancing
2017-02-11 20:36:20 +01:00
1ac6e4c7a2 UI: Redesign the VSE multicam strip
Idea from https://rightclickselect.com/p/sequencer/zfbbbc/sequencer-panels-update by @pauloup

|{F434631}|{F434624}|
|Before |After|

Test file:
{F434643}
2017-02-11 11:35:02 -05:00
c5f2380be7 OpenGL immediate mode: drawarmature.c (cont)
Cube bone wire.
Fix do_const_color.
This breaks the selection in glSelect mode. Occlusion queries are fine.
2017-02-11 14:19:23 +01:00
e008ca13f1 OpenGL: updated clip_utils.c to new immediate mode
D2391 by @darwin, part of T49043

Reviewed by @merwin who made some small changes before committing.
2017-02-11 00:59:43 -05:00
768e4e991c fix warning
Strip start & end are floating-point values, so clang expected fabsf here. Casting to int since we want a discrete number of vertices.
2017-02-11 00:27:43 -05:00
bbc31e8929 OpenGL: draw keyframe markers as point sprites
Also some conversion to new imm mode (T49043).

Multiple editors affected.
We could push this even further & draw all keyframes in an editor with a single draw call.

Something is strange with keyframe markers in blender2.8 -- they're not showing up before or after this commit. They do appear in master. This commit probably needs some follow-up work after keyframes are showing again. Better to share this code now instead of sitting on it.
2017-02-11 00:24:59 -05:00
a161d45cfb add builtin GPU_SHADER_KEYFRAME_DIAMOND
Now we can draw keyframe markers as point sprites, with fewer draw calls and state changes.

Based on the builtin shader for round points with anti-aliased outline. This one is more pointy.
2017-02-11 00:02:28 -05:00
f7b1b87ba9 Gawain: minor cleanup 2017-02-10 22:27:20 -05:00
1c09c8f32f OpenGL immediate mode: drawarmature.c
Changed the color function to output a float[4] to use with shaders.
Temporary leaving the UI_ThemeColor/glColor function.
Porting draw_bone_octahedral (wire) to Batch API.
2017-02-11 00:43:03 +01:00
b97864203e Gawain : Added Batch_init()
to init a batch without allocating memory
2017-02-11 00:43:03 +01:00
af2df36248 OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_TRACKPREVIEW

Changed stipple shader usage to a bunch of GL_LINES with flat color

OpenGL immediate mode: interface_draw.c (end)

Eradicate leftover legacy functions.
Fix a crash with histogram resolution.
2017-02-11 00:43:00 +01:00
7252049cba OpenGL immediate mode: Added replacement for glaDrawPixelsTex_* 2017-02-11 00:42:59 +01:00
13ab43afcf OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_CURVE
2017-02-11 00:42:59 +01:00
ae3646cd9f cleanup from recent commits
coding style, float literals

Converted some (expr / literal) to (expr * literal) where it does not impact readability.

Simplified a few function calls.
2017-02-11 00:42:55 +01:00
ef600e8ccf OpenGL immediate mode: clip_graph_draw.c
Part of T49043 and T49042
2017-02-11 00:39:18 +01:00
dfadb45254 OpenGL immediate mode: gluSphere replacement
Updated interface_draw.c to use the new sphere batch.
2017-02-11 00:39:17 +01:00
5b10a6bb8e OpenGL immediate mode: fix Waveform Font color 2017-02-11 00:39:17 +01:00
b4a01e7f4f OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_COLORBAND
Introduced a new checker shader to be used mostly on transparent areas.

OpenGL immediate mode: interface_draw.c (cont)

ui_draw_but_UNITVEC
Introduced a new shader to be used for simple lighting.
2017-02-11 00:39:09 +01:00
8fbf1c4d77 OpenGL immediate mode: Convert leftover UI_ThemeColor calls
Some `UI_ThemeColor` calls were left in converted files, in some cases
because they were just overlooked, and in the case of text drawing,
because the new BLF color functions were not yet implemented at the
time of conversion.

Also converted one `drawcircball` call that was left in
transform_constraints.c

Part of T49043
2017-02-11 00:36:06 +01:00
3f9f82f3c4 fix clang warning
uninitialized variable (glGen functions set the value)
2017-02-11 00:18:36 +01:00
8add4cc900 OpenGL immediate mode: uvedit_draw.c
Still has one `UI_ThemeColor` call, because drawing is happening in a DM
drawing callback which hasn't been converted yet.

Also has some old gl calls that are #ifdef'ed out.

This also changes active face drawing in UVs from stippled to a solid
color, which makes active faces much more visible, and also looks nicer.
The same should probably be done for active face drawing in the 3d view.
(has been discussed with merwin on IRC)

Part of T49043
2017-02-11 00:18:36 +01:00
3ede515b5b Use dummy versionning numbers for missing libraries.
We now assert that we now file version of libraries (needed for
do_version after linking step), so for missing libraries, set dummy
numbers (using version of main .blend file actually).
2017-02-10 22:50:45 +01:00
Dalai Felinto
0b27b65f24 Use OBACT_NEW to show the object edit mode 2017-02-10 20:46:16 +01:00
9d8a9cacc3 De-duplicate min/max calculation in F-Curve normalization 2017-02-10 18:10:26 +01:00
f9329997c3 Complete immUniform functions to support 2float and 3float 2017-02-10 17:29:12 +01:00
e33e58bf23 CTests: Initial work to cover Cycles nodes with OpenGL tests
Works similar to regular Cycles tests, just does OpenGL render to
get output image.

Seems to work fine with the only funny effect: Blender window will
pop up for each of the tests. This is current limitation of our
OpenGL context. Might be changed in the future.
2017-02-10 14:52:54 +01:00
e991af0934 Cleanup: Trailing whitespace 2017-02-10 14:08:12 +01:00
cd4309ced0 Cycles: Cleanup, move EdgeMap to blender_util
it's better place for such an utility structure. Still not fully ideal tho.
2017-02-10 13:34:10 +01:00
0178915ce9 Cycles: Make an utility class for edge map
Simplifies some logic.
2017-02-10 13:34:09 +01:00
fd7e9f7974 Cycles: Fix pointiness attribute giving wrong results with autosplit
Basically made the algorithm to handle vertices with the same coordinate
as a single vertex.
2017-02-10 13:34:09 +01:00
d395d81bfc Cycles: Cleanup: Use less indentation by inverting condition 2017-02-10 13:34:09 +01:00
0b65b889ef Cycles: Calculate all vertex attribute after faces generation
This way the calculation is not spread over multiple places.
2017-02-10 13:34:09 +01:00
b26da8b467 Cycles: Cleanup: use vector instead of bare malloc
This way memory is more "manageable" and easier to follow.
2017-02-10 13:34:09 +01:00
b929eef8c5 Alembic: fixed mistake in bounding box computation
By performing the Z-up to Y-up conversion, the change in sign of the
Z-coordinate swaps "minimum" and "maximum".
2017-02-10 11:54:00 +01:00
26f8095384 Alembic: fixed mistake in bounding box computation
By performing the Z-up to Y-up conversion, the change in sign of the
Z-coordinate swaps "minimum" and "maximum".
2017-02-10 11:52:51 +01:00
ae6e9401ab Alembic: using Base* instead of Object* to get selection
I also added some remarks & TODOs to indicate work in progress.
2017-02-10 11:52:33 +01:00
48a6aa3499 Alembic: don't use parent_selected() to determine which object to export
The parent_selected() function mixed semantics of "needs to be exported"
and "is selected", which is confusing. Now just selected objects are
exported to Alembic; any parent transforms that are required were already
taken care of by other code.
2017-02-10 11:52:33 +01:00
Julian Eisel
0c0bdd83a4 Cleanup: Use const for array argument 2017-02-10 00:20:46 +01:00
Julian Eisel
4b365064cf Remove most (maybe all?) remaining yellow text
Decided to request the text color as argument for UI_fonstyle_draw
functions, rather than keeping it being another state to keep track of.
2017-02-10 00:17:50 +01:00
38155c7d3c Do not overide text 2017-02-09 16:25:04 -05:00
bb1367cdaf Fix T50629 -- Add remove doubles to the cleanup menu
Also move it up in the verticies menu
2017-02-09 16:18:33 -05:00
Julian Eisel
0ce76a4274 Fix missing highlights in 3D View
Things like selection outlines didn't work at all.

Caused by rBc973e8d2da5cf3f.
When splitting up bitflags, the equivalent to `foo->flag & (bar1 + bar2)` is
`(foo->flag1 & bar1) || (foo->flag2 & bar2)`, *not*
`(foo->flag1 & bar1) && (foo->flag2 & bar2)`.
Also, let's please avoid using '+' operator for bitwise operations, a
binary addition is a binary OR *with* cary, which can cause quite some damage.
2017-02-09 21:26:38 +01:00
Julian Eisel
ca9c1de33e Fix object selection in 3D View 2017-02-09 20:49:53 +01:00
Julian Eisel
9e3cf0c2e8 Draw buttons for editing collections in outliner 2017-02-09 20:39:58 +01:00
Julian Eisel
c80f9822fd Support activating collections from outliner 2017-02-09 20:31:40 +01:00
Dalai Felinto
d82bb1f634 Main fix for outliner, but still need changes
Fix outliner related crashes. Basically in some functions bContext was
not passed around, so CTX_data_scene_layer(C) was crashing.

Right now we still rely on ob->flag SELECT in some places. In order to use the base flag we will need to bring back the Bases to the outliner.
2017-02-09 17:52:53 +01:00
Julian Eisel
1bcf199d2e Support displaying collections in outliner
Adds a new outliner display mode "Collections" which draws the active
collection. We might want to rename it to "Active Collection" if we don't
plan to support showing other collections there.
Also added the buttons for restricting visibility and selectability.

@dfelinto, code in restrictbutton_collection_hide_cb and
restrictbutton_collection_hide_select_cb is duplicated from
rna_LayerCollection_hide_update and
rna_LayerCollection_hide_select_update, maybe utility functions would be
handy for this?
2017-02-09 17:25:21 +01:00
Dalai Felinto
a41bbfb7f3 Depsgraph fix for scene layers
Objects can be moved around freely now
2017-02-09 16:46:05 +01:00
Dalai Felinto
1045026ea2 More housecleaning (BASACT > BASACT_NEW) 2017-02-09 16:34:26 +01:00
Dalai Felinto
cb490561d3 Layers: set active object in doversion for all render layers 2017-02-09 15:57:06 +01:00
Dalai Felinto
5bee553b1f Update get_camera_with_movieclip 2017-02-09 15:51:30 +01:00
e523cde574 Cleanup: Remove commented code
Code has been commented from before 2010 and relates to old Background image code.
2017-02-09 09:26:57 -05:00
Dalai Felinto
ff4dc7abfa Change ITER_BEGIN to work in C++ (include object type in the macro) 2017-02-09 15:26:28 +01:00
Dalai Felinto
0b473168cd Fix widget not showing up
(and more Scene.base > SceneLayer.object_bases changes in transforma code)
2017-02-09 14:49:56 +01:00
Dalai Felinto
8ff7f14c76 Temporary fix for object panel 2017-02-09 14:30:35 +01:00
Dalai Felinto
f20cc9e54c Fix logic in CollectionEngineSetting update
Now Clay engine can show different materials per collection o/
2017-02-09 12:48:39 +01:00
08399aca62 Clay Engine : fix 2017-02-09 12:04:37 +01:00
Dalai Felinto
0692fc9665 CollectionEngineSettings calculate: set COLLECTION_PROP_USE for combined property
This way the render engines can have a fallback value (scene or layer default value) for the shader values that were never set.
2017-02-09 11:48:09 +01:00
6b372e3a22 Clay Engine: support for overrides (not working yet) 2017-02-09 11:25:51 +01:00
Dalai Felinto
09af91e096 Fix crashes on outliner (fixup for rB2a16a4ee)
FOREACH_SCENE_OBJECT was wrong (skipping an object), but rB2a16a4ee made it crash. Things should be better now.
2017-02-09 11:22:56 +01:00
Dalai Felinto
9e95b5edd9 Fix active object name not showing in viewport 2017-02-09 10:28:50 +01:00
d2f4900d1a Use a smaller cross icon for clearing search box contents 2017-02-09 19:08:58 +13:00
351eb4fad1 More tweaks to Normalisation options in Graph Editor
* Added a new dedicated icon for normalize
* Only use an icon for "Auto"
2017-02-09 18:59:51 +13:00
316d23f2ba Graph Editor: Replace Normalise/Auto checkboxes with toggle buttons
These take less space, fit in better with rest of the UI, and make their relationship clearer
2017-02-09 17:10:49 +13:00
117d90b3da Fix: GPencil delete operators did not respect color locking 2017-02-09 17:10:48 +13:00
Cyrax
f2ea319316 OpenGL: outliner_draw_tree_element uses new imm mode
D2438 by @cyrax
review by @merwin
part of T49043
2017-02-08 18:36:03 -05:00
Cyrax
6444ba2635 added UI_GetThemeColorShade4ubv function
And updated UI_ThemeColorShade to use it.

Part of D2438 by @cyrax
2017-02-08 18:34:02 -05:00
Cyrax
b08483defa Update outliner_draw_hierarchy_lines to use new imm mode
Patch D2437 by @cyrax
review by @merwin
2017-02-08 15:02:55 -05:00
Cyrax
525937cc39 OpenGL: outliner_draw_highlights uses new imm mode
Patch D2433 by @cyrax, part of T49043
reviewed by @merwin
2017-02-08 14:37:37 -05:00
61df9fdb2f Cleanup: warnings 2017-02-09 02:39:31 +11:00
2a16a4ee43 Fix uninitialized var with FOREACH_SCENE_OBJECT 2017-02-09 02:25:27 +11:00
Dalai Felinto
3f7ca93490 Fix breakage when saving files from the UI
The problem was with offscreen buffer rendering
2017-02-08 16:06:11 +01:00
Dalai Felinto
260f97b3d9 create BKE_scene_layer_active 2017-02-08 16:05:24 +01:00
Dalai Felinto
a38298f4dd Bring back Lasso and Circle selection back
(and replace more instances of BaseLegacy/scene->base with Base/sl->object_bases)

Still need mouse selection, box selection, and menu selection

Also, there is still a problem with BA_WAS_SEL, at the moment only the
objects centers are highlighted.
2017-02-08 14:44:37 +01:00
b16fd22018 Cycles: Fix regression with transparent shadows in volume 2017-02-08 14:00:48 +01:00
da31a82832 Cycles: Solve speed regression by casting opaque ray first 2017-02-08 14:00:48 +01:00
04cf1538b5 Cycles: Fix compilation error on OpenCL 2017-02-08 14:00:48 +01:00
31a025f51e Cycles: Split shadow functions to avoid some duplicated calculations 2017-02-08 14:00:48 +01:00
dde40989f3 Cycles: Store shadow intersections in the kernel globals
Seems CUDA failed to de-duplicate the array across multiple inlined
versions of the shadow_blocked(). Helped it a bit with that now.

Gives about 100MB memory improvement on a scenes after previous
commit and brings up memory "regression" to only 100MB comparing to
the master branch now.
2017-02-08 14:00:48 +01:00
7447950bc3 Cycles: Speedup transparent shadows on CUDA
This commit enables record-all behavior of transparent shadows
rays.

Render times difference goes as following:

               GTX 1080 render time
BMW                  -0.5%
Fishy Cat            -0.0%
Pabellon Barcelona   -11.6%
Classroom            +1.2%
Koro                 -58.6%

Kernel will now use some extra VRAM memory to store the intersection
array (200MB on my configuration). This we can optimize out with some
further commits.
2017-02-08 14:00:48 +01:00
9830eeb44b Cycles: Implement record-all transparent shadow function for GPU
The idea is to record all possible transparent intersections when
shooting transparent ray on GPU (similar to what we were doing  on
CPU already).

This avoids need of doing whole ray-to-scene intersections queries
for each intersection and speeds up a lot cases like transparent
hair in the cost of extra memory.

This commit is a base ground for now and this feature is kept
disabled for until some further tweaks.
2017-02-08 14:00:48 +01:00
9c3d202e56 Cycles: Use an utility function to sort intersections array 2017-02-08 14:00:48 +01:00
58a10122d0 Cycles: Make GPU version of shadow_blocked() closer to CPU
Now we break the traversal cycle and then perform volume attenuation
and check with zero throughput. Not sure it makes any measurable sense
at this moment, but in the future it might help de-duplicating some
extra logic here.
2017-02-08 14:00:48 +01:00
98a1855803 Cycles: De-duplicate transparent shadows attenuation
Fair amount of code was duplicated for CPU and GPU, now we are
using inlined function to avoid such duplication.
2017-02-08 14:00:48 +01:00
d4913af846 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/blenloader/intern/writefile.c
2017-02-08 13:10:16 +01:00
8cda364d6f 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
2017-02-08 12:26:36 +01:00
ac38d5652b Alembic export: avoid infinite loops trying to find parent objects.
Also added some assertions for debugging purposes

Reviewed by: Kévin Dietrich
2017-02-08 12:26:36 +01:00
95e7f93fa2 Alembic export: only create transform writer if the object should be exported
Reviewed by: Kévin Dietrich
2017-02-08 12:26:36 +01:00
b320873382 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.
2017-02-08 12:26:36 +01:00
ce9df09067 Alembic: Use getXForm() in check, because it's used in rest of the function too
This makes the code within the function consistent.
2017-02-08 12:26:36 +01:00
82df7100c8 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
2017-02-08 12:26:36 +01:00
Dalai Felinto
c973e8d2da 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.
2017-02-07 19:11:17 +01:00
69dbeeca48 Cleanup: Use const qualifier in some of color management code 2017-02-07 17:49:54 +01:00
b641d016e1 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.
2017-02-07 17:49:54 +01:00
ce629c5dd9 Color management: Add utility function to convert byte to float with processor applied 2017-02-07 17:49:54 +01:00
e5bb005369 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.
2017-02-07 17:49:54 +01:00
5d6177111d 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.
2017-02-07 17:49:54 +01:00
Dalai Felinto
6432c8cc00 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.
2017-02-07 16:54:09 +01:00
03be3102c7 Param is_cached not being used in bvhtree_from_mesh_edges_setup_data
This could cause bugs in the memory release
2017-02-07 11:03:10 -03:00
03544eccb4 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.
2017-02-07 14:21:29 +01:00
53896d4235 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.
2017-02-07 13:05:19 +01:00
6bf9c8ac89 Fix broken COLLADA building. 2017-02-07 12:05:23 +01:00
83adc54438 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)
2017-02-07 11:31:22 +01:00
Dalai Felinto
aeb8e81f27 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
```
2017-02-07 11:11:00 +01:00
1158800d1b PIL_time_utildefines: also show total time in TIMEIT_AVERAGED. 2017-02-07 10:14:46 +01:00
97fa285ae1 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
2017-02-06 23:24:10 -05:00
d23c57b84c fix unused var warnings
follow-up to earlier patch
2017-02-06 23:24:10 -05:00
6c95e97e64 OpenGL: convert clip_dopesheet_draw to new imm mode
D2486 by @TCMBoby, part of T49043
2017-02-06 23:24:10 -05:00
9b742ff61b OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_WAVEFORM
ui_draw_but_VECTORSCOPE
2017-02-07 00:24:44 +01:00
f7eaaf35b4 Fix (unreported) Object previews being written even for skipped objects. 2017-02-06 20:58:18 +01:00
e217839fd3 Cleanup writefile code a bit.
Modernize some of it a bit, saves quite some lines of blabla (using
shile instead of for loops... tsssts...).
2017-02-06 20:43:14 +01:00
dbdc346e9f 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
2017-02-06 19:29:42 +01:00
0170c682fe Specify the correct size of the BVHTree of edges
~edge_num~ edges_num_active
Not always all the edges enter in the build
2017-02-06 14:59:31 -03:00
e3f99329d8 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)
2017-02-06 14:11:06 -03:00
ac8348d033 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).
2017-02-06 17:42:30 +01:00
a54110751a OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_HISTOGRAM
UI_draw_text_underline (untested)
2017-02-06 16:54:26 +01:00
9e97b00873 Fix compilation error after recent change 2017-02-06 15:29:13 +01:00
e58359c26f OpenGL immediate mode: interface_draw.c (cont)
Replaced GL_POLYGON in various places.
Ported UI_draw_roundbox_unfilled
2017-02-06 15:19:45 +01:00
c7f40caa2c Add shortcuts for unsigned int, short, long and char
Feel free to use those in the new code.

And stay away from simple "unsigned".
2017-02-06 15:04:13 +01:00
c5cc9e046d 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.
2017-02-06 14:47:36 +01:00
d0015cba02 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.
2017-02-06 14:21:29 +01:00
8dbd961a3e OpenGL immediate mode: interface_draw.c 2017-02-06 14:06:13 +01:00
Dalai Felinto
cb3daaf355 Immediate mode: edit_curve_paint 1/2
Part of T49043
2017-02-06 12:43:24 +01:00
89f3837d68 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.
2017-02-06 12:37:08 +01:00
385fe4f0ce 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.
2017-02-06 12:23:03 +01:00
223aff987a Fix memory leak when building without audaspace 2017-02-06 11:18:20 +01:00
Phil Christensen
351c409317 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
2017-02-06 10:44:56 +01:00
22156d951d fix T50602: Avoid crash when executing transform_snap_context_project_view3d_mixed with dist_px NULL 2017-02-06 01:01:39 -03:00
c3e2faaad5 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.
2017-02-05 01:01:41 -05:00
5ad5bb235b 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.
2017-02-05 00:54:21 -05:00
5908382011 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.
2017-02-04 23:12:53 -05:00
627566cb9a 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.
2017-02-04 19:35:54 -05:00
da08aa4b96 Cleaning of the last commit: lack of attention with the debug of time X(
This was a stupid mistake
2017-02-04 19:06:41 -03:00
75aa866211 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).
2017-02-04 19:01:29 -03:00
47caf343c0 fix T50592: Scene.raycast not working
Ray_start and ray_normal values were being ignored
2017-02-04 18:17:15 -03:00
a2c469edc2 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.
2017-02-04 21:51:27 +01:00
6663099810 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...
2017-02-04 21:31:52 +01:00
c367e23d46 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
2017-02-03 20:08:57 -03:00
a0561a05ef 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
2017-02-03 19:03:31 -03:00
21f3767809 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
2017-02-03 13:15:44 -03:00
0b4a9caf51 Forgotten in committee ddf99214dc
In obect mode, the rotation matrix need to be restored to the initial value if a snap point is not found
2017-02-03 12:57:02 -03:00
0e459ad1a3 Buildbot: Re-enable cuda support for OSX 2017-02-03 16:11:05 +01:00
52696a0d3f 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).
2017-02-03 16:10:00 +01:00
520ced4ad5 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
2017-02-03 16:01:32 +01:00
f3a7104adb 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...
2017-02-03 15:47:44 +01:00
a1820afa30 Depsgraph: Add some extra debug prints on eval 2017-02-03 14:05:59 +01:00
030e99588d Tests: Use proper order for EXPECT_EQ() 2017-02-03 12:03:59 +01:00
aea17a612d Tests: Use EXPECT_FALSE() instead of EXPECT_EQ(foo, false) 2017-02-03 11:52:47 +01:00
dc1b45ff1a Tests: Use EXPECT_TRUE() instead of EXPECT_EQ(foo, true) 2017-02-03 11:52:29 +01:00
e1e85454ea 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.
2017-02-03 11:35:34 +01:00
103f2655ab Explode modifier: Don't tessellate DM if we are not going to apply modifier 2017-02-03 11:03:47 +01:00
ddf99214dc 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)
2017-02-03 02:27:57 -03:00
b1b5ded37f Fix shaders in some immBindBuiltinProgram calls
Had mistakenly used 3D shaders for some 2D drawings...
Replaced those now.

Part of T49043
2017-02-02 23:21:08 -02:00
d85295534b Merge branch 'master' into blender2.8 2017-02-02 21:50:12 +01:00
9f67367f0a 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.).
2017-02-02 21:42:00 +01:00
33e456b0ce install_deps.sh: don't use backticks
The script complained that it could not find the executable "--build-all".
2017-02-02 17:49:24 +01:00
47b21dd4c6 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
2017-02-02 14:28:46 -02:00
9a22b32e7e Make imm_drawcircball public
(Approved by merwin in IRC)

Required by part of T49043
2017-02-02 14:28:26 -02:00
57ac20d5b7 OpenGL immediate mode: space_graph.c
Part of T49043
2017-02-02 14:24:43 -02:00
9e2dca933e 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.
2017-02-02 17:05:48 +01:00
3b71d5c0ae install_deps.sh: don't use backticks
The script complained that it could not find the executable "--build-all".
2017-02-02 16:04:49 +01:00
feb588060a Fix T50497: prop_search not correctly drew in UI (D2473) 2017-02-02 17:30:50 +03:00
86747ff180 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!
2017-02-02 14:36:30 +01:00
6edfa73f5c Revert the change of a default in a recent commit
This was my own mistake
2017-02-01 23:46:53 -05:00
Michael Stahre
7f10a889e3 Fix incorrect spot lamp blend in python GPU uniform export.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2378
2017-02-02 04:03:26 +01:00
Michael Stahre
d4e0557cf1 Fix missing uniform type for python GPU uniform export.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2379
2017-02-02 04:03:26 +01:00
2e8be8ac6b OpenGL immediate mode: view3d_ruler.c
Differential Revision: https://developer.blender.org/D2485

Part of T49043
2017-02-01 22:23:49 -02:00
8e05a5bf8c 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
2017-02-01 19:00:51 -05:00
64b4a3185c OpenGL immediate mode: drawanimviz.c
Differential Revision: https://developer.blender.org/D2484

Part of T49043
2017-02-01 20:58:56 -02:00
57573df0d3 Add GetThemeColorBlendShade3ubv function
Differential Revision: https://developer.blender.org/D2484

Used by part of T49043
2017-02-01 20:40:49 -02:00
4935e2449b 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.
2017-02-01 16:44:00 -05:00
7493a2b3c0 set default color for BLF fonts
Set to an annoying bright color so we can see where to add BLF_color calls.
2017-02-01 16:21:08 -05:00
ba551014f8 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.
2017-02-01 16:21:08 -05:00
13399d471e OpenGL immediate mode: editmesh_knife.c
Differential Revision: https://developer.blender.org/D2481

Part of T49043
2017-02-01 18:52:10 -02:00
Aaron
3ab8895610 UI: Add missing colon 2017-02-01 14:56:11 -05:00
fd089843b3 OpenGL immediate mode: transform_constraints.c
Differential Revision: https://developer.blender.org/D2483

Part of T49043
2017-02-01 17:32:33 -02:00
eca2f918a7 OpenGL immediate mode: transform_generics.c
Differential Revision: https://developer.blender.org/D2482

Part of T49043
2017-02-01 17:03:58 -02:00
fb61711b1a 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.
2017-02-01 12:52:26 +01:00
c231c29afa Cycles tests: Allow python auto-exec 2017-02-01 10:13:40 +01:00
fa19940dc6 Cycles: Fix rng_state initialization when using resumable rendering 2017-02-01 05:43:17 +01:00
92258f3678 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
2017-01-31 21:43:44 -03:00
be72d7a9f5 OpenGL: use new matrix API for Loop Cut
Follow-up to rB85174329d9f5
Part of T49450
2017-01-31 17:10:25 -05:00
adb422e500 OpenGL: fix MultMatrix order
Partial revert of rB06d4aca87956

Problem found while converting old GL matrix calls to new API (T49450)
2017-01-31 17:10:25 -05:00
75a4c836d6 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.
2017-01-31 17:10:34 -03:00
a90622ce93 Fix T50331: New Dependency Graph - "frame" python driver expression not working 2017-01-31 12:17:55 +01:00
326516c9d7 Cycles: Fix spelling in comment 2017-01-31 12:08:19 +01:00
b3690cdecd Fix variable shadow and avoid calculating same value twice 2017-01-31 11:55:29 +01:00
Dalai Felinto
887fc0ff6d Silence unused var warnings after rBac58a7fa 2017-01-31 11:00:50 +01:00
3e9ade6e31 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/library_query.c
2017-01-31 10:47:43 +01:00
b5682a6fdd Cleanup: use 'cb_flag', not 'cd_flag' for library_query callbacks.
`cd_flag` tends to be used for CustomData flags in mesh area, while for
library_query those are rather callback flags...
2017-01-31 10:41:25 +01:00
60e387f5e3 Cleanup: Rename callback flags from library_query to IDWALK_CB_...
Better to have clear way to tell whether flag is parameter for
BKE_library_foreach_ID_link(), parameter for its callback function, or
return value from this callback function.
2017-01-31 09:47:59 +01:00
85174329d9 blender 2.8: OpenGL immediate mode: editmesh_loopcut.c
Reviewers: merwin

Reviewed By: merwin

Subscribers: dfelinto

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2480
2017-01-31 03:07:47 -05:00
b997914f80 OpenGL: remove NPOT texture rescaling logic
This code was already disabled.

We might be able to simplify GPU_check_scaled_image even further. Maybe even delete it? Just removing the obvious stuff now.

Keeping is_power_of_2_resolution function since it is still used in DXT logic.
2017-01-31 02:52:43 -05:00
a928a9c1e1 Fix compilation error: too few arguments to function call.
D2492 by @tomjpsun.
2017-01-31 07:00:31 +01:00
d07e2416db Fix bug not reported: Ruler/Protractor: Snap to vertices and edges was not considering the depth variation
Taking advantage of the area, the depth is decreased 0.01 BU to each loop to give priority to elements in order: Vertice > Edge > Face. This increases the threshold and improves the snap to multiple elements
2017-01-30 23:49:09 -03:00
b841d60bf8 Snap System: Return depth by snapping to edges and vertices, because the Ruler only works right this way
The Ruler snaps to the element with the lowest depth.
2017-01-30 22:49:44 -03:00
a50b173952 Use the same solution to test the pixel distance to the AABB, with BoundBox
The previous solution took arbitrary values to determine if the mouse was near or not to the Bound Box (it simply scaled the Bound Box).

Now the same function that detected the distance from the BVHTree nodes to the mouse is used in the Bound Box
2017-01-30 22:27:38 -03:00
4e1025376e Freestyle: Use of the Fill Range by Selection operator in the mesh edit mode.
This revision extends the functionality of the "Fill Range by Selection" button in
the "Distance from Camera/Object" modifiers so that only selected mesh vertices
in the edit mode are taken into account  (instead of considering all vertices when
in the object mode) to compute the min & max distances from the reference.
This will give users much finer control on the range values.
2017-01-31 09:08:10 +09:00
bc4aeefe82 Make 'make local' twice quicker.
Use new Main->relations ID usages mapping in BKE_library_make_local().

This allows a noticeable simplification in code, and can be up to twice
quicker as previous code (Make Local: All from 2 to 1 minute e.g. in a
huge production file with thousands of linked data-blocks).

Note that new code has been successfuly tested with several complex cases
(production files from Agent327), as well as some testcases from recent
bug reports related to that function. But as always, nothing beats real
usage by real users, so please check this before we release 2.79. ;)

Main areas that would be affected: Make Local operations (L shortcut in
3DView), and append from libraries.
2017-01-30 22:33:20 +01:00
eadfd901ad Optimization: pass Main to BKE_library_foreach_ID_link() and use its relations.
Use Main->relations in BKE_library_foreach_ID_link(), when possible
(i.e. IDWALK_READONLY is set), and if the data is available of course.

This is quite minor optimization, no sensible improvements are expected,
but does not hurt either to avoid potentially tens of looping over e.g.
objects constraints and modifiers, or heap of drivers...
2017-01-30 22:33:20 +01:00
fbd28d375a Fix missing non-ID nodetrees in ID relationships built from library_query.c
This shall fix both existing code (bpy mapping, and local/lib usages
checks), and new Main->relations generation.
2017-01-30 22:33:20 +01:00
4443bad30a Add optional, free-after-use usages mapping of IDs to Main.
The new MainIDRelations stores two mappings, one from ID users to ID
used, the other vice-versa.

That data is assumed to be short-living runtime, code creating it is
responsible to clear it asap. It will be much useful in places where we
handle relations between IDs for a lot of them at once.

Note: This commit is not fully functional, that is, the infamous, ugly,
PoS non-ID nodetrees will not be handled correctly when building relations.
Fix needed here is a bit noisy, so will be done in next own commit.
2017-01-30 22:33:20 +01:00
997a210b08 Fix T49632: Grease pencil in "Edit Strokes" mode: Snap tool did not snap points to active object
A simple confusion between enums: ~SNAP_NOT_ACTIVE~
2017-01-30 18:30:19 -03:00
4580ace4c1 Alembic/CacheFile: fix crash de-referencing NULL pointer. 2017-01-30 10:46:24 +01:00
62f2c44ffb Cleanup: Unused function and and variables in snap code
Please doublecheck ED_transform_snap_object_project_ray_ex() is really
valid, it's weird to have extra arguments here unused.
2017-01-30 09:26:33 +01:00
505ff16dbf Snap System: BVH: ignore AABBs behind ray
This provides a slight improvement in performance in specific cases, such as when the observer is inside a high poly object and executes snap to edge or vertex
2017-01-30 02:49:41 -03:00
318ee2e8c1 Fix unreported bug: parameter ray_start repeated
The bug would only be seen in terms of performance
2017-01-30 02:26:00 -03:00
167ab03f36 Solve compilation error: Field has incomplete type 'enum eViewProj'
Error reported by @tomjpsun
Patch D2491
2017-01-30 02:19:18 -03:00
cdff659036 Freestyle: Fix (unreported) wrong distance calculation in the Fill Range by Selection operator.
Distance calculation performed by the "Fill Range by Selection" button of the
"Distance from Camera" color, alpha and thickness modifiers was incorrect,
limiting the usefulness of the functionality.

The problem was that the distance between the camera and individual vertex
locations was calculated in the world space, which was inconsistent with the
distance calculation done by the modifiers in the camera space.
2017-01-30 12:18:39 +09:00
Julian Eisel
04e4cb9714 Merge branch 'blender2.8' into custom-manipulators 2017-01-30 00:16:43 +01:00
Julian Eisel
bfe151e5f7 Fix compile error 2017-01-30 00:15:48 +01:00
6c23a1b8b9 Remove BKE_boundbox_ray_hit_check
Remove `BKE_boundbox_ray_hit_check` since it is no longer being used and can be easily replaced by `isect_ray_aabb_v3_simple`
2017-01-29 14:19:58 -03:00
b99491caf7 [msvc] Set proper OpenSubdiv flags when not using find_package to find opensubdiv. Fixes T50548 2017-01-29 10:00:38 -07:00
cf6ca226fa New math_geom function isect_ray_aabb_v3_simple
The new `isect_ray_aabb_v3_simple` function replaces the `BKE_boundbox_ray_hit_check` and can be used in BVHTree Root (first AABB). So it is much more efficient.
2017-01-29 13:56:58 -03:00
dead79a16a Rename func set_SnapData to snap_data_set
Don't use CamelCase in functions and try to keep area affected first, and action last, in names
2017-01-29 13:13:14 -03:00
88b0b22914 fix T50486: Don't always do the ray_start_correction in the ortho view
You need to make sure that ray_start is really far away, because even in the Orthografic view, in some cases, the ray can start inside the object
2017-01-29 12:26:15 -03:00
cd596fa1c7 Remove struct PreDefProject and store all immutable parameters within the new struct SnapData
In order to simplify the reading of these functions, the parameters: `snap_to`, `mval`, `ray_start`, `ray_dir`, `view_proj` and `depth_range` are now stored in the struct `SnapData`
2017-01-29 12:07:14 -03:00
d6f965b99c Fix T50550: GPUShader: compile error - Background image not showing in
viewport.

Caused by rBd6cf28c5e15739f864fbf04614c2a50708b4b152, which forgot to
update the GLSL code for the "Light Path" node.
2017-01-29 16:00:25 +01:00
15b253c082 Fix blurry icons 2017-01-29 17:21:57 +03:00
ba116c8e9c fix D2489: Collada exporter broke edit data when exporting Armature while in Armature edit mode 2017-01-28 22:10:20 +01:00
c64c901535 fix D2489: Collada exporter broke edit data when exporting Armature while in Armature edit mode 2017-01-28 21:51:18 +01:00
e4e1900012 Fix (IRC reported) DataTransfer modifier affecting base mesh in some cases.
Checking only whether mverts is same as base mesh one is not enough in
all cases, some modifiers (deform ones) can only generate new mvert
data, while keeping others from original mesh.

Now checking both mvert or medge, hopefully this will be enough to catch
all problematic cases this time.

Thanks @gaia for finding that problem. :)
2017-01-27 19:27:07 +01:00
11abb13483 Fix T50534, Part II: warn user when DataTransfer mod affects custom normals.
Custom normals need Autosmooth setting to be enabled, always!
2017-01-27 19:07:29 +01:00
fb2f95c91a Fix T50534: Part I, cleanup loop normals generated during modifier stack evaluation.
Those could stay around, and be displayed in 3DView even when autosmooth
was disabled (but would not be 'active').
2017-01-27 19:07:29 +01:00
bfe3b967fa UI: Move Scene Game Properties to the Scene Tab (was in world) 2017-01-27 11:36:53 -05:00
436f1e3345 Snap Functions: Remove the use of the function 'BLI_bvhtree_find_nearest_to_ray' in transform_snap_object
Although the "BLI_bvhtree_find_nearest_to_ray" function is more practical than the generic "BLI_bvhtree_walk_dfs", it does not work to snap in perspective view. This makes it necessary to add "ifs" and functions that make the code difficult to understand

patch: D2474
2017-01-27 13:02:05 -03:00
Dalai Felinto
2081dac93b Mesh batch caches should not be stored in file 2017-01-27 15:21:14 +01:00
0330741548 Cycles: Add option to replace GI with AO approximation after certain amount of bounces
This is a speed up option which is mainly useful for viewport. Gives nice speedup in
the barbershop scene of 2x when replacing GI with AO after 2nd bounce without loosing
too much details.

Reviewers: brecht

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D2383
2017-01-27 14:21:49 +01:00
Dalai Felinto
84b18162cf Fixup for rBac58a7fa (HSV doversion)
We are not bumping file version, but we cannot have the doversion code running twice.
In this particular case it was crashing files, since we were setting node->storage to NULL, and later on accessing it.
2017-01-27 11:24:23 +01:00
bce9e80d82 CMake: Fix typo 2017-01-27 05:24:58 +01:00
Julian Eisel
f1e7f6ec58 Merge branch 'blender2.8' into custom-manipulators 2017-01-20 17:05:49 +01:00
Julian Eisel
b77d3f55c0 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_ops.c
	source/blender/editors/transform/transform_manipulator.c
2017-01-14 17:50:24 +01:00
Julian Eisel
83c17d8de8 Don't limit manipulator scale to 200 2016-12-16 01:20:18 +01:00
Julian Eisel
da3523c48f Fix compile issues after merging 2016-12-16 01:10:18 +01:00
Julian Eisel
591cee2707 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/interface/resources.c
	source/blender/editors/space_node/drawnode.c
	source/blender/makesrna/intern/rna_wm.c
2016-12-16 00:58:06 +01:00
Julian Eisel
c696b70dae Fix incorrect color of axes on "Reset to Default Theme" 2016-11-10 23:21:02 +01:00
Julian Eisel
701689f354 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
2016-11-10 23:17:57 +01:00
Julian Eisel
aadb4c0640 Fix Blenderplayer not compiling.... 2016-10-17 17:13:51 +02:00
Julian Eisel
b706b745ce Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/interface/resources.c
	source/blender/editors/space_api/spacetypes.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/windowmanager/CMakeLists.txt
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_types.h
	source/blender/windowmanager/manipulators/intern/wm_manipulator.c
	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
2016-10-16 21:19:02 +02:00
Julian Eisel
c21122f0d3 Move manipulator drawing for new viewport into own function, add comments 2016-10-07 16:26:03 +02:00
Julian Eisel
78ed4e7e20 Merge branch 'temp_manipulators_core' into custom-manipulators
Conflicts:
	source/blender/editors/interface/resources.c
	source/blender/editors/space_api/spacetypes.c
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/windowmanager/CMakeLists.txt
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_types.h
	source/blender/windowmanager/manipulators/intern/wm_manipulator.c
	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
2016-10-07 16:15:02 +02:00
Julian Eisel
1e0a74fc25 Merge branch 'blender2.8' into custom-manipulators
Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
2016-10-07 15:44:43 +02:00
Julian Eisel
59cb21ab5a Merge branch 'blender2.8' into temp_manipulators_core 2016-10-07 15:15:24 +02:00
Julian Eisel
11ae190f00 Apply patch on blender2.8 branch
Ended up just deleting temp_manipulators_core branch and recreating it from blender2.8 branch. Applied D2232 on it then.
2016-10-07 01:32:59 +02:00
Julian Eisel
a19f862bd9 Bring back stuff removed in temp_manipulators_core
Was removed for merge into blender2.8, but we still need it in this branch.
2016-10-07 00:11:35 +02:00
Julian Eisel
67a161d703 Merge branch 'temp_manipulators_core' into custom-manipulators
Conflicts:
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/makesdna/DNA_view3d_types.h
2016-10-06 23:29:53 +02:00
Julian Eisel
62afcdedc5 Remove unneeded UserPref options
At least initial merge we don't need them.
2016-10-06 21:34:04 +02:00
Julian Eisel
fb7977a2f3 Remove any remaining OpenGL calls
This branch is likely going to be merged into blender2.8 branch soon so I rather avoid any OpenGL code that might need to be rewritten later.
2016-10-06 20:58:35 +02:00
Julian Eisel
c5f7486d4f Cleanup: Comments 2016-10-06 19:51:22 +02:00
Julian Eisel
2bdf886c5e Remove DNA_manipulator_types.h for now
At least for initial merge we don't need anything in DNA (and I'm not sure how DNA structs are handled which are not explicitely saved to disk... does it still store some info about it?).
2016-10-04 17:06:20 +02:00
Julian Eisel
aac3c0b6c8 Fix selected manipulators only drawn while hovering 2016-10-04 15:23:08 +02:00
Julian Eisel
7f56f62975 Fix a few memory leaks due to double allocation 2016-10-04 14:52:14 +02:00
Julian Eisel
28fa9ec7c0 Make manipulators work with changes from last merge 2016-10-04 02:16:28 +02:00
Julian Eisel
ebe25664d9 Merge branch 'temp_manipulators_core' into custom-manipulators 2016-10-03 23:55:09 +02:00
Julian Eisel
12d2bdd372 Move some manipulator flags to manipulator-group-type level
Had to do some changes to allow this, basically the wmManipulator.mgroup pointer to get the manipulator-group from the manipulator is back which is a bit ugly. Think that's fine though, only a minor annoyance.
2016-10-03 23:54:16 +02:00
Julian Eisel
291c28642d Split wmManipulator flag into behavior flags and state flags 2016-10-03 20:04:21 +02:00
Julian Eisel
3d707e94cd Fix some stupid mistakes in previous commit 2016-10-03 19:25:52 +02:00
Julian Eisel
30da20d0ee Fixes to make branch working after latest merge 2016-10-03 18:59:29 +02:00
Julian Eisel
f1d01b004e Merge branch 'temp_manipulators_core' into custom-manipulators 2016-10-03 18:28:45 +02:00
Julian Eisel
2712e4b4f4 Refactor manipulator draw routine
Updating and drawing works closer together now, makes it easier to define what to draw (3D vs 2D vs depth-culled manipulators) and to avoid unnecessary updates. Totally untested :)
2016-10-03 18:28:12 +02:00
Julian Eisel
d1e68a92aa Fix local ListBase var not initialized 2016-10-03 01:35:02 +02:00
Julian Eisel
100d043fce Merge branch 'temp_manipulators_core' into custom-manipulators
Also made changes to get branch compile and work.
Conflicts:
	source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h
2016-10-03 01:31:15 +02:00
Julian Eisel
d4f3278962 Fixes for custom-manipulators branch 2016-10-03 00:52:41 +02:00
Julian Eisel
dbe147257d Refactor lookups for hovered manipulator
2D manipulators now have priority over 3D ones, think that's what you'd want usually. Untested code, need to merge into custom_manipulators first.
2016-10-03 00:23:34 +02:00
Julian Eisel
2e595daee3 Refactor manipulator-group flags
Flags are internal now, not exposed to non-manipulator window manager code.
2016-10-02 22:12:10 +02:00
Julian Eisel
3668050589 Merge branch 'master' into temp_manipulators_core 2016-09-30 01:29:16 +02:00
Julian Eisel
0d4ea39f95 Merge branch 'blender2.8' into custom-manipulators 2016-09-30 01:28:53 +02:00
Julian Eisel
3571559577 Merge branch 'temp_manipulators_core' into custom-manipulators 2016-09-29 18:56:37 +02:00
Julian Eisel
109ba2d190 More fixes for recent refactor 2016-09-29 18:50:42 +02:00
Julian Eisel
781dc08f09 Some fixes for manipulator tweaking after recent changes 2016-09-29 18:40:24 +02:00
Julian Eisel
1571c8bc9e Merge branch 'temp_manipulators_core' into custom-manipulators 2016-09-29 01:00:17 +02:00
Julian Eisel
f6a814554a Fix some errors in last commit 2016-09-29 00:59:39 +02:00
Julian Eisel
2976d3e120 Make branch compile after latest merge 2016-09-29 00:53:11 +02:00
Julian Eisel
c5d8a674f9 Merge branch 'temp_manipulators_core' into custom-manipulators
Conflicts:
	source/blender/blenkernel/BKE_screen.h
	source/blender/blenkernel/intern/screen.c
	source/blender/editors/interface/resources.c
	source/blender/editors/screen/screen_edit.c
	source/blender/editors/space_api/spacetypes.c
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/makesdna/DNA_view3d_types.h
	source/blender/windowmanager/CMakeLists.txt
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/intern/wm_event_system.c
	source/blender/windowmanager/intern/wm_init_exit.c
	source/blender/windowmanager/manipulators/WM_manipulator_api.h
	source/blender/windowmanager/manipulators/WM_manipulator_types.h
	source/blender/windowmanager/manipulators/intern/wm_manipulator.c
	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
	source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h
2016-09-29 00:22:20 +02:00
Julian Eisel
075bf33e0f Regions now use a single manipulator-map again
Instead of having multiple manipulator-maps for 2D and 3D manipulators, manipulator-group-types should be tagged as being either 2D or 3D. When it comes to drawing these can be drawn separately.
Note that more work needs to be done here (added some todo marks), but there are probably going to be quite a few issues when merging into custom_manipulators, so will handle these first.
2016-09-29 00:12:24 +02:00
Julian Eisel
319db37ac1 Remove manipulator library for initial core merge
Will continue work on them in 2.8 based custom_manipulators branch, there I can also work on making manipulator drawing based on OpenGL 3.2 core profile.
2016-09-25 01:00:45 +02:00
Julian Eisel
bd239c7661 Rebase wiggly-widgets branch onto blender2.8 branch
This commit adds a new 'custom-manipulators' branch in which changes of the wiggly-widgets branch are applied onto the blender2.8 branch. I've done it so I can start porting manipulator drawing code to use the new abstractions for OpenGL 3.2 core profile.
At some point I had to do it anyway - better earlier than later to reduce loss of git history.
From now on this is the main branch for the custom manipulators project, I'll delete the wiggly-widgets branch in a bit (but keep it available at https://github.com/julianeisel/blender/tree/wiggly-widgets). It's still possible to merge some manipulators for pre-2.8 by rewriting the drawing of those to use OpenGL <= 2.1 (or copy & pasting from earlier state).
2016-09-23 02:45:57 +02:00
Julian Eisel
d208684398 Fix 3 bugs causing startup to fail in wiggly-widgets branch 2016-09-22 02:13:24 +02:00
Julian Eisel
581f3825ed Merge branch 'master' into temp_manipulators_core 2016-09-22 01:19:44 +02:00
Julian Eisel
90df954585 Use GPU_glew.h to include glew 2016-09-21 02:15:25 +02:00
Julian Eisel
dcd0858ef6 Fix manipulator update event define using already used value
Quite old issue even, since 97bb7d0a5b.
2016-09-21 02:13:17 +02:00
Julian Eisel
f822d3b32f Merge branch 'master' into temp_manipulators_core 2016-09-20 00:11:52 +02:00
Julian Eisel
157bd82fde Move structs to lower level, avoid storing manipulator-group pointers, naming, etc 2016-09-15 12:50:05 +02:00
Julian Eisel
37d225ce55 Move manipulator-group creation into own function 2016-09-15 02:26:30 +02:00
Julian Eisel
e930182b29 Remove unused manipulator-map update flag 2016-09-15 02:26:30 +02:00
Julian Eisel
c77ed84edc Avoid include in header file 2016-09-14 23:57:28 +02:00
Julian Eisel
2849dc429b Add SpaceType.manipulators callback for startup registration of manipulator-maps
Aaaannd the usual cleanup.
2016-09-14 17:02:12 +02:00
Julian Eisel
1b1be1576a Cleanup: Rename manipulator_draw_intern->manipulator_drawinfo_draw 2016-09-14 14:55:04 +02:00
Julian Eisel
ddb0a27e0e Cleanup: Line length, indentation, etc 2016-09-13 15:30:13 +02:00
Julian Eisel
e2b79f8756 Resolve some XXX'es and TODO's
And some cleanup.
2016-09-13 00:42:32 +02:00
Julian Eisel
dbd6f806fe Merge branch 'master' into temp_manipulators_core 2016-09-12 23:27:09 +02:00
Julian Eisel
fc719f3e9a Avoid bad-level calls to WM_manipulatormap_delete from BKE 2016-09-12 17:44:55 +02:00
Julian Eisel
ac7e3ba7e8 Cleanup: Comments 2016-09-11 23:59:10 +02:00
Julian Eisel
eea7125d54 Add some missing function calls for manipulators 2016-09-11 23:17:36 +02:00
Julian Eisel
9372e8a16b More renaming (widget->manipulator): Variables, sturct members, comments, etc 2016-09-11 23:06:15 +02:00
Julian Eisel
459fe932da Hook up manipulator core with window-manager 2016-09-11 20:05:11 +02:00
Julian Eisel
0b95deb6fa Fix accidentaly changed prefix capitalization 2016-09-11 18:59:08 +02:00
Julian Eisel
e6706d533e Merge branch 'master' into temp_manipulators_core 2016-09-11 15:53:11 +02:00
Julian Eisel
8e7e73afa6 Rename remaining structs (widget->manipulator)
And some other stuff ;)
2016-09-11 14:56:09 +02:00
Julian Eisel
a7a78728e2 Rename operators (widget->manipulator) 2016-09-11 14:43:40 +02:00
Julian Eisel
32cd173259 Rename functions and defines (widget->manipulator) 2016-09-11 14:34:19 +02:00
Julian Eisel
b464e93947 Rename types (wmWidget->wmManipulator) 2016-09-09 17:54:18 +02:00
Julian Eisel
64da6d876d Rename files and folders (widget->manipulator) 2016-09-09 17:21:32 +02:00
Julian Eisel
49fcfd4be9 Minor cleanup 2016-09-09 15:34:47 +02:00
Julian Eisel
ae55eeb2ce Initially add widget files and get them compiling
Another temp_ branch :S This time for preparing custom manipulators core code for merge.
2016-09-08 22:48:37 +02:00
3282 changed files with 862541 additions and 107996 deletions

View File

@@ -1,6 +1,6 @@
{
"project_id" : "Blender",
"conduit_uri" : "https://developer.blender.org/",
"git.default-relative-commit" : "origin/master",
"git.default-relative-commit" : "origin/blender2.8",
"arc.land.update.default" : "rebase"
}

9
.gitignore vendored
View File

@@ -21,7 +21,6 @@ Desktop.ini
# commonly used paths in blender
/blender.bin
/user-config.py
/BUILD_NOTES.txt
# local patches
@@ -34,8 +33,6 @@ Desktop.ini
/doc/python_api/sphinx-in/
/doc/python_api/sphinx-out/
/doc/python_api/rst/bmesh.ops.rst
/doc/python_api/rst/in_menu.png
/doc/python_api/rst/menu_id.png
/doc/python_api/rst/op_prop.png
/doc/python_api/rst/run_script.png
/doc/python_api/rst/spacebar.png
# in-source lib downloads
/build_files/build_environment/downloads

8
.gitmodules vendored
View File

@@ -1,16 +1,24 @@
[submodule "release/scripts/addons"]
path = release/scripts/addons
url = ../blender-addons.git
branch = blender2.8
ignore = all
branch = master
[submodule "release/scripts/addons_contrib"]
path = release/scripts/addons_contrib
url = ../blender-addons-contrib.git
branch = master
ignore = all
branch = master
[submodule "release/datafiles/locale"]
path = release/datafiles/locale
url = ../blender-translations.git
branch = master
ignore = all
branch = master
[submodule "source/tools"]
path = source/tools
url = ../blender-dev-tools.git
branch = master
ignore = all
branch = master

View File

@@ -32,7 +32,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
if(NOT DEFINED WITH_IN_SOURCE_BUILD)
message(FATAL_ERROR
"CMake generation for blender is not allowed within the source directory!"
"\n Remove the CMakeCache.txt file and try again from another folder, e.g.:"
"\n Remove \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" and try again from another folder, e.g.:"
"\n "
"\n rm CMakeCache.txt"
"\n cd .."
@@ -45,7 +45,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()
endif()
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.5)
if(NOT EXECUTABLE_OUTPUT_PATH)
set(FIRST_RUN TRUE)
@@ -58,7 +58,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/platform")
# avoid having empty buildtype
set(CMAKE_BUILD_TYPE_INIT "Release")
if(NOT DEFINED CMAKE_BUILD_TYPE_INIT)
set(CMAKE_BUILD_TYPE_INIT "Release")
endif()
# quiet output for Makefiles, 'make -s' helps too
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
@@ -192,7 +194,7 @@ endif()
#-----------------------------------------------------------------------------
# Options
# First platform spesific non-cached vars
# First platform specific non-cached vars
if(UNIX AND NOT APPLE)
set(WITH_X11 ON)
endif()
@@ -229,7 +231,7 @@ mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ${_init_FFTW3})
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ${_init_FFTW3})
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced(WITH_SYSTEM_BULLET)
@@ -242,6 +244,8 @@ endif()
option(WITH_PLAYER "Build Player" OFF)
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
option(WITH_CLAY_ENGINE "Enable Clay engine" ON)
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
@@ -287,7 +291,7 @@ if(WITH_X11)
endif()
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" ON)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
else()
# not an option for other OS's
@@ -332,10 +336,6 @@ option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd
option(WITH_ALEMBIC "Enable Alembic Support" OFF)
option(WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF)
if(APPLE)
option(WITH_CODEC_QUICKTIME "Enable Quicktime Support" OFF)
endif()
# 3D format support
# Disable opencollada when we don't have precompiled libs
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${_init_OPENCOLLADA})
@@ -363,6 +363,12 @@ option(WITH_LIBMV "Enable Libmv structure from motion library" ON)
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." OFF)
mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
# Logging/unbit test libraries.
option(WITH_SYSTEM_GFLAGS "Use system-wide Gflags instead of a bundled one" OFF)
option(WITH_SYSTEM_GLOG "Use system-wide Glog instead of a bundled one" OFF)
mark_as_advanced(WITH_SYSTEM_GFLAGS)
mark_as_advanced(WITH_SYSTEM_GLOG)
# Freestyle
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
@@ -382,10 +388,14 @@ if(UNIX AND NOT APPLE)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
if(WITH_PYTHON_INSTALL)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
if(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
mark_as_advanced(PYTHON_NUMPY_PATH)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
if(WITH_PYTHON_INSTALL)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
if(UNIX AND NOT APPLE)
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@ -445,6 +455,7 @@ option(WITH_BOOST "Enable features depending on boost" ON)
# Unit testsing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_TESTS "Enable OpenGL related unit testing (Experimental)" OFF)
# Documentation
@@ -455,28 +466,16 @@ endif()
# OpenGL
option(WITH_GLEW_MX "Support multiple GLEW contexts (experimental)" OFF )
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
mark_as_advanced(
WITH_GLEW_MX
WITH_GLEW_ES
WITH_GL_EGL
WITH_GL_PROFILE_COMPAT
WITH_GL_PROFILE_CORE
WITH_GL_PROFILE_ES20
)
if(WITH_GL_PROFILE_COMPAT)
set(WITH_GLU ON)
else()
set(WITH_GLU OFF)
endif()
if(WIN32)
option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
mark_as_advanced(WITH_GL_ANGLE)
@@ -495,7 +494,12 @@ endif()
# Experimental support of C11 and C++11
#
# We default options to whatever default standard in the current compiler.
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
if(APPLE)
set(_c11_init ON)
set(_cxx11_init ON)
set(WITH_C11 ON)
set(WITH_CXX11 ON)
elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
set(_c11_init ON)
else()
set(_c11_init OFF)
@@ -514,21 +518,23 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif()
# Dependency graph
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
option(WITH_DEPSGRAPH_COPY_ON_WRITE "Build Blender with copy-on-write support for dependency graph" OFF)
mark_as_advanced(WITH_DEPSGRAPH_COPY_ON_WRITE)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
if(WIN32)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
option(WITH_WINDOWS_CODESIGN "Use signtool to sign the final binary." OFF)
mark_as_advanced(WITH_WINDOWS_CODESIGN)
option(WITH_WINDOWS_CODESIGN "Use signtool to sign the final binary." OFF)
mark_as_advanced(WITH_WINDOWS_CODESIGN)
set(WINDOWS_CODESIGN_PFX CACHE FILEPATH "Path to pfx file to use for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX)
set(WINDOWS_CODESIGN_PFX CACHE FILEPATH "Path to pfx file to use for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX)
set(WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX_PASSWORD)
set(WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX_PASSWORD)
endif()
# avoid using again
option_defaults_clear()
@@ -556,113 +562,7 @@ endif()
# Apple
if(APPLE)
# require newer cmake on osx because of version handling,
# older cmake cannot handle 2 digit subversion!
cmake_minimum_required(VERSION 3.0.0)
if(NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
"Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
FORCE)
endif()
if(NOT DEFINED OSX_SYSTEM)
execute_process(
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE OSX_SYSTEM
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
# workaround for incorrect cmake xcode lookup for developer previews - XCODE_VERSION does not
# take xcode-select path into account but would always look into /Applications/Xcode.app
# while dev versions are named Xcode<version>-DP<preview_number>
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_CHECK OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${XCODE_CHECK}) # truncate to bundlepath in any case
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# earlier xcode has no bundled developer dir, no sense in getting xcode path from
if(${XCODE_VERSION} VERSION_GREATER 4.2)
# reduce to XCode name without dp extension
string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME)
if(${DP_NAME} MATCHES Xcode5)
set(XCODE_VERSION 5)
endif()
endif()
##### cmake incompatibility with xcode 4.3 and higher #####
if(${XCODE_VERSION} MATCHES '') # cmake fails due looking for xcode in the wrong path, thus will be empty var
message(FATAL_ERROR "Xcode 4.3 and higher must be used with cmake 2.8-8 or higher")
endif()
### end cmake incompatibility with xcode 4.3 and higher ###
if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4 AND ${XCODE_VERSION} VERSION_LESS 4.3)
# Xcode 4 defaults to the Apple LLVM Compiler.
# Override the default compiler selection because Blender only compiles with gcc up to xcode 4.2
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
endif()
else() # unix makefile generator does not fill XCODE_VERSION var, so we get it with a command
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILD_NR)
string(SUBSTRING "${XCODE_VERS_BUILD_NR}" 6 3 XCODE_VERSION) # truncate away build-nr
unset(XCODE_VERS_BUILD_NR)
endif()
message(STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_BUNDLE}")
if(${XCODE_VERSION} VERSION_LESS 4.3)
# use guaranteed existing sdk
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk CACHE PATH "" FORCE)
else()
# note: xcode-select path could be ambigous,
# cause /Applications/Xcode.app/Contents/Developer or /Applications/Xcode.app would be allowed
# so i use a selfcomposed bundlepath here
set(OSX_SYSROOT_PREFIX ${XCODE_BUNDLE}/Contents/Developer/Platforms/MacOSX.platform)
message(STATUS "OSX_SYSROOT_PREFIX: " ${OSX_SYSROOT_PREFIX})
set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk
set(CMAKE_OSX_SYSROOT ${OSX_SYSROOT_PREFIX}/${OSX_DEVELOPER_PREFIX} CACHE PATH "" FORCE)
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# to silence sdk not found warning, just overrides CMAKE_OSX_SYSROOT
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT macosx${OSX_SYSTEM})
endif()
# QuickTime framework is no longer available in SDK 10.12+
if(WITH_CODEC_QUICKTIME AND ${OSX_SYSTEM} VERSION_GREATER 10.11)
set(WITH_CODEC_QUICKTIME OFF)
message(STATUS "QuickTime not supported by SDK ${OSX_SYSTEM}, disabling WITH_CODEC_QUICKTIME")
endif()
endif()
if(OSX_SYSTEM MATCHES 10.9)
# make sure syslibs and headers are looked up in sdk ( expecially for 10.9 openGL atm. )
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT})
endif()
if(WITH_CXX11)
# 10.9 is our min. target, if you use higher sdk, weak linking happens
if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
message(STATUS "Setting deployment target to 10.9, lower versions are incompatible with WITH_CXX11")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
endif()
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
endif()
else()
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
# 10.6 is our min. target, if you use higher sdk, weak linking happens
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE)
endif()
endif()
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
# force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else ( cmake bug ? )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
add_definitions("-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
include(platform_apple_xcode)
endif()
@@ -680,6 +580,12 @@ if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
endif()
if(NOT WITH_CXX11)
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
endif()
endif()
if(NOT WITH_AUDASPACE)
if(WITH_OPENAL)
message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
@@ -722,22 +628,17 @@ if(NOT WITH_BOOST)
macro(set_and_warn
_setting _val)
if(${${_setting}})
message(STATUS "'WITH_BOOST' is disabled: forceing 'set(${_setting} ${_val})'")
message(STATUS "'WITH_BOOST' is disabled: forcing 'set(${_setting} ${_val})'")
endif()
set(${_setting} ${_val})
endmacro()
set_and_warn(WITH_CYCLES OFF)
set_and_warn(WITH_AUDASPACE OFF)
set_and_warn(WITH_INTERNATIONAL OFF)
set_and_warn(WITH_OPENVDB OFF)
set_and_warn(WITH_OPENCOLORIO OFF)
set_and_warn(WITH_MOD_BOOLEAN OFF)
set_and_warn(WITH_OPENAL OFF) # depends on AUDASPACE
set_and_warn(WITH_GAMEENGINE OFF) # depends on AUDASPACE
set_and_warn(WITH_PLAYER OFF) # depends on GAMEENGINE
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL OR
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_MOD_BOOLEAN)
# Keep enabled
else()
@@ -805,30 +706,9 @@ TEST_SHARED_PTR_SUPPORT()
TEST_UNORDERED_MAP_SUPPORT()
if(WITH_AUDASPACE)
if(WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_DEFINITIONS
-DWITH_AUDASPACE
-DWITH_SYSTEM_AUDASPACE
"-DAUD_DEVICE_H=<AUD_Device.h>"
"-DAUD_SPECIAL_H=<AUD_Special.h>"
"-DAUD_SOUND_H=<AUD_Sound.h>"
"-DAUD_HANDLE_H=<AUD_Handle.h>"
"-DAUD_SEQUENCE_H=<AUD_Sequence.h>"
"-DAUD_TYPES_H=<AUD_Types.h>"
"-DAUD_PYTHON_H=<python/PyAPI.h>"
)
else()
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
set(AUDASPACE_DEFINITIONS
-DWITH_AUDASPACE
"-DAUD_DEVICE_H=<AUD_C-API.h>"
"-DAUD_SPECIAL_H=<AUD_C-API.h>"
"-DAUD_SOUND_H=<AUD_C-API.h>"
"-DAUD_HANDLE_H=<AUD_C-API.h>"
"-DAUD_SEQUENCE_H=<AUD_C-API.h>"
"-DAUD_TYPES_H=<AUD_Space.h>"
)
if(NOT WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings")
endif()
endif()
@@ -923,7 +803,7 @@ if(WITH_X11)
if(WITH_X11_ALPHA)
find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
mark_as_advanced(X11_Xrender_LIB)
if (X11_Xrender_LIB)
if(X11_Xrender_LIB)
list(APPEND PLATFORM_LINKLIBS ${X11_Xrender_LIB})
else()
set(WITH_X11_ALPHA OFF)
@@ -1009,16 +889,16 @@ endif()
if(MSVC)
# for some reason this fails on msvc
add_definitions(-D__LITTLE_ENDIAN__)
# OSX-Note: as we do crosscompiling with specific set architecture,
# endianess-detection and autosetting is counterproductive
# OSX-Note: as we do cross-compiling with specific set architecture,
# endianess-detection and auto-setting is counterproductive
# so we just set endianess according CMAKE_OSX_ARCHITECTURES
elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
add_definitions(-D__LITTLE_ENDIAN__)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64)
add_definitions(-D__BIG_ENDIAN__)
else()
include(TestBigEndian)
test_big_endian(_SYSTEM_BIG_ENDIAN)
@@ -1053,19 +933,11 @@ endif()
find_package(OpenGL)
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
if(WITH_GLU)
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
list(APPEND GL_DEFINITIONS -DWITH_GLU)
endif()
if(WITH_SYSTEM_GLES)
find_package_wrapper(OpenGLES)
endif()
if(WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE)
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
elseif(WITH_GL_PROFILE_ES20)
if(WITH_GL_PROFILE_ES20)
if(WITH_SYSTEM_GLES)
if(NOT OPENGLES_LIBRARY)
message(FATAL_ERROR
@@ -1125,6 +997,9 @@ elseif(WITH_GL_PROFILE_ES20)
endif()
else()
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
endif()
if(WITH_GL_EGL)
@@ -1172,16 +1047,10 @@ if(WITH_GL_EGL)
endif()
if(WITH_GL_PROFILE_COMPAT)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_COMPAT)
endif()
if(WITH_GL_PROFILE_CORE)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
endif()
if(WITH_GL_PROFILE_ES20)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20)
else()
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
endif()
if(WITH_GL_EGL)
@@ -1218,10 +1087,6 @@ endif()
#-----------------------------------------------------------------------------
# Configure GLEW
if(WITH_GLEW_MX)
list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
endif()
if(WITH_SYSTEM_GLEW)
find_package(GLEW)
@@ -1231,11 +1096,7 @@ if(WITH_SYSTEM_GLEW)
message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
endif()
if(WITH_GLEW_MX)
set(BLENDER_GLEW_LIBRARIES ${GLEW_MX_LIBRARY})
else()
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
endif()
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
else()
if(WITH_GLEW_ES)
set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
@@ -1243,12 +1104,11 @@ else()
list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
# These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
if(NOT WITH_GL_PROFILE_ES20)
if(WITH_GL_PROFILE_ES20)
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
else()
# No ES functions are needed
list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
elseif(NOT (WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT))
# ES is enabled, but the other functions are all disabled
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
endif()
if(WITH_GL_PROFILE_ES20)
@@ -1285,9 +1145,7 @@ else()
endif()
if(NOT WITH_GLU)
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
endif()
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
#-----------------------------------------------------------------------------
# Configure Bullet
@@ -1313,15 +1171,42 @@ endif()
# Configure GLog/GFlags
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
set(GLOG_DEFINES
-DGOOGLE_GLOG_DLL_DECL=
)
if(WITH_SYSTEM_GFLAGS)
find_package(Gflags)
if(NOT GFLAGS_FOUND)
message(FATAL_ERROR "System wide Gflags is requested but was not found")
endif()
# FindGflags does not define this, and we are not even sure what to use here.
set(GFLAGS_DEFINES)
else()
set(GFLAGS_DEFINES
-DGFLAGS_DLL_DEFINE_FLAG=
-DGFLAGS_DLL_DECLARE_FLAG=
-DGFLAGS_DLL_DECL=
)
set(GFLAGS_NAMESPACE "gflags")
set(GFLAGS_LIBRARIES extern_gflags)
set(GFLAGS_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/extern/gflags/src")
endif()
set(GFLAGS_DEFINES
-DGFLAGS_DLL_DEFINE_FLAG=
-DGFLAGS_DLL_DECLARE_FLAG=
-DGFLAGS_DLL_DECL=
)
if(WITH_SYSTEM_GLOG)
find_package(Glog)
if(NOT GLOG_FOUND)
message(FATAL_ERROR "System wide Glog is requested but was not found")
endif()
# FindGlog does not define this, and we are not even sure what to use here.
set(GLOG_DEFINES)
else()
set(GLOG_DEFINES
-DGOOGLE_GLOG_DLL_DECL=
)
set(GLOG_LIBRARIES extern_glog)
if(WIN32)
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src/windows)
else()
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src)
endif()
endif()
endif()
#-----------------------------------------------------------------------------
@@ -1392,6 +1277,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_RESTRICT -Wrestrict)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -1433,6 +1319,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_FORMAT_SIGN -Wformat-signedness)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -1445,10 +1332,20 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
endif()
# Use 'ATTR_FALLTHROUGH' macro to suppress.
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5)
endif()
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
endif()
if(NOT APPLE)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
endif()
@@ -1459,7 +1356,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib -liomp5") # these are only used for the checks
endif()
# strange, clang complains these are not supported, but then yses them.
# strange, clang complains these are not supported, but then uses them.
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
@@ -1533,6 +1430,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
"/wd4800" # forcing value to bool 'true' or 'false'
# errors:
"/we4013" # 'function' undefined; assuming extern returning int
"/we4133" # incompatible pointer types
"/we4431" # missing type specifier - int assumed
)
@@ -1555,10 +1453,15 @@ if(WITH_PYTHON)
)
endif()
if(WIN32 OR APPLE)
if(WIN32)
# pass, we have this in an archive to extract
elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
find_python_package(numpy)
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
find_python_package(numpy)
unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
endif()
if(WIN32 OR APPLE)
@@ -1603,7 +1506,7 @@ endif()
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")
set(CMAKE_CXX_FLAGS "${CXX_WARNINGS} ${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS}")
# defined above, platform spesific but shared names
# defined above, platform specific but shared names
mark_as_advanced(
CYCLES_OSL
OSL_LIB_EXEC
@@ -1795,10 +1698,7 @@ if(FIRST_RUN)
info_cfg_text("OpenGL:")
info_cfg_option(WITH_GLEW_ES)
info_cfg_option(WITH_GLU)
info_cfg_option(WITH_GL_EGL)
info_cfg_option(WITH_GL_PROFILE_COMPAT)
info_cfg_option(WITH_GL_PROFILE_CORE)
info_cfg_option(WITH_GL_PROFILE_ES20)
if(WIN32)
info_cfg_option(WITH_GL_ANGLE)
@@ -1812,4 +1712,3 @@ endif()
if(0)
print_all_vars()
endif()

View File

@@ -1,4 +1,4 @@
# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
# -*- mode: gnumakefile; tab-width: 4; indent-tabs-mode: t; -*-
# vim: tabstop=4
#
# ##### BEGIN GPL LICENSE BLOCK #####
@@ -43,6 +43,11 @@ ifndef BUILD_DIR
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
endif
# Dependencies DIR's
DEPS_SOURCE_DIR:=$(BLENDER_DIR)/build_files/build_environment
DEPS_BUILD_DIR:=$(BUILD_DIR)/deps
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
# Allow to use alternative binary (pypy3, etc)
ifndef PYTHON
PYTHON:=python3
@@ -86,13 +91,7 @@ ifndef NPROCS
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifeq ($(OS), Darwin)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), FreeBSD)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), NetBSD)
ifneq (,$(filter $(OS),Darwin FreeBSD NetBSD))
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
endif
@@ -104,7 +103,7 @@ endif
CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
-H"$(BLENDER_DIR)" \
-B"$(BUILD_DIR)" \
-DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE)
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
# -----------------------------------------------------------------------------
@@ -113,7 +112,7 @@ CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
# X11 spesific
ifdef DISPLAY
CMAKE_CONFIG_TOOL = cmake-gui
else
else
CMAKE_CONFIG_TOOL = ccmake
endif
@@ -127,7 +126,7 @@ all: .FORCE
# # if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
# # $(CMAKE_CONFIG); \
# # fi
# # do this always incase of failed initial build, could be smarter here...
@$(CMAKE_CONFIG)
@@ -146,6 +145,27 @@ cycles: all
headless: all
bpy: all
# -----------------------------------------------------------------------------
# Build dependencies
DEPS_TARGET = install
ifneq "$(findstring clean, $(MAKECMDGOALS))" ""
DEPS_TARGET = clean
endif
deps: .FORCE
@echo
@echo Configuring dependencies in \"$(DEPS_BUILD_DIR)\"
@cmake -H"$(DEPS_SOURCE_DIR)" \
-B"$(DEPS_BUILD_DIR)" \
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
@echo
@echo Building dependencies ...
$(MAKE) -C "$(DEPS_BUILD_DIR)" -s -j $(NPROCS) $(DEPS_TARGET)
@echo
@echo Dependencies successfully built and installed to $(DEPS_INSTALL_DIR).
@echo
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
@@ -164,6 +184,7 @@ help: .FORCE
@echo " * headless - build without an interface (renderfarm or server automation)"
@echo " * cycles - build Cycles standalone only, without Blender"
@echo " * bpy - build as a python module which can be loaded from python directly"
@echo " * deps - build library dependencies (intended only for platform maintainers)"
@echo ""
@echo " * config - run cmake configuration tool to set build options"
@echo ""
@@ -398,10 +419,16 @@ icons: .FORCE
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
update: .FORCE
if [ "$(OS_NCASE)" == "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
fi
if [ -d "../lib" ]; then \
svn cleanup ../lib/* ; \
svn update ../lib/* ; \
fi
git pull --rebase
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master

View File

@@ -0,0 +1,132 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
####################################################################################################
#
# This is a build system used by platform maintainers to build library dependencies on
# Windows and macOS. There is some support for Linux as well, but not ready for releases.
#
# Windows and macOS users should download the precompiled libraries in lib/, Linux users
# should run install_deps.sh for building dependencies.
#
# WINDOWS USAGE:
# Don't call this cmake file your self, use build_deps.cmd
# build_deps 2013 x64 / build_deps 2013 x86
# build_deps 2015 x64 / build_deps 2015 x86
#
# MAC OS X USAGE:
# Install with homebrew: brew install autoconf automake libtool yasm openssl xz
# Run "make deps" from main Blender directory
#
# LINUX USAGE:
# Install compiler, cmake, autoconf, automake, libtool, yasm
# Run "make deps" from main Blender directory
#
####################################################################################################
project("BlenderDependencies")
cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include(cmake/options.cmake)
include(cmake/versions.cmake)
include(cmake/zlib.cmake)
include(cmake/blendthumb.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/boost.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/ilmbase.cmake)
include(cmake/openexr.cmake)
include(cmake/freetype.cmake)
include(cmake/freeglut.cmake)
include(cmake/glew.cmake)
include(cmake/hdf5.cmake)
include(cmake/alembic.cmake)
include(cmake/glfw.cmake)
include(cmake/clew.cmake)
include(cmake/cuew.cmake)
include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake)
include(cmake/opencollada.cmake)
include(cmake/opencolorio.cmake)
include(cmake/llvm.cmake)
include(cmake/clang.cmake)
include(cmake/openimageio.cmake)
include(cmake/tiff.cmake)
include(cmake/flexbison.cmake)
include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/python.cmake)
include(cmake/python_site_packages.cmake)
include(cmake/numpy.cmake)
if (WITH_WEBP)
include(cmake/webp.cmake)
endif()
if(WIN32)
include(cmake/hidapi.cmake)
endif()
if(ENABLE_MINGW64)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
include(cmake/setup_mingw64.cmake)
else()
include(cmake/setup_mingw32.cmake)
endif()
else()
set(mingw_LIBDIR ${LIBDIR})
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/openjpeg.cmake)
if(BUILD_MODE STREQUAL Release)
if(WIN32)
include(cmake/zlib_mingw.cmake)
endif()
include(cmake/lame.cmake)
include(cmake/ogg.cmake)
include(cmake/vorbis.cmake)
include(cmake/theora.cmake)
include(cmake/vpx.cmake)
include(cmake/orc.cmake)
include(cmake/schroedinger.cmake)
include(cmake/x264.cmake)
include(cmake/xvidcore.cmake)
include(cmake/faad.cmake)
include(cmake/ffmpeg.cmake)
include(cmake/fftw.cmake)
include(cmake/sndfile.cmake)
if(WIN32)
include(cmake/iconv.cmake)
include(cmake/lapack.cmake)
endif()
if(UNIX)
include(cmake/flac.cmake)
if(NOT APPLE)
include(cmake/spnav.cmake)
include(cmake/jemalloc.cmake)
include(cmake/xml2.cmake)
endif()
endif()
endif()
endif()
include(cmake/harvest.cmake)

View File

@@ -0,0 +1,75 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(ALEMBIC_HDF5)
set(ALEMBIC_HDF5_HL)
# in debug mode we do not build HDF5_hdf5_hl_LIBRARY which makes cmake really
# unhappy, stub it with the debug mode lib. it's not linking it in at this
# point in time anyhow
if(BUILD_MODE STREQUAL Debug)
set(ALEMBIC_HDF5_HL -DHDF5_hdf5_hl_LIBRARY=${LIBDIR}/hdf5/lib/libhdf5_hl_D.${LIBEXT})
endif()
endif()
set(ALEMBIC_EXTRA_ARGS
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DALEMBIC_LIB_USES_BOOST=ON
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DUSE_STATIC_BOOST=On
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBoost_DEBUG=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DILMBASE_ROOT=${LIBDIR}/ilmbase
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/ilmbase/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Half${LIBEXT}
-DALEMBIC_ILMBASE_IMATH_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DALEMBIC_ILMBASE_ILMTHREAD_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DALEMBIC_ILMBASE_IEX_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DUSE_PYILMBASE=0
-DUSE_PYALEMBIC=0
-DUSE_ARNOLD=0
-DUSE_MAYA=0
-DUSE_PRMAN=0
-DUSE_HDF5=Off
-DUSE_STATIC_HDF5=Off
-DHDF5_ROOT=${LIBDIR}/hdf5
-DUSE_TESTS=Off
-DALEMBIC_NO_OPENGL=1
-DUSE_BINARIES=ON
-DALEMBIC_ILMBASE_LINK_STATIC=On
-DALEMBIC_SHARED_LIBS=OFF
-DGLUT_INCLUDE_DIR=""
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
${ALEMBIC_HDF5_HL}
)
ExternalProject_Add(external_alembic
URL ${ALEMBIC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ALEMBIC_MD5}
PREFIX ${BUILD_DIR}/alembic
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ALEMBIC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/alembic
)
add_dependencies(external_alembic external_boost external_zlib external_ilmbase)

View File

@@ -0,0 +1,61 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release)
if(WIN32)
set(THUMB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../release/windows/blendthumb)
ExternalProject_Add(external_zlib_32
URL ${ZLIB_URI}
CMAKE_GENERATOR ${GENERATOR_32}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib32
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib32 ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib32
)
ExternalProject_Add(external_zlib_64
URL ${ZLIB_URI}
CMAKE_GENERATOR ${GENERATOR_64}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib64
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib64 ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib64
)
ExternalProject_Add(external_blendthumb_32
CMAKE_GENERATOR ${GENERATOR_32}
SOURCE_DIR ${THUMB_DIR}
PREFIX ${BUILD_DIR}/blendthumb32
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb32 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib32/include -DZLIB_LIBS=${LIBDIR}/zlib32/lib/zlibstatic.lib
INSTALL_DIR ${LIBDIR}/blendthumb32
)
add_dependencies(external_blendthumb_32 external_zlib_32)
ExternalProject_Add(external_blendthumb_64
CMAKE_GENERATOR ${GENERATOR_64}
SOURCE_DIR ${THUMB_DIR}
PREFIX ${BUILD_DIR}/blendthumb64
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb64 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib64/include -DZLIB_LIBS=${LIBDIR}/zlib64/lib/zlibstatic.lib
INSTALL_DIR ${LIBDIR}/blendthumb64
)
add_dependencies(external_blendthumb_64 external_zlib_64)
endif()
endif()

View File

@@ -0,0 +1,43 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(BLOSC_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DBUILD_TESTS=OFF
-DBUILD_BENCHMARKS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DThreads_FOUND=1
-DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC2.lib
-DPTHREAD_INCLUDE_DIR=${LIBDIR}/pthreads/inc
)
ExternalProject_Add(external_blosc
URL ${BLOSC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${BLOSC_HASH}
PREFIX ${BUILD_DIR}/blosc
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/blosc
)
add_dependencies(external_blosc external_zlib)
if(WIN32)
add_dependencies(external_blosc external_pthreads)
endif()

View File

@@ -0,0 +1,107 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PYTHON_ARCH x64)
set(PYTHON_ARCH2 win-AMD64)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/amd64/)
else()
set(PYTHON_ARCH x86)
set(PYTHON_ARCH2 win32)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
endif()
if(MSVC12)
set(BOOST_TOOLSET toolset=msvc-12.0)
set(BOOST_COMPILER_STRING -vc120)
set(PYTHON_COMPILER_STRING v120)
endif()
if(MSVC14)
set(BOOST_TOOLSET toolset=msvc-14.0)
set(BOOST_COMPILER_STRING -vc140)
set(PYTHON_COMPILER_STRING v140)
endif()
set(JAM_FILE ${BUILD_DIR}/boost/src/external_boost/user-config.jam)
set(semi_path "${PATCH_DIR}/semi.txt")
FILE(TO_NATIVE_PATH ${semi_path} semi_path)
set(BOOST_CONFIGURE_COMMAND bootstrap.bat &&
echo using python : ${PYTHON_OUTPUTDIR}\\python.exe > "${JAM_FILE}" &&
echo. : ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/pc >> "${JAM_FILE}" &&
echo. : ${BUILD_DIR}/python/src/external_python/pcbuild >> "${JAM_FILE}" &&
type ${semi_path} >> "${JAM_FILE}"
)
set(BOOST_BUILD_COMMAND bjam)
#--user-config=user-config.jam
set(BOOST_BUILD_OPTIONS runtime-link=static )
#set(BOOST_WITH_PYTHON --with-python)
set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
if(BUILD_MODE STREQUAL Release)
set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-1_60/ ${HARVEST_TARGET}/boost/include/)
endif()
elseif(APPLE)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./bjam)
set(BOOST_BUILD_OPTIONS toolset=clang cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} --disable-icu boost.locale.icu=off)
set(BOOST_HARVEST_CMD echo .)
else()
set(BOOST_HARVEST_CMD echo .)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./bjam)
set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off)
endif()
set(BOOST_OPTIONS
--with-filesystem
--with-locale
--with-thread
--with-regex
--with-system
--with-date_time
--with-wave
--with-atomic
--with-serialization
--with-program_options
--with-iostreams
${BOOST_WITH_PYTHON}
${BOOST_TOOLSET}
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(BOOST_ADDRESS_MODEL 64)
else()
set(BOOST_ADDRESS_MODEL 32)
endif()
string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
ExternalProject_Add(external_boost
URL ${BOOST_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${BOOST_MD5}
PREFIX ${BUILD_DIR}/boost
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=x86 address-model=${BOOST_ADDRESS_MODEL} variant=${BOOST_BUILD_TYPE} link=static threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install
BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
)
if(WIN32)
add_dependencies(external_boost Make_Python_Environment)
endif()

View File

@@ -0,0 +1,51 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLANG_EXTRA_ARGS
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
-DLLVM_USE_CRT_RELEASE=MT
-DLLVM_USE_CRT_DEBUG=MTd
)
ExternalProject_Add(external_clang
URL ${CLANG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_HASH}
PATCH_COMMAND ${PATCH_CMD} -p 2 -N -R -d ${BUILD_DIR}/clang/src/external_clang < ${PATCH_DIR}/clang.diff
PREFIX ${BUILD_DIR}/clang
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clang ${DEFAULT_CMAKE_FLAGS} ${CLANG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clang
)
if (MSVC)
if (BUILD_MODE STREQUAL Release)
set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/ )
else()
set(CLANG_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/include/ ${HARVEST_TARGET}/llvm/debug/include/
)
endif()
ExternalProject_Add_Step(external_clang after_install
COMMAND ${CLANG_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()
add_dependencies(external_clang ll)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLEW_EXTRA_ARGS)
ExternalProject_Add(external_clew
URL ${CLEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLEW_HASH}
PREFIX ${BUILD_DIR}/clew
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clew
)

View File

@@ -0,0 +1,29 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CUEW_EXTRA_ARGS)
ExternalProject_Add(external_cuew
URL ${CUEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CUEW_HASH}
PREFIX ${BUILD_DIR}/cuew
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/cuew/src/external_cuew < ${PATCH_DIR}/cuew.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/cuew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CUEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/cuew
)

View File

@@ -0,0 +1,35 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FAAD_EXTRA_ARGS)
ExternalProject_Add(external_faad
URL ${FAAD_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FAAD_HASH}
PREFIX ${BUILD_DIR}/faad
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/faad/src/external_faad < ${PATCH_DIR}/libfaad.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && ${CONFIGURE_COMMAND} --disable-shared --enable-static --prefix=${LIBDIR}/faad
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make install
INSTALL_DIR ${LIBDIR}/faad
)
if(MSVC)
set_target_properties(external_faad PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,119 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/dirac/include/dirac -I${mingw_LIBDIR}/schroedinger/include/schroedinger-1.0 -I${mingw_LIBDIR}/zlib/include")
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/dirac/lib -L${mingw_LIBDIR}/schroedinger/lib -L${mingw_LIBDIR}/orc/lib -L${mingw_LIBDIR}/zlib/lib")
set(FFMPEG_EXTRA_FLAGS --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/schroedinger/lib/pkgconfig:${mingw_LIBDIR}/orc/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR})
if(WIN32)
set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--disable-static
--enable-shared
--enable-w32threads
--disable-pthreads
--enable-libopenjpeg
)
else()
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--enable-static
--disable-shared
--enable-libopenjpeg)
endif()
if(APPLE)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--target-os=darwin
)
endif()
ExternalProject_Add(external_ffmpeg
URL ${FFMPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FFMPEG_HASH}
PREFIX ${BUILD_DIR}/ffmpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} &&
cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ &&
${FFMPEG_ENV} ${CONFIGURE_COMMAND_NO_TARGET} ${FFMPEG_EXTRA_FLAGS}
--disable-lzma
--disable-avfilter
--disable-vdpau
--disable-bzlib
--disable-libgsm
--disable-libspeex
--enable-libvpx
--prefix=${LIBDIR}/ffmpeg
--enable-libschroedinger
--enable-libtheora
--enable-libvorbis
--enable-zlib
--enable-stripping
--enable-runtime-cpudetect
--disable-vaapi
--disable-nonfree
--enable-gpl
--disable-postproc
--disable-x11grab
--enable-libmp3lame
--disable-librtmp
--enable-libx264
--enable-libxvid
--disable-libopencore-amrnb
--disable-libopencore-amrwb
--disable-libdc1394
--disable-version3
--disable-debug
--enable-optimizations
--disable-sse
--disable-ssse3
--enable-ffplay
--disable-openssl
--disable-securetransport
--disable-indev=avfoundation
--disable-indev=qtkit
--disable-sdl
--disable-gnutls
--disable-vda
--disable-videotoolbox
--disable-libxcb
--disable-xlib
--disable-audiotoolbox
--disable-cuvid
--disable-nvenc
--disable-indev=jack
--disable-indev=alsa
--disable-outdev=alsa
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/ffmpeg/src/external_ffmpeg < ${PATCH_DIR}/ffmpeg.diff
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ffmpeg ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/ffmpeg
)
if(MSVC)
set_target_properties(external_ffmpeg PROPERTIES FOLDER Mingw)
endif(MSVC)
add_dependencies(external_ffmpeg external_zlib external_faad external_openjpeg external_xvidcore external_x264 external_schroedinger external_vpx external_theora external_vorbis external_ogg external_lame)
if(WIN32)
add_dependencies(external_ffmpeg external_zlib_mingw)
endif()

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FFTW_EXTRA_ARGS)
if(WIN32)
set(FFTW3_ENV set CFLAGS=-fno-stack-check -fno-stack-protector -mno-stack-arg-probe -fno-lto &&)
set(FFTW3_PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/fftw3/src/external_fftw3 < ${PATCH_DIR}/fftw3.diff)
endif()
ExternalProject_Add(external_fftw3
URL ${FFTW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FFTW_HASH}
PREFIX ${BUILD_DIR}/fftw3
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${FFTW3_ENV} cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/fftw3
PATCH_COMMAND ${FFTW3_PATCH_COMMAND}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make install
INSTALL_DIR ${LIBDIR}/fftw3
)
if(MSVC)
set_target_properties(external_fftw3 PROPERTIES FOLDER Mingw)
endif(MSVC)

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_flac
URL ${FLAC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${FLAC_HASH}
PREFIX ${BUILD_DIR}/flac
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flac --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make install
INSTALL_DIR ${LIBDIR}/flac
)
if(MSVC)
set_target_properties(external_flac PROPERTIES FOLDER Mingw)
endif(MSVC)

View File

@@ -0,0 +1,31 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FLEXBISON_EXTRA_ARGS)
ExternalProject_Add(external_flexbison
URL ${FLEXBISON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FLEXBISON_HASH}
PREFIX ${BUILD_DIR}/flexbison
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/flexbison ${DEFAULT_CMAKE_FLAGS} ${FLEXBISON_EXTRA_ARGS}
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/flexbison/src/external_flexbison/ ${LIBDIR}/flexbison/
INSTALL_DIR ${LIBDIR}/flexbison
)

View File

@@ -0,0 +1,35 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
if(BUILD_MODE STREQUAL Release)
set(FREEGLUT_EXTRA_ARGS
-DFREEGLUT_BUILD_SHARED_LIBS=Off
-DFREEGLUT_BUILD_STATIC_LIBS=On
)
ExternalProject_Add(external_freeglut
URL ${FREEGLUT_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FREEGLUT_HASH}
PREFIX ${BUILD_DIR}/freeglut
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freeglut ${DEFAULT_C_FLAGS} ${DEFAULT_CXX_FLAGS} ${FREEGLUT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freeglut
)
endif()
endif()

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FREETYPE_EXTRA_ARGS -DCMAKE_RELEASE_POSTFIX:STRING=2ST -DCMAKE_DEBUG_POSTFIX:STRING=2ST_d -DWITH_BZip2=OFF -DWITH_HarfBuzz=OFF)
ExternalProject_Add(external_freetype
URL ${FREETYPE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FREETYPE_HASH}
PREFIX ${BUILD_DIR}/freetype
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freetype ${DEFAULT_CMAKE_FLAGS} ${FREETYPE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freetype
)

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GLEW_EXTRA_ARGS
-DBUILD_UTILS=Off
-DBUILD_SHARED_LIBS=Off
)
ExternalProject_Add(external_glew
URL ${GLEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLEW_HASH}
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_glew.txt ${BUILD_DIR}/glew/src/external_glew/CMakeLists.txt
PREFIX ${BUILD_DIR}/glew
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glew ${DEFAULT_CMAKE_FLAGS} ${GLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glew
)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GLFW_EXTRA_ARGS)
ExternalProject_Add(external_glfw
URL ${GLFW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLFW_HASH}
PREFIX ${BUILD_DIR}/glfw
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glfw -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${GLFW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glfw
)

View File

@@ -0,0 +1,279 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
########################################################################
# Copy all generated files to the proper strucure as blender prefers
########################################################################
if(NOT DEFINED HARVEST_TARGET)
set(HARVEST_TARGET ${CMAKE_CURRENT_SOURCE_DIR}/Harvest)
endif()
message("HARVEST_TARGET = ${HARVEST_TARGET}")
if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
# Zlib Rename the lib file and copy the include/bin folders
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstatic.lib ${HARVEST_TARGET}/zlib/lib/libz_st.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/include/ ${HARVEST_TARGET}/zlib/include/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/bin/ ${HARVEST_TARGET}/zlib/bin/ &&
# jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# FreeType, straight up copy
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype &&
# pthreads, rename include dir
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/inc/ ${HARVEST_TARGET}/pthreads/include/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/lib/ ${HARVEST_TARGET}/pthreads/lib &&
# ffmpeg copy include+bin
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ffmpeg/include ${HARVEST_TARGET}/ffmpeg/include &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ffmpeg/bin ${HARVEST_TARGET}/ffmpeg/lib &&
# sdl merge bin/lib folder, copy include
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/include/sdl2 ${HARVEST_TARGET}/sdl/include &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/lib ${HARVEST_TARGET}/sdl/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/bin ${HARVEST_TARGET}/sdl/lib &&
# openal
${CMAKE_COMMAND} -E copy ${LIBDIR}/openal/lib/openal32.lib ${HARVEST_TARGET}/openal/lib/openal32.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openal/bin/openal32.dll ${HARVEST_TARGET}/openal/lib/openal32.dll &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openal/include/ ${HARVEST_TARGET}/openal/include/ &&
# OpenImageIO
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe &&
# openEXR
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ilmbase ${HARVEST_TARGET}/openexr &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# fftw3
${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/lib/libfftw3.a ${HARVEST_TARGET}/fftw3/lib/libfftw.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/include/fftw3.h ${HARVEST_TARGET}/fftw3/include/fftw3.h &&
# freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# sndfile
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/lib/libsndfile.dll.a ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
# iconv
${CMAKE_COMMAND} -E copy ${LIBDIR}/iconv/lib/libiconv.a ${HARVEST_TARGET}/iconv/lib/iconv.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/iconv/include/iconv.h ${HARVEST_TARGET}/iconv/include/iconv.h &&
# opencolorIO
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenColorIO/ ${HARVEST_TARGET}/opencolorio &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenColorIO/lib/OpenColorIO.dll ${HARVEST_TARGET}/opencolorio/bin/OpenColorIO.dll &&
# Osl
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/osl/ ${HARVEST_TARGET}/osl &&
# OpenVDB
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openVDB/ ${HARVEST_TARGET}/openVDB &&
# blosc
${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc.lib ${HARVEST_TARGET}/blosc/lib/libblosc.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/blosc/include/ ${HARVEST_TARGET}/blosc/include/ &&
# tbb
${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/ &&
# opencollada
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencollada/ ${HARVEST_TARGET}/opencollada/ &&
# opensubdiv
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opensubdiv ${HARVEST_TARGET}/opensubdiv &&
# python
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ &&
# alembic
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/alembic ${HARVEST_TARGET}/alembic &&
# hdf5
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5 ${HARVEST_TARGET}/hdf5 &&
# BlendThumb
${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb64/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb64.dll &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb32/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb.dll &&
# python
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}.tar.gz &&
# numpy
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}.tar.gz &&
# hidapi
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/ &&
# webp, straight up copy
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp
DEPENDS
)
endif(BUILD_MODE STREQUAL Release)
if(BUILD_MODE STREQUAL Debug)
add_custom_target(Harvest_Debug_Results
# OpenImageIO
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib &&
# ilmbase+openexr
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Half.lib ${HARVEST_TARGET}/openexr/lib/Half_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Iex-2_2.lib ${HARVEST_TARGET}/openexr/lib/Iex-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IexMath-2_2.lib ${HARVEST_TARGET}/openexr/lib/IexMath-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IlmThread-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmThread-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Imath-2_2.lib ${HARVEST_TARGET}/openexr/lib/Imath-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImf-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImf-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImfUtil-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImfUtil-2_2_d.lib &&
# opencollada
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/buffer.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/buffer_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/ftoa.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/ftoa_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/GeneratedSaxParser.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/GeneratedSaxParser_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/MathMLSolver.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/MathMLSolver_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADABaseUtils.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADABaseUtils_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAFramework.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAFramework_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/pcre.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/pcre_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/UTF.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/UTF_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/xml.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/xml_d.lib &&
# blosc
${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc_d.lib ${HARVEST_TARGET}/blosc/lib/libblosc_d.lib &&
# osl
${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib &&
# opensubdiv
${CMAKE_COMMAND} -E copy ${LIBDIR}/opensubdiv/lib/osdCPU.lib ${HARVEST_TARGET}/opensubdiv/lib/osdCPU_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opensubdiv/lib/osdGPU.lib ${HARVEST_TARGET}/opensubdiv/lib/osdGPU_d.lib &&
# tbb
${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib &&
# openvdb
${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib &&
# python
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ &&
# alembic
${CMAKE_COMMAND} -E copy ${LIBDIR}/alembic/lib/alembic.lib ${HARVEST_TARGET}/alembic/lib/alembic_d.lib &&
# hdf5
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib &&
# numpy
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz &&
# python
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz
DEPENDS Package_Python
)
endif(BUILD_MODE STREQUAL Debug)
else(WIN32)
function(harvest from to)
set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename})
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "clang" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
endif()
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(blosc/lib openvdb/lib "*.a")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(ilmbase openexr "*")
harvest(ilmbase/include openexr/include "*.h")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
endif()
harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h")
harvest(opencolorio/lib opencolorio/lib "*.a")
harvest(openexr/include openexr/include "*.h")
harvest(openexr/lib openexr/lib "*.a")
harvest(openimageio/bin openimageio/bin "idiff")
harvest(openimageio/bin openimageio/bin "maketx")
harvest(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest(openimageio/lib openimageio/lib "*.a")
harvest(openjpeg/include/openjpeg-1.5 openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb/openvdb openvdb/include/openvdb "*.h")
harvest(openvdb/lib openvdb/lib "*.a")
harvest(orc/lib/liborc-0.4.a ffmpeg/lib/liborc.a)
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/shaders osl/shaders "*.h")
harvest(png/include png/include "*.h")
harvest(png/lib png/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
harvest(schroedinger/lib/libschroedinger-1.0.a ffmpeg/lib/libschroedinger.a)
harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(sndfile/include sndfile/include "*.h")
harvest(sndfile/lib sndfile/lib "*.a")
harvest(spnav/include spnav/include "*.h")
harvest(spnav/lib spnav/lib "*.a")
harvest(tbb/include tbb/include "*.h")
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
endif(WIN32)

View File

@@ -0,0 +1,42 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(HDF5_EXTRA_ARGS
-DHDF5_ENABLE_THREADSAFE=Off
-DHDF5_BUILD_CPP_LIB=Off
-DBUILD_TESTING=Off
-DHDF5_BUILD_TOOLS=Off
-DHDF5_BUILD_EXAMPLES=Off
-DHDF5_BUILD_HL_LIB=On
-DBUILD_STATIC_CRT_LIBS=On
-DBUILD_SHARED_LIBS=On
)
if(WIN32)
set(HDF5_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/hdf5/src/external_hdf5 < ${PATCH_DIR}/hdf5.diff)
endif()
ExternalProject_Add(external_hdf5
URL ${HDF5_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${HDF5_HASH}
PREFIX ${BUILD_DIR}/hdf5
PATCH_COMMAND ${HDF5_PATCH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hdf5 ${HDF5_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/hdf5
)

View File

@@ -0,0 +1,29 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(HIDAPI_EXTRA_ARGS)
ExternalProject_Add(external_hidapi
URL ${HIDAPI_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${HIDAPI_HASH}
PREFIX ${BUILD_DIR}/hidapi
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_hidapi.txt ${BUILD_DIR}/hidapi/src/external_hidapi/cmakelists.txt && ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/hidapi/src/external_hidapi < ${PATCH_DIR}/hidapi.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hidapi -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${HIDAPI_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/hidapi
)

View File

@@ -0,0 +1,34 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(ICONV_EXTRA_ARGS)
ExternalProject_Add(external_iconv
URL ${ICONV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ICONV_HASH}
PREFIX ${BUILD_DIR}/iconv
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make install
INSTALL_DIR ${LIBDIR}/iconv
)
if(MSVC)
set_target_properties(external_iconv PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,35 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
endif()
set(ILMBASE_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_CXX_STANDARD_LIBRARIES=${ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES}
)
ExternalProject_Add(external_ilmbase
URL ${ILMBASE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ILMBASE_HASH}
PREFIX ${BUILD_DIR}/ilmbase
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ilmbase ${DEFAULT_CMAKE_FLAGS} ${ILMBASE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openexr
)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_jemalloc
URL ${JEMALLOC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JEMALLOC_HASH}
PREFIX ${BUILD_DIR}/jemalloc
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jemalloc --disable-shared --enable-static --with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make install
INSTALL_DIR ${LIBDIR}/jemalloc
)

View File

@@ -0,0 +1,65 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
# cmake for windows
set(JPEG_EXTRA_ARGS -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d)
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpegd${LIBEXT} ${LIBDIR}/jpg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Release)
set(JPEG_LIBRARY jpeg-static${LIBEXT})
else()
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif()
else(WIN32)
# autoconf for unix
if(APPLE)
set(JPEG_EXTRA_ARGS --host x86_64-apple-darwin --with-jpeg8)
else()
set(JPEG_EXTRA_ARGS --with-jpeg8)
endif()
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JPEG_HASH}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && autoreconf -fiv && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jpg NASM=yasm ${JPEG_EXTRA_ARGS}
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CONFIGURE_ENV} && make install
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
)
set(JPEG_LIBRARY libjpeg${LIBEXT})
endif(WIN32)

View File

@@ -0,0 +1,47 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LAME_EXTRA_ARGS)
if(MSVC)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(LAME_EXTRA_ARGS CFLAGS=-msse)
endif()
endif()
ExternalProject_Add(external_lame
URL ${LAME_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LAME_HASH}
PREFIX ${BUILD_DIR}/lame
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lame --disable-shared --enable-static ${LAME_EXTRA_ARGS}
--enable-export=full
--with-fileio=sndfile
--without-vorbis
--with-pic
--disable-mp3x
--disable-mp3rtp
--disable-gtktest
--enable-export=full
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && make install
INSTALL_DIR ${LIBDIR}/lame
)
if(MSVC)
set_target_properties(external_lame PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,43 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LAPACK_EXTRA_ARGS)
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(LAPACK_EXTRA_ARGS -G "MSYS Makefiles" -DCMAKE_Fortran_COMPILER=${DOWNLOAD_DIR}/mingw/mingw64/bin/gfortran.exe)
else()
set(LAPACK_EXTRA_ARGS -G "MSYS Makefiles" -DCMAKE_Fortran_COMPILER=${DOWNLOAD_DIR}/mingw/mingw32/bin/gfortran.exe)
endif()
endif()
ExternalProject_Add(external_lapack
URL ${LAPACK_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LAPACK_HASH}
PREFIX ${BUILD_DIR}/lapack
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && ${CMAKE_COMMAND} ${LAPACK_EXTRA_ARGS} -DBUILD_TESTING=Off -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lapack .
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && make install
INSTALL_DIR ${LIBDIR}/lapack
)
if(MSVC)
set_target_properties(external_lapack PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,61 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MT
-DLLVM_USE_CRT_DEBUG=MTd
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
)
if(WIN32)
set(LLVM_GENERATOR "NMake Makefiles")
else()
set(LLVM_GENERATOR "Unix Makefiles")
endif()
# short project name due to long filename issues on windows
ExternalProject_Add(ll
URL ${LLVM_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LLVM_HASH}
CMAKE_GENERATOR ${LLVM_GENERATOR}
PREFIX ${BUILD_DIR}/ll
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/ll/src/ll < ${PATCH_DIR}/llvm-alloca-fix.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm ${DEFAULT_CMAKE_FLAGS} ${LLVM_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/llvm
)
if (MSVC)
if (BUILD_MODE STREQUAL Release)
set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
else()
set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include/ ${HARVEST_TARGET}/llvm/debug/include/
)
endif()
ExternalProject_Add_Step(ll after_install
COMMAND ${LLVM_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()

View File

@@ -0,0 +1,57 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(MSVC)
if(BUILD_MODE STREQUAL Debug)
set(NUMPY_DIR_POSTFIX -pydebug)
set(NUMPY_ARCHIVE_POSTFIX d)
set(NUMPY_BUILD_OPTION --debug)
else()
set(NUMPY_DIR_POSTFIX)
set(NUMPY_ARCHIVE_POSTFIX)
set(NUMPY_BUILD_OPTION)
endif(BUILD_MODE STREQUAL Debug)
endif()
set(NUMPY_POSTFIX)
if(WIN32)
set(NUMPY_INSTALL
${CMAKE_COMMAND} -E copy_directory "${BUILD_DIR}/python/src/external_python/run/lib/site-packages/numpy/core/include/numpy" "${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/numpy" &&
${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
)
set(NUMPY_PATCH ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff )
else()
set(NUMPY_INSTALL echo .)
set(NUMPY_PATCH echo .)
endif()
ExternalProject_Add(external_numpy
URL ${NUMPY_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${NUMPY_HASH}
PREFIX ${BUILD_DIR}/numpy
PATCH_COMMAND ${NUMPY_PATCH}
CONFIGURE_COMMAND ""
LOG_BUILD 1
BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
INSTALL_COMMAND ${NUMPY_INSTALL}
)
add_dependencies(external_numpy Make_Python_Environment)

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_ogg
URL ${OGG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OGG_HASH}
PREFIX ${BUILD_DIR}/ogg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make install
INSTALL_DIR ${LIBDIR}/ogg
)
if(MSVC)
set_target_properties(external_ogg PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,42 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release)
set(OPENAL_EXTRA_ARGS
-DALSOFT_UTILS=Off
-DALSOFT_NO_CONFIG_UTIL=On
-DALSOFT_EXAMPLES=Off
-DALSOFT_TESTS=Off
-DALSOFT_CONFIG=Off
-DALSOFT_HRTF_DEFS=Off
-DALSOFT_INSTALL=On
)
if(UNIX)
set(OPENAL_EXTRA_ARGS ${OPENAL_EXTRA_ARGS} -DLIBTYPE=STATIC)
endif()
ExternalProject_Add(external_openal
URL ${OPENAL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENAL_HASH}
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal
)
endif()

View File

@@ -0,0 +1,37 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(UNIX AND NOT APPLE)
set(OPENCOLLADA_EXTRA_ARGS
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
-DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
endif()
ExternalProject_Add(external_opencollada
URL ${OPENCOLLADA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENCOLLADA_HASH}
PREFIX ${BUILD_DIR}/opencollada
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencollada
)
if(UNIX AND NOT APPLE)
add_dependencies(external_opencollada external_xml2)
endif()

View File

@@ -0,0 +1,70 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OPENCOLORIO_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_INCLUDEDIR=${LIBDIR}/boost/include/boost_1_60/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_DEBUG=ON
-DBoost_MAJOR_VERSION=1
-DBoost_MINOR_VERSION=60
-DOCIO_BUILD_APPS=OFF
-DOCIO_BUILD_PYGLUE=OFF
-DOCIO_BUILD_NUKE=OFF
)
if(WIN32)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_BOOST_PTR=ON
-DOCIO_BUILD_STATIC=OFF
-DOCIO_BUILD_SHARED=ON
)
else()
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_BOOST_PTR=OFF
-DOCIO_BUILD_STATIC=ON
-DOCIO_BUILD_SHARED=OFF
)
endif()
ExternalProject_Add(external_opencolorio
URL ${OPENCOLORIO_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENCOLORIO_HASH}
PREFIX ${BUILD_DIR}/opencolorio
PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/opencolorio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencolorio ${DEFAULT_CMAKE_FLAGS} ${OPENCOLORIO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencolorio
)
if(NOT WIN32)
add_custom_command(
OUTPUT ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libtinyxml.a ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/libyaml-cpp.a
)
add_custom_target(external_opencolorio_extra ALL DEPENDS external_opencolorio ${LIBDIR}/opencolorio/lib/libtinyxml.a)
endif()
add_dependencies(external_opencolorio external_boost)

View File

@@ -0,0 +1,41 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
endif()
set(OPENEXR_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_CXX_STANDARD_LIBRARIES=${OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES}
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase
)
ExternalProject_Add(external_openexr
URL ${OPENEXR_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENEXR_HASH}
PREFIX ${BUILD_DIR}/openexr
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/openexr/src/external_openexr < ${PATCH_DIR}/openexr.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openexr
)
add_dependencies(external_openexr external_zlib external_ilmbase)

View File

@@ -0,0 +1,132 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release)
set(OIIO_TOOLS ON)
else()
set(OIIO_TOOLS OFF)
endif()
if(UNIX AND NOT APPLE)
# This causes linking to static pthread libraries which gives link errors.
# Since we manually specify library paths it should static link other libs.
set(OPENIMAGEIO_LINKSTATIC -DLINKSTATIC=OFF)
else()
set(OPENIMAGEIO_LINKSTATIC -DLINKSTATIC=ON)
endif()
if(WIN32)
set(PNG_LIBNAME libpng16_static${LIBEXT})
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2 -DOPJ_STATIC=1)
set(OPENJPEG_POSTFIX _msvc)
else()
set(PNG_LIBNAME libpng${LIBEXT})
set(OIIO_SIMD_FLAGS)
endif()
if (WITH_WEBP)
set(WEBP_ARGS -DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} )
set(WEBP_DEP external_webp)
endif()
if (MSVC)
set(OPENJPEG_FLAGS -DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
-DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
)
else()
set(OPENJPEG_FLAGS -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
)
endif()
set(OPENIMAGEIO_EXTRA_ARGS
-DBUILDSTATIC=ON
${OPENIMAGEIO_LINKSTATIC}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/openexr/
-DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/IlmImf-2_2${LIBEXT}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-OIIO_BUILD_CPP11=ON
-DUSE_OPENGL=OFF
-DUSE_TBB=OFF
-DUSE_FIELD3D=OFF
-DUSE_QT=OFF
-DUSE_PYTHON=OFF
-DUSE_GIF=OFF
-DUSE_OPENCV=OFF
-DUSE_OPENSSL=OFF
-DUSE_OPENJPEG=ON
-DUSE_FFMPEG=OFF
-DUSE_PTEX=OFF
-DUSE_FREETYPE=OFF
-DUSE_LIBRAW=OFF
-DUSE_PYTHON=OFF
-DUSE_PYTHON3=OFF
-DUSE_OCIO=OFF
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
-DOIIO_BUILD_TESTS=OFF
-DBUILD_TESTING=OFF
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
-DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME}
-DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
${OPENJPEG_FLAGS}
-DOCIO_PATH=${LIBDIR}/opencolorio/
-DOpenEXR_USE_STATIC_LIBS=On
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_PATH=${LIBDIR}/ilmbase/
-DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Half${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
-DSTOP_ON_WARNING=OFF
${WEBP_FLAGS}
${OIIO_SIMD_FLAGS}
)
ExternalProject_Add(external_openimageio
URL ${OPENIMAGEIO_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENIMAGEIO_HASH}
PREFIX ${BUILD_DIR}/openimageio
PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/src/include < ${PATCH_DIR}/openimageio_gdi.diff &&
${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio_staticexr.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openimageio
)
add_dependencies(external_openimageio external_png external_zlib external_ilmbase external_openexr external_jpeg external_boost external_tiff external_opencolorio external_openjpeg${OPENJPEG_POSTFIX} ${WEBP_DEP})
if(NOT WIN32)
add_dependencies(external_openimageio external_opencolorio_extra)
endif()

View File

@@ -0,0 +1,57 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# Note the encoder/decoder may use png/tiff/lcms system libraries, but the
# library itself does not depend on them, so should give no problems.
set(OPENJPEG_EXTRA_ARGS -DBUILD_SHARED_LIBS=OFF)
if(WIN32)
set(OPENJPEG_EXTRA_ARGS -G "MSYS Makefiles")
else()
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
endif()
ExternalProject_Add(external_openjpeg
URL ${OPENJPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make install
INSTALL_DIR ${LIBDIR}/openjpeg
)
#on windows ffmpeg wants a mingw build, while oiio needs a msvc build
if (MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc
URL ${OPENJPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc
)
endif()
set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT})
if(MSVC)
set_target_properties(external_openjpeg PROPERTIES FOLDER Mingw)
endif(MSVC)

View File

@@ -0,0 +1,71 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OPENSUBDIV_EXTRA_ARGS
-DNO_EXAMPLES=ON
-DNO_REGRESSION=ON
-DNO_PYTHON=ON
-DNO_MAYA=ON
-DNO_PTEX=ON
-DNO_DOC=ON
-DNO_CLEW=OFF
-DNO_OPENCL=OFF
-DNO_TUTORIALS=ON
-DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
-DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
-DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
-DGLFW_LIBRARIES=${LIBDIR}/glfw/lib/glfw3${LIBEXT}
)
if(WIN32)
#no cuda support for vc15 yet
if(msvc15)
set(OPENSUBDIV_CUDA ON)
else()
set(OPENSUBDIV_CUDA ON)
endif()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=${OPENSUBDIV_CUDA}
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/cl
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
-DCMAKE_EXE_LINKER_FLAGS_RELEASE=libcmt.lib
)
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=ON
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}
)
endif()
ExternalProject_Add(external_opensubdiv
URL ${OPENSUBDIV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENSUBDIV_Hash}
PREFIX ${BUILD_DIR}/opensubdiv
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/opensubdiv/src/external_opensubdiv < ${PATCH_DIR}/opensubdiv.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opensubdiv
)
add_dependencies(external_opensubdiv external_glew external_glfw external_clew external_cuew)

View File

@@ -0,0 +1,71 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Debug)
set(BLOSC_POST _d)
endif()
set(OPENVDB_EXTRA_ARGS
-DILMBASE_HOME=${LIBDIR}/ilmbase/
-DILMBASE_CUSTOM=ON
-DILMBASE_CUSTOM_LIBRARIES=Half;Imath-2_2;IlmThread-2_2;Iex-2_2
-DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
-DILMBASE_HALF_LIBRARIES=${LIBDIR}/ilmbase/lib/Half${LIBEXT}
-DILMBASE_IMATH_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DILMBASE_ILMTHREAD_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DILMBASE_IEX_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DOPENEXR_USE_STATIC_LIBS=ON
-DOPENEXR_CUSTOM=ON
-DOPENEXR_CUSTOM_LIBRARY=IlmImf-2_2
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
-DTBB_ROOT_DIR=${LIBDIR}/tbb/
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
-DTBB_LIBRARY=${LIBDIR}/tbb/lib/tbb_static${LIBEXT}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DWITH_BLOSC=ON
-DBLOSC_INCLUDE_DIR=${LIBDIR}/blosc/include/
-DBLOSC_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
)
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS})
# CMake script for OpenVDB based on https://raw.githubusercontent.com/diekev/openvdb-cmake/master/CMakeLists.txt
# can't be in external_openvdb because of how the includes are setup.
ExternalProject_Add(openvdb
URL ${OPENVDB_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENVDB_HASH}
PREFIX ${BUILD_DIR}/openvdb
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_openvdb.txt ${BUILD_DIR}/openvdb/src/openvdb/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy_directory ${PATCH_DIR}/cmake/ ${BUILD_DIR}/openvdb/src/openvdb/cmake/ &&
${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb_vc2013.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openvdb
)
add_dependencies(openvdb external_tbb external_boost external_ilmbase external_openexr external_zlib external_blosc)

View File

@@ -0,0 +1,210 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/lapack/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)
set(BUILD_MODE "Release")
message(STATUS "Build type not specified: defaulting to a release build.")
endif()
Message("BuildMode = ${BUILD_MODE}")
if(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
ELSE(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
ENDIF(BUILD_MODE STREQUAL "Debug")
option(DOWNLOAD_DIR "Path for downloaded files" ${CMAKE_CURRENT_SOURCE_DIR}/downloads)
file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR)
set(PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/build)
message("LIBDIR = ${LIBDIR}")
message("DOWNLOAD_DIR = ${DOWNLOAD_DIR}")
message("PATCH_DIR = ${PATCH_DIR}")
message("BUILD_DIR = ${BUILD_DIR}")
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
else()
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/patch.exe)
endif()
set(LIBEXT ".lib")
set(LIBPREFIX "")
# For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
# TODO FIXME highly MSVC specific
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS)
set(PLATFORM_CMAKE_FLAGS)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw64)
set(MINGW_SHELL ming64sh.cmd)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl/portableshell.bat)
set(MINGW_HOST x86_64-w64-mingw32)
else()
set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw32)
set(MINGW_SHELL ming32sh.cmd)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl32/portableshell.bat)
set(MINGW_HOST i686-w64-mingw32)
endif()
set(CONFIGURE_ENV
cd ${MINGW_PATH} &&
call ${MINGW_SHELL} &&
call ${PERL_SHELL} &&
set path &&
set CFLAGS=-g &&
set LDFLAGS=-Wl,--as-needed -static-libgcc
)
set(CONFIGURE_ENV_NO_PERL
cd ${MINGW_PATH} &&
call ${MINGW_SHELL} &&
set path &&
set CFLAGS=-g &&
set LDFLAGS=-Wl,--as-needed -static-libgcc
)
set(CONFIGURE_COMMAND sh ./configure)
set(CONFIGURE_COMMAND_NO_TARGET ${CONFIGURE_COMMAND})
else()
set(PATCH_CMD patch)
set(LIBEXT ".a")
set(LIBPREFIX "lib")
if(APPLE)
# Let's get the current Xcode dir, to support xcode-select
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
set(OSX_ARCHITECTURES x86_64)
set(OSX_DEPLOYMENT_TARGET 10.9)
set(OSX_SDK_VERSION 10.12)
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK_VERSION}.sdk)
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin13.0.0) # OS X 10.9
set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
)
else()
set(PLATFORM_CFLAGS "-fPIC")
set(PLATFORM_CXXFLAGS "-std=c++11 -fPIC")
set(PLATFORM_LDFLAGS)
set(PLATFORM_BUILD_TARGET)
set(PLATFORM_CMAKE_FLAGS)
endif()
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "-O2 -DNDEBUG")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "-g")
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "-O2 -DNDEBUG ${PLATFORM_CXXFLAGS}")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "-g ${PLATFORM_CXXFLAGS}")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(CONFIGURE_ENV
export MACOSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} &&
export CFLAGS=${PLATFORM_CFLAGS} &&
export CXXFLAGS=${PLATFORM_CXXFLAGS} &&
export LDFLAGS=${PLATFORM_LDFLAGS}
)
set(CONFIGURE_ENV_NO_PERL ${CONFIGURE_ENV})
set(CONFIGURE_COMMAND ./configure ${PLATFORM_BUILD_TARGET})
set(CONFIGURE_COMMAND_NO_TARGET ./configure)
endif()
set(DEFAULT_CMAKE_FLAGS
-DCMAKE_BUILD_TYPE=${BUILD_MODE}
-DCMAKE_C_FLAGS_DEBUG=${BLENDER_CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_MINSIZEREL=${BLENDER_CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELEASE=${BLENDER_CMAKE_C_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_CXX_FLAGS_DEBUG=${BLENDER_CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS_MINSIZEREL=${BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL}
-DCMAKE_CXX_FLAGS_RELEASE=${BLENDER_CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
${PLATFORM_CMAKE_FLAGS}
)
if(WIN32)
#we need both flavors to build the thumbnail dlls
if(MSVC12)
set(GENERATOR_32 "Visual Studio 12 2013")
set(GENERATOR_64 "Visual Studio 12 2013 Win64")
elseif(MSVC14)
set(GENERATOR_32 "Visual Studio 14 2015")
set(GENERATOR_64 "Visual Studio 14 2015 Win64")
endif()
endif()
if(WIN32)
set(ZLIB_LIBRARY zlibstatic${LIBEXT})
else()
set(ZLIB_LIBRARY libz${LIBEXT})
endif()
if(MSVC)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
set(CMAKE_INSTALL_MESSAGE LAZY)

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_orc
URL ${ORC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${ORC_HASH}
PREFIX ${BUILD_DIR}/orc
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/orc --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && make install
INSTALL_DIR ${LIBDIR}/orc
)
if(MSVC)
set_target_properties(external_orc PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,87 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DFLEX_EXTRA_OPTIONS="--wincompat" -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/libpng16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=0)
else()
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
endif()
else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
set(OSL_FLEX_BISON)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}")
endif()
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/ilmbase/lib/Imath-2_2.lib^^${LIBDIR}/ilmbase/lib/Half.lib^^${LIBDIR}/ilmbase/lib/IlmThread-2_2.lib^^${LIBDIR}/ilmbase/lib/Iex-2_2.lib")
set(OSL_LLVM_LIBRARY "${LIBDIR}/llvm/lib/LLVMAnalysis${LIBEXT};${LIBDIR}/llvm/lib/LLVMAsmParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMAsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/LLVMBitReader${LIBEXT};${LIBDIR}/llvm/lib/LLVMBitWriter${LIBEXT};${LIBDIR}/llvm/lib/LLVMCodeGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMCore${LIBEXT};${LIBDIR}/llvm/lib/LLVMDebugInfo${LIBEXT};${LIBDIR}/llvm/lib/LLVMExecutionEngine${LIBEXT};${LIBDIR}/llvm/lib/LLVMInstCombine${LIBEXT};${LIBDIR}/llvm/lib/LLVMInstrumentation${LIBEXT};${LIBDIR}/llvm/lib/LLVMInterpreter${LIBEXT};${LIBDIR}/llvm/lib/LLVMJIT${LIBEXT};${LIBDIR}/llvm/lib/LLVMLinker${LIBEXT};${LIBDIR}/llvm/lib/LLVMMC${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCDisassembler${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCJIT${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMObject${LIBEXT};${LIBDIR}/llvm/lib/LLVMRuntimeDyld${LIBEXT};${LIBDIR}/llvm/lib/LLVMScalarOpts${LIBEXT};${LIBDIR}/llvm/lib/LLVMSelectionDAG${LIBEXT};${LIBDIR}/llvm/lib/LLVMSupport${LIBEXT};${LIBDIR}/llvm/lib/LLVMTableGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMTarget${LIBEXT};${LIBDIR}/llvm/lib/LLVMTransformUtils${LIBEXT};${LIBDIR}/llvm/lib/LLVMVectorize${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86AsmParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86AsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86CodeGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Desc${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Disassembler${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Info${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Utils${LIBEXT};${LIBDIR}/llvm/lib/LLVMipa${LIBEXT};${LIBDIR}/llvm/lib/LLVMipo${LIBEXT}")
set(OSL_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DLLVM_DIRECTORY=${LIBDIR}/llvm
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
-DLLVM_VERSION=3.4
-DLLVM_LIBRARY=${OSL_LLVM_LIBRARY}
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_HOME=${LIBDIR}/ilmbase/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
-DOSL_BUILD_TESTS=OFF
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DOPENIMAGEIOHOME=${LIBDIR}/openimageio/
-DOPENIMAGEIO_LIBRARY=${OSL_OPENIMAGEIO_LIBRARY}
-DOPENIMAGEIO_INCLUDES=${LIBDIR}/openimageio/include
${OSL_FLEX_BISON}
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DOSL_BUILD_PLUGINS=Off
-DSTOP_ON_WARNING=OFF
-DOSL_BUILD_CPP11=ON
-DUSE_LLVM_BITCODE=OFF
${OSL_SIMD_FLAGS}
)
ExternalProject_Add(external_osl
URL ${OSL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
LIST_SEPARATOR ^^
URL_HASH MD5=${OSL_HASH}
PREFIX ${BUILD_DIR}/osl
PATCH_COMMAND ${PATCH_CMD} -p 3 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff &&
${PATCH_CMD} -p 0 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl_simd_oiio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/osl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${DEFAULT_CMAKE_FLAGS} ${OSL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/osl
)
add_dependencies(external_osl external_boost ll external_clang external_ilmbase external_openexr external_zlib external_flexbison external_openimageio)

View File

@@ -0,0 +1,41 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(PNG_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DPNG_STATIC=ON
)
ExternalProject_Add(external_png
URL ${PNG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PNG_HASH}
PREFIX ${BUILD_DIR}/png
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/png
)
add_dependencies(external_png external_zlib)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,45 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(PTHREAD_XCFLAGS /MD)
if(MSVC14) # vs2015 has timespec
set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H /D_TIMESPEC_DEFINED ")
else() # everything before doesn't
set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H ")
endif()
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XCFLAGS=${PTHREAD_XCFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA512=${PTHREADS_SHA512}
PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff
BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2.dll ${LIBDIR}/pthreads/lib/pthreadVC2.dll &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC2${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h
INSTALL_DIR ${LIBDIR}/pthreads
)
endif()

View File

@@ -0,0 +1,138 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(PYTHON_POSTFIX)
if(BUILD_MODE STREQUAL Debug)
set(PYTHON_POSTFIX _d)
endif()
if(WIN32)
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe)
macro(cmake_to_dos_path MsysPath ResultingPath)
string(REPLACE "/" "\\" ${ResultingPath} "${MsysPath}")
endmacro()
set(PYTHON_EXTERNALS_FOLDER ${BUILD_DIR}/python/src/external_python/externals)
set(DOWNLOADS_EXTERNALS_FOLDER ${DOWNLOAD_DIR}/externals)
cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS)
cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS)
message("Python externals = ${PYTHON_EXTERNALS_FOLDER}")
message("Python externals_dos = ${PYTHON_EXTERNALS_FOLDER_DOS}")
message("Python DOWNLOADS_EXTERNALS_FOLDER = ${DOWNLOADS_EXTERNALS_FOLDER}")
message("Python DOWNLOADS_EXTERNALS_FOLDER_DOS = ${DOWNLOADS_EXTERNALS_FOLDER_DOS}")
ExternalProject_Add(external_python
URL ${PYTHON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
PATCH_COMMAND echo mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" &&
mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" &&
${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python.diff &&
${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/pc < ${PATCH_DIR}/pyshell.diff
CONFIGURE_COMMAND ""
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p ${PYTHON_ARCH} -c ${BUILD_MODE} -k ${PYTHON_COMPILER_STRING}
INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll &&
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib &&
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION} &&
${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION}/pyconfig.h
)
Message("PythinRedist = ${BUILD_DIR}/python/src/external_python/redist")
Message("POutput = ${PYTHON_OUTPUTDIR}")
else()
if(APPLE)
# we need to manually add homebrew headers to get ssl module building
set(PYTHON_CFLAGS "-I/usr/local/opt/openssl/include -I${OSX_SYSROOT}/usr/include ${PLATFORM_CFLAGS}")
set(PYTHON_LDFLAGS "-L/usr/local/opt/openssl/lib ${PLATFORM_LDFLAGS}")
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && export CFLAGS=${PYTHON_CFLAGS} && export LDFLAGS=${PYTHON_LDFLAGS})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_apple.diff)
else()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
endif()
ExternalProject_Add(external_python
URL ${PYTHON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
PATCH_COMMAND ${PYTHON_PATCH}
CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python
BUILD_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make install
INSTALL_DIR ${LIBDIR}/python)
add_custom_target(Make_Python_Environment ALL DEPENDS external_python)
endif()
if(MSVC)
add_custom_command(
OUTPUT ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz
OUTPUT ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/lib ${BUILD_DIR}/python/src/external_python/redist/lib
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_bz2${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_bz2${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_hashlib${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_hashlib${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_lzma${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_lzma${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_sqlite3${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_sqlite3${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ssl${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ssl${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/pyexpat${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/pyexpat${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/select${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/select${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/unicodedata${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/unicodedata${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/winsound${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/winsound${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes_test${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes_test${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_decimal${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_decimal${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_elementtree${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_elementtree${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_msi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_msi${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_multiprocessing${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_multiprocessing${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_overlapped${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_overlapped${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_socket${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_socket${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testbuffer${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testbuffer${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testcapi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testcapi${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testimportmultiple${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testimportmultiple${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testmultiphase${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testmultiphase${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/python/src/external_python/redist" ${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz" "."
)
add_custom_target(Package_Python ALL DEPENDS external_python ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe)
if(MSVC12)
set(PYTHON_DISTUTIL_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/run/lib/distutils < ${PATCH_DIR}/python_runtime_vc2013.diff)
else()
set(PYTHON_DISTUTIL_PATCH echo "No patch needed")
endif()
add_custom_command(OUTPUT ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/redist ${BUILD_DIR}/python/src/external_python/run
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/run/include
COMMAND ${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${BUILD_DIR}/python/src/external_python/run/include/pyconfig.h
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib #missing postfix on purpose, distutils is not expecting it
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib #other things like numpy still want it though.
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
COMMAND ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe -m ensurepip --upgrade
COMMAND ${PYTHON_DISTUTIL_PATCH}
)
add_custom_target(Make_Python_Environment ALL DEPENDS ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe Package_Python)
endif(MSVC)

View File

@@ -0,0 +1,38 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(HARVEST_CMD cmd /C FOR /d /r ${BUILD_DIR}/python/src/external_python/run/lib/site-packages %d IN (__pycache__) DO @IF EXIST "%d" rd /s /q "%d" &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/idna ${HARVEST_TARGET}/Release/site-packages/idna &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/chardet ${HARVEST_TARGET}/Release/site-packages/chardet &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/urllib3 ${HARVEST_TARGET}/Release/site-packages/urllib3 &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/certifi ${HARVEST_TARGET}/Release/site-packages/certifi &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/requests ${HARVEST_TARGET}/Release/site-packages/requests
)
else()
set(HARVEST_CMD echo .)
endif()
ExternalProject_Add(external_python_site_packages
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all: && ${HARVEST_CMD}
)
add_dependencies(external_python_site_packages Make_Python_Environment)

View File

@@ -0,0 +1,45 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(SCHROEDINGER_EXTRA_FLAGS "CFLAGS=-g -I./ -I${LIBDIR}/orc/include/orc-0.4" "LDFLAGS=-Wl,--as-needed -static-libgcc -L${LIBDIR}/orc/lib" ORC_CFLAGS=-I${LIBDIR}/orc/include/orc-0.4 ORC_LDFLAGS=-L${LIBDIR}/orc/lib ORC_LIBS=${LIBDIR}/orc/lib/liborc-0.4.a ORCC=${LIBDIR}/orc/bin/orcc.exe)
else()
set(SCHROEDINGER_CFLAGS "${PLATFORM_CFLAGS} -I./ -I${LIBDIR}/orc/include/orc-0.4")
set(SCHROEDINGER_LDFLAGS "${PLATFORM_LDFLAGS} -L${LIBDIR}/orc/lib")
set(SCHROEDINGER_EXTRA_FLAGS CFLAGS=${SCHROEDINGER_CFLAGS} LDFLAGS=${SCHROEDINGER_LDFLAGS} ORC_CFLAGS=-I${LIBDIR}/orc/include/orc-0.4 ORC_LDFLAGS=-L${LIBDIR}/orc/lib ORCC=${LIBDIR}/orc/bin/orcc) # ORC_LIBS=${LIBDIR}/orc/lib/liborc-0.4.a
endif()
ExternalProject_Add(external_schroedinger
URL ${SCHROEDINGER_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${SCHROEDINGER_HASH}
PREFIX ${BUILD_DIR}/schroedinger
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/schroedinger/src/external_schroedinger < ${PATCH_DIR}/schroedinger.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/schroedinger --disable-shared --enable-static ${SCHROEDINGER_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ && make install
INSTALL_DIR ${LIBDIR}/schroedinger
)
add_dependencies(external_schroedinger external_orc)
if(MSVC)
set_target_properties(external_schroedinger PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,39 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(SDL_EXTRA_ARGS
-DSDL_STATIC=Off
)
else()
set(SDL_EXTRA_ARGS
-DSDL_STATIC=ON
-DSDL_SHARED=OFF
-DSDL_VIDEO=OFF
)
endif()
ExternalProject_Add(external_sdl
URL ${SDL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SDL_HASH}
PREFIX ${BUILD_DIR}/sdl
PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/sdl/src/external_sdl < ${PATCH_DIR}/sdl.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/sdl ${DEFAULT_CMAKE_FLAGS} ${SDL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/sdl
)

View File

@@ -0,0 +1,219 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
####################################################################################################################
# Mingw32 Builds
####################################################################################################################
# This installs mingw32+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
####################################################################################################################
message("LIBDIR = ${LIBDIR}")
macro(cmake_to_msys_path MsysPath ResultingPath)
string(REPLACE ":" "" TmpPath "${MsysPath}")
string(SUBSTRING ${TmpPath} 0 1 Drive)
string(SUBSTRING ${TmpPath} 1 255 PathPart)
string(TOLOWER ${Drive} LowerDrive)
string(CONCAT ${ResultingPath} "/" ${LowerDrive} ${PathPart})
endmacro()
cmake_to_msys_path(${LIBDIR} mingw_LIBDIR)
message("mingw_LIBDIR = ${mingw_LIBDIR}")
message("Checking for mingw32")
# download mingw32
if(NOT EXISTS "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z")
message("Downloading mingw32")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z" "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z")
endif()
# make mingw root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/mingw
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract mingw32
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/mingw32env.cmd") AND (EXISTS "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z"))
message("Extracting mingw32")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw
)
endif()
message("Checking for pkg-config")
if(NOT EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
message("Downloading pkg-config")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip" "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
endif()
# extract pkgconfig
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe") AND (EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"))
message("Extracting pkg-config")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1/bin/pkg-config.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe"
)
endif()
message("Checking for nasm")
if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip")
message("Downloading nasm")
file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win32/nasm-2.12.01-win32.zip" "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip")
endif()
# extract nasm
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip"))
message("Extracting nasm")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.12.01/nasm.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe"
)
endif()
message("Checking for mingwGet")
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
message("Downloading mingw-get")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
endif()
# extract mingw_get
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"))
message("Extracting mingw-get")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/
)
endif()
if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/make.exe"))
message("Installing MSYS")
execute_process(
COMMAND ${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get install msys msys-patch
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/bin/
)
endif()
message("Checking for CoreUtils")
# download old core_utils for pr.exe (ffmpeg needs it to build)
if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
message("Downloading CoreUtils 5.97")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/_obsolete/coreutils-5.97-MSYS-1.0.11-2/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2" "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
endif()
if((EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"))
message("Installing pr from CoreUtils 5.97")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/tmp_coreutils
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${DOWNLOAD_DIR}/tmp_coreutils/coreutils-5.97/bin/pr.exe "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
endif()
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd")
message("Installing ming32sh.cmd")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/ming32sh.cmd ${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd
)
endif()
message("Checking for perl")
# download perl for libvpx
if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
message("Downloading perl")
file(DOWNLOAD "http://strawberryperl.com/download/5.22.1.3/strawberry-perl-5.22.1.3-32bit-portable.zip" "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
endif()
# make perl root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/perl32")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/perl32
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract perl
if((NOT EXISTS "${DOWNLOAD_DIR}/perl32/portable.perl") AND (EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip"))
message("Extracting perl")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip
WORKING_DIRECTORY ${DOWNLOAD_DIR}/perl32
)
endif()
# get yasm for vpx
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
message("Downloading yasm")
file(DOWNLOAD "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win32.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
endif()
message("checking i686-w64-mingw32-strings")
# copy strings.exe to i686-w64-mingw32-strings for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe")
message("fixing i686-w64-mingw32-strings.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strings.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe"
)
endif()
message("checking i686-w64-mingw32-ar.exe")
# copy ar.exe to i686-w64-mingw32-ar.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe")
message("fixing i686-w64-mingw32-ar.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ar.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe"
)
endif()
message("checking i686-w64-mingw32-strip.exe")
# copy strip.exe to i686-w64-mingw32-strip.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe")
message("fixing i686-w64-mingw32-strip.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strip.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe"
)
endif()
message("checking i686-w64-mingw32-ranlib.exe")
# copy ranlib.exe to i686-w64-mingw32-ranlib.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
message("fixing i686-w64-mingw32-ranlib.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -0,0 +1,219 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
####################################################################################################################
# Mingw64 Builds
####################################################################################################################
# This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
####################################################################################################################
message("LIBDIR = ${LIBDIR}")
macro(cmake_to_msys_path MsysPath ResultingPath)
string(REPLACE ":" "" TmpPath "${MsysPath}")
string(SUBSTRING ${TmpPath} 0 1 Drive)
string(SUBSTRING ${TmpPath} 1 255 PathPart)
string(TOLOWER ${Drive} LowerDrive)
string(CONCAT ${ResultingPath} "/" ${LowerDrive} ${PathPart})
endmacro()
cmake_to_msys_path(${LIBDIR} mingw_LIBDIR)
message("mingw_LIBDIR = ${mingw_LIBDIR}")
message("Checking for mingw64")
# download ming64
if(NOT EXISTS "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z")
message("Downloading mingw64")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z" "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z")
endif()
# make mingw root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/mingw
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract mingw64
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/mingw64env.cmd") AND (EXISTS "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z"))
message("Extracting mingw64")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw
)
endif()
message("Checking for pkg-config")
if(NOT EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
message("Downloading pkg-config")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip" "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
endif()
# extract pkgconfig
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/pkg-config.exe") AND (EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"))
message("Extracting pkg-config")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1/bin/pkg-config.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/pkg-config.exe"
)
endif()
message("Checking for nasm")
if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip")
message("Downloading nasm")
file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip" "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip")
endif()
# extract nasm
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip"))
message("Extracting nasm")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.12.01/nasm.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/nasm.exe"
)
endif()
message("Checking for mingwGet")
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
message("Downloading mingw-get")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
endif()
# extract mingw_get
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"))
message("Extracting mingw-get")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw64/
)
endif()
if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/make.exe"))
message("Installing MSYS")
execute_process(
COMMAND ${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get install msys msys-patch
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw64/bin/
)
endif()
message("Checking for CoreUtils")
# download old core_utils for pr.exe (ffmpeg needs it to build)
if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
message("Downloading CoreUtils 5.97")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/_obsolete/coreutils-5.97-MSYS-1.0.11-2/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2" "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
endif()
if((EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/pr.exe"))
message("Installing pr from CoreUtils 5.97")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/tmp_coreutils
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${DOWNLOAD_DIR}/tmp_coreutils/coreutils-5.97/bin/pr.exe "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/pr.exe"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
endif()
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/ming64sh.cmd")
message("Installing ming64sh.cmd")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/ming64sh.cmd ${DOWNLOAD_DIR}/mingw/mingw64/ming64sh.cmd
)
endif()
message("Checking for perl")
# download perl for libvpx
if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip")
message("Downloading perl")
file(DOWNLOAD "http://strawberryperl.com/download/5.22.1.3/strawberry-perl-5.22.1.3-64bit-portable.zip" "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip")
endif()
# make perl root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/perl")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/perl
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract perl
if((NOT EXISTS "${DOWNLOAD_DIR}/perl/portable.perl") AND (EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip"))
message("Extracting perl")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip
WORKING_DIRECTORY ${DOWNLOAD_DIR}/perl
)
endif()
# get yasm for vpx
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/yasm.exe")
message("Downloading yasm")
file(DOWNLOAD "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/yasm.exe")
endif()
message("checking x86_64-w64-mingw32-strings.exe")
# copy strings.exe to x86_64-w64-mingw32-strings.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strings.exe")
message("fixing x86_64-w64-mingw32-strings.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/strings.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strings.exe"
)
endif()
message("checking x86_64-w64-mingw32-ar.exe")
# copy ar.exe to x86_64-w64-mingw32-ar.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ar.exe")
message("fixing x86_64-w64-mingw32-ar.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ar.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ar.exe"
)
endif()
message("checking x86_64-w64-mingw32-strip.exe")
# copy strip.exe to x86_64-w64-mingw32-strip.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strip.exe")
message("fixing x86_64-w64-mingw32-strip.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/strip.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strip.exe"
)
endif()
message("checking x86_64-w64-mingw32-ranlib.exe")
# copy ranlib.exe to x86_64-w64-mingw32-ranlib.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe")
message("fixing x86_64-w64-mingw32-ranlib.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -0,0 +1,55 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(SNDFILE_EXTRA_ARGS)
set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/flac/lib/pkgconfig:${mingw_LIBDIR})
if(WIN32)
set(SNDFILE_ENV set ${SNDFILE_ENV} &&)
#shared for windows because static libs will drag in a libgcc dependency.
set(SNDFILE_OPTIONS --disable-static --enable-shared )
else()
set(SNDFILE_OPTIONS --enable-static --disable-shared )
endif()
if(APPLE)
set(SNDFILE_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/sndfile/src/external_sndfile < ${PATCH_DIR}/sndfile.diff)
else()
set(SNDFILE_PATCH_CMD)
endif()
ExternalProject_Add(external_sndfile
URL ${SNDFILE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SNDFILE_HASH}
PREFIX ${BUILD_DIR}/sndfile
PATCH_COMMAND ${SNDFILE_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && ${SNDFILE_ENV} ${CONFIGURE_COMMAND} ${SNDFILE_OPTIONS} --prefix=${mingw_LIBDIR}/sndfile
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make install
INSTALL_DIR ${LIBDIR}/sndfile
)
if(MSVC)
set_target_properties(external_sndfile PROPERTIES FOLDER Mingw)
endif()
add_dependencies(external_sndfile external_ogg external_vorbis)
if(UNIX)
add_dependencies(external_sndfile external_flac)
endif()

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_spnav
URL ${SPNAV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SPNAV_HASH}
PREFIX ${BUILD_DIR}/spnav
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/spnav --disable-shared --enable-static --with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make install
INSTALL_DIR ${LIBDIR}/spnav
)

View File

@@ -0,0 +1,36 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
-DTBB_BUILD_TBBMALLOC=Off
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
)
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
ExternalProject_Add(external_tbb
URL ${TBB_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TBB_HASH}
PREFIX ${BUILD_DIR}/tbb
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_tbb.txt ${BUILD_DIR}/tbb/src/external_tbb/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/vs2010/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tbb ${DEFAULT_CMAKE_FLAGS} ${TBB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tbb
)

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_theora
URL ${THEORA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${THEORA_HASH}
PREFIX ${BUILD_DIR}/theora
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora
--disable-shared
--enable-static
--with-pic
--with-ogg=${LIBDIR}/ogg
--with-vorbis=${LIBDIR}/vorbis
--disable-examples
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make install
INSTALL_DIR ${LIBDIR}/theora
)
add_dependencies(external_theora external_vorbis external_ogg)
if(MSVC)
set_target_properties(external_theora PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,44 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(TIFF_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
-DPNG_STATIC=ON
-DBUILD_SHARED_LIBS=OFF
-Dlzma=OFF
-Djbig=OFF
)
ExternalProject_Add(external_tiff
URL ${TIFF_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TIFF_HASH}
PREFIX ${BUILD_DIR}/tiff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tiff ${DEFAULT_CMAKE_FLAGS} ${TIFF_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tiff
)
add_dependencies(external_tiff external_zlib)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tiff after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT}
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,250 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(ZLIB_VERSION 1.2.8)
set(ZLIB_URI https://netcologne.dl.sourceforge.net/project/libpng/zlib/${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 44d667c142d7cda120332623eab69f40)
set(OPENAL_VERSION 1.17.2)
set(OPENAL_URI http://kcat.strangesoft.net/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
set(OPENAL_HASH 1764e0d8fec499589b47ebc724e0913d)
set(PNG_VERSION 1.6.21)
set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.gz)
set(PNG_HASH aca36ec8e0a3b406a5912243bc243717)
set(JPEG_VERSION 1.4.2)
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
set(JPEG_HASH f9804884c1c41eb7f4febb9353a2cb27)
set(BOOST_VERSION 1.60.0)
set(BOOST_VERSION_NODOTS 1_60_0)
set(BOOST_URI http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_NODOTS}.tar.bz2/download)
set(BOOST_MD5 65a840e1a0b13a558ff19eeb2c4f0cbe)
set(BLOSC_VERSION 1.7.1)
set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.zip)
set(BLOSC_HASH ff5cc729a5a25934ef714217218eed26)
set(PTHREADS_VERSION 2-9-1)
set(PTHREADS_URI ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-${PTHREADS_VERSION}-release.tar.gz)
set(PTHREADS_SHA512 9c06e85310766834370c3dceb83faafd397da18a32411ca7645c8eb6b9495fea54ca2872f4a3e8d83cb5fdc5dea7f3f0464be5bb9af3222a6534574a184bd551)
set(ILMBASE_VERSION 2.2.0)
set(ILMBASE_URI http://download.savannah.nongnu.org/releases/openexr/ilmbase-${ILMBASE_VERSION}.tar.gz)
set(ILMBASE_HASH b540db502c5fa42078249f43d18a4652)
set(OPENEXR_VERSION 2.2.0)
set(OPENEXR_URI http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.0.tar.gz)
set(OPENEXR_HASH b64e931c82aa3790329c21418373db4e)
set(FREETYPE_VERSION 263)
set(FREETYPE_URI http://download.savannah.gnu.org/releases/freetype/ft${FREETYPE_VERSION}.zip)
set(FREETYPE_HASH 0db2a43301572e5c2b4a0864f237aeeb)
set(GLEW_VERSION 1.13.0)
set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz)
set(GLEW_HASH 7cbada3166d2aadfc4169c4283701066)
set(FREEGLUT_VERSION 3.0.0)
set(FREEGLUT_URI http://pilotfiber.dl.sourceforge.net/project/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz)
set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
set(HDF5_VERSION 1.8.17)
set(HDF5_URI https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz)
set(HDF5_HASH 7d572f8f3b798a628b8245af0391a0ca)
set(ALEMBIC_VERSION 1.7.1)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.zip)
set(ALEMBIC_MD5 cf7705055501d5ea0cb8256866496f79)
## hash is for 3.1.2
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip)
set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0)
#latest uid in git as of 2016-04-01
set(CLEW_GIT_UID 277db43f6cafe8b27c6f1055f69dc67da4aeb299)
set(CLEW_URI https://github.com/OpenCLWrangler/clew/archive/${CLEW_GIT_UID}.zip)
set(CLEW_HASH 2c699d10ed78362e71f56fae2a4c5f98)
#latest uid in git as of 2016-04-01
set(CUEW_GIT_UID 1744972026de9cf27c8a7dc39cf39cd83d5f922f)
set(CUEW_URI https://github.com/CudaWrangler/cuew/archive/${CUEW_GIT_UID}.zip)
set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
set(OPENSUBDIV_VERSION v3_1_1)
set(OPENSUBDIV_Hash 25a9a6a94136b0eb85ce69e9c8cb6ab3)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.zip)
set(SDL_VERSION 2.0.4)
set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_HASH 44fc4a023349933e7f5d7a582f7b886e)
set(OPENCOLLADA_VERSION v1.6.51)
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
set(OPENCOLLADA_HASH 23db5087faed4bc4cc1dfe456c0d4701)
set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/6de971097c7f552300f669ed69ca0b6cf5a70843.zip)
set(OPENCOLORIO_HASH c9de0fd98f26ce6f2e08d617ca68b8e4)
set(LLVM_VERSION 3.4.2)
set(LLVM_URI http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.gz)
set(LLVM_HASH a20669f75967440de949ac3b1bad439c)
set(CLANG_URI http://llvm.org/releases/${LLVM_VERSION}/cfe-${LLVM_VERSION}.src.tar.gz)
set(CLANG_HASH 87945973b7c73038871c5f849a818588)
set(OPENIMAGEIO_VERSION 1.7.15)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.zip)
set(OPENIMAGEIO_HASH_178 e156e3669af0e1373142ab5e8f13de66)
set(OPENIMAGEIO_HASH_179 4121cb0e0433bda6a7ef32c8628a149f)
set(OPENIMAGEIO_HASH_1713 42a662775b834161ba88c6abdb299360)
set(OPENIMAGEIO_HASH_1715 e2ece0f62c013d64c478f82265988b0b)
set(OPENIMAGEIO_HASH ${OPENIMAGEIO_HASH_1715})
set(TIFF_VERSION 4.0.6)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH d1d2e940dea0b5ad435f21f03d96dd72)
set(FLEXBISON_VERSION 2.5.5)
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
set(OSL_VERSION 1.7.5)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.zip)
set(OSL_HASH 6924dd5d453159e7b6eb106a08c358cf)
set(PYTHON_VERSION 3.6.2)
set(PYTHON_SHORT_VERSION 3.6)
set(PYTHON_SHORT_VERSION_NO_DOTS 36)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH 2c68846471994897278364fc18730dd9)
set(TBB_VERSION 44_20160128)
set(TBB_URI https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb${TBB_VERSION}oss_src_0.tgz)
set(TBB_HASH 9d8a4cdf43496f1b3f7c473a5248e5cc)
set(OPENVDB_VERSION 3.1.0)
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH 30a7e9571a03ab7bcf1a39fb62aa436f)
set(IDNA_VERSION 2.6)
set(CHARDET_VERSION 3.0.2)
set(URLLIB3_VERSION 1.22)
set(CERTIFI_VERSION 2017.7.27.1)
set(REQUESTS_VERSION 2.18.4)
set(NUMPY_VERSION v1.13.1)
set(NUMPY_SHORT_VERSION 1.13)
set(NUMPY_URI https://pypi.python.org/packages/c0/3a/40967d9f5675fbb097ffec170f59c2ba19fc96373e73ad47c2cae9a30aed/numpy-1.13.1.zip)
set(NUMPY_HASH 2c3c0f4edf720c3a7b525dacc825b9ae)
set(LAME_VERSION 3.99.5)
set(LAME_URI http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME_VERSION}.tar.gz)
set(LAME_HASH 84835b313d4a8b68f5349816d33e07ce)
set(OGG_VERSION 1.3.2)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
set(OGG_HASH e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692)
set(VORBIS_VERSION 1.3.5)
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_HASH 6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce)
set(THEORA_VERSION 1.1.1)
set(THEORA_URI http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2)
set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc)
set(FLAC_VERSION 1.3.1)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 4773c0099dba767d963fd92143263be338c48702172e8754b9bc5103efe1c56c)
set(VPX_VERSION 1.5.0)
set(VPX_URI http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-${VPX_VERSION}.tar.bz2)
set(VPX_HASH 306d67908625675f8e188d37a81fbfafdf5068b09d9aa52702b6fbe601c76797)
set(ORC_VERSION 0.4.25)
set(ORC_URI https://gstreamer.freedesktop.org/src/orc/orc-${ORC_VERSION}.tar.xz)
set(ORC_HASH c1b1d54a58f26d483f0b3881538984789fe5d5460ab8fab74a1cacbd3d1c53d1)
set(SCHROEDINGER_VERSION 1.0.11)
set(SCHROEDINGER_URI https://download.videolan.org/contrib/schroedinger/schroedinger-${SCHROEDINGER_VERSION}.tar.gz)
set(SCHROEDINGER_HASH 1e572a0735b92aca5746c4528f9bebd35aa0ccf8619b22fa2756137a8cc9f912)
set(X264_URI http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20160401-2245-stable.tar.bz2)
set(X264_HASH 1e9a7b835e80313aade53a9b6ff353e099de3856bf5f30a4d8dfc91281f786f5)
set(XVIDCORE_VERSION 1.3.4)
set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH 4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f)
#this has to be in sync with the version in blenders /extern folder
set(OPENJPEG_VERSION 1.5.2)
set(OPENJPEG_SHORT_VERSION 1.5)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/version.${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 3734e95edd0bef6e056815591755efd822228dc3cd866894e00a2c929026b16d)
set(FAAD_VERSION 2-2.7)
set(FAAD_URI http://downloads.sourceforge.net/faac/faad${FAAD_VERSION}.tar.bz2)
set(FAAD_HASH 4c332fa23febc0e4648064685a3d4332)
set(FFMPEG_VERSION 3.2.1)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH cede174178e61f882844f5870c35ce72)
set(FFTW_VERSION 3.3.4)
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
set(FFTW_HASH 2edab8c06b24feeb3b82bbb3ebf3e7b3)
set(ICONV_VERSION 1.14)
set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
set(ICONV_HASH e34509b1623cec449dfeb73d7ce9c6c6)
set(LAPACK_VERSION 3.6.0)
set(LAPACK_URI http://www.netlib.org/lapack/lapack-${LAPACK_VERSION}.tgz)
set(LAPACK_HASH f2f6c67134e851fe189bb3ca1fbb5101)
set(SNDFILE_VERSION 1.0.28)
set(SNDFILE_URI http://www.mega-nerd.com/libsndfile/files/libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
#set(HIDAPI_VERSION 0.8.0-rc1)
#set(HIDAPI_URI https://github.com/signal11/hidapi/archive/hidapi-${HIDAPI_VERSION}.tar.gz)
#set(HIDAPI_HASH 069f9dd746edc37b6b6d0e3656f47199)
set(HIDAPI_UID 89a6c75dc6f45ecabd4ddfbd2bf5ba6ad8ba38b5)
set(HIDAPI_URI https://github.com/TheOnlyJoey/hidapi/archive/${HIDAPI_UID}.zip)
set(HIDAPI_HASH b6e22f6b514f8bcf594989f20ffc46fb)
set(WEBP_VERSION 0.5.1)
set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_HASH 3d7db92ebba5b4f679413d25c6040881)
set(SPNAV_VERSION 0.2.3)
set(SPNAV_URI http://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%20${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
set(SPNAV_HASH 44d840540d53326d4a119c0f1aa7bf0a)
set(JEMALLOC_VERSION 5.0.1)
set(JEMALLOC_URI https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2)
set(JEMALLOC_HASH 507f7b6b882d868730d644510491d18f)
set(XML2_VERSION 2.9.4)
set(XML2_URI ftp://xmlsoft.org/libxml2/libxml2-${XML2_VERSION}.tar.gz)
set(XML2_HASH ae249165c173b1ff386ee8ad676815f5)

View File

@@ -0,0 +1,38 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_vorbis
URL ${VORBIS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${VORBIS_HASH}
PREFIX ${BUILD_DIR}/vorbis
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/vorbis
--disable-shared
--enable-static
--with-pic
--with-ogg=${LIBDIR}/ogg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && make install
INSTALL_DIR ${LIBDIR}/vorbis
)
add_dependencies(external_vorbis external_ogg)
if(MSVC)
set_target_properties(external_vorbis PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,60 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc)
else()
set(VPX_EXTRA_FLAGS --target=x86-win32-gcc)
endif()
else()
if(APPLE)
set(VPX_EXTRA_FLAGS --target=x86_64-darwin13-gcc)
else()
set(VPX_EXTRA_FLAGS --target=generic-gnu)
endif()
endif()
ExternalProject_Add(external_vpx
URL ${VPX_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${VPX_HASH}
PREFIX ${BUILD_DIR}/vpx
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/vpx/src/external_vpx/ &&
${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/vpx
--disable-shared
--enable-static
--disable-install-bins
--disable-install-srcs
--disable-sse4_1
--disable-sse3
--disable-ssse3
--disable-avx
--disable-avx2
--disable-unit-tests
--disable-examples
${VPX_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install
INSTALL_DIR ${LIBDIR}/vpx
)
if(MSVC)
set_target_properties(external_vpx PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,50 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
set(WEBP_EXTRA_ARGS
-DWEBP_HAVE_SSE2=ON
-DWEBP_HAVE_SSE41=OFF
-DWEBP_HAVE_AVX2=OFF
)
if(WIN32)
set(WEBP_BUILD_DIR ${BUILD_MODE}/)
else()
set(WEBP_BUILD_DIR)
endif()
ExternalProject_Add(external_webp
URL ${WEBP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${WEBP_HASH}
PREFIX ${BUILD_DIR}/webp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/webp -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${WEBP_EXTRA_ARGS}
INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp-build/${WEBP_BUILD_DIR}${LIBPREFIX}webp${LIBEXT} ${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/decode.h ${LIBDIR}/webp/include/webp/decode.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/encode.h ${LIBDIR}/webp/include/webp/encode.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/demux.h ${LIBDIR}/webp/include/webp/demux.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/extras.h ${LIBDIR}/webp/include/webp/extras.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/format_constants.h ${LIBDIR}/webp/include/webp/format_constants.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/mux.h ${LIBDIR}/webp/include/webp/mux.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/mux_types.h ${LIBDIR}/webp/include/webp/mux_types.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/types.h ${LIBDIR}/webp/include/webp/types.h
INSTALL_DIR ${LIBDIR}/webp
)

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(X264_EXTRA_ARGS --enable-win32thread --cross-prefix=${MINGW_HOST}- --host=${MINGW_HOST})
endif()
ExternalProject_Add(external_x264
URL ${X264_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${X264_HASH}
PREFIX ${BUILD_DIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
--enable-static
--enable-pic
--disable-lavf
${X264_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && make install
INSTALL_DIR ${LIBDIR}/x264
)
if(MSVC)
set_target_properties(external_x264 PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,36 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_xml2
URL ${XML2_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${XML2_HASH}
PREFIX ${BUILD_DIR}/xml2
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && ${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/xml2
--disable-shared
--enable-static
--with-pic
--with-python=no
--with-lzma=no
--with-zlib=no
--with-iconv=no
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make install
INSTALL_DIR ${LIBDIR}/xml2
)

View File

@@ -0,0 +1,44 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(XVIDCORE_EXTRA_ARGS --host=${MINGW_HOST})
endif()
ExternalProject_Add(external_xvidcore
URL ${XVIDCORE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${XVIDCORE_HASH}
PREFIX ${BUILD_DIR}/xvidcore
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/xvidcore ${XVIDCORE_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/* && # clean because re-installing fails otherwise
cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make install
INSTALL_DIR ${LIBDIR}/xvidcore
)
ExternalProject_Add_Step(external_xvidcore after_install
COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/xvidcore/lib/xvidcore.a ${LIBDIR}/xvidcore/lib/libxvidcore.a || true
COMMAND ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/xvidcore.dll.a
DEPENDEES install
)
if(MSVC)
set_target_properties(external_xvidcore PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,33 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_zlib after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib_mingw
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib_mingw
CONFIGURE_COMMAND echo .
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/zlib_mingw/src/external_zlib_mingw/ && make -f win32/makefile.gcc -j${MAKE_THREADS}
INSTALL_COMMAND echo .
INSTALL_DIR ${LIBDIR}/zlib_mingw
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_zlib_mingw after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/zlib_mingw/src/external_zlib_mingw/libz.a ${LIBDIR}/zlib/lib/z.lib
DEPENDEES install
)
endif()
if(MSVC)
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
endif()

View File

@@ -26,7 +26,7 @@ ARGS=$( \
getopt \
-o s:i:t:h \
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
with-all,with-opencollada,\
with-all,with-opencollada,with-jack,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
force-all,force-python,force-numpy,force-boost,\
force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
@@ -113,6 +113,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--with-opencollada
Build and install the OpenCOLLADA libraries.
--with-jack
Install the jack libraries.
--ver-ocio=<ver>
Force version of OCIO library.
@@ -284,13 +287,13 @@ NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=true # Mandatory in blender2.8
PYTHON_VERSION="3.5.2"
PYTHON_VERSION_MIN="3.5"
PYTHON_VERSION="3.6.2"
PYTHON_VERSION_MIN="3.6"
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false
NUMPY_VERSION="1.10.1"
NUMPY_VERSION="1.13.1"
NUMPY_VERSION_MIN="1.8"
NUMPY_FORCE_BUILD=false
NUMPY_FORCE_REBUILD=false
@@ -317,8 +320,8 @@ OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false
_with_built_openexr=false
OIIO_VERSION="1.7.8"
OIIO_VERSION_MIN="1.6.0"
OIIO_VERSION="1.7.15"
OIIO_VERSION_MIN="1.7.15"
OIIO_VERSION_MAX="1.9.0" # UNKNOWN currently # Not supported by current OSL...
OIIO_FORCE_BUILD=false
OIIO_FORCE_REBUILD=false
@@ -355,14 +358,13 @@ OPENVDB_FORCE_REBUILD=false
OPENVDB_SKIP=false
# Alembic needs to be compiled for now
ALEMBIC_VERSION="1.6.0"
ALEMBIC_VERSION="1.7.1"
ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
# Version??
OPENCOLLADA_VERSION="1.3"
OPENCOLLADA_VERSION="1.6.51"
OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
@@ -500,6 +502,9 @@ while true; do
--with-opencollada)
WITH_OPENCOLLADA=true; shift; continue
;;
--with-jack)
WITH_JACK=true; shift; continue;
;;
--ver-ocio)
OCIO_VERSION="$2"
OCIO_VERSION_MIN=$OCIO_VERSION
@@ -703,6 +708,9 @@ done
if [ "$WITH_ALL" = true -a "$OPENCOLLADA_SKIP" = false ]; then
WITH_OPENCOLLADA=true
fi
if [ "$WITH_ALL" = true ]; then
WITH_JACK=true
fi
WARNING "****WARNING****"
@@ -723,13 +731,16 @@ PRINT ""
# This has to be done here, because user might force some versions...
PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
NUMPY_SOURCE=( "https://github.com/numpy/numpy/releases/download/v$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
_boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" )
BOOST_BUILD_MODULES="--with-system --with-filesystem --with-thread --with-regex --with-locale --with-date_time --with-wave --with-iostreams --with-python --with-program_options"
OCIO_USE_REPO=true
OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" )
OCIO_SOURCE_REPO=( "https://github.com/imageworks/OpenColorIO.git" )
OCIO_SOURCE_REPO_UID="6de971097c7f552300f669ed69ca0b6cf5a70843"
OPENEXR_USE_REPO=false
OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
@@ -778,7 +789,7 @@ ALEMBIC_SOURCE=( "https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.
# ALEMBIC_SOURCE_REPO_BRANCH="master"
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d"
OPENCOLLADA_REPO_UID="0c2cdc17c22cf42050e4d42154bed2176363549c"
OPENCOLLADA_REPO_BRANCH="master"
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
@@ -787,7 +798,7 @@ CXXFLAGS_BACK=$CXXFLAGS
if [ "$USE_CXX11" = true ]; then
WARNING "C++11 is now mandatory for blender2.8, this *should* go smoothly with any very recent distribution.
However, if you are experiencing linking errors (also when building Blender itself), please try the following:
* Re-run this script with `--build-all --force-all` options.
* Re-run this script with '--build-all --force-all' options.
* Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
Please note that until the transition to C++11-built libraries if completed in your distribution, situation will
@@ -1141,7 +1152,7 @@ compile_Numpy() {
cd $_src
$_python/bin/python3 setup.py install --prefix=$_inst
$_python/bin/python3 setup.py install --old-and-unmanageable --prefix=$_inst
if [ -d $_inst ]; then
# Can't use _create_inst_shortcut here...
@@ -1260,7 +1271,7 @@ compile_OCIO() {
fi
# To be changed each time we make edits that would modify the compiled result!
ocio_magic=1
ocio_magic=2
_init_ocio
# Clean install if needed!
@@ -1277,14 +1288,27 @@ compile_OCIO() {
if [ ! -d $_src ]; then
INFO "Downloading OpenColorIO-$OCIO_VERSION"
mkdir -p $SRC
download OCIO_SOURCE[@] $_src.tar.gz
INFO "Unpacking OpenColorIO-$OCIO_VERSION"
tar -C $SRC --transform "s,(.*/?)imageworks-OpenColorIO[^/]*(.*),\1OpenColorIO-$OCIO_VERSION\2,x" \
-xf $_src.tar.gz
if [ "$OCIO_USE_REPO" = true ]; then
git clone ${OCIO_SOURCE_REPO[0]} $_src
else
download OCIO_SOURCE[@] $_src.tar.gz
INFO "Unpacking OpenColorIO-$OCIO_VERSION"
tar -C $SRC --transform "s,(.*/?)imageworks-OpenColorIO[^/]*(.*),\1OpenColorIO-$OCIO_VERSION\2,x" \
-xf $_src.tar.gz
fi
fi
cd $_src
if [ "$OCIO_USE_REPO" = true ]; then
# XXX For now, always update from latest repo...
git pull origin master
git checkout $OCIO_SOURCE_REPO_UID
git reset --hard
fi
# Always refresh the whole build!
if [ -d build ]; then
rm -rf build
@@ -1490,7 +1514,6 @@ compile_OPENEXR() {
if [ "$OPENEXR_USE_REPO" = true ]; then
# XXX For now, always update from latest repo...
git pull origin master
# Stick to same rev as windows' libs...
git checkout $OPENEXR_SOURCE_REPO_UID
git reset --hard
oiio_src_path="../OpenEXR"
@@ -1568,7 +1591,7 @@ compile_OIIO() {
fi
# To be changed each time we make edits that would modify the compiled result!
oiio_magic=16
oiio_magic=17
_init_oiio
# Clean install if needed!
@@ -1632,6 +1655,9 @@ compile_OIIO() {
INFO "ILMBASE_HOME=$INST/openexr"
fi
# ptex is only needed when nicholas bishop is ready
cmake_d="$cmake_d -D USE_PTEX=OFF"
# Optional tests and cmd tools
cmake_d="$cmake_d -D USE_QT=OFF"
cmake_d="$cmake_d -D USE_PYTHON=OFF"
@@ -1743,7 +1769,7 @@ compile_LLVM() {
cd $_src
# XXX Ugly patching hack!
patch -p1 -i "$SCRIPT_DIR/install_deps_patches/llvm.patch"
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_llvm.diff"
cd $CWD
@@ -1849,7 +1875,7 @@ compile_OSL() {
git reset --hard
# XXX Ugly patching hack!
patch -p1 -i "$SCRIPT_DIR/install_deps_patches/osl.patch"
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_osl.diff"
fi
# Always refresh the whole build!
@@ -2228,9 +2254,6 @@ compile_ALEMBIC() {
return
fi
compile_HDF5
PRINT ""
# To be changed each time we make edits that would modify the compiled result!
alembic_magic=2
_init_alembic
@@ -2258,8 +2281,16 @@ compile_ALEMBIC() {
cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst"
# Without Boost or TR1, Alembic requires C++11.
if [ "$USE_CXX11" != true ]; then
cmake_d="$cmake_d -D ALEMBIC_LIB_USES_BOOST=ON"
cmake_d="$cmake_d -D ALEMBIC_LIB_USES_TR1=OFF"
fi
if [ -d $INST/boost ]; then
cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost"
if [ -d $INST/boost ]; then
cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost"
fi
cmake_d="$cmake_d -D USE_STATIC_BOOST=ON"
else
cmake_d="$cmake_d -D USE_STATIC_BOOST=OFF"
@@ -2277,8 +2308,6 @@ compile_ALEMBIC() {
cmake_d="$cmake_d -D USE_STATIC_HDF5=OFF"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_LINK_STATIC=OFF"
cmake_d="$cmake_d -D ALEMBIC_SHARED_LIBS=OFF"
cmake_d="$cmake_d -D ALEMBIC_LIB_USES_BOOST=ON"
cmake_d="$cmake_d -D ALEMBIC_LIB_USES_TR1=OFF"
INFO "ILMBASE_ROOT=$INST/openexr"
fi
@@ -2590,7 +2619,6 @@ install_DEB() {
fi
# These libs should always be available in debian/ubuntu official repository...
OPENJPEG_DEV="libopenjpeg-dev"
VORBIS_DEV="libvorbis-dev"
OGG_DEV="libogg-dev"
THEORA_DEV="libtheora-dev"
@@ -2598,16 +2626,24 @@ install_DEB() {
_packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
git libfreetype6-dev libx11-dev flex bison libtbb-dev libxxf86vm-dev \
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
# libglewmx-dev (broken in deb testing currently...)
OPENJPEG_USE=true
VORBIS_USE=true
OGG_USE=true
THEORA_USE=true
PRINT ""
# New Ubuntu crap (17.04 and more) have no openjpeg lib!
OPENJPEG_DEV="libopenjpeg-dev"
check_package_DEB $OPENJPEG_DEV
if [ $? -eq 0 ]; then
_packages="$_packages $OPENJPEG_DEV"
OPENJPEG_USE=true
fi
PRINT ""
# Some not-so-old distro (ubuntu 12.4) do not have it, do not fail in this case, just warn.
YAMLCPP_DEV="libyaml-cpp-dev"
@@ -2620,7 +2656,7 @@ install_DEB() {
PRINT ""
fi
if [ "$WITH_ALL" = true ]; then
if [ "$WITH_JACK" = true ]; then
_packages="$_packages libspnav-dev"
# Only install jack if jack2 is not already installed!
JACK="libjack-dev"
@@ -2637,10 +2673,10 @@ install_DEB() {
install_packages_DEB $_packages
PRINT""
SNDFILE_DEV="libsndfile1-dev"
check_package_DEB $SNDFILE_DEV
LIBSNDFILE_DEV="libsndfile1-dev"
check_package_DEB $LIBSNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_DEB $SNDFILE_DEV
install_packages_DEB $LIBSNDFILE_DEV
fi
PRINT ""
@@ -2769,7 +2805,7 @@ install_DEB() {
boost_version=$(echo `get_package_version_DEB libboost-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_DEB libboost-{filesystem,iostreams,locale,regex,system,thread,wave}$boost_version-dev
install_packages_DEB libboost-{filesystem,iostreams,locale,regex,system,thread,wave,program-options}$boost_version-dev
clean_Boost
else
compile_Boost
@@ -3157,7 +3193,7 @@ install_RPM() {
if [ "$RPM" = "FEDORA" -o "$RPM" = "RHEL" ]; then
_packages="$_packages freetype-devel tbb-devel"
if [ "$WITH_ALL" = true ]; then
if [ "$WITH_JACK" = true ]; then
_packages="$_packages jack-audio-connection-kit-devel"
fi
@@ -3235,10 +3271,10 @@ install_RPM() {
fi
PRINT""
SNDFILE_DEV="libsndfile-devel"
check_package_RPM $SNDFILE_DEV
LIBSNDFILE_DEV="libsndfile-devel"
check_package_RPM $LIBSNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_RPM $SNDFILE_DEV
install_packages_RPM $LIBSNDFILE_DEV
fi
if [ "$WITH_ALL" = true ]; then
@@ -3631,17 +3667,21 @@ install_ARCH() {
THEORA_USE=true
if [ "$WITH_ALL" = true ]; then
_packages="$_packages jack libspnav"
_packages="$_packages libspnav"
fi
if [ "$WITH_JACK" = true ]; then
_packages="$_packages jack"
fi
PRINT ""
install_packages_ARCH $_packages
PRINT""
SNDFILE_DEV="libsndfile"
check_package_ARCH $SNDFILE_DEV
LIBSNDFILE_DEV="libsndfile"
check_package_ARCH $LIBSNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_ARCH $SNDFILE_DEV
install_packages_ARCH $LIBSNDFILE_DEV
fi
PRINT ""
@@ -4244,7 +4284,7 @@ print_info() {
PRINT " $_3"
_buildargs="$_buildargs $_1 $_2 $_3"
if [ -d $INST/osl ]; then
_1="-D CYCLES_OSL=$INST/osl"
_1="-D OSL_ROOT_DIR=$INST/osl"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
@@ -4293,6 +4333,14 @@ print_info() {
_buildargs="$_buildargs $_1"
fi
if [ "$WITH_JACK" = true ]; then
_1="-D WITH_JACK=ON"
_2="-D WITH_JACK_DYNLOAD=ON"
PRINT " $_1"
PRINT " $_2"
_buildargs="$_buildargs $_1 $_2"
fi
if [ "$ALEMBIC_SKIP" = false ]; then
_1="-D WITH_ALEMBIC=ON"
PRINT " $_1"

View File

@@ -0,0 +1,35 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e09c57..26565ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,7 +116,7 @@ IF (NOT ${ALEMBIC_LIB_USES_TR1} AND NOT ${ALEMBIC_LIB_USES_BOOST})
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
- IF (COMPILER_SUPPORTS_CXX1X)
+ IF (COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF (COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
--- a/lib/Alembic/AbcCoreOgawa/StreamManager.cpp
+++ b/lib/Alembic/AbcCoreOgawa/StreamManager.cpp
@@ -47,7 +47,18 @@
#define COMPARE_EXCHANGE( V, COMP, EXCH ) V.compare_exchange_weak( COMP, EXCH, std::memory_order_seq_cst, std::memory_order_seq_cst )
// Windows
#elif defined( _MSC_VER )
-#define COMPARE_EXCHANGE( V, COMP, EXCH ) InterlockedCompareExhange64( &V, EXCH, COMP ) == COMP
+#define COMPARE_EXCHANGE( V, COMP, EXCH ) InterlockedCompareExchange64( &V, EXCH, COMP ) == COMP
+int ffsll(long long value)
+{
+ if (!value)
+ return 0;
+
+ for (int bit = 0; bit < 63; bit++)
+ {
+ if (value & (1 << bit))
+ return bit + 1;
+ }
+}
// gcc 4.8 and above not using C++11
#elif defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8
#define COMPARE_EXCHANGE( V, COMP, EXCH ) __atomic_compare_exchange_n( &V, &COMP, EXCH, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST )

View File

@@ -0,0 +1,33 @@
diff -Naur src/blosc/CMakeLists.txt external_blosc/blosc/CMakeLists.txt
--- src/blosc/CMakeLists.txt 2016-02-03 10:26:28 -0700
+++ external_blosc/blosc/CMakeLists.txt 2017-03-03 09:03:31 -0700
@@ -61,6 +61,8 @@
set(SOURCES ${SOURCES} win32/pthread.c)
else(NOT Threads_FOUND)
set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
+ set(LIBS ${LIBS} ${PTHREAD_LIBS})
+ include_directories( ${PTHREAD_INCLUDE_DIR} )
endif(NOT Threads_FOUND)
else(WIN32)
find_package(Threads REQUIRED)
diff -Naur src/blosc/blosc.c external_blosc/blosc/blosc.c
--- src/blosc/blosc.c 2016-02-03 10:26:28 -0700
+++ external_blosc/blosc/blosc.c 2017-03-03 09:01:50 -0700
@@ -49,12 +49,12 @@
#include <inttypes.h>
#endif /* _WIN32 */
-#if defined(_WIN32) && !defined(__GNUC__)
- #include "win32/pthread.h"
- #include "win32/pthread.c"
-#else
+//#if defined(_WIN32) && !defined(__GNUC__)
+// #include "win32/pthread.h"
+ //#include "win32/pthread.c"
+//#else
#include <pthread.h>
-#endif
+//#endif
/* If C11 is supported, use it's built-in aligned allocation. */
#if __STDC_VERSION__ >= 201112L

View File

@@ -0,0 +1,127 @@
--- cfe/trunk/lib/Serialization/ASTWriter.cpp
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp
@@ -56,14 +56,14 @@
using namespace clang::serialization;
template <typename T, typename Allocator>
-static StringRef bytes(const std::vector<T, Allocator> &v) {
+static StringRef data(const std::vector<T, Allocator> &v) {
if (v.empty()) return StringRef();
return StringRef(reinterpret_cast<const char*>(&v[0]),
sizeof(T) * v.size());
}
template <typename T>
-static StringRef bytes(const SmallVectorImpl<T> &v) {
+static StringRef data(const SmallVectorImpl<T> &v) {
return StringRef(reinterpret_cast<const char*>(v.data()),
sizeof(T) * v.size());
}
@@ -1385,7 +1385,7 @@
Record.push_back(INPUT_FILE_OFFSETS);
Record.push_back(InputFileOffsets.size());
Record.push_back(UserFilesNum);
- Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, bytes(InputFileOffsets));
+ Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, data(InputFileOffsets));
}
//===----------------------------------------------------------------------===//
@@ -1771,7 +1771,7 @@
Record.push_back(SOURCE_LOCATION_OFFSETS);
Record.push_back(SLocEntryOffsets.size());
Record.push_back(SourceMgr.getNextLocalOffset() - 1); // skip dummy
- Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, bytes(SLocEntryOffsets));
+ Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, data(SLocEntryOffsets));
// Write the source location entry preloads array, telling the AST
// reader which source locations entries it should load eagerly.
@@ -2087,7 +2087,7 @@
Record.push_back(MacroOffsets.size());
Record.push_back(FirstMacroID - NUM_PREDEF_MACRO_IDS);
Stream.EmitRecordWithBlob(MacroOffsetAbbrev, Record,
- bytes(MacroOffsets));
+ data(MacroOffsets));
}
void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) {
@@ -2185,7 +2185,7 @@
Record.push_back(PPD_ENTITIES_OFFSETS);
Record.push_back(FirstPreprocessorEntityID - NUM_PREDEF_PP_ENTITY_IDS);
Stream.EmitRecordWithBlob(PPEOffsetAbbrev, Record,
- bytes(PreprocessedEntityOffsets));
+ data(PreprocessedEntityOffsets));
}
}
@@ -2548,7 +2548,7 @@
Record.push_back(CXX_BASE_SPECIFIER_OFFSETS);
Record.push_back(CXXBaseSpecifiersOffsets.size());
Stream.EmitRecordWithBlob(BaseSpecifierOffsetAbbrev, Record,
- bytes(CXXBaseSpecifiersOffsets));
+ data(CXXBaseSpecifiersOffsets));
}
//===----------------------------------------------------------------------===//
@@ -2623,7 +2623,7 @@
Decls.push_back(std::make_pair((*D)->getKind(), GetDeclRef(*D)));
++NumLexicalDeclContexts;
- Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, bytes(Decls));
+ Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, data(Decls));
return Offset;
}
@@ -2642,7 +2642,7 @@
Record.push_back(TYPE_OFFSET);
Record.push_back(TypeOffsets.size());
Record.push_back(FirstTypeID - NUM_PREDEF_TYPE_IDS);
- Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, bytes(TypeOffsets));
+ Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, data(TypeOffsets));
// Write the declaration offsets array
Abbrev = new BitCodeAbbrev();
@@ -2655,7 +2655,7 @@
Record.push_back(DECL_OFFSET);
Record.push_back(DeclOffsets.size());
Record.push_back(FirstDeclID - NUM_PREDEF_DECL_IDS);
- Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, bytes(DeclOffsets));
+ Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, data(DeclOffsets));
}
void ASTWriter::WriteFileDeclIDsMap() {
@@ -2680,7 +2680,7 @@
unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev);
Record.push_back(FILE_SORTED_DECLS);
Record.push_back(FileSortedIDs.size());
- Stream.EmitRecordWithBlob(AbbrevCode, Record, bytes(FileSortedIDs));
+ Stream.EmitRecordWithBlob(AbbrevCode, Record, data(FileSortedIDs));
}
void ASTWriter::WriteComments() {
@@ -2893,7 +2893,7 @@
Record.push_back(SelectorOffsets.size());
Record.push_back(FirstSelectorID - NUM_PREDEF_SELECTOR_IDS);
Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record,
- bytes(SelectorOffsets));
+ data(SelectorOffsets));
}
}
@@ -3253,7 +3253,7 @@
Record.push_back(IdentifierOffsets.size());
Record.push_back(FirstIdentID - NUM_PREDEF_IDENT_IDS);
Stream.EmitRecordWithBlob(IdentifierOffsetAbbrev, Record,
- bytes(IdentifierOffsets));
+ data(IdentifierOffsets));
}
//===----------------------------------------------------------------------===//
@@ -4046,7 +4046,7 @@
Record.clear();
Record.push_back(TU_UPDATE_LEXICAL);
Stream.EmitRecordWithBlob(TuUpdateLexicalAbbrev, Record,
- bytes(NewGlobalDecls));
+ data(NewGlobalDecls));
// And a visible updates block for the translation unit.
Abv = new llvm::BitCodeAbbrev();

View File

@@ -0,0 +1,73 @@
# - Find BLOSC library
# Find the native BLOSC includes and library
# This module defines
# BLOSC_INCLUDE_DIRS, where to find blosc.h, Set when
# BLOSC is found.
# BLOSC_LIBRARIES, libraries to link against to use BLOSC.
# BLOSC_ROOT_DIR, The base directory to search for BLOSC.
# This can also be an environment variable.
# BLOSC_FOUND, If false, do not try to use BLOSC.
#
# also defined, but not for general use are
# BLOSC_LIBRARY, where to find the BLOSC library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If BLOSC_ROOT_DIR was defined in the environment, use it.
IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "")
SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})
ENDIF()
SET(_blosc_SEARCH_DIRS
${BLOSC_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/blosc
)
FIND_PATH(BLOSC_INCLUDE_DIR
NAMES
blosc.h
HINTS
${_blosc_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(BLOSC_LIBRARY
NAMES
blosc
HINTS
${_blosc_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
IF(BLOSC_FOUND)
SET(BLOSC_LIBRARIES ${BLOSC_LIBRARY})
SET(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIR})
ELSE()
SET(BLOSC_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
BLOSC_INCLUDE_DIR
BLOSC_LIBRARY
)

View File

@@ -0,0 +1,73 @@
# - Find CPPUNIT library
# Find the native CPPUNIT includes and library
# This module defines
# CPPUNIT_INCLUDE_DIRS, where to find cppunit.h, Set when
# CPPUNIT is found.
# CPPUNIT_LIBRARIES, libraries to link against to use CPPUNIT.
# CPPUNIT_ROOT_DIR, The base directory to search for CPPUNIT.
# This can also be an environment variable.
# CPPUNIT_FOUND, If false, do not try to use CPPUNIT.
#
# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CPPUNIT library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If CPPUNIT_ROOT_DIR was defined in the environment, use it.
IF(NOT CPPUNIT_ROOT_DIR AND NOT $ENV{CPPUNIT_ROOT_DIR} STREQUAL "")
SET(CPPUNIT_ROOT_DIR $ENV{CPPUNIT_ROOT_DIR})
ENDIF()
SET(_cppunit_SEARCH_DIRS
${CPPUNIT_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/cppunit
)
FIND_PATH(CPPUNIT_INCLUDE_DIR
NAMES
cppunit/Test.h
HINTS
${_cppunit_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(CPPUNIT_LIBRARY
NAMES
cppunit
HINTS
${_cppunit_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set CPPUNIT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG
CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR)
IF(CPPUNIT_FOUND)
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY})
SET(CPPUNIT_INCLUDE_DIRS ${CPPUNIT_INCLUDE_DIR})
ELSE()
SET(CPPUNIT_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
CPPUNIT_INCLUDE_DIR
CPPUNIT_LIBRARY
)

View File

@@ -0,0 +1,260 @@
# Module to find IlmBase
#
# This module will first look into the directories defined by the variables:
# - ILMBASE_HOME, ILMBASE_VERSION, ILMBASE_LIB_AREA
#
# It also supports non-standard names for the library components.
#
# To use a custom IlmBase:
# - Set the variable ILMBASE_CUSTOM to True
# - Set the variable ILMBASE_CUSTOM_LIBRARIES to a list of the libraries to
# use, e.g. "SpiImath SpiHalf SpiIlmThread SpiIex"
# - Optionally set the variable ILMBASE_CUSTOM_INCLUDE_DIR to any
# particularly weird place that the OpenEXR/*.h files may be found
# - Optionally set the variable ILMBASE_CUSTOM_LIB_DIR to any
# particularly weird place that the libraries files may be found
#
# This module defines the following variables:
#
# ILMBASE_INCLUDE_DIR - where to find half.h, IlmBaseConfig.h, etc.
# ILMBASE_LIBRARIES - list of libraries to link against when using IlmBase.
# ILMBASE_FOUND - True if IlmBase was found.
# Other standarnd issue macros
include (FindPackageHandleStandardArgs)
include (FindPackageMessage)
include (SelectLibraryConfigurations)
if( ILMBASE_USE_STATIC_LIBS )
set( _ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif()
endif()
# Macro to assemble a helper state variable
macro (SET_STATE_VAR varname)
set (tmp_ilmbaselibs ${ILMBASE_CUSTOM_LIBRARIES})
separate_arguments (tmp_ilmbaselibs)
set (tmp_lst
${ILMBASE_CUSTOM} | ${tmp_ilmbaselibs} |
${ILMBASE_HOME} | ${ILMBASE_VERSION} | ${ILMBASE_LIB_AREA}
)
set (${varname} "${tmp_lst}")
unset (tmp_ilmbaselibs)
unset (tmp_lst)
endmacro ()
# To enforce that find_* functions do not use inadvertently existing versions
if (ILMBASE_CUSTOM)
set (ILMBASE_FIND_OPTIONS "NO_DEFAULT_PATH")
endif ()
# Macro to search for an include directory
macro (PREFIX_FIND_INCLUDE_DIR prefix includefile libpath_var)
string (TOUPPER ${prefix}_INCLUDE_DIR tmp_varname)
find_path(${tmp_varname} ${includefile}
HINTS ${${libpath_var}}
PATH_SUFFIXES include
${ILMBASE_FIND_OPTIONS}
)
if (${tmp_varname})
mark_as_advanced (${tmp_varname})
endif ()
unset (tmp_varname)
endmacro ()
# Macro to search for the given library and adds the cached
# variable names to the specified list
macro (PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
string (TOUPPER ${prefix}_${libname} tmp_prefix)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${ILMBASE_FIND_OPTIONS}
)
find_library(${tmp_prefix}_LIBRARY_DEBUG
NAMES ${libname}d ${libname}_d ${libname}debug ${libname}_debug
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${ILMBASE_FIND_OPTIONS}
)
# Properly define ${tmp_prefix}_LIBRARY (cached) and ${tmp_prefix}_LIBRARIES
select_library_configurations (${tmp_prefix})
list (APPEND ${liblist_var} ${tmp_prefix}_LIBRARIES)
# Add to the list of variables which should be reset
list (APPEND ${cachelist_var}
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
mark_as_advanced (
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
unset (tmp_prefix)
endmacro ()
# Encode the current state of the external variables into a string
SET_STATE_VAR (ILMBASE_CURRENT_STATE)
# If the state has changed, clear the cached variables
if (ILMBASE_CACHED_STATE AND
NOT ILMBASE_CACHED_STATE STREQUAL ILMBASE_CURRENT_STATE)
foreach (libvar ${ILMBASE_CACHED_VARS})
unset (${libvar} CACHE)
endforeach ()
endif ()
# Generic search paths
set (IlmBase_generic_include_paths
${ILMBASE_CUSTOM_INCLUDE_DIR}
/usr/include
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/include
/sw/include
/opt/local/include)
set (IlmBase_generic_library_paths
${ILMBASE_CUSTOM_LIB_DIR}
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/sw/lib
/opt/local/lib)
# Search paths for the IlmBase files
if (ILMBASE_HOME)
if (ILMBASE_VERSION)
set (IlmBase_include_paths
${ILMBASE_HOME}/ilmbase-${ILMBASE_VERSION}/include
${ILMBASE_HOME}/include/ilmbase-${ILMBASE_VERSION})
set (IlmBase_library_paths
${ILMBASE_HOME}/ilmbase-${ILMBASE_VERSION}/lib
${ILMBASE_HOME}/lib/ilmbase-${ILMBASE_VERSION})
endif()
list (APPEND IlmBase_include_paths ${ILMBASE_HOME}/include)
set (IlmBase_library_paths
${ILMBASE_HOME}/lib
${ILMBASE_HOME}/lib64
${ILMBASE_LIB_AREA}
${IlmBase_library_paths})
endif ()
list (APPEND IlmBase_include_paths ${IlmBase_generic_include_paths})
list (APPEND IlmBase_library_paths ${IlmBase_generic_library_paths})
# Locate the header files
PREFIX_FIND_INCLUDE_DIR (IlmBase
OpenEXR/IlmBaseConfig.h IlmBase_include_paths)
if (ILMBASE_INCLUDE_DIR)
# Get the version from config file, if not already set.
if (NOT ILMBASE_VERSION)
FILE(STRINGS "${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h" ILMBASE_BUILD_SPECIFICATION
REGEX "^[ \t]*#define[ \t]+ILMBASE_VERSION_STRING[ \t]+\"[.0-9]+\".*$")
if(ILMBASE_BUILD_SPECIFICATION)
if (NOT IlmBase_FIND_QUIETLY)
message(STATUS "${ILMBASE_BUILD_SPECIFICATION}")
endif ()
string(REGEX REPLACE ".*#define[ \t]+ILMBASE_VERSION_STRING[ \t]+\"([.0-9]+)\".*"
"\\1" XYZ ${ILMBASE_BUILD_SPECIFICATION})
set("ILMBASE_VERSION" ${XYZ} CACHE STRING "Version of ILMBase lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("ILMBASE_VERSION" "2.0" CACHE STRING "Version of ILMBase lib")
endif()
endif()
endif ()
if (ILMBASE_CUSTOM)
if (NOT ILMBASE_CUSTOM_LIBRARIES)
message (FATAL_ERROR "Custom IlmBase libraries requested but ILMBASE_CUSTOM_LIBRARIES is not set.")
endif()
set (IlmBase_Libraries ${ILMBASE_CUSTOM_LIBRARIES})
separate_arguments(IlmBase_Libraries)
else ()
#elseif (${ILMBASE_VERSION} VERSION_LESS "2.1")
set (IlmBase_Libraries Half Iex Imath IlmThread)
#else ()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
# set (IlmBase_Libraries Half Iex-${_ilmbase_libs_ver} Imath-${_ilmbase_libs_ver} IlmThread-${_ilmbase_libs_ver})
endif ()
# Locate the IlmBase libraries
set (IlmBase_libvars "")
set (IlmBase_cachevars "")
foreach (ilmbase_lib ${IlmBase_Libraries})
PREFIX_FIND_LIB (IlmBase ${ilmbase_lib}
IlmBase_library_paths IlmBase_libvars IlmBase_cachevars)
endforeach ()
# Create the list of variables that might need to be cleared
set (ILMBASE_CACHED_VARS
ILMBASE_INCLUDE_DIR ${IlmBase_cachevars}
CACHE INTERNAL "Variables set by FindIlmBase.cmake" FORCE)
# Store the current state so that variables might be cleared if required
set (ILMBASE_CACHED_STATE ${ILMBASE_CURRENT_STATE}
CACHE INTERNAL "State last seen by FindIlmBase.cmake" FORCE)
# Link with pthreads if required
if (NOT WIN32 AND EXISTS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h)
file (STRINGS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h
ILMBASE_HAVE_PTHREAD
REGEX "^[ \\t]*#define[ \\t]+HAVE_PTHREAD[ \\t]1[ \\t]*\$"
)
if (ILMBASE_HAVE_PTHREAD)
find_package (Threads)
if (CMAKE_USE_PTHREADS_INIT)
set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
endif ()
endif ()
endif ()
# Use the standard function to handle ILMBASE_FOUND
FIND_PACKAGE_HANDLE_STANDARD_ARGS (IlmBase DEFAULT_MSG
ILMBASE_INCLUDE_DIR ${IlmBase_libvars})
if (ILMBASE_FOUND)
set (ILMBASE_LIBRARIES "")
foreach (tmplib ${IlmBase_libvars})
list (APPEND ILMBASE_LIBRARIES ${${tmplib}})
endforeach ()
list (APPEND ILMBASE_LIBRARIES ${ILMBASE_PTHREADS})
if (NOT IlmBase_FIND_QUIETLY)
FIND_PACKAGE_MESSAGE (ILMBASE
"Found IlmBase: ${ILMBASE_LIBRARIES}"
"[${ILMBASE_INCLUDE_DIR}][${ILMBASE_LIBRARIES}][${ILMBASE_CURRENT_STATE}]"
)
endif ()
endif ()
# Restore the original find library ordering
if( ILMBASE_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# Unset the helper variables to avoid pollution
unset (ILMBASE_CURRENT_STATE)
unset (IlmBase_include_paths)
unset (IlmBase_library_paths)
unset (IlmBase_generic_include_paths)
unset (IlmBase_generic_library_paths)
unset (IlmBase_libvars)
unset (IlmBase_cachevars)
unset (ILMBASE_PTHREADS)

View File

@@ -0,0 +1,73 @@
# - Find LOGC4PLUS library
# Find the native LOGC4PLUS includes and library
# This module defines
# LOGC4PLUS_INCLUDE_DIRS, where to find logc4plus.h, Set when
# LOGC4PLUS is found.
# LOGC4PLUS_LIBRARIES, libraries to link against to use LOGC4PLUS.
# LOGC4PLUS_ROOT_DIR, The base directory to search for LOGC4PLUS.
# This can also be an environment variable.
# LOGC4PLUS_FOUND, If false, do not try to use LOGC4PLUS.
#
# also defined, but not for general use are
# LOGC4PLUS_LIBRARY, where to find the LOGC4PLUS library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If LOGC4PLUS_ROOT_DIR was defined in the environment, use it.
IF(NOT LOGC4PLUS_ROOT_DIR AND NOT $ENV{LOGC4PLUS_ROOT_DIR} STREQUAL "")
SET(LOGC4PLUS_ROOT_DIR $ENV{LOGC4PLUS_ROOT_DIR})
ENDIF()
SET(_logc4plus_SEARCH_DIRS
${LOGC4PLUS_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/logc4plus
)
FIND_PATH(LOGC4PLUS_INCLUDE_DIR
NAMES
logc4plus.h
HINTS
${_logc4plus_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(LOGC4PLUS_LIBRARY
NAMES
logc4plus
HINTS
${_logc4plus_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LOGC4PLUS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LOGC4PLUS DEFAULT_MSG
LOGC4PLUS_LIBRARY LOGC4PLUS_INCLUDE_DIR)
IF(LOGC4PLUS_FOUND)
SET(LOGC4PLUS_LIBRARIES ${LOGC4PLUS_LIBRARY})
SET(LOGC4PLUS_INCLUDE_DIRS ${LOGC4PLUS_INCLUDE_DIR})
ELSE()
SET(LOGC4PLUS_LOGC4PLUS_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
LOGC4PLUS_INCLUDE_DIR
LOGC4PLUS_LIBRARY
)

View File

@@ -0,0 +1,244 @@
# Module to find OpenEXR.
#
# This module will first look into the directories defined by the variables:
# - OPENEXR_HOME, OPENEXR_VERSION, OPENEXR_LIB_AREA
#
# It also supports non-standard names for the library components.
#
# To use a custom OpenEXR
# - Set the variable OPENEXR_CUSTOM to True
# - Set the variable OPENEXR_CUSTOM_LIBRARY to the name of the library to
# use, e.g. "SpiIlmImf"
# - Optionally set the variable OPENEXR_CUSTOM_INCLUDE_DIR to any
# particularly weird place that the OpenEXR/*.h files may be found
# - Optionally set the variable OPENEXR_CUSTOM_LIB_DIR to any
# particularly weird place that the libraries files may be found
#
# This module defines the following variables:
#
# OPENEXR_INCLUDE_DIR - where to find ImfRgbaFile.h, OpenEXRConfig, etc.
# OPENEXR_LIBRARIES - list of libraries to link against when using OpenEXR.
# This list does NOT include the IlmBase libraries.
# These are defined by the FindIlmBase module.
# OPENEXR_FOUND - True if OpenEXR was found.
# Other standarnd issue macros
include (SelectLibraryConfigurations)
include (FindPackageHandleStandardArgs)
include (FindPackageMessage)
if( OPENEXR_USE_STATIC_LIBS )
set( _openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif()
endif()
# Macro to assemble a helper state variable
macro (SET_STATE_VAR varname)
set (tmp_lst
${OPENEXR_CUSTOM} | ${OPENEXR_CUSTOM_LIBRARY} |
${OPENEXR_HOME} | ${OPENEXR_VERSION} | ${OPENEXR_LIB_AREA}
)
set (${varname} "${tmp_lst}")
unset (tmp_lst)
endmacro ()
# To enforce that find_* functions do not use inadvertently existing versions
if (OPENEXR_CUSTOM)
set (OPENEXR_FIND_OPTIONS "NO_DEFAULT_PATH")
endif ()
# Macro to search for an include directory
macro (PREFIX_FIND_INCLUDE_DIR prefix includefile libpath_var)
string (TOUPPER ${prefix}_INCLUDE_DIR tmp_varname)
find_path(${tmp_varname} ${includefile}
HINTS ${${libpath_var}}
PATH_SUFFIXES include
${OPENEXR_FIND_OPTIONS}
)
if (${tmp_varname})
mark_as_advanced (${tmp_varname})
endif ()
unset (tmp_varname)
endmacro ()
# Macro to search for the given library and adds the cached
# variable names to the specified list
macro (PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
string (TOUPPER ${prefix}_${libname} tmp_prefix)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${OPENEXR_FIND_OPTIONS}
)
find_library(${tmp_prefix}_LIBRARY_DEBUG
NAMES ${libname}d ${libname}_d ${libname}debug ${libname}_debug
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${OPENEXR_FIND_OPTIONS}
)
# Properly define ${tmp_prefix}_LIBRARY (cached) and ${tmp_prefix}_LIBRARIES
select_library_configurations (${tmp_prefix})
list (APPEND ${liblist_var} ${tmp_prefix}_LIBRARIES)
# Add to the list of variables which should be reset
list (APPEND ${cachelist_var}
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
mark_as_advanced (
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
unset (tmp_prefix)
endmacro ()
# Encode the current state of the external variables into a string
SET_STATE_VAR (OPENEXR_CURRENT_STATE)
# If the state has changed, clear the cached variables
if (OPENEXR_CACHED_STATE AND
NOT OPENEXR_CACHED_STATE STREQUAL OPENEXR_CURRENT_STATE)
foreach (libvar ${OPENEXR_CACHED_VARS})
unset (${libvar} CACHE)
endforeach ()
endif ()
# Generic search paths
set (OpenEXR_generic_include_paths
${OPENEXR_CUSTOM_INCLUDE_DIR}
/usr/include
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/include
/sw/include
/opt/local/include)
set (OpenEXR_generic_library_paths
${OPENEXR_CUSTOM_LIB_DIR}
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/sw/lib
/opt/local/lib)
# Search paths for the OpenEXR files
if (OPENEXR_HOME)
set (OpenEXR_library_paths
${OPENEXR_HOME}/lib
${OPENEXR_HOME}/lib64)
if (OPENEXR_VERSION)
set (OpenEXR_include_paths
${OPENEXR_HOME}/openexr-${OPENEXR_VERSION}/include
${OPENEXR_HOME}/include/openexr-${OPENEXR_VERSION})
list (APPEND OpenEXR_library_paths
${OPENEXR_HOME}/openexr-${OPENEXR_VERSION}/lib
${OPENEXR_HOME}/lib/openexr-${OPENEXR_VERSION})
endif()
list (APPEND OpenEXR_include_paths ${OPENEXR_HOME}/include)
if (OPENEXR_LIB_AREA)
list (INSERT OpenEXR_library_paths 2 ${OPENEXR_LIB_AREA})
endif ()
endif ()
if (ILMBASE_HOME AND OPENEXR_VERSION)
list (APPEND OpenEXR_include_paths
${ILMBASE_HOME}/include/openexr-${OPENEXR_VERSION})
endif()
list (APPEND OpenEXR_include_paths ${OpenEXR_generic_include_paths})
list (APPEND OpenEXR_library_paths ${OpenEXR_generic_library_paths})
# Locate the header files
PREFIX_FIND_INCLUDE_DIR (OpenEXR
OpenEXR/ImfArray.h OpenEXR_include_paths)
if (OPENEXR_INCLUDE_DIR)
# Get the version from config file, if not already set.
if (NOT OPENEXR_VERSION)
FILE(STRINGS "${OPENEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h" OPENEXR_BUILD_SPECIFICATION
REGEX "^[ \t]*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"[.0-9]+\".*$")
if(OPENEXR_BUILD_SPECIFICATION)
if (NOT OpenEXR_FIND_QUIETLY)
message(STATUS "${OPENEXR_BUILD_SPECIFICATION}")
endif ()
string(REGEX REPLACE ".*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"([.0-9]+)\".*"
"\\1" XYZ ${OPENEXR_BUILD_SPECIFICATION})
set("OPENEXR_VERSION" ${XYZ} CACHE STRING "Version of OpenEXR lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("OPENEXR_VERSION" "2.0" CACHE STRING "Version of OpenEXR lib")
endif()
endif()
endif ()
if (OPENEXR_CUSTOM)
if (NOT OPENEXR_CUSTOM_LIBRARY)
message (FATAL_ERROR "Custom OpenEXR library requested but OPENEXR_CUSTOM_LIBRARY is not set.")
endif()
set (OpenEXR_Library ${OPENEXR_CUSTOM_LIBRARY})
else ()
#elseif (${OPENEXR_VERSION} VERSION_LESS "2.1")
set (OpenEXR_Library IlmImf)
#else ()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION})
# set (OpenEXR_Library IlmImf-${_openexr_libs_ver})
endif ()
# Locate the OpenEXR library
set (OpenEXR_libvars "")
set (OpenEXR_cachevars "")
PREFIX_FIND_LIB (OpenEXR ${OpenEXR_Library}
OpenEXR_library_paths OpenEXR_libvars OpenEXR_cachevars)
# Create the list of variables that might need to be cleared
set (OPENEXR_CACHED_VARS
OPENEXR_INCLUDE_DIR ${OpenEXR_cachevars}
CACHE INTERNAL "Variables set by FindOpenEXR.cmake" FORCE)
# Store the current state so that variables might be cleared if required
set (OPENEXR_CACHED_STATE ${OPENEXR_CURRENT_STATE}
CACHE INTERNAL "State last seen by FindOpenEXR.cmake" FORCE)
# Always link explicitly with zlib
set (OPENEXR_ZLIB ${ZLIB_LIBRARIES})
# Use the standard function to handle OPENEXR_FOUND
FIND_PACKAGE_HANDLE_STANDARD_ARGS (OpenEXR DEFAULT_MSG
OPENEXR_INCLUDE_DIR ${OpenEXR_libvars})
if (OPENEXR_FOUND)
set (OPENEXR_LIBRARIES "")
foreach (tmplib ${OpenEXR_libvars})
list (APPEND OPENEXR_LIBRARIES ${${tmplib}})
endforeach ()
list (APPEND OPENEXR_LIBRARIES ${ZLIB_LIBRARIES})
if (NOT OpenEXR_FIND_QUIETLY)
FIND_PACKAGE_MESSAGE (OPENEXR
"Found OpenEXR: ${OPENEXR_LIBRARIES}"
"[${OPENEXR_INCLUDE_DIR}][${OPENEXR_LIBRARIES}][${OPENEXR_CURRENT_STATE}]"
)
endif ()
endif ()
# Restore the original find library ordering
if( OPENEXR_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# Unset the helper variables to avoid pollution
unset (OPENEXR_CURRENT_STATE)
unset (OpenEXR_include_paths)
unset (OpenEXR_library_paths)
unset (OpenEXR_generic_include_paths)
unset (OpenEXR_generic_library_paths)
unset (OpenEXR_libvars)
unset (OpenEXR_cachevars)

View File

@@ -0,0 +1,73 @@
# - Find TBB library
# Find the native TBB includes and library
# This module defines
# TBB_INCLUDE_DIRS, where to find tbb.h, Set when
# TBB is found.
# TBB_LIBRARIES, libraries to link against to use TBB.
# TBB_ROOT_DIR, The base directory to search for TBB.
# This can also be an environment variable.
# TBB_FOUND, If false, do not try to use TBB.
#
# also defined, but not for general use are
# TBB_LIBRARY, where to find the TBB library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If TBB_ROOT_DIR was defined in the environment, use it.
IF(NOT TBB_ROOT_DIR AND NOT $ENV{TBB_ROOT_DIR} STREQUAL "")
SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})
ENDIF()
SET(_tbb_SEARCH_DIRS
${TBB_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/tbb
)
FIND_PATH(TBB_INCLUDE_DIR
NAMES
tbb/tbb.h
HINTS
${_tbb_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(TBB_LIBRARY
NAMES
tbb
HINTS
${_tbb_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set TBB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG
TBB_LIBRARY TBB_INCLUDE_DIR)
IF(TBB_FOUND)
SET(TBB_LIBRARIES ${TBB_LIBRARY})
SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
ELSE()
SET(TBB_TBB_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
TBB_INCLUDE_DIR
TBB_LIBRARY
)

View File

@@ -0,0 +1,82 @@
# select_library_configurations( basename )
#
# This macro takes a library base name as an argument, and will choose good
# values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and
# basename_LIBRARY_RELEASE depending on what has been found and set. If only
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
# and basename_LIBRARY_RELEASE will be set to the release value. If only
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
#
# If the generator supports configuration types, then basename_LIBRARY and
# basename_LIBRARIES will be set with debug and optimized flags specifying the
# library to be used for the given configuration. If no build type has been set
# or the generator in use does not support configuration types, then
# basename_LIBRARY and basename_LIBRARIES will take only the release values.
#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009 Will Dicharry <wdicharry@stellarscience.com>
# Copyright 2005-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
# Utility macro to check if one variable exists while another doesn't, and set
# one that doesn't exist to the one that exists.
macro( _set_library_name basename GOOD BAD )
if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
endmacro( _set_library_name )
macro( select_library_configurations basename )
# if only the release version was found, set the debug to be the release
# version.
_set_library_name( ${basename} RELEASE DEBUG )
# if only the debug version was found, set the release value to be the
# debug value.
_set_library_name( ${basename} DEBUG RELEASE )
if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( ${basename}_LIBRARY
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
set( ${basename}_LIBRARIES
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
# If there are no configuration types or build type, just use
# the release version
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
"The ${basename} library" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif( ${basename}_LIBRARY )
mark_as_advanced( ${basename}_LIBRARY
${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro( select_library_configurations )

View File

@@ -0,0 +1,2 @@
cmake_minimum_required (VERSION 2.4)
add_subdirectory(build/cmake)

View File

@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 2.8)
project(hidapi)
set(SRC_FILES
windows/hid.c
)
set(HEADER_FILES
hidapi/hidapi.h
)
include_directories(hidapi)
add_definitions(-DHID_API_STATIC)
add_library(hidapi STATIC ${SRC_FILES} ${HEADER_FILES})
install(TARGETS hidapi DESTINATION lib)
INSTALL(FILES hidapi/hidapi.h
DESTINATION "include"
)

View File

@@ -0,0 +1,398 @@
# --------------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8)
# --------------------------------------------------------------------------------
project(OpenVDB)
# --------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
# --------------------------------------------------------------------------------
set(CMAKE_BUILD_TYPE_INIT "Release")
# --------------------------------------------------------------------------------
# Options
option(WITH_BLOSC "Enable Blosc support for compression" OFF)
option(WITH_LOGC4PLUS "Enable logging" OFF)
option(WITH_OPENVDB_2_ABI "Enable building the library to be compability with the OpenVDB 2 ABI" OFF)
option(WITH_PRINTER "Enable building the OpenVDB print executable" OFF)
option(WITH_PYTHON "Enable building the OpenVDB python API" OFF)
option(WITH_RENDERER "Enable building the OpenVDB render executable" OFF)
option(WITH_UNITTEST "Enable building the unit tests" OFF)
option(WITH_VIEWER "Enable building the OpenVDB viewer executable" OFF)
# --------------------------------------------------------------------------------
# Find packages
#set(BOOST_LIBRARIES boost_iostreams boost_system boost_thread)
find_package(IlmBase)
find_package(OpenEXR)
find_package(TBB)
find_package(Boost)
if(WITH_BLOSC)
find_package(Blosc)
if(NOT BLOSC_FOUND)
set(WITH_BLOSC OFF)
endif()
endif()
# todo
if(WITH_VIEWER)
set(GLFW_INCLUDE_DIRS ${GLFW_INCLUDE_PATH})
set(GLFW_LIBRARY_DIRS ${GLFW_LIBRARY_PATH})
endif()
if(WITH_LOGC4PLUS)
find_package(LogC4Plus)
if(NOT LOGC4PLUS_FOUND)
set(WITH_LOGC4PLUS OFF)
endif()
endif()
# todo
if(WITH_PYTHON)
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH})
set(PYTHON_LIBRARY_DIRS ${PYTHON_LIBRARY_PATH})
endif()
if(WITH_UNITTEST)
find_package(CppUnit)
if(NOT CPPUNIT_FOUND)
set(WITH_UNITTEST OFF)
endif()
endif()
# --------------------------------------------------------------------------------
message (STATUS "BOOST_ROOT ${BOOST_ROOT}")
message (STATUS "Boost found ${Boost_FOUND} ")
message (STATUS "Boost version ${Boost_VERSION}")
message (STATUS "Boost include dirs ${Boost_INCLUDE_DIRS}")
message (STATUS "Boost library dirs ${Boost_LIBRARY_DIRS}")
message (STATUS "Boost libraries ${Boost_LIBRARIES}")
message (STATUS "ILMBase found ${ILMBASE_FOUND} ")
message (STATUS "ILMBase include dir ${ILMBASE_INCLUDE_DIR}")
message (STATUS "ILMBase libraries ${ILMBASE_LIBRARIES}")
message (STATUS "TBB found ${TBB_FOUND} ")
message (STATUS "TBB include dir ${TBB_INCLUDE_DIR}")
message (STATUS "TBB libraries ${TBB_LIBRARIES}")
if(MSVC)
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
endif()
set(OPENVDB_LIBRARIES ${BLOSC_LIBRARIES} ${BOOST_LIBRARIES} ${OPENEXR_LIBRARIES} ${ILMBASE_LIBRARIES} ${TBB_LIBRARIES} ${ZLIB_LIBRARY} )
include_directories(. ${CMAKE_CURRENT_SOURCE_DIR}/../ ${Boost_INCLUDE_DIRS} ${ILMBASE_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR} ${TBB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS} ${OPENEXR_LIBRARY_DIRS} ${TBB_INCLUDE_DIRS})
add_definitions(-DNOMINMAX -D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_STATICLIB -DOPENVDB_OPENEXR_STATICLIB)
if(WITH_BLOSC)
add_definitions(-DOPENVDB_USE_BLOSC)
include_directories(${BLOSC_INCLUDE_DIRS})
link_directories(${BLOSC_LIBRARY_DIRS})
endif()
if(WITH_LOGC4PLUS)
add_definitions(-DOPENVDB_USE_LOG4CPLUS)
include_directories(${LOG4CPLUS_INCLUDE_DIRS})
link_directories(${LOG4CPLUS_LIBRARY_DIRS})
endif()
if(WITH_OPENVDB_2_ABI)
add_definitions(-DOPENVDB_2_ABI_COMPATIBLE)
endif()
# todo
if(WITH_OPENVDB_USE_GLFW_3)
add_definitions(-DOPENVDB_USE_GLFW_3)
endif()
if(WITH_UNITTEST)
include_directories(${CPPUNIT_INCLUDE_DIRS})
link_directories(${CPPUNIT_LIBRARY_DIRS})
endif()
# --------------------------------------------------------------------------------
set(SRC_FILES
openvdb/openvdb.cc
openvdb/io/Compression.cc
openvdb/io/File.cc
openvdb/io/Queue.cc
openvdb/io/Stream.cc
openvdb/io/TempFile.cc
openvdb/io/GridDescriptor.cc
openvdb/io/Archive.cc
openvdb/metadata/MetaMap.cc
openvdb/metadata/Metadata.cc
openvdb/math/Maps.cc
openvdb/math/Transform.cc
openvdb/math/QuantizedUnitVec.cc
openvdb/math/Proximity.cc
openvdb/Grid.cc
openvdb/util/Formats.cc
openvdb/util/Util.cc
)
set(HEADER_FILES
openvdb/openvdb.h
openvdb/version.h
openvdb/PlatformConfig.h
openvdb/Metadata.h
openvdb/Exceptions.h
openvdb/Grid.h
openvdb/Types.h
openvdb/Platform.h
openvdb/tree/ValueAccessor.h
openvdb/tree/NodeUnion.h
openvdb/tree/Tree.h
openvdb/tree/Iterator.h
openvdb/tree/LeafNodeBool.h
openvdb/tree/TreeIterator.h
openvdb/tree/LeafNode.h
openvdb/tree/NodeManager.h
openvdb/tree/LeafManager.h
openvdb/tree/InternalNode.h
openvdb/tree/RootNode.h
openvdb/tools/PointScatter.h
openvdb/tools/VolumeAdvect.h
openvdb/tools/LevelSetTracker.h
openvdb/tools/Composite.h
openvdb/tools/Morphology.h
openvdb/tools/ValueTransformer.h
openvdb/tools/ChangeBackground.h
openvdb/tools/GridTransformer.h
openvdb/tools/Prune.h
openvdb/tools/LevelSetUtil.h
openvdb/tools/VolumeToSpheres.h
openvdb/tools/LevelSetAdvect.h
openvdb/tools/Statistics.h
openvdb/tools/LevelSetMeasure.h
openvdb/tools/VectorTransformer.h
openvdb/tools/RayIntersector.h
openvdb/tools/PointPartitioner.h
openvdb/tools/Interpolation.h
openvdb/tools/VelocityFields.h
openvdb/tools/PointIndexGrid.h
openvdb/tools/LevelSetRebuild.h
openvdb/tools/Clip.h
openvdb/tools/SignedFloodFill.h
openvdb/tools/MeshToVolume.h
openvdb/tools/Dense.h
openvdb/tools/Filter.h
openvdb/tools/RayTracer.h
openvdb/tools/Diagnostics.h
openvdb/tools/VolumeToMesh.h
openvdb/tools/PoissonSolver.h
openvdb/tools/LevelSetFracture.h
openvdb/tools/GridOperators.h
openvdb/tools/DenseSparseTools.h
openvdb/tools/ParticlesToLevelSet.h
openvdb/tools/LevelSetSphere.h
openvdb/tools/LevelSetMorph.h
openvdb/tools/LevelSetFilter.h
openvdb/tools/PointAdvect.h
openvdb/io/Queue.h
openvdb/io/TempFile.h
openvdb/io/Stream.h
openvdb/io/GridDescriptor.h
openvdb/io/Archive.h
openvdb/io/io.h
openvdb/io/Compression.h
openvdb/io/File.h
openvdb/metadata/StringMetadata.h
openvdb/metadata/MetaMap.h
openvdb/metadata/Metadata.h
openvdb/math/DDA.h
openvdb/math/Vec2.h
openvdb/math/FiniteDifference.h
openvdb/math/Stencils.h
openvdb/math/BBox.h
openvdb/math/Mat3.h
openvdb/math/Mat.h
openvdb/math/Proximity.h
openvdb/math/Ray.h
openvdb/math/ConjGradient.h
openvdb/math/Quat.h
openvdb/math/Vec3.h
openvdb/math/Vec4.h
openvdb/math/QuantizedUnitVec.h
openvdb/math/Coord.h
openvdb/math/Operators.h
openvdb/math/Stats.h
openvdb/math/Math.h
openvdb/math/Tuple.h
openvdb/math/LegacyFrustum.h
openvdb/math/Mat4.h
openvdb/math/Maps.h
openvdb/math/Transform.h
openvdb/util/PagedArray.h
openvdb/util/CpuTimer.h
openvdb/util/Formats.h
openvdb/util/NullInterrupter.h
openvdb/util/Util.h
openvdb/util/Name.h
openvdb/util/MapsUtil.h
openvdb/util/NodeMasks.h
openvdb/util/logging.h
)
add_library(openvdb STATIC ${SRC_FILES} ${HEADER_FILES})
# --------------------------------------------------------------------------------
target_link_libraries(openvdb ${OPENVDB_LIBRARIES})
set(OPENVDB_VERSION_MAJOR 3)
set(OPENVDB_VERSION_MINOR 1)
set(OPENVDB_VERSION_PATCH 0)
set(OPENVDB_VERSION_STRING ${OPENVDB_VERSION_MAJOR}.${OPENVDB_VERSION_MINOR}.${OPENVDB_VERSION_PATCH})
set_target_properties(openvdb PROPERTIES VERSION ${OPENVDB_VERSION_STRING} SOVERSION ${OPENVDB_VERSION_MAJOR})
install(TARGETS openvdb DESTINATION lib)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include COMPONENT Development FILES_MATCHING PATTERN "*.h"
PATTERN ".git" EXCLUDE PATTERN "build" EXCLUDE PATTERN "cmake" EXCLUDE)
# --------------------------------------------------------------------------------
if(WITH_PRINTER)
set(PRINT_SRC
openvdb/cmd/openvdb_print/main.cc
)
add_executable(vdb_print ${PRINT_SRC})
target_link_libraries(vdb_print openvdb)
install(TARGETS vdb_print RUNTIME DESTINATION bin)
endif()
if(WITH_RENDER)
set(RENDER_SRC
openvdb/cmd/openvdb_render/main.cc
)
add_executable(vdb_render ${RENDER_SRC})
target_link_libraries(vdb_render openvdb)
install(TARGETS vdb_render RUNTIME DESTINATION bin)
endif()
# todo
if(WITH_VIEWER)
set(VIEWER_SRC
openvdb/viewer/Camera.cc
openvdb/viewer/ClipBox.cc
openvdb/viewer/Font.cc
openvdb/viewer/RenderModules.cc
openvdb/viewer/Viewer.cc
openvdb/viewer/Camera.h
openvdb/viewer/ClipBox.h
openvdb/viewer/Font.h
openvdb/viewer/RenderModules.h
openvdb/viewer/Viewer.h
openvdb/cmd/openvdb_viewer/main.cc
)
include_directories(${GLFW_INCLUDE_DIRS})
link_directories(${GLFW_LIBRARY_DIRS})
add_executable(vdb_viewer ${VIEWER_SRC})
target_link_libraries(vdb_viewer openvdb)
install(TARGETS vdb_viewer RUNTIME DESTINATION bin)
endif()
# todo
if(WITH_PYTHON)
# add_library(pyopenvdb SHARED )
endif()
set(UNITTEST_SRC
openvdb/unittest/main.cc
openvdb/unittest/TestBBox.cc
openvdb/unittest/TestConjGradient.cc
openvdb/unittest/TestCoord.cc
openvdb/unittest/TestCpt.cc
openvdb/unittest/TestCurl.cc
openvdb/unittest/TestDense.cc
openvdb/unittest/TestDenseSparseTools.cc
openvdb/unittest/TestDiagnostics.cc
openvdb/unittest/TestDivergence.cc
openvdb/unittest/TestDoubleMetadata.cc
openvdb/unittest/TestExceptions.cc
openvdb/unittest/TestFile.cc
openvdb/unittest/TestFloatMetadata.cc
openvdb/unittest/TestGradient.cc
openvdb/unittest/TestGrid.cc
openvdb/unittest/TestGridBbox.cc
openvdb/unittest/TestGridDescriptor.cc
openvdb/unittest/TestGridIO.cc
openvdb/unittest/TestGridTransformer.cc
openvdb/unittest/TestInit.cc
openvdb/unittest/TestInt32Metadata.cc
openvdb/unittest/TestInt64Metadata.cc
openvdb/unittest/TestInternalOrigin.cc
openvdb/unittest/TestLaplacian.cc
openvdb/unittest/TestLeaf.cc
openvdb/unittest/TestLeafBool.cc
openvdb/unittest/TestLeafIO.cc
openvdb/unittest/TestLeafOrigin.cc
openvdb/unittest/TestLevelSetRayIntersector.cc
openvdb/unittest/TestLevelSetUtil.cc
openvdb/unittest/TestLinearInterp.cc
openvdb/unittest/TestMaps.cc
openvdb/unittest/TestMat4Metadata.cc
openvdb/unittest/TestMath.cc
openvdb/unittest/TestMeanCurvature.cc
openvdb/unittest/TestMeshToVolume.cc
openvdb/unittest/TestMetadata.cc
openvdb/unittest/TestMetadataIO.cc
openvdb/unittest/TestMetaMap.cc
openvdb/unittest/TestName.cc
openvdb/unittest/TestNodeIterator.cc
openvdb/unittest/TestNodeMask.cc
openvdb/unittest/TestParticlesToLevelSet.cc
openvdb/unittest/TestPointIndexGrid.cc
openvdb/unittest/TestPointPartitioner.cc
openvdb/unittest/TestPoissonSolver.cc
openvdb/unittest/TestPrePostAPI.cc
openvdb/unittest/TestQuadraticInterp.cc
openvdb/unittest/TestQuantizedUnitVec.cc
openvdb/unittest/TestQuat.cc
openvdb/unittest/TestRay.cc
openvdb/unittest/TestStats.cc
openvdb/unittest/TestStream.cc
openvdb/unittest/TestStringMetadata.cc
openvdb/unittest/TestTools.cc
openvdb/unittest/TestTransform.cc
openvdb/unittest/TestTree.cc
openvdb/unittest/TestTreeCombine.cc
openvdb/unittest/TestTreeGetSetValues.cc
openvdb/unittest/TestTreeIterators.cc
openvdb/unittest/TestTreeVisitor.cc
openvdb/unittest/TestUtil.cc
openvdb/unittest/TestValueAccessor.cc
openvdb/unittest/TestVec2Metadata.cc
openvdb/unittest/TestVec3Metadata.cc
openvdb/unittest/TestVolumeRayIntersector.cc
openvdb/unittest/TestVolumeToMesh.cc
)
# todo
if(WITH_UNITTEST)
add_executable(test ${UNITTEST_SRC} ${HEADER_FILES})
target_link_libraries(test openvdb ${CPPUNIT_LIBRARIES})
endif()

View File

@@ -0,0 +1,196 @@
cmake_minimum_required (VERSION 2.8)
project(tbb CXX)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
include_directories(include src src/rml/include )
option(TBB_BUILD_SHARED "Build TBB shared library" ON)
option(TBB_BUILD_STATIC "Build TBB static library" ON)
option(TBB_BUILD_TBBMALLOC "Build TBB malloc library" ON)
option(TBB_BUILD_TBBMALLOC_PROXY "Build TBB malloc proxy library" ON)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
file(GLOB tbb_src "${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/old/*.cpp")
list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/rml/client/rml_tbb.cpp)
file(GLOB to_remove "${CMAKE_CURRENT_SOURCE_DIR}/src/old/test*.cpp")
list(REMOVE_ITEM tbb_src ${to_remove})
set(tbbmalloc_static_src
src/tbbmalloc/backend.cpp
src/tbbmalloc/large_objects.cpp
src/tbbmalloc/backref.cpp
src/tbbmalloc/tbbmalloc.cpp
src/tbbmalloc/frontend.cpp
src/tbb/itt_notify.cpp)
set(tbbmalloc_src ${tbbmalloc_static_src})
set(tbbmalloc_proxy_src
src/tbbmalloc/proxy.cpp
src/tbbmalloc/tbb_function_replacement.cpp)
if (NOT APPLE)
add_definitions(-DDO_ITT_NOTIFY)
else()
# Disable annoying "has no symbols" warnings
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DUSE_PTHREAD")
if(NOT CMAKE_CXX_FLAGS MATCHES "-mno-rtm")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mrtm")
endif()
if (APPLE)
set(ARCH_PREFIX "mac")
else()
set(ARCH_PREFIX "lin")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_PREFIX "${ARCH_PREFIX}64")
else()
set(ARCH_PREFIX "${ARCH_PREFIX}32")
endif()
set(ENABLE_RTTI "-frtti -fexceptions ")
set(DISABLE_RTTI "-fno-rtti -fno-exceptions ")
elseif(WIN32)
cmake_minimum_required (VERSION 3.1)
enable_language(ASM_MASM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GS- /Zc:wchar_t /Zc:forScope /DUSE_WINTHREAD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0600 /volatile:iso")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4800 /wd4146 /wd4244 /wd4018")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND tbb_src src/tbb/intel64-masm/atomic_support.asm
src/tbb/intel64-masm/itsx.asm src/tbb/intel64-masm/intel64_misc.asm)
list(APPEND tbbmalloc_src src/tbb/intel64-masm/atomic_support.asm)
set(CMAKE_ASM_MASM_FLAGS "/DEM64T=1")
set(ARCH_PREFIX "win64")
else()
list(APPEND tbb_src src/tbb/ia32-masm/atomic_support.asm
src/tbb/ia32-masm/itsx.asm src/tbb/ia32-masm/lock_byte.asm)
list(APPEND tbbmalloc_src src/tbb/ia32-masm/atomic_support.asm)
set(ARCH_PREFIX "win32")
endif()
set(ENABLE_RTTI "/EHsc /GR ")
set(DISABLE_RTTI "/EHs- /GR- ")
endif()
# Linker export definitions
if (WIN32)
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include > tbb.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
COMMENT "Preprocessing tbb.def"
)
add_custom_command(OUTPUT tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include > tbbmalloc.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
else()
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
COMMENT "Preprocessing tbb.def"
)
add_custom_command(OUTPUT tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbbmalloc.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
endif()
add_custom_target(tbb_def_files DEPENDS tbb.def tbbmalloc.def)
# TBB library
if (TBB_BUILD_STATIC)
add_library(tbb_static STATIC ${tbb_src})
set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_SOURCE_DIRECTLY_INCLUDED=1")
set_property(TARGET tbb_static APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
install(TARGETS tbb_static ARCHIVE DESTINATION lib)
endif()
if (TBB_BUILD_SHARED)
add_library(tbb SHARED ${tbb_src})
set_property(TARGET tbb APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
set_property(TARGET tbb APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
add_dependencies(tbb tbb_def_files)
if (APPLE)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(UNIX)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(WIN32)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
endif()
install(TARGETS tbb DESTINATION lib)
endif()
if(CMAKE_COMPILER_IS_GNUCC)
# Quench a warning on GCC
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/governor.cpp COMPILE_FLAGS "-Wno-missing-field-initializers ")
elseif(MSVC)
# Quench a warning on MSVC
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/scheduler.cpp COMPILE_FLAGS "/wd4458 ")
endif()
if(TBB_BUILD_TBBMALLOC)
# TBB malloc library
if (TBB_BUILD_STATIC)
add_library(tbbmalloc_static STATIC ${tbbmalloc_static_src})
set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
install(TARGETS tbbmalloc_static ARCHIVE DESTINATION lib)
endif()
if (TBB_BUILD_SHARED)
add_library(tbbmalloc SHARED ${tbbmalloc_src})
set_property(TARGET tbbmalloc APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
add_dependencies(tbbmalloc tbb_def_files)
if (APPLE)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
elseif(UNIX)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
elseif(WIN32)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
endif()
install(TARGETS tbbmalloc DESTINATION lib)
endif()
endif()
if(TBB_BUILD_TBBMALLOC_PROXY)
# TBB malloc proxy library
if (TBB_BUILD_STATIC)
add_library(tbbmalloc_proxy_static STATIC ${tbbmalloc_proxy_src})
set_property(TARGET tbbmalloc_proxy_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
link_libraries(tbbmalloc_proxy_static tbbmalloc)
install(TARGETS tbbmalloc_proxy_static ARCHIVE DESTINATION lib)
endif()
if (TBB_BUILD_SHARED)
add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src})
set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
link_libraries(tbbmalloc_proxy tbbmalloc)
install(TARGETS tbbmalloc_proxy DESTINATION lib)
endif()
endif()
install(DIRECTORY include/tbb DESTINATION include)

View File

@@ -0,0 +1,26 @@
--- CmakeLists.txt.orig 2015-12-31 03:46:41 -0700
+++ CMakeLists.txt 2016-04-01 13:28:33 -0600
@@ -22,3 +22,10 @@
add_executable(testcuew cuewTest/cuewTest.c include/cuew.h)
target_link_libraries(testcuew cuew ${CMAKE_DL_LIBS})
+
+install(TARGETS cuew
+ LIBRARY DESTINATION lib COMPONENT libraries
+ ARCHIVE DESTINATION lib/static COMPONENT libraries)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/cuew.h
+ DESTINATION include/)
\ No newline at end of file
--- src/cuew.c 2016-04-01 13:41:43 -0600
+++ src/cuew.c 2016-04-01 13:41:11 -0600
@@ -15,7 +15,9 @@
*/
#ifdef _MSC_VER
+#if _MSC_VER < 1900
# define snprintf _snprintf
+#endif
# define popen _popen
# define pclose _pclose
# define _CRT_SECURE_NO_WARNINGS

View File

@@ -0,0 +1,11 @@
--- _msvccompiler.py.orig 2017-01-17 00:57:48 -0700
+++ _msvccompiler.py 2017-05-20 09:47:26 -0600
@@ -237,7 +237,7 @@
ldflags.extend(('/nodefaultlib:libucrt.lib', 'ucrt.lib'))
ldflags_debug = [
- '/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL'
+ '/nologo', '/INCREMENTAL:NO', '/LTCG'
]
self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1']

View File

@@ -0,0 +1,32 @@
--- libavutil/common.h 2016-02-14 19:29:42 -0700
+++ libavutil/common.h 2016-03-30 09:50:29 -0600
@@ -99,6 +99,11 @@
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+//msvc helper
+#ifdef _MSC_VER
+#define inline __inline
+#endif
+
/* misc math functions */
#ifdef HAVE_AV_CONFIG_H
--- configure 2016-11-26 03:12:05.000000000 +0100
+++ configure 2017-04-05 03:24:35.000000000 +0200
@@ -1899,7 +1899,6 @@
access
aligned_malloc
arc4random
- clock_gettime
closesocket
CommandLineToArgvW
CoTaskMemFree
@@ -5494,7 +5493,6 @@
check_func access
check_func_headers stdlib.h arc4random
-check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
check_func fcntl
check_func fork
check_func gethrtime

View File

@@ -0,0 +1,25 @@
--- config.h.in 2014-03-04 11:44:58 -0700
+++ config.h.in 2016-03-30 11:42:49 -0600
@@ -142,9 +142,6 @@
/* Define to 1 if you have the `gethrtime' function. */
#undef HAVE_GETHRTIME
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
-
/* Define to 1 if hrtime_t is defined in <sys/time.h> */
#undef HAVE_HRTIME_T
--- kernel/assert.c 2014-03-04 11:41:03 -0700
+++ kernel/assert.c 2016-04-01 09:41:05 -0600
@@ -24,8 +24,10 @@
void X(assertion_failed)(const char *s, int line, const char *file)
{
+#if 0
fflush(stdout);
fprintf(stderr, "fftw: %s:%d: assertion failed: %s\n", file, line, s);
+#endif
#ifdef HAVE_ABORT
abort();
#else

View File

@@ -0,0 +1,11 @@
--- UserMacros.cmake
+++ UserMacros.cmake
@@ -16,6 +16,8 @@
if (BUILD_USER_DEFINED_LIBS)
MACRO_USER_DEFINED_LIBS ()
endif (BUILD_USER_DEFINED_LIBS)
+
+include(Config/cmake/usermacros/windows_mt.cmake)
#-----------------------------------------------------------------------------
#------------------- E X A M P L E E N D -----------------------------------
#-----------------------------------------------------------------------------

View File

@@ -0,0 +1,15 @@
--- hidapi/hidapi.h 2011-10-25 20:58:16 -0600
+++ hidapi/hidapi.h 2016-11-01 12:05:58 -0600
@@ -30,7 +30,11 @@
#include <wchar.h>
#ifdef _WIN32
- #define HID_API_EXPORT __declspec(dllexport)
+ #ifdef HID_API_STATIC
+ #define HID_API_EXPORT
+ #else
+ #define HID_API_EXPORT __declspec(dllexport)
+ #endif
#define HID_API_CALL
#else
#define HID_API_EXPORT /**< API export macro */

View File

@@ -0,0 +1,10 @@
--- frontend/main.c 2008-09-22 11:55:09 -0600
+++ frontend/main.c 2016-04-06 15:20:36 -0600
@@ -31,7 +31,6 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#define off_t __int64
#else
#include <time.h>
#endif

View File

@@ -0,0 +1,111 @@
Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- lib/Target/X86/X86ISelLowering.cpp 2014-04-11 23:04:44.000000000 +0200
+++ lib/Target/X86/X86ISelLowering.cpp (working copy)
@@ -15493,12 +15493,36 @@
// non-trivial part is impdef of ESP.
if (Subtarget->isTargetWin64()) {
+ const char *StackProbeSymbol =
+ Subtarget->isTargetCygMing() ? "___chkstk" : "__chkstk";
+
+ MachineInstrBuilder MIB;
+
+ if (getTargetMachine().getCodeModel() == CodeModel::Large) {
+ // For large code model we need to do indirect call to __chkstk.
+
+ // R11 will be used to contain the address of __chkstk.
+ // R11 is a volotiale register and assumed to be destoyed by the callee,
+ // so there is no need to save and restore it.
+ BuildMI(*BB, MI, DL, TII->get(X86::MOV64ri), X86::R11)
+ .addExternalSymbol(StackProbeSymbol);
+ // Create a call to __chkstk function which address contained in R11.
+ MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL64r))
+ .addReg(X86::R11, RegState::Kill);
+
+ } else {
+
+ // For non-large code model we can do direct call to __chkstk.
+
+ MIB = BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
+ .addExternalSymbol(StackProbeSymbol);
+ }
+
if (Subtarget->isTargetCygMing()) {
// ___chkstk(Mingw64):
// Clobbers R10, R11, RAX and EFLAGS.
// Updates RSP.
- BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
- .addExternalSymbol("___chkstk")
+ MIB
.addReg(X86::RAX, RegState::Implicit)
.addReg(X86::RSP, RegState::Implicit)
.addReg(X86::RAX, RegState::Define | RegState::Implicit)
@@ -15507,8 +15531,7 @@
} else {
// __chkstk(MSVCRT): does not update stack pointer.
// Clobbers R10, R11 and EFLAGS.
- BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
- .addExternalSymbol("__chkstk")
+ MIB
.addReg(X86::RAX, RegState::Implicit)
.addReg(X86::EFLAGS, RegState::Define | RegState::Implicit);
// RAX has the offset to be subtracted from RSP.
Index: lib/Target/X86/X86FrameLowering.cpp
===================================================================
--- lib/Target/X86/X86FrameLowering.cpp 2013-10-24 01:37:01.000000000 +0200
+++ lib/Target/X86/X86FrameLowering.cpp (working copy)
@@ -635,25 +635,49 @@
.addReg(X86::EAX, RegState::Kill)
.setMIFlag(MachineInstr::FrameSetup);
}
+
+ MachineInstrBuilder MIB;
if (Is64Bit) {
+
// Handle the 64-bit Windows ABI case where we need to call __chkstk.
// Function prologue is responsible for adjusting the stack pointer.
BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64ri), X86::RAX)
.addImm(NumBytes)
.setMIFlag(MachineInstr::FrameSetup);
+
+ if (TM.getCodeModel() == CodeModel::Large) {
+ // For large code model we need to do indirect call to __chkstk.
+
+
+ // R11 will be used to contain the address of __chkstk.
+ // R11 is a volotiale register and assumed to be destoyed by the callee,
+ // so there is no need to save and restore it.
+ BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64ri), X86::R11)
+ .addExternalSymbol(StackProbeSymbol);
+ // Create a call to __chkstk function which address contained in R11.
+ MIB = BuildMI(MBB, MBBI, DL, TII.get(X86::CALL64r))
+ .addReg(X86::R11, RegState::Kill);
+ } else {
+
+ // For non-large code model we can do direct call to __chkstk.
+
+ MIB = BuildMI(MBB, MBBI, DL, TII.get(X86::W64ALLOCA))
+ .addExternalSymbol(StackProbeSymbol);
+ }
} else {
// Allocate NumBytes-4 bytes on stack in case of isEAXAlive.
// We'll also use 4 already allocated bytes for EAX.
BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), X86::EAX)
.addImm(isEAXAlive ? NumBytes - 4 : NumBytes)
.setMIFlag(MachineInstr::FrameSetup);
+
+ MIB = BuildMI(MBB, MBBI, DL, TII.get(X86::CALLpcrel32))
+ .addExternalSymbol(StackProbeSymbol);
}
- BuildMI(MBB, MBBI, DL,
- TII.get(Is64Bit ? X86::W64ALLOCA : X86::CALLpcrel32))
- .addExternalSymbol(StackProbeSymbol)
- .addReg(StackPtr, RegState::Define | RegState::Implicit)
+
+ MIB.addReg(StackPtr, RegState::Define | RegState::Implicit)
.addReg(X86::EFLAGS, RegState::Define | RegState::Implicit)
.setMIFlag(MachineInstr::FrameSetup);

View File

@@ -0,0 +1,7 @@
@title MinGW-w64 32-bit GCC build environment
@echo Setting up environment for MinGW-w64 GCC 32-bit...
@set PATH=%CD%\bin;%CD%\msys\1.0\bin;%cd%\..\..\perl32\site\bin;%cd%\..\..\perl32\bin;%cd%\..\..\c\bin;%PATH%

View File

@@ -0,0 +1,7 @@
@title MinGW-w64 64-bit GCC build environment
@echo Setting up environment for MinGW-w64 GCC 64-bit...
@set PATH=%CD%\bin;%CD%\msys\1.0\bin;%cd%\..\..\perl\site\bin;%cd%\..\..\perl\bin;%cd%\..\..\c\bin;%PATH%

View File

@@ -0,0 +1,23 @@
diff -Naur numpy-1.11.1/numpy/distutils/ccompiler.py numpy-1.11.1/numpy/distutils/ccompiler.py
--- numpy-1.11.1/numpy/distutils/ccompiler.py 2016-06-25 08:38:34 -0600
+++ numpy-1.11.1/numpy/distutils/ccompiler.py 2016-08-04 12:33:43 -0600
@@ -29,6 +29,7 @@
# Using customized CCompiler.spawn.
def CCompiler_spawn(self, cmd, display=None):
+ cmd = quote_args(cmd)
"""
Execute a command in a sub-process.
diff -Naur numpy-1.11.1/numpy/distutils/misc_util.py numpy-1.11.1/numpy/distutils/misc_util.py
--- numpy-1.11.1/numpy/distutils/misc_util.py 2016-06-25 08:38:34 -0600
+++ numpy-1.11.1/numpy/distutils/misc_util.py 2016-08-04 12:34:56 -0600
@@ -116,7 +116,7 @@
args = list(args)
for i in range(len(args)):
a = args[i]
- if ' ' in a and a[0] not in '"\'':
+ if ' ' in a and a[0] not in '"\'' and a[len(a)-1] not in '"\'':
args[i] = '"%s"' % (a)
return args

View File

@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fc9be5..5112ce6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -254,11 +254,11 @@
endif()
#adding PCRE
-find_package(PCRE)
+#find_package(PCRE)
if (PCRE_FOUND)
message(STATUS "SUCCESSFUL: PCRE found")
else () # if pcre not found building its local copy from ./Externals
- if (WIN32 OR APPLE)
+ if (1)
message("WARNING: Native PCRE not found, taking PCRE from ./Externals")
add_definitions(-DPCRE_STATIC)
add_subdirectory(${EXTERNAL_LIBRARIES}/pcre)
diff --git a/DAEValidator/library/include/no_warning_begin.orig b/DAEValidator/library/include/no_warning_begin
index 3fc9be5..5112ce6 100644
--- a/DAEValidator/library/include/no_warning_begin.orig 2017-05-31 16:56:39 -0600
+++ b/DAEValidator/library/include/no_warning_begin 2017-06-07 10:18:45 -0600
@@ -2,6 +2,9 @@
#if defined(_WIN32)
# pragma warning(push)
# pragma warning(disable:4668)
+# if _MSC_VER >=1900
+# pragma warning(disable:5031)
+# endif
# if defined(_MSC_VER) && defined(_DEBUG)
# pragma warning(disable:4548)
# endif

View File

@@ -0,0 +1,21 @@
diff -ru ./CMakeLists.txt ./CMakeLists.txt
--- ./CMakeLists.txt 2014-09-11 21:08:18.000000000 +0200
+++ ./CMakeLists.txt 2016-05-15 17:17:01.000000000 +0200
@@ -186,7 +186,7 @@
PATCH_COMMAND patch -f -p1 < ${CMAKE_SOURCE_DIR}/ext/tinyxml_${TINYXML_VERSION}.patch
BINARY_DIR ext/build/tinyxml
INSTALL_DIR ext/dist
- CMAKE_ARGS ${TINYXML_CMAKE_ARGS}
+ CMAKE_ARGS ${TINYXML_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
)
if(WIN32)
set(TINYXML_STATIC_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/tinyxml.lib)
@@ -254,7 +254,7 @@
BINARY_DIR ext/build/yaml-cpp
PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/ext/yaml-cpp-${YAML_CPP_VERSION}.patch
INSTALL_DIR ext/dist
- CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS}
+ CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
)
set(YAML_CPP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ext/dist/include)
set(YAML_CPP_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)

View File

@@ -0,0 +1,33 @@
--- IlmImf/CMakeLists.txt 2014-08-10 06:23:56.000000000 +0200
+++ IlmImf/CMakeLists.txt 2017-01-08 04:06:04.931723800 +0100
@@ -8,8 +8,8 @@
TARGET_LINK_LIBRARIES ( b44ExpLogTable
Half
- Iex${ILMBASE_LIBSUFFIX}
IlmThread${ILMBASE_LIBSUFFIX}
+ Iex${ILMBASE_LIBSUFFIX}
${PTHREAD_LIB}
)
@@ -25,8 +25,8 @@
TARGET_LINK_LIBRARIES ( dwaLookups
Half
- Iex${ILMBASE_LIBSUFFIX}
IlmThread${ILMBASE_LIBSUFFIX}
+ Iex${ILMBASE_LIBSUFFIX}
${PTHREAD_LIB}
)
@@ -138,9 +138,9 @@
TARGET_LINK_LIBRARIES ( IlmImf
Half
- Iex${ILMBASE_LIBSUFFIX}
Imath${ILMBASE_LIBSUFFIX}
IlmThread${ILMBASE_LIBSUFFIX}
+ Iex${ILMBASE_LIBSUFFIX}
${PTHREAD_LIB} ${ZLIB_LIBRARIES}
)

View File

@@ -0,0 +1,26 @@
Index: OpenImageIO/osdep.h
===================================================================
--- OpenImageIO/osdep.h (revision 61595)
+++ OpenImageIO/osdep.h (working copy)
@@ -34,6 +34,7 @@
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# define NOMINMAX
+# define NOGDI
# include <windows.h>
#endif
Index: OpenImageIO/platform.h
===================================================================
--- OpenImageIO/platform.h (revision 61595)
+++ OpenImageIO/platform.h (working copy)
@@ -77,6 +77,9 @@
# ifndef NOMINMAX
# define NOMINMAX
# endif
+# ifndef NOGDI
+# define NOGDI
+# endif
# include <windows.h>
#endif

View File

@@ -0,0 +1,13 @@
--- idiff.cpp 2016-11-18 11:42:01 -0700
+++ idiff.cpp 2016-11-18 11:41:25 -0700
@@ -308,8 +308,10 @@
// printed with three digit exponent. We change this behaviour to fit
// Linux way
#ifdef _MSC_VER
+#if _MSC_VER < 1900
_set_output_format(_TWO_DIGIT_EXPONENT);
#endif
+#endif
std::streamsize precis = std::cout.precision();
std::cout << " " << cr.nwarn << " pixels ("
<< std::setprecision(3) << (100.0*cr.nwarn / npels)

Some files were not shown because too many files have changed in this diff Show More