1
1

Compare commits

...

5603 Commits

Author SHA1 Message Date
a2a7ca6aa1 SLIM: Fix uppercase folder name in CMake file 2018-05-27 19:46:34 +02:00
bbfee34e9e Merge remote-tracking branch 'origin/master' into uv_unwrapping_slim_algorithm 2018-05-01 17:03:20 +02:00
2e98524b58 Add support for area lights to the Apply Transform operator
Since area lights are affected by scaling them, it only makes sense to support applying the scale to the lamp size.
Of course, applying location or rotation does not work.

If a scaling that changes the aspect ratio is applied to a square lamp, the mode is automatically changed to Rectangle.
2018-04-30 22:09:23 +02:00
Dalai Felinto
32c4158047 Fix Merge > To Cursor
In master this is working fine, but in 2.8 ob->imat was identity matrix.
Committing this in master to simplify merging.
2018-04-30 21:42:16 +02:00
188c4a22c9 Cleanup: de-duplicate paint access from object 2018-04-30 18:58:43 +02:00
Julian Eisel
e76a65e359 UV editing: Make 'Select Linked' work consistent to 3D View
Don't see a good reason for the old behavior, so better have it consistent.
2018-04-30 15:42:29 +02:00
128506eeb1 BLI Color: YUV to/from rgb colorspace option
This commit does two things:

- Adds an option to do the calculation in different color spaces (BT601
or BT709).
- Changes the default caluclation from legacy BT601 to BT709.

This affects several areas:

- UI areas (mainly scopes)
- ViewLevelsNode
- Several other nodes that use `COM_ConvertOperation.h`
2018-04-29 18:00:45 -04:00
16c05161e7 Cycles: Cleanup: Remove double semicolons 2018-04-29 09:28:41 +02:00
60f4cb24da Fix vertex paint alpha brush setting color black 2018-04-28 14:47:53 +02:00
ffda096413 Cleanup: meaningful names for color blending 2018-04-28 14:45:10 +02:00
57405054b2 Fix T54836: Select sharp edges doesn't flush to faces 2018-04-26 14:32:35 +02:00
Julian Eisel
3c7500ca71 Cleanup: Use enums for View2D value defines
Makes the file much less cluttered and more structured.
Also made some whitespace tweaks.
2018-04-26 14:07:03 +02:00
d37dcc4880 Fix discontinuity in default UVs for a torus
Reported in T47489 by Simon Windmill (coolpowers) who also provided the
fix, thanx.

Reviewed by Sebastian Witt (witt)
2018-04-26 11:18:59 +02:00
f69feb4957 UI: optionally pass icon size to widget_draw_icon
No functional changes.
2018-04-25 17:26:45 +02:00
89bcc80c25 Library: Add assert to catch unsupported copy flags combination
Thanks Bastien for review!
2018-04-25 16:59:35 +02:00
331e97bcf3 Depsgraph: Fix missing relations in array modifier
Found by Dr. Sybren while working on modifiers port.
2018-04-25 16:34:01 +02:00
13b6867d1f CDDM: correct (disabled) logic in merge verts 2018-04-25 14:53:44 +02:00
53dc251fd3 Remove developer exception hack
This caused too much trouble, also it's possible users run with
'release' in their CWD causing issues.

Developers can symlink "release/" to "bin/2.79".
2018-04-25 12:54:27 +02:00
d7d20b483a Revert "Fix (unreported) broken 'get system path' in some cases."
This reverts commit f1bc0aedde.
2018-04-25 12:48:51 +02:00
26dab9c2fe Buildbot: Attempt to link against Blosc statically
Was broken by f1e6838376.
2018-04-25 12:27:35 +02:00
9a7f963a02 Cleanup: comments 2018-04-25 12:25:47 +02:00
f1bc0aedde Fix (unreported) broken 'get system path' in some cases.
There were two issues here actually:
* The hack to allow running Blender directly from the source directory
would just check for a 'release' directory, without actually ensuring it
is release dir from blender source tree, and not some other random
folder.
* GHOST_getSystemDir returns nothing for portable installations, now
we'll then check directly in the blender binary dir in that case.

This fix is more critical in 2.8 branch, where that system path is used
to retrieve new '3D' icons...
2018-04-25 10:37:36 +02:00
Dalai Felinto
5285de16f3 Fix string comparison in GNUMakefile for linux systems 2018-04-25 09:30:55 +02:00
bb92d9a946 BLI BVHTree Walk DFS: Decreases the size of the stack space used for the recursive function.
Each parameter of the function is copied into the memory stack.
This also brought an improvement in peformance of snapping functions between 5% and 12% in my tests.
2018-04-24 09:48:14 -03:00
Stefan Werner
f1e6838376 Build: Added explicit search for Blosc in CMake files. Unix build will now disable WITH_OPENVDB_BLOSC if Blosc libraries cannot be found. 2018-04-24 13:26:54 +02:00
Stefan Werner
0ab30f9e39 Build deps: Fixed TBB build with GCC 6 and newer, turning off dead store elimination. 2018-04-24 13:23:52 +02:00
Stefan Werner
dac8b08f4c Build deps: Fixed capitalisation of CMake modules path for OpenVDB. Before, OpenVDB would always build without BLOSC and TBB support on case-sensitive file systems. 2018-04-24 10:28:38 +02:00
92f36586e3 BLI_math: avoid assert with non-finite numbers 2018-04-23 21:09:01 +02:00
53d69e6d04 Depsgraph: Add relation flag to avoid flush across it
This way we can avoid re-evaluation of certain parts of datablock
when something unrelated has changed.
2018-04-23 16:42:37 +02:00
0ca7a78f20 Depsgraph: Fix missing update with animated curve path 2018-04-23 14:53:54 +02:00
41cf2d9042 Depsgraph: Cleanup, remove unused relation tag 2018-04-23 14:34:56 +02:00
b14979f91f Cleanup: style 2018-04-23 12:53:45 +02:00
8264b772f5 Fix T54766: "Record With"-NLA "Push Down" discards Blend Mode, Extrapolation, and Influence
Applied similar fix to T54233 to get the "Record with NLA" feature working with
active action blending + influence settings. Extrapolation is explicitly ignored
though, as it shouldn't be used with this feature (i.e. it is already disabled
with the new strips and also on the animdata by default)
2018-04-23 12:35:37 +02:00
fa7e19bca4 Depsgraph: Add missing relations builder
Was possible to miss some relations from being built
when parent object is linked to the scene graph indirectly.
2018-04-23 09:33:33 +02:00
89ab591345 Cleanup: UI naming 2018-04-22 19:22:10 +02:00
420e379e99 Cleanup: de-dup popup/pie menu RNA definition
Also rename pupmenu -> popmenu
2018-04-22 10:49:45 +02:00
46a9038f60 Cleanup: variable naming 2018-04-21 20:22:12 +02:00
1e9fb355bf BLI_bitmap: 2D triangle drawing function
Matching polygon filling but no need for allocation or qsort.
2018-04-21 18:34:34 +02:00
83cb387944 BLI math: clamped barycentric weight calculation 2018-04-21 18:34:20 +02:00
26ee70099a Fix: D3160 fixed blednerplayer stub.s for unix 2018-04-20 23:34:54 +02:00
e5bb234f64 Cleanup (followup commit for D3160)
Added some spaces to keep the eInsertKeyFlags enumeration proper
2018-04-20 15:09:56 +02:00
ff839fb6c1 Fix: D3160 Propose to use proper typedefs to avoid confusion
Differential Revision: https://developer.blender.org/D3160
2018-04-20 15:02:11 +02:00
ac8f6413cc Fix usage of lib filepath in previous own commit... 2018-04-20 11:00:12 +02:00
88bbb68ad0 Add debug tool to check validity of current file *before* saving.
It is hidden behind the --debug-io flag for now.

Idea is to try to catch broken libraries state in current Main before we
actually write the file on disk, should help catching and understanding
what happens in Spring corruption cases.
2018-04-20 10:46:59 +02:00
dda7e3b695 VSE Effects: Wipe box: fix compilation errors
This is still broken I cant tell if it is the fact that the in_band
funtion does not work properally or an issue in the box algorithm, or
both.

It seems like the calculation of the size of the box while roatated
needs to be fixed also.
2018-04-19 18:44:56 -04:00
e2678d6b7b Cleanup: make variable name English 2018-04-19 18:10:51 +02:00
307492c2db Cleanup: rename vlak -> poly 2018-04-19 18:08:55 +02:00
da82269c58 Cleanup: rename Icon.type -> id_type
Confusing when adding non-id icons.
2018-04-19 12:52:32 +02:00
63225d7c8b Port particle instance modifier changes from Gooseberry branch
The work is mainly from Lukas Toenne, with some modifications from myself.

Includes following obvious changes:

- Particle system selection is now name-based, with lookup menu.
- Lots of new options to control varieties.

Changes comparing to the Gooseberry branch:

- Default values and versioning code ensures same behavior as the
  old modifier.

- Custom data layers are coming from vertex color, the modifier
  does not create arbitrary layers now. The hope is to keep data
  more manageable, and maybe make it easier to select in the shader
  later on.

  This means, values are quantized to 256 values, but it should be
  enough to get varieties in practice.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D3157
2018-04-19 10:51:18 +02:00
fcac9e8410 Cleanup: style 2018-04-19 08:18:16 +02:00
9f7f6d5540 Undo: add missing flag for text delete 2018-04-19 08:16:37 +02:00
f28aec17e9 Depsgraph: Fix missinf relation for particle instance modifier
Was causing lack of animation update when particle system had simulation,
2018-04-18 13:54:02 +02:00
3811998177 Cleanup: Trailing whitespace 2018-04-18 12:31:26 +02:00
287d1924fa Remove irrelevant print statement
This statement is only relevant in 2.8, but causes confusion in master.
I kept the 'default' label to prevent compiler warnings about unhandled
cases. The break is needed because there should be at least one statement
after 'default'.
2018-04-18 12:26:40 +02:00
0afe103269 Particles: Interpolate size for interpolated children
This finally allows us to use Random factor to add variations to the
interpolated children. This feature never worked since 2007L there was
random factor slider in the interface, but it was only used by simple
children. Now it has affect on interpolated children as well.

Technically, this will break compatibility if older file had random
factor set to something else than 0 (default value is 0 though). But
we are leaving 2.7 series, so can accept such breackage in the name
of supported features.
2018-04-18 10:52:27 +02:00
Julian Eisel
bc9e05599d Fix makesdna not respecting C++ comments
Tab after C++ comment broke parsing and didn't remove the line at all.
Was there since 2002 at least, probably confused some peeps.

This means commented out code was actually written to SDNA.
2018-04-18 00:29:53 +02:00
Dalai Felinto
a0ef147f29 bpy consistency fix handler_add(handle)
This doesn't change the API, so it doesn't affect any script.
However it give more consistent error messages.
2018-04-17 12:29:40 +02:00
Dalai Felinto
c558d8fa7c bpy blf api example update
With changes from Campbell Barton as well.
2018-04-17 12:25:51 +02:00
aff71a7fdc Fix (unreported) RNA sometimes trying to get named sub-props from non-Group IDProp.
Why exactly this happens remains unclear, found that in the
autumn.blenrig file of Spring production while working on static
overrides... Tons of ugly IDProps in that rig. xD
2018-04-17 11:59:14 +02:00
eb6fe5fa94 Cleanup: indentation 2018-04-16 18:13:48 +02:00
95eb9f22e6 Cleanup: indentation 2018-04-16 17:16:29 +02:00
85de548e03 Cleanup: indentation 2018-04-16 17:08:27 +02:00
141f0f4c47 BKE_context: macro to access ID's while looping 2018-04-16 16:19:16 +02:00
047950db7c Depsgraph: Pull indirect relations via driver targets 2018-04-16 16:12:15 +02:00
6617818c7a Make ID icons safe for deletion from threads
Added a lock-free deferred queue for deletion. Now if ID icon
is requested to be freed from non-main thread, it will be added
to the deferred list. Actual deletion will happen later from main
thread.

Currently actual deletion only happens next time BKE_icon_id_delete()
is called, which might not be enough. But it's easy to enforce
deferred deletion.

Icons for preview images are not covered by deferred deletion yet.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D3146
2018-04-16 10:18:43 +02:00
5bfe6126f8 Added lock-free single linked list implementation
Only supports lock-free insertion for now, can not delete element
or traverse the list at the same time.
2018-04-16 10:18:43 +02:00
2720667566 Disable Feature Collada: Tests do not work on unix
The tests as they are now make string comparisons. This only works
on Windows because the reference files look different for different
operating systems because of different number formatting.
The collada tests need a complete rework (wip)
2018-04-16 09:56:59 +02:00
b4e8d33f11 Logging: edits to build on macOS 2018-04-16 07:38:11 +02:00
80f7249d09 Cleanup: skip redundant edit-bone select lookups 2018-04-15 21:46:25 +02:00
447622f717 Pydoc: Fix multiple bpy.type modules 2018-04-15 11:45:25 -04:00
7bccd21afa Cleanup: remove redundant args from ebone picking
Make this match editmesh picking more closely
2018-04-15 12:45:39 +02:00
0f2efce6c5 Cleanup: remove bad casts 2018-04-15 11:57:49 +02:00
c12d976020 Cleanup: ED_armature naming
- Wasn't clear which functions handle edit-bones.
- Mixed both ebone and edit_bone in names.
- Didn't use ED_armature_* prefix for public API.

See P655 to apply to branches.
2018-04-15 11:50:53 +02:00
d0e3fbc06b Cleanup: remove undoing access, minor formatting
Access to undoing state isn't needed,
some text insert code was overly compacted.
2018-04-15 10:48:50 +02:00
fb3528d088 Fix T54593: Py text edits crash (undo regression) 2018-04-15 10:34:41 +02:00
87a9b6ac06 Fix compiler error in Windows 2018-04-15 09:55:42 +02:00
2666e77c22 Fix T54527: Misleading Tooltip on Snap Target Menu 2018-04-14 18:26:27 -04:00
73dfd3d382 Pydocs: Expand bge.contraint docs
Takes information from the manual and dumps it here.
2018-04-14 18:08:32 -04:00
3a10f8e1b1 Cleanup: style 2018-04-14 22:26:12 +02:00
5ab77ab4ee Cleanup: use const for BKE_object args 2018-04-14 14:27:38 +02:00
66d4e9300b Logging: replace 'fwrite' w/ 'write'
We're already buffing output, so use write directly.
2018-04-14 13:59:33 +02:00
1c23b5c6ff Cleanup: rename WriteData struct members.
Relationship between tot/count/buf wasn't clear.

Also use doxy sections.
2018-04-14 13:35:20 +02:00
cbd4a79c6d Undo: refactor memfile writing
- Move static undo variable into 'WriteData',
  'memfile_chunk_add' used arguments in a confusing way,
  sometimes to set/clear static var.

- Replace checks for 'wd->current' with 'wd->use_memfile'
  move memfile vars into 'wd->mem' struct.
2018-04-14 13:03:41 +02:00
2e9b92b5cc Fix T54568: Undo memory de-duplication failed
Error in 651b8fb14e caused de-duplication to fail.
2018-04-14 12:30:14 +02:00
332846b188 Remove editor type selector from File Browser when in 'Operator' mode.
Having that one when opening a file or loading some lib makes absolutely
no sense, and switching that 'temp' editor to some other type can
trigger all kind of funny bugs...

Note that using the shortcuts keys (Shift-F5 etc.) is still possible,
removing those seems a bit more involved. :/
2018-04-13 12:14:50 +02:00
a494df8e38 Fix: Follow up to 16b795cb95
It's not just the Graph Editor that needed this - the NLA also uses similar code
and thus suffers from a similar problem.

(My first commit from the Blender Institute v2.0 - Just testing that everything works)
2018-04-12 15:50:26 +02:00
d213474070 Moved vectorblur code from render to compositor
In preparation of the removal of blender internal render we
moved the vectorblur code that was placed in the render package
(legacy) to the compositor. The compositor is only using this
code even the blender internal renderer did not use the code at
all.
2018-04-12 10:27:38 +02:00
8aa6e4d50b Changed assertion of '..' in file browser entries
The previous assert assumed '..' is always there, which isn't necessarily
true (for example when in the root of an Asset Engine repository).

The new code asserts that if '..' is present it should be the first entry
(rather than forcing the first entry to be '..').
2018-04-11 15:06:42 +02:00
5a3c146652 fix T54549: Vector Transform node in wrong nodeclass
the Vector Transform node was added to the "Vector" category in
nodeitems_builtins.py
but was using the "NODE_CLASS_CONVERTOR" internally (thus using e.g. the
'wrong' theme color)

thanx @dingto for review

Differential Revision: https://developer.blender.org/D3138
2018-04-11 14:14:31 +02:00
c963488b5e Pose Mode: pass object to mode enter/exit
Also add lower level mode exit function
2018-04-11 09:21:01 +02:00
32339a56f1 Cleanup: minor changes to pose-mode switching API
Prepare for multi-object pose mode
2018-04-11 08:53:59 +02:00
f55adabb3e Cleanup: remove unused flag 2018-04-10 20:13:31 +02:00
549d4a55ab Fix transform nearest axis check
Was mixing up global/local coords
2018-04-10 16:14:29 +02:00
5c3857b305 Depsgraph: Build relations for objects linked via pchan constraints
This is similar to previous fix for missing ID nodes, just the original
fix missed this part of change because it looked like it is already
happening.
2018-04-10 11:57:20 +02:00
814f143acf Fix T54423: Messages from RNA_property_editable_info() were not translatable. 2018-04-10 10:24:02 +02:00
bd76c88754 Depsgraph: Flush debug prints
Makes it more reliable to see what was updating last when
crash happens.
2018-04-10 09:54:27 +02:00
16b795cb95 Fix crash in graph editor id remapping
Dopsheet pointer isn't set...?
2018-04-09 21:40:52 -04:00
Julian Eisel
77e9193c23 Fix invalid context when refreshing popups
Patch D2759 by @raa, with minor edits by me.
2018-04-09 19:31:39 +02:00
ec91948dd7 Cleanup: unused variable 2018-04-09 19:01:49 +02:00
Julian Eisel
7213553c84 UI: Clamp scrollbar offset to lower view boundaries
Fixes the "emtpy scrolling" glitch by clamping the scroller offset to
the boundary of the view when it's smaller than the previous.

Fixes T45197. Patch by @januz.

Differential Revision: D1580
2018-04-09 18:55:50 +02:00
26a283deae Use the newer version of the bullet 6dof spring constraint for rigidbody.
The new constraint is slower and not backward compatible, but should
be better, especially in the damping side. The new constraint also
has a different valid range of the damping coefficient, and a limit
implementation that bounces instead of making the object stationary.

Reviewers: sergof

Differential Revision: https://developer.blender.org/D3125
2018-04-09 19:14:35 +03:00
7e39d151d8 Added support for the WEBM/VP9 video codec
WEBM is the codec name, and VP9 is the encoder (the older encoder "VP8"
is less efficient than VP9).

WEBM/VP9 and h.264 both have options to control the file size versus
compression time (e.g. fast but big, or slow and small, for the same
output quality). Since WEBM/VP9 only has three choices, I've chosen to
map those to 3 of the 9 possible choices of h.264:

- BEST → SLOWER
- GOOD → MEDIUM
- REALTIME → SUPERFAST

The VERYSLOW and ULTRAFAST options give very little extra benefit.

Reviewed by: @Severin
2018-04-09 15:27:11 +02:00
39116a4340 Remove commented-out code 2018-04-09 15:26:12 +02:00
f0edb853be Build: fix make deps using system webp/sndio libs. 2018-04-09 15:08:40 +02:00
2872965652 Cleanup: avoid recalculating global center 2018-04-09 12:40:10 +02:00
d6a1a0ebb8 Alphabetically ordered audio and video codecs 2018-04-08 17:52:30 +02:00
245e01c30a Encoding panel clarifications
The encoding panel mentions "None" in a few places, which is confusing.
- "Codec: None" now reads "No Video"
- "Audio Codec: None" now reads "No Audio"
- "Output Quality: None; ..." now reads "Constant Bitrate"

When selecting "No Video" the remaining video encoding options are
hidden, making it even more explicit that there will not be video in the
output file.

The label "Codec" now reads "Video Codec" for symmetry with "Audio
Codec".
2018-04-08 13:46:29 +02:00
e0452cc5a9 Fix edit-mesh select next
Last change introduced error, return would stop looking over candidates.

D3137 by @nBurn
2018-04-07 19:54:59 +02:00
4db3b4da46 Bullet: Fix velocity calculation of new spring constraint
This is a backport of bullet commit: 86ca7dc
2018-04-07 17:37:23 +02:00
d2e1a14a57 Fix Collada: nullptr is a c++11 keyword. Changed to NULL 2018-04-06 13:06:46 +02:00
fe73c12990 Fix Collada: Import of animations for objects with multiple materials
When importing multiple materials for one object,
the imported material animation curves have all been
assigned to the first material in the object.

This fix also improves the console logging whenever the importer
finds a consistency problem with the imported animation data.
2018-04-06 12:42:38 +02:00
4de70da73a Cleanup: style, doxy headers 2018-04-06 10:47:39 +02:00
Julian Eisel
72e5082b67 UI: Add accelerator keys to quit confirmation popup 2018-04-05 19:15:37 +02:00
eb7b701137 Fix error where find-next missed None check
Thanks to @nBurn
2018-04-05 18:48:48 +02:00
58ba5a65bc Cleanup: use string macros to avoid duplicate args 2018-04-05 18:39:23 +02:00
3a864f5ee4 BLI_string_utf8: macros that de-duplicate sizeof arg 2018-04-05 18:37:54 +02:00
9b8a92b874 Depsgraph: Pull indirect dependencies via pchan constraints
Was missing ID looper for pchan constraint.
2018-04-05 18:03:36 +02:00
ea0e2f9bd3 Load metadata from video files and expose via RNA
The MovieSequence and MovieClip classes now have a metadata() function
that exposes the `IDProperty *` holding the video metadata.

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:24 +02:00
6c3110a661 Write the scene render frame range to image/video files
This is useful to create a mapping from the frame range in the video to
frame index in the blend file.

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:24 +02:00
6374d390d3 Write StampData metadata to video files
This is currently only supported by FFmpeg (so not frameserver, AVI RAW,
or AVI JPEG), and only seems to work when using Matroska or Ogg Theora
containers.

Only metadata that doesn't change from frame to frame is written to
video files. This distinction is visible in the UI by looking at the
stamp checkbox tooltips (they either mention "image" or "image/video").

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:23 +02:00
b0a767b85b IMB_metadata improvements
- Metadata handling is now separate from `ImBuf *`, allowing it to be
  used with a generic `IDProperty *`.
- Merged `IMB_metadata_add_field()` and `IMB_metadata_change_field()`
  into a more robust `IMB_metadata_set_field()`. This new function
  doesn't return any status (it now always succeeds, and the previously
  existing return value was never checked anyway).
- Removed `IMB_metadata_del_field()` as it was never actually used
  anywhere.
- Use `IMB_metadata_ensure()` instead of having
  `IMB_metadata_set_field()` create the containing `IDProperty` for
  you.
- Deduplicated function declarations, moved `intern/IMB_metadata.h` out
  of `intern/`. Note that this does mean that we have some extra
  `#include "IMB_metadata.h"` lines now, as the metadata functions are
  no longer declared in `IMB_imbuf.h`.
- Deduplicated function declarations, all metadata-related declarations
  are now in imbuf/IMB_metadata.h.

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:23 +02:00
f0f6c96a92 BLI_string: macros that de-duplicate sizeof arg 2018-04-05 16:44:48 +02:00
ad1ea9a427 Undo: split text undo steps out of the data-block
This moves undo storage into a separate struct which is passed
in from the undo system.
2018-04-05 15:22:33 +02:00
79c3c56894 Undo System: return undo step from undo push init
Also improve logging
2018-04-05 14:11:51 +02:00
1761095abc Logging: use -1 log level to log all levels 2018-04-05 13:55:04 +02:00
cd474b913b ED_undo: use logging 2018-04-05 13:41:52 +02:00
47b6e23271 Fix crash w/ empty text undo operations 2018-04-05 10:01:12 +02:00
d59c2d12b1 Fix modifier freeing code re. ID refcounting.
Free code should not handle ID refcounting at all. This has to be done
at higher level, since in some case we want to free (temp) data that
actually did not refcount at all its IDs.

This change seems to be working OK, but as usual in that area, only
lots of testing in real-case situation will say whether there are some
hidden bugs or not.
2018-04-04 14:58:52 +02:00
0c7ec58966 Depsgraph: Make sure textures used by modifiers are in the graph 2018-04-04 12:56:04 +02:00
49f77b0d83 Proper fix for T54337
Accidentally checked the wrong variable in fa01a1738b.
2018-04-04 06:36:16 -04:00
677d699645 Tweak ID->tag reset on file load (no visible change expected!).
Issue was, *some* IDs (like infamous nodetrees from materials etc.)
would not go through the 'main' read_libblock() func, so their tags were
never reset.

So now, we ensure direct_link_id() always clear the tags, and move
setting them in read_libblock() after the call to direct_link_id().

Needed for depsgraph, but general healthier fix actually.
2018-04-04 11:59:16 +02:00
c128738926 Depsgraph: Ensure root pchan is always found 2018-04-04 11:49:01 +02:00
909efe6be5 Depsgraph: Assert that pchan index is always valid 2018-04-04 10:35:32 +02:00
f913e69093 Depsgraph: Add missing expansion od custom bone shapes
This was fixed in 2.8 branch but not in master.
2018-04-04 10:15:45 +02:00
4674e02562 Depsgraph: Only bind ID-data and indices to depsgraph callbacks
This is a part of copy-on-write sanitization, to avoid all the checks
which were attempting to keep sub-data pointers intact.

Point is: ID pointers never change for CoW datablocks, but nested
data pointers might change when updating existing copy.

Solution: Only bind ID data pointers and index of sub-data.
This will make CoW datablock 7update function was easier in 2.8.

In master we were only using pose channel pointers in callbacks,
this is exactly what this commit addresses. A linear lookup array
is created on pose evaluation init and is thrown away afterwards.

One thing we might consider doing is to keep indexed array of
poses, similar to chanhash.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D3124
2018-04-04 09:48:41 +02:00
fa01a1738b Fix T54337: Cycles crash with simple subd object in debug build 2018-04-03 23:37:12 -04:00
8c4d28cdb9 Fix T54400: Some GCN 1 cards available to select for use with Cycles
Hainan was missing from the list of GCN 1 cards.
2018-04-03 23:15:07 -04:00
2f723a414f BMesh: remove redundant loop in select-next-active
Thanks to @nBurn for spotting
2018-04-03 18:32:55 +02:00
ab695c3297 Undo: make id-map use binary search to keep sorted 2018-04-03 18:07:51 +02:00
1f0f234b07 Fix own error w/ undo ID lookup
Was testing with small number of items, so this went unnoticed.
2018-04-03 17:58:37 +02:00
b2c9fdfe87 Cleanup: rename BMesh count_ex -> count_at_most 2018-04-03 17:06:36 +02:00
bfdb88f3f4 Cleanup: rename list count_ex -> count_at_most 2018-04-03 17:05:21 +02:00
06a62d4e06 Undo: use with_prev verisons of id-map lookups 2018-04-03 17:03:33 +02:00
5a7deab65a Undo: use general id-map for image undo lookups.
Was doing own name based lookups to keep compatible w/ global undo.
2018-04-03 17:03:33 +02:00
75de21f072 Undo System: id-map avoid duplicate add/lookup
Add versions of add/lookup that check the previous item.
2018-04-03 17:03:33 +02:00
53f068454e Fix mistake logging w/ undo 2018-04-03 17:03:33 +02:00
96f565b380 Fix T54477: Broken utf8 strings in old .blend files
Back in the days (2.4x and before), it was rather easy to get some
invalid utf-8 strings in Blender. This is totally breaking modern code,
so this commit adds a simple 'check & fix strings' operator, available
from the main File menu.
2018-04-03 16:03:11 +02:00
601835cd31 Fix (unreported) crash when accessing some bl_rna.properties.
E.g. typing `bpy.data.bl_rna.properties[8].<tab>` in console would hard-crash
trying to dereference NULL pointer. Was a missing check in rna_Property_tags_itemf().
2018-04-03 14:32:23 +02:00
b3004d30f5 Undo: remove particle undo push
Was only called on copy particle system
which is already doing an undo push.
2018-04-03 08:57:01 +02:00
72ae0e1b6d Cleanup: editor BKE_main includes 2018-04-03 08:42:12 +02:00
a0eb54142f Undo: replace global access w/ ED_undo_stack_get
While I'd like to avoid using this too much since the operator
system should handle.
It's less trouble than accessing it inline each time.
2018-04-03 08:35:42 +02:00
31f2a6755d PyAPI: Add PyC_Tuple_Pack_F64 utility 2018-04-02 19:48:34 +02:00
71d7d6cd8c Build: add WITH_OPENVDB_3_ABI_COMPATIBLE option.
Better fix for T54457. It seems Debian compiles OpenVDB without ABI 3
compatibility, while Arch does enable it as is the default in the OpeVDB
CMake build system.

So now there's an option that the distribution can set depending on how
they compile their OpenVDB package.
2018-04-02 19:13:04 +02:00
4041385ddd Cleanup: remove redundant imbuf return values
Some functions always returned the input argument
which was never used.

This made code read as if there might be a leak.

Now return a boolean (true the imbuf is modified).
2018-04-02 17:34:52 +02:00
Milan Jaros
888a04c7e4 Build: fixes for the Intel compiler versions 2016, 2017, 2018.
Differential Revision: https://developer.blender.org/D3109
2018-04-02 16:39:04 +02:00
692aeb6fe0 Cleanup: newlines left in messages 2018-04-02 15:46:31 +02:00
4ffa05c30b Cleanup: move undo into it's own directory
Split out undo API from ED_util.h into ED_undo.h
2018-04-02 15:07:40 +02:00
b186592b21 Cleanup: move BKE_global include under ifdef's 2018-04-02 14:19:44 +02:00
44efbef41e Undo: store active curve shape key in edit-mode 2018-04-02 13:13:57 +02:00
017c731cf3 Logging: use for Python API
Adds categories "bpy.context" & "bpy.rna"
2018-04-02 13:13:57 +02:00
21fcc723e9 imbuf: revert some of the changes of rBb6ba3c682dd6615e760905572a5bcd69bb46371f since they broke the build. 2018-04-01 15:17:17 -06:00
b29ecbfc6b Fix compiling with Alembic
Still need G.main
2018-04-01 19:50:19 +02:00
f48895f74a Correct accidental changes by C Logging addition
Error in 891c1cfc9a
2018-04-01 10:23:28 +02:00
473f17b3d5 Resolve unsigned comparison error w/ MSVC 2018-04-01 07:41:23 +02:00
b6ba3c682d Cleanup: remove global header 2018-04-01 07:24:45 +02:00
951d89b7b4 Cleanup: warning 2018-03-31 23:51:38 +02:00
d18116a297 Removed by accident in last commit 2018-03-31 23:47:05 +02:00
651b8fb14e Undo: unified undo system w/ linear history
- Use a single undo history for all operations.
- UndoType's are registered and poll the context to check if they
  should be used when performing an undo push.
- Mode switching is used to ensure the state is correct before
  undo data is restored.
- Some undo types accumulate changes (image & text editing)
  others store the state multiple times (with de-duplication).
  This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`.
- Each undo step stores ID datablocks they use with utilities to help
  manage restoring correct ID's.
  Needed since global undo is now mixed with other modes undo.
- Currently performs each undo step when going up/down history
  Previously this wasn't done, making history fail in some cases.
  This can be optimized to skip some combinations of undo steps.

grease-pencil is an exception which has not been updated
since it integrates undo into the draw-session.

See D3113
2018-03-31 20:40:37 +02:00
91d0825b55 BLI_sort_utils: add pointer sorting callback
Also rename Pointer -> Ptr
2018-03-31 19:25:27 +02:00
ae3a1da1e6 Logging: fix own error with formatting 2018-03-31 15:43:47 +02:00
b237a1c2ea Use int instead of bool
Causes issues when including in some files.
2018-03-31 15:33:15 +02:00
db8e7f9780 Logging: add argument --log-show-basename
Optionally strips leading path from filenames when logging.
2018-03-31 15:29:46 +02:00
5cb440492e Cleanup: --help text output
Some arguments missed their <value>.
2018-03-31 14:53:15 +02:00
22d40fdfd8 Cleanup: blf internal struct naming
- use x/y/width/height/max as a suffix.
- replace 'num' prefix /w 'len' suffix.
2018-03-31 13:40:23 +02:00
ac4513a5b8 Logging: add ability to exclude categories. 2018-03-31 12:52:47 +02:00
5f59c22bf1 Docs: doxygen docs for clog 2018-03-31 12:27:18 +02:00
b8a66973ac Fix clog: own error allocating from static buffer 2018-03-31 11:25:49 +02:00
af11eea3fd Fix logger build w/ MSVC 2018-03-31 09:18:30 +02:00
1ebc14064b Build deps: do sndfile patch also on linux platform 2018-03-31 02:15:13 +03:00
891c1cfc9a C Logging: use instead of printf for messages
- See `--log` help message for usage.
- Supports enabling categories.
- Color severity.
- Optionally logs to a file.
- Currently use to replace printf calls in wm module.

See D3120 for details.
2018-03-30 18:57:41 +02:00
c647c93f63 build_deps: Disable building docs for OIIO
Two issues are fixed with this commit:

1) When we build OIIO (on unixoid build environments) and no /src/doc/oiiotool was present we had no build target for it (which led to a build error). As we don't need docs for OIIO, we disable it now.

2) We specified a var that OIIO does not recognize (was removed upstream a long time ago): ILMBASE_VERSION.
2018-03-30 15:22:40 +02:00
ee2aa31982 PyDoc: Merge manual docs for bge.texture
https://docs.blender.org/manual/en/dev/game_engine/python_api/videotexture.html

Had a few things that this file did not while this file having things the other did not.
To fix, I merged both documents into the python api.
2018-03-29 18:02:04 -04:00
354dfdac88 UI: Edit mode move edge data tool into a menu
UI: Edit mode move edge data tool into a menu

See also:

- D1741
- T46853

Reviewers: Severin, meta-androcto, campbellbarton

Subscribers: mont29, #user_interface

Tags: #user_interface

Differential Revision: https://developer.blender.org/D2259
2018-03-29 14:26:49 -04:00
0f6d52cd29 PyDocs: Adde link to Wikipedia page for mathutils.Euler class
This update adds a link to the Wikipedia article "Euler angles" to the description of the mathutils.Euler class.
I initially was not sure what a "Euler" represented in Blender API, but found the Wikipedia article helpful. I believe others will find the link helpful too if it appears in the class documentation.

This is similar to the Wikipedia links that appear in the mathutils.Matrix class, e.g: https://docs.blender.org/api/blender_python_api_current/mathutils.html?highlight=euler#mathutils.Matrix.adjugate

Author: @justasb

Reviewers: campbellbarton, trumanblending, Blendify

Reviewed By: Blendify

Subscribers: Blendify

Tags: #bf_blender

Differential Revision: https://developer.blender.org/D3077
2018-03-29 14:25:13 -04:00
Dalai Felinto
9f60c850f9 Depsgraph: initialize EvaluationContext even if nothing to update
This is required to T54437 (sequencer preview uses last updated scene).
Although the fix itself needs to be in 2.8, for the 2.8 specific
initialization code.
2018-03-29 09:56:09 -03:00
ca5f3dd220 Fix T54457: build error with OpenVDB versions newer than 3.
Solution provided by Sven-Hendrik Haase.
2018-03-29 07:21:35 +02:00
52302757cd Fix T54455: OpenCL build error after recent changes. 2018-03-29 07:14:09 +02:00
Matt Heimlich
e3f1d98098 Cycles: take into account diffuse roughness for roughness baking.
Roughness baking previously defaulted to 1.0 for all diffuse materials,
now we also bake roughness values of Oren-Nayer and Principled Diffuse.

Differential Revision: https://developer.blender.org/D3115
2018-03-28 23:45:15 +02:00
1953de335e Cleanup: Tooltip spelling 2018-03-28 13:09:00 -04:00
1b6bf5b75e build_deps: disable hdf5 lib support
we do not ship with hdf5 support for alembic on any of the platforms.
2018-03-28 10:48:52 -06:00
8afc9c1e7d Fix Collada: broken tangents with Camera Animation import for xfov
When importing an xfov curve, we must transformed the data to
Lens opening angles in degrees. While the curve value itself is
correctly transformed, the transformation of the tangents has been
forgotten. this is fixed now.
2018-03-28 18:01:32 +02:00
Jeff Witthuhn
bc3a55c343 Cycles: don't require pthreads as dependency on Windows.
Use C++11 threads when available, and native critical section on Windows.
Later on we can remove pthread code when C+11 becomes required.

Differential Revision: https://developer.blender.org/D3116
2018-03-28 12:13:04 +02:00
e49d66f22c Cleanup: typo in function name 2018-03-28 11:23:38 +02:00
a970ac5d55 BLI_array: utility to check memory is zerod 2018-03-28 11:13:54 +02:00
4bd5b824b0 Fix missing confirm quit dialog on macOS, after recent changes. 2018-03-28 10:54:17 +02:00
be587d76ef Cycles: Fix bad register cast in sseb
This is currently unused code, but causes gcc-8 to fail.
2018-03-28 10:34:31 +02:00
e4d82c0dcf Fix T54435: Quit prompt fails w/ fractional scale 2018-03-27 16:46:10 +02:00
e22b870b4a Cleanup: global undo (minor changes to internals)
- Get memory usage from MemFile instead of MEM API
  avoids possible invalid when threads alloc memory.
- Use size_t instead of uint and uintptr_t to store size.
- Rename UndoElem.str -> filename
- Rename MemFileChunk.ident -> is_identical
2018-03-27 14:56:54 +02:00
3bca1ef26b Cleanup: move paint curve undo into own file 2018-03-27 07:06:14 +02:00
a7aee250b8 Fix T54420: too much volume render noise with multiple volume objects.
Random numbers for step offset were correlated, now use stratified samples
which reduces noise as well for some types of volumes, mainly procedural
ones where the step size is bigger than the volume features.
2018-03-27 01:08:30 +02:00
3c45fdd171 GHOST: Solve compilation error of test programs 2018-03-26 14:51:56 +02:00
64e5f83133 BLF: Don't use user preferences
BLF is a low level module, which might (and is) used without Blender.

Thanks Campbell for review!
2018-03-26 14:49:23 +02:00
0476f8277a BLF: Cleanup, indentation inside of preprocessor 2018-03-26 14:07:19 +02:00
31bf6edf79 Text: line break always returned cancelled
Harmless but incorrect.
2018-03-25 17:51:49 +02:00
977a4e7f5d Text: re-allocate exact lengths for undo
Undo sometimes reserved too much space in the buffer,
now assert when this happens and allocate the exact size needed.

Note prepares for moving text editor undo out of the text block (D3113)
which will split the undo buffer into a list of undo steps.
2018-03-24 14:27:31 +01:00
3f9d5ea0ec Fix text editor undo w/ 4+ byte utf8 characters 2018-03-24 14:14:19 +01:00
9d1de621e2 Cleanup: move undo opcodes out of public header 2018-03-24 12:46:25 +01:00
19f148d9d0 PyDoc: Add docutils ref for "registration"
This will be used to link to from the manual.
2018-03-23 20:25:30 -04:00
Julian Eisel
357b72e0a7 Theming: Use list-item colors for all un-embossed buttons in list-items
E.g. number buttons in the shape key list would use theme colors of text
widgets.

Addresses T50862.
2018-03-23 20:46:51 +01:00
a7e4268bee UI: restore quit confirmation when dialog disabled 2018-03-23 17:32:13 +01:00
15af75d79e msvc: Fix msvc2013 new despgraph related build errors.
msvc's function.hpp does not like NULL for function pointers. disabled support for this platform.
2018-03-23 09:23:08 -06:00
4f8e407086 Libmv: Fix compilation error on Windows 2018-03-23 15:05:08 +01:00
ab48e6355d Glog/gflags: Reduce amount of local modifications
With better directory layout and more proper include
statements we can avoid several local modifications,
such as changing config.h for Windows Glog and the
ones related on pass-through statements in logging
headers in Glog.

This commit also makes unused functions not-a-warning
for external code.
2018-03-23 14:38:02 +01:00
Julian Eisel
60712d12eb UI: 4-column layout for the editor-type selector menu
The list of editor-types is rather long by now, so better to arrange them into
sections.

Original patch by @jeske with updates by @Blendify and myself.
Design Task: T36028
Patch: D3112
2018-03-23 14:28:46 +01:00
7cc2b27099 Cleanup: stray tabs
Tabs in middle of code (mostly for no reason / by accident).
2018-03-23 11:51:19 +01:00
f2f32c81d4 Cleanup: doxy header, line length 2018-03-23 11:28:25 +01:00
72c43e0285 Cleanup: move image undo into own file 2018-03-23 09:15:23 +01:00
Julian Eisel
529c21acc2 Fix issues with confirmation prompt on Windows
* Pressing "OK" wouldn't close Blender anymore
* Using File -> Quit would use popup version, not OS native window

Cleaned up code a bit to avoid duplicated logic.
2018-03-23 02:00:14 +01:00
Julian Eisel
aeec19d2e7 Fix own mistake from 4cb4556fa5
Trying to close Blender from a second window wouldn't work, the first window
would have to be hovered first. Ouch!
2018-03-22 23:52:38 +01:00
Julian Eisel
a4ea46ffc5 Fix memory leaks when doing "Save & Quit"
Steps to reproduce were:
* Open Blender (no need for factory settings, "Promt Quit" needs to be enabled)
* Edit the file (e.g. translate some object)
* Quit Blender but don't skip quit promt
* Press "Save & Quit"
* Save the file

Not sure if Windows supports the "Save & Quit" behavior, so this may not have
applied to Windows.
2018-03-22 23:29:48 +01:00
Julian Eisel
4cb4556fa5 Fix T48027: Memory leaks when exiting Blender from menu
You only had to close Blender through File -> Quit.

Leaks happened because WM_exit() was called from within operator, UI wasn't able
to free some of it's heap data then. This data was the handler added in
uiTemplateRunningJobs() and the IDProperty group added in uiItemFullO_ptr_ex().
There was obviously a general design issue which only became visible in this
specific case.

We now delay the WM_exit call by wrapping it into a handler that gets registered
as usual. I didn't see a better way to do this, all tricks done in
ui_apply_but_funcs_after() to prevent leaks didn't work here. In fact they may
be redundant now, but am not brave enough to try ;)
2018-03-22 23:25:28 +01:00
150ad2238c PyDocs: Fix link syntax 2018-03-22 16:38:53 -04:00
897a21e6a3 Glog: Restore some custom config for MSVC2015 2018-03-22 17:48:36 +01:00
4486eddfaa GLog: Tweak settings according to our config
We do have gflags.
2018-03-22 17:32:51 +01:00
c9e7e1987b Glog: Workaround mess around windows and non-windows headers
Seems we can not use include directories order trick, since
files are included form inside ".." string, which forces current
directory to be checked first.
2018-03-22 17:26:02 +01:00
9f45f1a6b7 GFlags: Fix usage of unused attribute 2018-03-22 17:19:56 +01:00
2a4c40f4b9 Glog: Attempt to fix compilation error on Windows
Ideally it should be possible without hacking into sources files
of Glog itself.
2018-03-22 17:02:16 +01:00
0bce7186f7 Glog: Restore haiko OS 2018-03-22 16:58:23 +01:00
27d9863fa5 Fix T54172: Avoid jumping panel length during playback 2018-03-22 11:42:35 -04:00
69b327d8dc Depsgraph: Report new depsgraph evaluation time
Timing is printed to the console when running with --debug-depsgraph-time.
2018-03-22 16:40:32 +01:00
d554b8a748 UI: skip confirmation menu on quit prompt to save 2018-03-22 16:24:14 +01:00
161393805f Update Google libraries
This commit updates:

- gflags 2.2.0 -> 2.2.1
- glog 0.3.4 -> 0.3.4
- gmock 1.7.0 -> 1.8.0
- gtest 1.7.0 -> 1.8.0
2018-03-22 16:10:08 +01:00
cfe43f8d1a Fix T54360: FFMPEG bitrate not editable for all codecs
The bitrate selection was hidden when a CRF mode was chosen and then
switched to a codec that doesn't support CRF.
2018-03-22 14:47:22 +01:00
e35f964daa Cleanup: Use more python way of checking boolean 2018-03-22 09:33:15 +01:00
865fbe343a Fix T54348: Bone dissolve gives invalid hierarchy
Disconnected bones weren't handled correctly.
2018-03-22 07:50:58 +01:00
ce51066e47 Fix bone dissolve using wrong envelope radius
Also correctly copy bone tip selection when dissolving.
2018-03-22 07:50:03 +01:00
5ba5254ec1 UI: Optional prompt to quit for non win32 systems
D566 by @januz

Use Blender native dialog when OS dialog's aren't supported.
2018-03-21 16:04:01 +01:00
23ffd4ec39 Tracking: Make object created form tracks active and selected 2018-03-21 12:33:04 +01:00
658fb7f453 Tracking: Warn when no tracks are selected when creating mesh
Makes it more clear why mesh was not created this way.

Fixes T54368: 3D markers to mesh In MovieClipEditor Not working.
2018-03-21 12:30:50 +01:00
1e43665a39 Fix T54378: Drivers fail with property from empty
Empties were missing Parameters component.
2018-03-21 12:17:51 +01:00
d03223850e Fix build error on Windows 32 bit. 2018-03-20 17:11:14 +01:00
69e35429bf Remove debug only code from previous commit 2018-03-20 16:54:50 +01:00
a5bb918392 Memory allocator: Clarify consistency check function
Also make it to return truth when everything is good and
false otherwise.
2018-03-20 16:51:33 +01:00
4f97f58513 MSVC: Fix lite build.
MSVC still defines __cplusplus as 199711L until it's in full conformance with the newer c++ standards, however the things we need from the standard are fully supported, hence a check for the msvc version was needed.
2018-03-20 08:26:11 -06:00
09c88fed1f Fixed: cache clearing when using multiple Alembic files. 2018-03-20 12:54:48 +01:00
1782abf6e2 Fix BLI_assert for MSVC
Also use `_BLI_ASSERT` prefix for internal defines.
2018-03-20 11:56:11 +01:00
60ff803998 Fix missing ID pointer handling in materials in ID remapping code. 2018-03-20 11:32:16 +01:00
46a391b668 Fix missing array duplication when copying material
Texture paint slots were copied as a pointer, causing double-free.
2018-03-20 11:22:47 +01:00
8e5c407fc4 Fix compile error with MSVC2013 - Can't use __func__ (from BLI_assert) in inlined functions
ERROR: blenlib/intern/math_base_inline.c:371 - '__func__' : undeclared identifier (C:\blenderdev\master2\blender\source\blender\editors\lattice\editlattice_tools.c)  [C2065]
2018-03-20 16:03:43 +13:00
Bogdan Nagirniak
b65933e7b3 Fix T54019: copying and linking bugs with custom ID pointer properties. 2018-03-19 22:14:02 +01:00
Matthias Ellerbeck
8ecf35d850 Fix T54240: automatic node link moving should take into account type.
Without this a "Clearcoat" link could be moved to "Clearcoat Normal"
for example, which doesn't make much sense.

Differential Revision: https://developer.blender.org/D3105
2018-03-19 21:52:49 +01:00
148b0fef09 Fix T54317: overlapping volume render bug after recent changes.
Increasing the samplig dimensions like this is not optimal, I'm looking
into some deeper changes to reuse the random number and change the RR
probabilities, but this should fix the bug for now.
2018-03-19 21:22:15 +01:00
fddb4dee8a Fix T54356: volume rendering bug using just color attribute. 2018-03-19 21:22:15 +01:00
b8eca8e07d Cleanup: use utility header for particle looping 2018-03-19 18:18:04 +01:00
a3486e735f Cleanup: move particle undo into own file
Also avoid extern declarations which can get out of sync.
2018-03-19 17:46:49 +01:00
a5fc0ae150 Cleanup: move armature undo into own file 2018-03-19 17:45:20 +01:00
566f4e06ba Cleanup: move metaball undo into own file 2018-03-19 16:59:34 +01:00
e7ca9d3477 Cleanup: move curve undo into own file 2018-03-19 16:30:53 +01:00
c78ebf9f26 Cleanup: split lattice into own library
Was mixed with object functionality.
2018-03-19 15:45:50 +01:00
342a18287f Cleanup: type conversion warning 2018-03-19 09:12:48 +01:00
7729966af1 Fixed typo Python API
`mathutils.geometry.barycentric_transform` used `tri_a[1-3]` for the
target triangle, but in fact they are `tri_b[1-3]`
2018-03-19 08:19:48 +01:00
0301df40e5 Fix ugly recursive pattern in RNA PointCache data layout.
PointCache was having a collection of items of PointCache type, having a
collection of items of PointCache type, having...

Nuff said.

For now, chose the 'ugly' way to fix it, that is, the one that changes
nothing to API and scripts using it: we define another 'PointCacheItem'
RNA type for items of our point cache collection, which has exact same
interface as PointCache except for the collection.

This is doomed to be rewritten at some point anyway, not worth spending
time trying to define a really correct data layout for now.
2018-03-18 15:37:23 +01:00
368c581df1 CMake: disable boost for lite builds 2018-03-18 05:10:02 +01:00
2a9f000806 Cleanup: kdopbvh, only set parent nodes once 2018-03-18 05:08:12 +01:00
a51fdd89fd Cleanup: use MEM_SAFE_FREE 2018-03-18 05:08:12 +01:00
2aa0bde3dc mathutils: replace interp w/ blend when standalone 2018-03-18 05:08:12 +01:00
07c90f3a73 build_environment: remove msvc compiler warning from boost.
Even the boost people have given up trying to keep up with the rapid release
of new msvc versions, and have removed the warn for now see: 5ad0730630 (diff-eac863c1d46c77471e54e8818aab7534)
2018-03-17 12:47:17 -06:00
7427e3e501 MSVC: ignore warning c4828 The file contains a character that is illegal.
The only place this warning is coming from is from comments in headers of 3rd party libs. we can safely repress this warning for now.
2018-03-17 12:45:27 -06:00
64fbd50e4c Refactor: Collada: remove param, changed order of params in Function call
* In the Collada Module parameters are typically ordered
  in a similar way. I changed this to:

    extern std::string get_joint_id(Object *ob, Bone *bone);

* The Object parameter was not used in get_joint_sid().
  I changed this to:

	extern std::string get_joint_sid(Bone *bone);
2018-03-17 14:16:19 +01:00
5389964eea Add an assert to BKE_icon_changed() that we are actually dealing with ID icon.
Otherwise, ID->obj is an opaque pointer, wrong usage here could lead to
a vast amount of bad things.
2018-03-16 17:17:19 +01:00
1a71d5ae85 Fix T54310: Assert when enable Brush custom icon.
We had a mix of two issues here actually:
* First, Brush are currently using their own sauce for custom previews,
this is not great, but moving them to use common ImagePreview system of
IDs is a low-priority TODO. For now, they should totally ignore their
own ImagePreview.
* Second, BKE_icon_changed() would systematically create a PreviewImage
for ID types supporting it, which does not really makes sense, this
function is merely here to 'tag' previews as outdated. Actual creation
of previews is deferred to later, when we actually need them.
2018-03-16 17:06:43 +01:00
67e2806dcb Cleanup: naming and const parameter. 2018-03-16 16:44:23 +01:00
da4efaeb87 Depsgraph: Support colored addresses in debug prints
Enabled with --debug-depsgraph-pretty, only works with ANSI terminals.

Thanks Bastien for review!
2018-03-16 12:24:51 +01:00
295d8510af Add Truecolor ANSI console constants
They are used to start and end colored output in console.
Use with care, it is up to you to check that console actually
supports Truecolor ANSII.

In thew future we can extend this to other consoles and platforms.
2018-03-16 12:16:29 +01:00
f0596bf660 Hash: Add utility function to convert address to rgb values
Some magic hashing, will become handy to make debug messages
easier to follow.
2018-03-16 12:11:55 +01:00
3baf31e73a Depsgraph: Move evaluation debug prints to depsgraph
This way we can easily control format and keep it consistent.

And also possibly do other trickery, like coloring addresses!
2018-03-16 11:14:38 +01:00
5de9c8f6f0 Cleanup: move mesh mirror functions to own file 2018-03-17 00:55:11 +11:00
ee0697e50b Cleanup: doxy sections for editmesh files. 2018-03-17 00:55:11 +11:00
e5327afcb7 Fix T54326: Import Alembic stuck in edit mode
Switch to object mode before doing the import.
2018-03-16 04:06:34 +01:00
Cheryl Chen
07b07e53ea Fix T53971: single layer render showing the wrong render layer in image editor.
Original patch Cheryl Chen, extra fixes by Brecht.

Differential Revision: https://developer.blender.org/D3098
2018-03-16 00:58:10 +01:00
Guillaume Chereau
e56fd59f22 Code refactor: move OIIO image buffer writing outside session, into callback.
Original patch by Guillaume, modifications by Brecht.

Differential Revision: https://developer.blender.org/D3102
2018-03-15 23:05:16 +01:00
41149ca134 GHOST: Support Unity taskbar progress API
Unity itself is deprecated, but the API is also supported by KDE and the GNOME Dock extension,
which means that it will be useful for a wide variety of distributions.

To get a progress bar, the system must have a blender.desktop file and libunity installed.

The need for libunity is annoying, but the only alternative would be to integrate a DBus library...

Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D3106
2018-03-15 22:49:56 +01:00
995ccf8168 BLI_assert: extract from BLI_utildefines
BLI_utildefines is quite large, defining many unrelated things.
Add BLI_assert to include in inline headers, so math defines don't
pull in too much.
2018-03-16 06:03:29 +11:00
71139cedcb Missed last commit 2018-03-15 11:16:32 +11:00
e55c29b4ec BLI_math: don't use asserts in inline API
Requires BLI_utildefines.h to be included first,
(already noted in other inline code).

Possible alternative could be to move BLI_assert into own header.
2018-03-15 11:12:10 +11:00
b0823962e9 Style cleanup. 2018-03-14 18:05:09 +01:00
d34b1b35bf Fix (unreported) broken IDarray case in IDP_EqualsProperties_ex.
For IDProps IDarray, IDP_EqualsProperties was called for each item,
instead of IDP_EqualsProperties_ex, discarding value of `is_strict`
option.

Probably not an issue with current code, though.
2018-03-14 17:53:29 +01:00
d0055155e8 Fix T54319: Crash after double-clicking baked F-curve 2018-03-14 16:02:46 +01:00
342593f124 Cleanup: rename BLI_array_count -> len
Match naming convention used everywhere else.
Count should only be used when this isn't directly accessible.
2018-03-15 01:53:20 +11:00
c22c2ff060 Updated bpy.props getter/setter example
- The common name in computer science are 'getters' and 'setters', so by
  adding these names to the documentation (while 'get' and 'set are still
  also mentioned) we improve findability. Having 'Getters/Setters' as a
  title also makes it clearer that this example is not just about
  getting or setting the property value.
- Added a little prefix to each printed value, so that print statement,
  expected output, and real output can be matched easier.
2018-03-14 11:42:36 +01:00
b76471c1f9 Fix T54286: bpy.props operator example misses property access
The old example had two downsides:

- It promoted a blocking UI design, where the user is shown a popup
  before actually executing the operator.
- It didn't show how to actually use the property values.

The new code avoids these mistakes. The properties are also shown in the
redo panel in the 3D view.

Note that I also changed the bl_idname, as this is an example about
properties, not about dialogue boxes, and changed the class name to use
the standard operator naming convention.

I also extended the example to include a panel that sets multiple
properties of the operator, since I see questions about this relatively
frequently.
2018-03-14 11:31:14 +01:00
8803c5ca5d Cleanup: use sections for editmesh tools/select 2018-03-14 17:54:45 +11:00
c1694540c3 API generating script: give better version for releases builds.
Was giving '2.62.1 <sha1>' even for releases, now rather giving nicer
'2.62a <sha1>' in that case.
2018-03-13 19:49:39 +01:00
be25a0faa7 Cleanup: pass selectmode directly
Pass instead of editmesh or toolsettings.
Needed for multi edit-mode
2018-03-14 02:08:29 +11:00
bf8f5f5142 Cleanup: doxygen comments 2018-03-14 02:08:07 +11:00
81c199af83 Fix T54302 - Wrong added scene when adding a scene strip to the Sequencer
When adding scene strips to the sequencer, the wrong scenes were
getting getting added if some were skipped. For example:
Given 4 scenes (A, B, C, D) if you're trying to add the last 3 scenes
(B, C, D) as strips to the first scene (A), it would ended up adding
"A, B, C" instead of "B, C, D" as expected.

Fix provided by Andrew (signal9).
2018-03-13 23:05:57 +13:00
e0bb5109b3 Use Action datablock's own icon (instead of Animation Data's one) for File Browser's lib icons 2018-03-13 23:05:57 +13:00
3106f18176 Cleanup: long lines, use doxy sections 2018-03-13 18:07:10 +11:00
17793a66c6 Fix T54299: crash rendering objects with motion blur disabled, after recent changes. 2018-03-12 17:37:29 +01:00
44aa86b0a5 Cycles: reorganize tests in more evenly distributed groups. 2018-03-12 17:29:44 +01:00
e07dd9fd59 Cycles: add constant folding to displacement nodes. 2018-03-12 17:29:44 +01:00
629d44e049 Fix type in comment 2018-03-12 17:03:54 +01:00
a752bc148e Depsgraph: Make timing profile a command line option
This way we can add even more statistics, even one which will be print
to the console.

Would be nice if we also have verbosity level control.
2018-03-12 17:01:02 +01:00
815852e950 Fix T54296: Cycles viewport render stuck on constant re-render
Need Clear ID recalc flag on load. Otherwise it's possible to have
some IDs considered always updated by Cycles, when they were saved
in a tagged-for-update state.

Thanks Bastien for feedback and review!
2018-03-12 10:58:12 +01:00
da62507bc8 Cleanup: remove misleading array size 2018-03-12 16:37:26 +11:00
d75456196f Cleanup: typo 2018-03-12 16:35:31 +11:00
25502a9bdc Cleanup: sync EDBM_uv_* functions w/ 2.8
They're nearly the same, so keep names matching to avoid conflicts.
2018-03-12 14:51:45 +11:00
1966924467 UV: internal changes to picking
Nothing user visible, only things needed for multi-object support,
making picking functions more flexible too.

- Support passing in an initialized hit-struct,
  so it's possible to do multiple nearest calls on the same hit data.
- Replace manhattan distance w/ squared distance
  so they can be compared.
- Return success to detect changes to a hit-data
  which might already be initialized (also more readable).
2018-03-12 13:57:38 +11:00
2c9c22df26 fix Collada: wrong usage of pointer and hidden redeclaration
* Suspicious usage of pointer:

  short *type = 0; // this creates a null pointer

When this is later used for anything then blender would crash.
After following the code and check what happens i strongly believe
the author wanted to use a short and not a pointer to a short here.

* local variable where reused later in same function
While this did no harm, i still felt it was better to use a different
name here to make things more separated:

- moved variable declaraiotns into loop (for int a=0; ...)
- renamed uv_images to uv_image_set
- renamed index variable from i to j in inner loop that
  reused same index name from outer loop
2018-03-11 20:59:50 +01:00
49a7cd1ba4 Cleanup Collada: Removed duplicate variable setting 2018-03-11 20:59:50 +01:00
7952ece01b Cleanup: avoid redeclaration of iterator in same function
The iterator was redeclared 3 times. I fixed this to avoid future issues.
I commit separately because so the changes are less cluttered all over
the place.
2018-03-11 20:59:49 +01:00
a2cc85b264 Cleanup Collada: Avoid unintentional reuse of previous defined variable
The variable child was redeclared multiple times in the same function.
While this has not created any issues i still changed this to avoid
confusion and keep the usage of the variables more local.
2018-03-11 20:59:49 +01:00
ca11ef7fd3 Fix Collada: Avoid unnecessary and even wrong check on unavailable data
The function validateConstraints() potentially causes a null pointer
exception. I changed this so that the function returns a failure as soon
as the validation fails. This avoids falling into the null pointer trap.
2018-03-11 20:59:49 +01:00
2de0daa179 Cleanup Collada: Make sure index variables are not reused
The variables i and j have been declared before in the same function.
I changed the names to mi and mj to keep things clear.
2018-03-11 20:59:49 +01:00
86b1887ded Cleanup Collada: make sure float array is initialised
This is just to silence a compiler warning and keeping
the code clean. The actual code never uses uninitialised
array elements.
2018-03-11 20:59:49 +01:00
01c27faed0 Refactor Collada: combined 2 almost identical functions into one
The 2 methods add_bezt() and create_bezt() do almost the same.
I combined them both into add_bezt() and added the optional parameter
eBezTriple_Interpolation ipo
2018-03-11 20:59:48 +01:00
3eaa408cb3 Fix T54274, and rename option --window-borderless to --window-fullscreen 2018-03-11 12:26:43 +02:00
63483fe417 Cleanup: long lines 2018-03-11 15:50:25 +11:00
23ccf5767f Cycles: add roughness baking support, using squared roughness convention. 2018-03-10 18:37:33 +01:00
7613ffc944 Cycles: switch to squared roughness convention for all nodes.
This was already done for the Principled BSDF to be compatible with typical
baked roughness maps in PBR workflows.
2018-03-10 18:05:01 +01:00
8a76f8dac3 Code cleanup: fix compiler warning. 2018-03-10 06:51:52 +01:00
1f5c5fa189 Fix T54279: viewport update bug with volume meshes.
Meshes without vertex normals were not handled correctly.
2018-03-10 06:27:19 +01:00
3f2b88d195 Code refactor: reduce number of loops over meshes. 2018-03-10 06:27:19 +01:00
07d0a87b5c Fix T54278: volume artifacts with small density and color after recent changes. 2018-03-10 06:27:19 +01:00
50dde3d01a Fix T54269: saved EXR file files unreadable some editors in Blender.
Don't write the multichannel metadata when there is only a single layer,
and don't unnecessarily consider single layer images with Blender metadata
as multi layer.
2018-03-10 06:27:19 +01:00
d526b35ce2 Code cleanup: use spaces for aligned indentation. 2018-03-10 06:27:19 +01:00
db333d9ea4 Cycles: support arbitrary number of motion blur steps for objects. 2018-03-10 06:27:19 +01:00
78c2063685 Cycles: support arbitrary number of motion blur steps for cameras. 2018-03-10 06:27:19 +01:00
267d892326 Code refactor: motion blur cleanups, preparing for next commit. 2018-03-10 04:54:05 +01:00
6c4ddfc5d9 Code refactor: don't expose UpdateObjectTransformState in header. 2018-03-10 04:54:05 +01:00
b66efbecf4 Code refactor: make Transform always affine, dropping last row.
This save a little memory and copying in the kernel by storing only a 4x3
matrix instead of a 4x4 matrix. We already did this in a few places, and
those don't need to be special exceptions anymore now.
2018-03-10 04:54:05 +01:00
623141f339 Code refactor: add DecomposedTransform.
This is in preparation of making Transform affine only, and also gives us
a little extra type safety so we don't accidentally treat it as a regular
4x4 matrix.
2018-03-10 04:54:05 +01:00
516e82a900 Code refactor: add ProjectionTransform separate from regular Transform.
This is in preparation of making Transform affine only.
2018-03-10 04:54:04 +01:00
cd15d87bfc Code refactor: avoid motion transform copy, remove unused curved code.
The purpose of the previous code refactoring is to make the code more readable,
but combined with this change benchmarks also render about 2-3% faster with an
NVIDIA Titan Xp.
2018-03-10 04:54:04 +01:00
Stefan Werner
f3010e98c3 Code refactor: use KernelShader and KernelParticle instead of float arrays.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Stefan Werner
fa9175ff02 Code refactor: use KernelLight instead of float4 arrays.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Stefan Werner
f66ff4ee86 Code refactor: use KernelOject struct instead of float4 array.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Julian Eisel
41b38c5f75 Don't add "Report a Bug" button for official tracker to non-official add-ons
If no custom URL was set, add-ons would get a "Report a Bug" button opening
the default developer.blender.org bug tracker. Now we only add this default
button if the add-on is bundled and not installed by the user.
2018-03-09 21:22:24 +01:00
14e7ba0c8a Fix Pose Lib: pose is applied when selected bones don't overlap with pose
Premise: When pose bones are selected, applying a pose library should
only affect the selected bones.

This commit fixes a bug where the pose was also applied when there was
no overlap between the selected bones and the bones in the pose. For
example, applying a pose which contains only keyframes for the left
hand, while only right-hand bones are selected, would apply the pose
to the left hand anyway.

The code is now also slightly more efficient; the removed 'selcount'
counter was only used as a binary (i.e. zero or non-zero). It's now
stored as a bitflag instead.
2018-03-09 19:03:29 +01:00
40e62f271c FFmpeg: Add regression tests
Currently only covering handful of files from reports about wrong fps detected.

It will need D3083 applied first to get tests passed, also tests themselves
are to be committed to svn.

But there are some python code which needs to be reviewed, like blendfile
passed to run_blender().

Reviewers: sybren, mont29

Reviewed By: sybren, mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D3096
2018-03-09 10:33:20 +01:00
370a2d6917 Fix T53857: Incorrect framerate for videos imported from OBS
This is an issue with which value to trust: fps vs. tbr. They both cam be
somewhat broken. Currently the idea is:

- If file was saved with FFmpeg AND we are decoding with FFmpeg we trust tbr.
- If we are decoding with Libav we use fps (there does not seem to be tbr in
  Libav, unless i'm missing something).
- All other cases we use fps.

Seems to work all good for files from T53857, T54148 and T51153. Ideally we
would need to collect some amount of regression files to make further tweaks
more scientific.

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D3083
2018-03-09 10:32:17 +01:00
ecab7bef69 Cleanup: Rename view3d context set function
Use common prefix so adding related functions share the prefix.
2018-03-08 17:30:24 +11:00
28f86bf117 Cleanup: use edit/active objects from view context
Needed to implement multiple edit-objects.
2018-03-08 17:27:36 +11:00
cb8311fecf Cleanup: set the view-context once 2018-03-08 17:27:36 +11:00
5331581ea4 Cleanup: Use BKE_ prefix for all public functions exposed by the NLA module 2018-03-08 17:15:34 +13:00
7e2100e499 T54233: NLA "Push Down" discards Blend Mode, Extrapolation, and Influence
Each AnimData block has a set of Blend/Extrapolation/Influence settings
that can be used to control how the active action is blended with the
NLA stack. However, these settings were not getting copied over to the
newly created strips (as the push-down code existed long before these
settings were added).

This commit solves this in several ways:
* Active Action Blend/Extrapolation/Influence settings now get copied
  to the new strips when adding them to the NLA stack via Push Down.

  Note: This doesn't happen when there are no existing NLA tracks,
        as these settings don't get used in that case.

* Strip Influence will be copied across when inf < 1.0 (i.e. when a
  non-default value is used), to maintain the effect. To make this work,
  the influence value will get added as a keyframe to the strip's
  "Influence" Control FCurve.

  - See code comments for an alternative approach and why that was not chosen
  - Strip Time still doesn't get keyframes added automatically yet.

* To ensure the "extrapolation mode" settings don't get always overwritten,
  I've put in place a compromise: the extrapolation will only get changed
  if the chosen setting will cause problmes (i.e. hold forward & back -> hold forward
  if there are other tracks before it already).

Not safe for backporting to 2.79[x] stable releases.
2018-03-08 17:15:33 +13:00
fb70f9bf99 Fix crash if NLA strip with "Use Animated Influence" setting is enabled without the Influence Strip F-Curve existing 2018-03-08 17:15:33 +13:00
a5d63624de Cleanup: Fix invalid name prefix 2018-03-08 17:15:32 +13:00
596f33f801 Fix T54206: bevel and inset operations repeat did not remember offset.
Now repeating the operator will use the previously chosen offset, either with
the modal operator or typed in. The modal operator will still start at zero.
2018-03-07 22:53:22 +01:00
118fb9f1f7 EditMesh: pass object data to notifiers
Both were being passed in different parts of the code,
use object data for consistency.
2018-03-08 01:49:30 +11:00
737a5efff4 Cleanup: edit-mode undo API
Move function descriptions into the struct,
minor improvements to variable naming,
use convention of 'g_' prefix for static vars.
2018-03-07 14:00:02 +11:00
76122bc8f0 Cycles: Fix crash when building with no shading systems 2018-03-06 13:04:28 +01:00
ec904ed327 Cycles: Cleanup, indentation 2018-03-06 13:04:28 +01:00
8d572e8764 Cleanup: unused var 2018-03-06 22:42:32 +11:00
4d86a432da Utility to enter sculpt mode 2018-03-06 19:11:19 +11:00
b5b5260464 Fix T54234, add BLENDER_VERSION_CHAR to .plist 2018-03-06 02:36:29 +02:00
d9d3ed16a8 Fix T53206: Array modifier doesn't merge vgroups
Vertex group remapping utility function,
now shared between object join and array modifier cap-ends.

Weights which don't exist are removed.

D3092 by @Foaly
2018-03-06 09:57:41 +11:00
df267bd4c4 Sequencer: Expose read-only FPS property for movie-type strips
Main purpose is to make it possible to cover FPS detection with regression test.
But it might also be handy for some other scripters.

Thanks Campbell for review!
2018-03-05 15:01:23 +01:00
caa0b0fadf Fix T54204: Wrong selection on Clean Tracks (Motion Tracking)
A mistake in a fix for T53612.

Regression in 2.79a, candidate for 2.79b :S
2018-03-05 12:00:25 +01:00
63d8ccf9ff Fix T54225: Blur node stopped working when Map Range was fed with image
The issue was happening with fast Gaussian blur, and caused by NaN value pixels
in the input buffer.

Now made it so Map Range output does not produce NaN, by returning arbitrary
value of 0. Still better than NaN!
2018-03-05 11:44:42 +01:00
9593a62746 Cleanup: left wrong comment in 2018-03-05 17:03:18 +11:00
f3018322c0 Fix T53478, T53430: Sequencer cut edge case fails
Previous fix for T53430 caused T54200.

The edge case for soft & hard cuts weren't working,
where the strip used start/end-still & the frame was placed exactly on
the start/end of of the sequence content.

T54200 fixed the end-still case but broke hard-cuts for all other cases.

This fixes the case for soft/hard cuts with/without start/end-still.
2018-03-05 16:58:01 +11:00
327985e887 Revert "Fix T53430: Cut at the strip end fails w/ endstill"
This reverts commit 855799ecc1.

Caused T54200
2018-03-05 16:58:01 +11:00
807663742b Error passing context arg to marker menu
own mistake in 6981861fcf
2018-03-05 14:10:43 +11:00
3607b4eb52 Fix LLVM/OSL library detection on macOS to prefer own OSL libraries. 2018-03-04 07:40:21 +01:00
74f3fb746a Fix Clang compiler detection on macOS.
"AppleClang" was not properly detected here. Now make the compiler ID
test a bit less compact but consistent with other code.
2018-03-04 07:39:04 +01:00
dab20bd41f Fix T54211: OpenGL debug error message in texture draw mode.
Quite harmless and won't be a problem in 2.8.
2018-03-03 14:57:02 +01:00
94b99949eb Fix T54202: Cycles crash rendering empty mesh volume after recent optimization. 2018-03-02 23:10:27 +01:00
b6fe80ca19 Fix Cycle standalone build. 2018-03-02 19:56:22 +01:00
f76d49ed95 Depsgraph: Fix dependency cycle when ID prop drives ID property
Introduced explicit ID property node for driers in depsgraph,
so it is clear what is the input for driver, and what is the
output.

This also solved relations builder throwing lots of errors
due to ID property not being found.
2018-03-02 16:27:31 +01:00
411a781491 Depsgraph: Silence obviously noisy relations build errors
Those were happening for drivers which points to invalid drivers, and those
drivers will have their own dedicated error prints.
2018-03-02 15:51:44 +01:00
0fb55310b3 Depsgraph: Cleanup, use dedicated function to ensure node exists 2018-03-02 14:35:19 +01:00
cedc7676ac Depsgraph: Cleanup, function return value
Driver build result was never used, so no reason to return operation.
2018-03-02 14:12:33 +01:00
42d9280b8a Depsgraph: Fix cycle detector to handle closed loops
It was possible to have relations like A -> B -> C -> A (import thing is
that no other operations points into this cluster) which were not detected
or reported by dependency cycle solver.

Now this is solved by ensuring we don't leave unvisited nodes behind.
2018-03-02 12:30:58 +01:00
99bcfb825f Cleanup: Avoid double semi-colon 2018-03-02 11:26:07 +01:00
b5b34bc2c0 Tests: Avoid access globals from abstract base class
Delegate functionality to subclasses, assert when subclasses didn't do
job the are supposed to do.

Thanks Sybren for pointing to a proper solution.
2018-03-02 11:18:12 +01:00
f2a2d5492b Cycles: Fix building of OpenCL kernels after volume optimization commit
OpenCL is C based, so no support for operators.

Related commit: 7377d411b4
2018-03-02 04:53:13 -05:00
a9509a2f8a Maintain scaling ratio of non-free axes in Maintain Volume T48079 fix.
This is probably a better way to handle it: instead of totally
discarding scaling of non-free axes, keep the ratio between them.
Basically the logic of the constraint is now that it rescales the
object uniformly in the non-free axis plane in order to force the
total volume change to the desired value.
2018-03-02 11:01:49 +03:00
ff74357da0 Object Mode: move logic to 'object_modes.c'
Was mixed with edit-mode, centralize mode switching in a single file.

No functional changes.
2018-03-02 14:00:47 +11:00
7e4c23e4d7 FCurve: only calculate single axis length
Was calculating all 3
2018-03-02 12:45:25 +11:00
341ab45f7b Fix building w/o Python
Also minor cleanup.
2018-03-02 11:17:57 +11:00
ec76f38b09 Discard non-free axis scaling in Maintain Volume to improve 2.79 compat.
It seems the reason the old version of the constraint overcompensates
as reported in T48079 is to allow the constraint to work with uniform
scaling on all axes. However the way it did that actually _requires_
uniform scaling for the constraint to work correctly, and breaks if
only the free scaling axis is used to avoid redundant channels.

This version attempts to allow both by discarding scaling in the non-
free directions instead of applying the correction on top of it.
2018-03-01 20:46:59 +03:00
3a3dfd4e65 Python tests: Split re-usable test related functionality to a module
The idea is to avoid re-implementing this for an upcoming FFmpeg tests.
2018-03-01 17:44:35 +01:00
1178518a68 Refactor: Merge non-functional-change part of 'edit normals' 2017 GSoC.
This merges changes in internals, runtime-only of existing custom
normals code, which make sense as of themselves, and will make diff of
soc branch easier/lighter to review.

In the details, it mostly changes two things:

* Now, smooth fans (aka MLoopNorSpaceArray) can store either loop
indices, or pointers to BMLoop themselves. This makes sense since in
BMesh, it's relatively easy to get index from a BMElement, but nearly
impracticable to go the other way around.

* First change enforces another, now we cannot rely anymore on `loops`
being NULL in MLoopNorSpace to detect single-loop fans, so we instead
store that info in a new flag.

Again, these are expected to be totally non-functional changes.
2018-03-01 16:54:21 +01:00
7377d411b4 Cycles volume: fast empty space optimization by generating a tight mesh
around the volume.

We generate a tight mesh around the active voxels of the volume in order
to effectively skip empty space, and start volume ray marching as close
to interesting volume data as possible. See code comments for details on
how the mesh generation algorithm works.

This gives up to 2x speedups in some scenes.

Reviewed by: brecht, dingto

Reviewers: #cycles

Subscribers: lvxejay, jtheninja, brecht

Differential Revision: https://developer.blender.org/D3038
2018-03-01 11:54:01 +01:00
172614fb7d GPU_select: remove unused finalize function
Changed 2.8x code so this is no longer needed.
2018-03-01 16:43:45 +11:00
7f86afec9d Cycles: don't count volume boundaries as transparent bounces.
This is more important now that we will have tigther volume bounds that
we hit multiple times. It also avoids some noise due to RR previously
affecting these surfaces, which shouldn't have been the case and should
eventually be fixed for transparent BSDFs as well.

For non-volume scenes I found no performance impact on NVIDIA or AMD.
For volume scenes the noise decrease and fixed artifacts are worth the
little extra render time, when there is any.
2018-03-01 01:21:29 +01:00
03d1070378 Cycles: change principled BSDF default distribution and SSS.
* Use a subsurface color equal to the base color, and give the subsurface
  radius skin like values by default. This is how the parameter should
  typically be used.
* Use GGX by default, multiscatter GGX is still quite noisy and has some
  fireflies so let's keep it optional for now.
2018-02-28 21:31:28 +01:00
8cc7f48581 Cycles: principled absorption color now has more effect at lower values. 2018-02-28 20:11:53 +01:00
4762c099d7 Fix T52685, part II: Add option to strip numbers from flipped bone names again.
While doing so with Bone_R.001, Bone_R.003, Bone_R.003 etc. is doomed to
issues, doing that on duplicates of actually correctly named bones can
be handy, and safe.

So adding back as an option (was removed in rB702bc5ba26d5).
2018-02-28 17:13:31 +01:00
cee66b8cc0 Fix T52685: Flip names for bones its not working.
Flip names operator changed in rB702bc5ba26d5, to some sensible
behavior. But this breaks common workflow of 'duplicate part of the
bones, scale-mirror new ones, and flip their names'.

So now, instead of doing this in two steps, trying to guesstimate which
bones should get which name, just add option to flip names to duplicate
operator itself. Simpler, safer, and much, much more consitent behavior
and predictable results.
2018-02-28 16:59:32 +01:00
56ea42efa1 Radial control: Skip operator properties from being saved
This solves issue with tweaking brush size when interleaving particle edit
and texture paint modes. The issue was caused by texture paing setting more
operator properties then it's done for particle edit mode, which made window
manager to use saved proeprties for the "missing" ones.

Don't see any reason why we would want to save any of those properties.

This is a regression since rB83b60dac57a1.
2018-02-28 16:14:35 +01:00
a363324f7f Collada: Make EvaluationContext const as its only used for reading here 2018-02-28 16:05:29 +01:00
91c3cfbb6f collada: call from operator to Collada exporter/importer now uses structures instead of passing many parameters 2018-02-28 16:05:29 +01:00
01f732d97b Collada: Moved structure definitions for export settings to the exportSettings.h Also make typedefs for import/export structures. 2018-02-28 16:05:28 +01:00
8b8e16dc2c De-duplicate tool settings copy and make tool settings freeing reusable 2018-02-28 14:52:17 +01:00
e7aca5bd3c Null pointer check exiting sculpt mode
Needed for 2.8x, harmless here.
2018-02-28 23:23:48 +11:00
8a7eb6c4c1 Update CUEW to latest version
Some Linux distribution have only libcuda.so.1, not libcuda.so.
2018-02-28 03:03:12 +01:00
7990105407 Code cleanup: fix a few compiler warnings. 2018-02-28 03:03:07 +01:00
6bd53cb541 Cleanup: comment for depth picking code, const args
Note that setting `glDepthFunc` isn't important,
since 2.8 branch changes this value it might seem like an error
however it's harmless in this case - so better make note of this.
2018-02-28 11:47:54 +11:00
6addaf7393 Cleanup: use 'uint' for GPU_select 2018-02-28 11:37:39 +11:00
2eb94be750 Code cleanup: refactor Cycles image metadata retrieval to use a struct. 2018-02-27 23:42:30 +01:00
450be3b226 Collada: Added tests for Animation export 2018-02-27 20:41:34 +01:00
05b5958a7a Collada: Remove obsolete code 2018-02-27 17:08:40 +01:00
d1f0bdd337 fix: Collada Matrixdata Importer tried to fix rotations where nothing was to fix. The matrixdata import is now only doing a matrix decompose and then pplies the decomposed values to 3 trans-, 3 scale- and 4 rot-curves) 2018-02-27 17:02:52 +01:00
148e2ace61 Collada: removed unnecessary dup[licate matrix conversion in matrix data exporter 2018-02-27 17:02:52 +01:00
0ea110f4ea Collada exporter: Replaced numbers 0/1 by boolean values fasle/true for better reading 2018-02-27 17:02:52 +01:00
91f3cfec10 Collada Shape key export can create huge datafiles and may need some optimization. Disable export by default, user can still enable on demand 2018-02-27 17:02:52 +01:00
20c5131384 Collada enable Export of animation data by default 2018-02-27 17:02:52 +01:00
6aadd61bd8 Cleanup: remove unused duplicate code 2018-02-27 22:02:18 +11:00
26f4ce4a76 Collada: Remove unused vector of flaot[4][4] values
Was in fact causing issues on macOS, something to do with
a destructor.
2018-02-27 11:14:55 +01:00
2026179bb2 Collada: Use floating point version of abs()
Avoids implicit cast of float to int.
2018-02-27 11:14:17 +01:00
a7ef312611 GPU_select: correction to select-pick-finalize
Would run twice, harmless at the moment but could cause issues later.
2018-02-27 20:44:12 +11:00
4de50d7572 GPU_select: utility function to finalize selection
Needed for depth picking in 2.8
2018-02-27 20:16:53 +11:00
50b95211bf Fix T54106: Save blend ignores 'check_existing' 2018-02-27 13:33:59 +11:00
b5f0e8e1a1 Collada: removed unused variables. fixed incompatible format in console output (AnimationExporter.cpp) 2018-02-26 23:37:27 +01:00
7dd0e36dc4 simplified collada integration in Blender. made functions mostly similar with blender2.8 2018-02-26 17:18:31 +01:00
a024da55af Adding support for Matrix Transformation export
The exporter does export matrix data (4*4 Transformation matrix) only for Skeletal animation. For object animation only exporting to trans/rot/loc is implemented.

This task implements Matrix export also for simple Object animation.

Differential Revision: https://developer.blender.org/D3082
2018-02-26 17:16:56 +01:00
5f9657316e collada: fix typo in if statement 2018-02-26 12:55:54 +01:00
57b378b046 as discussed on IRC this definition seems to be not necessary 2018-02-26 12:45:37 +01:00
8e826caf5e optimized the output of the collada test script for better reading 2018-02-26 12:09:48 +01:00
c52df4fc7c Cleanup: typos
D3081 by @rjg, with others.
2018-02-26 19:58:31 +11:00
f1bd96a9ab Revert "changing collada parameters"
This reverts commit d91f2ac37a.

This change makes scene.collada_export() meaningless
(ignoring the scene the method is being run on).
2018-02-26 19:35:45 +11:00
3fd5a4047c Presets: remove double underscore in preset names 2018-02-26 19:21:02 +11:00
d416e56e70 Fix T54029: Wrong preset name display in win32 2018-02-26 19:05:01 +11:00
b1414b7322 Cleanup: use function for clearing bmesh tags 2018-02-26 14:05:58 +11:00
Hugo Sales
5d54d6b479 Fix T50132: UV sticky mode is not respected with border/circle/lasso select.
Differential Revision: https://developer.blender.org/D3074
2018-02-25 22:28:54 +01:00
ec27281812 Fix incorrect text clipping on node link button in material properties. 2018-02-25 19:57:40 +01:00
15dfd866db Fix Player tm, a lifes job 2018-02-25 10:35:08 +01:00
d91f2ac37a changing collada parameters
Differential Revision: https://developer.blender.org/D3080
2018-02-24 22:51:04 +01:00
0a1434ed86 Fix a whitespace slipped in 2018-02-24 18:07:05 +01:00
c23b77fe46 Fix Plyer tm 2018-02-24 17:30:37 +01:00
dd7b9a362d T45687: Rework the Export/Import of Animations
This started with a fix for an animated Object Hierarchy. Then i decided to cleanup and optimize a bit. But at the end this has become a more or less full rewrite of the Animation Exporter. All of this happened in a separate local branch and i have retained all my local commits to better see what i have done.

Brief description:

* I fixed a few issues with exporting keyframed animations of object hierarchies where the objects have parent inverse matrices which differ from the Identity matrix.
* I added the option to export sampled animations with a user defined sampling rate (new user interface option)
* I briefly tested Object Animations and Rig Animations.

What is still needed:

* Cleanup the code
* Optimize the user interface
* Do the Documentation

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D3070
2018-02-24 15:55:27 +01:00
4403ca80bd Smoke: expose empty space clipping property to the UI.
This is used to determine which voxels are to be considered empty space.

Previously it was hardcoded for converting dense grids to OpenVDB grids
to reduce disk space usage.

This value is also useful for rendering engines to know, i.e. to
optimize ray marching.
2018-02-24 13:37:58 +01:00
6d8a4c10b6 OpenVDB : use underscores instead of spaces in grid names.
Some other software cannot handle grid names with spaces in them. We still check for names with spaces so as to not break old
files.

This fixes T53802.
2018-02-24 13:37:08 +01:00
0aec2dcd3a Cycles: add Principled Volume shader.
Similar to the Principled BSDF, this should make it easier to set up volume
materials. Smoke and fire can be rendererd with just a single principled
volume node, the appropriate attributes will be used when available. The node
also works for simpler homogeneous volumes like water or mist.

Differential Revision: https://developer.blender.org/D3033
2018-02-23 18:57:58 +01:00
acd619d7c9 Cycles: change smoke color grid to not include density multiplied in.
This breaks backwards compatibility some, making smoke colors brighters
than before. But it is also more correct this way.
2018-02-23 18:57:58 +01:00
a963c7d48d Code refactor: improve attribute handling for optional volume attributes.
A volume shader should be able to request attributes, and still be rendered
as homogeneous if no volume attributes are available for the object.
2018-02-23 18:57:58 +01:00
4448ed6c5e Smoke: change default flame temperatures to match OpenGL preview. 2018-02-23 18:57:58 +01:00
04896d223d Smoke: add temperature grid, with values 0..1 corresponding to 0..1000K. 2018-02-23 18:57:58 +01:00
15fb8ad6ae Nodes: left align text for color and string sockets, same as other types. 2018-02-23 18:57:58 +01:00
dceb8d37c2 Fix T54137: OpenEXR files with long red/green/blue channel names not loading correctly. 2018-02-23 14:34:27 +01:00
44d45e1af4 Buildbot: Enable Volta deviced CUDA binaries 2018-02-23 14:24:59 +01:00
e24dee435e Buildbot: Remove master configuration files
Those are stored in blender-buildbot repository now, so having them in
Blender only causes extra work to keep files in sync.
2018-02-23 12:37:05 +01:00
07f05e294a Buildbot: Disable cuda hack for macOS 2018-02-23 10:55:26 +01:00
6618852b7f WM: Add WM_menutype_poll function
Wraps menutype poll, no functional changes.
2018-02-23 17:02:03 +11:00
f36c803e55 WM: add WM_keymap_poll function
Wrapps keymap poll, no functional changes.
2018-02-23 12:59:55 +11:00
dd77e45151 Cleanup: header guards & style 2018-02-23 12:59:55 +11:00
71e00252f0 Depsgraph: Fix mistake in previous refactor commit 2018-02-22 16:30:47 +01:00
5f857378af Cleanup: Fix const pointers mess in previous commit. 2018-02-22 15:41:41 +01:00
0eee776e45 Fix (unreported) meshes changing shading when creating empty clnors data.
When you were using autosmooth to generate some custom normals, and
created empty custom loop normal data, you would go back to an 'all
smooth' shading, cancelling some sharp edges generated by the mesh's
smooth threshold.

Now we will first tag such edges as sharp, such that shading remains the
same. This is not crucial in current master, but it is for clnors
editing gsoc branch!
2018-02-22 15:20:39 +01:00
4b068c4d6f Cleanup: clnor code: more 'do not use same varname for two different things'. 2018-02-22 15:20:39 +01:00
e83b9cde1a Fix T54129: Moving keyframes on top of other keyframes, removes both keyframes
Regression caused by earlier commits to improve the automerge behaviour.
In this case, the problems only occurred when moving a selected keyframe
forwards in time to overlap an unselected keyframe.
2018-02-23 03:13:56 +13:00
00ba28e9f8 Fix: Don't ignore duplicate channels when doing border/circle/lasso select
While it is necessary to ignore duplicates when doing Deselect/Column Select
(where double-updates may result in nothing being selected), for borderselect,
not including the duplicates meant that sometimes, nothing would happen
if you were trying to borderselect keyframes originating from hidden channels.

This was first noticed in the greasepencil-object branch, but affects all
animation channel types.
2018-02-23 02:41:05 +13:00
86ad5cacfa Depsgraph: Remove unused argument 2018-02-22 14:27:29 +01:00
3d1c0afe0e Depsgraph: Remove unused bmain from modifiers relations update context 2018-02-22 14:07:08 +01:00
62b3522da2 Fix compilation error with legacy depsgraph disabled 2018-02-22 13:05:38 +01:00
df04520602 Depsgraph: Wrap all arguments foe modifiers relations update into a struct
Makes it easier to add or remove fields needed to update relations.
2018-02-22 12:54:06 +01:00
93072e44d1 Depsgraph: Replace LIB_TAG_DOIT with hash lookup
This allows us to:

- Not mock around with tags stored in a global space,
    and not to iterate over all datablocks in the database
    to clear the tags.

- Properly deal with datablocks which might not be in main database.

    While it sounds crazy, it might be handy when dealing with preview,
    or some partial scene updates, such as motion paths.

- Avoids majority of places where depsgraph construction needed bmain.

    This is something what could help in blender2.8 branch.

From tests with production file here did not see any measurable slowdown.

Hopefully, there is no functional changes :)
2018-02-22 11:03:39 +01:00
76953a6ebd Depsgraph: Add utility class to keep track of handled ID datablocks
Currently unused, actual logic change will come in the next commit.
2018-02-22 10:58:33 +01:00
51483bd49f Depsgraph: Use proper debug print flags check
Was printing some tagging/evaluation prints when only building
messages were requested.
2018-02-22 10:40:18 +01:00
9729726aa8 Depsgraph: Report graph construction time when run with --debug-depsgraph-build 2018-02-22 10:35:04 +01:00
632d66eb89 Depsgraph: Cleanup, reduce indentation level 2018-02-22 10:31:47 +01:00
5d5c6bb5ef Cycles: add Russian roulette termination for volume multiple scattering.
This mainly helps with dense volumes, rendering can be 30% faster with
little noise increase in such scenes.
2018-02-22 00:55:32 +01:00
2d81758aa6 Cycles: better path termination for transparency.
We now continue transparent paths after diffuse/glossy/transmission/volume
bounces are exceeded. This avoids unexpected boundaries in volumes with
transparent boundaries. It is also required for MIS to work correctly with
transparent surfaces, as we also continue through these in shadow rays.

The main visible changes is that volumes will now be lit by the background
even at volume bounces 0, same as surfaces.

Fixes T53914 and T54103.
2018-02-22 00:55:32 +01:00
84e92f9b3c Cycles: make principled BSDF node wider in the node editor by default. 2018-02-22 00:55:32 +01:00
6a48a9dc6e Code cleanup: fix incorrect socket names in hair and particle info nodes. 2018-02-22 00:55:11 +01:00
9a5be1fba9 Fix incorrect OSL raytype bits and add some comments. 2018-02-21 17:56:26 +01:00
606bc5f301 Fix T54105: random walk SSS missing in branched indirect paths.
Unify the path and branched path indirect SSS code. No performance impact
found on CUDA, for AMD split kernel the extra code was already there.
2018-02-21 17:56:26 +01:00
5cc1d5fe17 Fix T54107: bevel shader + normal map gives wrong result. 2018-02-21 17:56:26 +01:00
7de387f4b5 Cleanup: Don't perform borderselect on channels that aren't visible 2018-02-22 01:46:12 +13:00
cab608066a Fix: Return back to conventional way of averaging points for keyframe de-dup
The other approach was causing too much error in some cases (e.g. favouring
the lower-valued keyframes). This fix should make the resulting curves less
bumpy/jagged.
2018-02-22 01:46:11 +13:00
915d120c36 Fix: Forgot to recalculate handles after deleting keyframes 2018-02-22 01:46:11 +13:00
bba1120116 Fix: Don't average keyframe values if FCurve can only have int/discrete values
This is to prevent problems with integer/enum properties getting invalid
values set.
2018-02-22 01:46:10 +13:00
dd75211d83 Cleanup: Delete debugging code and the old version of the automerge code 2018-02-22 01:46:10 +13:00
f2cdb1c7cc Tweak/Fix for T54106 - Moving multiple selected keyframes on top of an unselected one would not merge the keys
This commit removes an earlier attempt at optimising the lookups
for duplicates of a particular tRetainedKeyframe once we'd already
deleted all the selected copies. The problem was that now, instead
of getting rid of the unselected keys (i.e. the basic function here),
we were only getting rid of the selected duplicates.

With this fix, unselected keyframes will now get removed (as expected)
again. However, we currently don't take their values into account
when merging keyframes, since it is assumed that we don't care so much
about their values when overriding.
2018-02-22 01:46:09 +13:00
63da3b79ed Minor Optimisation: Terminate early if we've passed the insertion point for tRetainedKeyframes 2018-02-22 01:46:08 +13:00
ac717928ad Feature Request T54106: When scaling keyframes, merge (by-averaging) selected keys
that end up on the same frame

Currently, when scaling keyframes in the Dopesheet, if multiple
selected keyframes end up on the same frame post-scaling, they
would not get removed by the "Automerge" setting that normally
removes duplicates on the same frame.

This commit changes the behaviour so that when multiple selected
keyframes end up on the same frame, instead of keeping all these
around on the same frame (e.g. resulting in a column of keyframes
on different values), we will instead merge them into a single
keyframe (by averaging the values). This should result in a
smoother F-Curve with fewer "stair-steps" that need to be carefully
cleaned out afterwards.

Requested by @hjalti
2018-02-22 01:46:07 +13:00
6b31a14ff7 bezt_add_to_cfra_elem() - Use same keyframe equality test as in other places
This shouldn't affect anything currently, as this function doesn't appear
to get used anywhere.
2018-02-22 01:46:07 +13:00
4d966aa19c Fix T54065: NLA-Strip Control Curves would get disabled when name-based-filtering is enabled
This bug took a while to track down. In the test file with this report,
the Nla-Strip Control Curve for strip time would get disabled if you
changed the NLA Editor to a second Graph Editor instance.

It turns out that because this second Graph Editor would have the
"filter fcurves by name" option enabled, this would trigger a lookup
of the referenced property's name (in order to test whether it matched
the filtering criteria). However, since that filtering code was written
before the introduction of these curves, it still assumed that the names
for these Control Curves should be handled the same as for standard FCurves.
Unfortunately, that doesn't work, as the property lookups fail if the standard
method is used - when the lookups fail, the F-Curves get tagged as being
invalid/disabled (and need to be reset using the "Revive Disabled FCurves"
operator).

Note: The changes in this patch look complicated, as I've had to shuffle
a bit of code around so that the name-filtering check can have access to
the additional info it needs. In the process, I've also removed the earlier
(hacky) approach where the control curves were getting added to a temp
buffer to get changed from normal FCurves to special ANIMTYPE_NLACURVES.
2018-02-22 01:46:06 +13:00
f7354119cc Fix more missing ID remapping in animation editor callbacks
Applying the same fixes as introduced in 98d797b67c
this time, for the Graph and NLA editors
2018-02-22 01:46:05 +13:00
2945831630 Depsgraph: Fix fake dependency cycle with chained IK solvers with tip excluded
Not sure why we need a relation from solver to a tip local transform, this
will be handled via parent relation.

Fixes remaining dependency cycles reported in T54083.
2018-02-21 12:04:28 +01:00
74ee98f642 Depsgraph: Fix dependency when constraint influence drives some other constraint
It is not possible to address transform at particular position of constraint
stack, and when constraint is being addressed is usually from driver variable.

This fixes some of dependency cycles reported in T54083.
2018-02-21 11:13:25 +01:00
fe1a508e55 Depsgraph: Split debug flags
Now it's possible to have debug messages for following things:

- Graph construction
- Graph evaluation
- Graph tagging
2018-02-21 10:44:36 +01:00
2e73efa9b8 Depsgraph: Fix crash using --debug-depsgraph and --debug-depsgraph-no-threads
Was accessing past the array boundaries.

Should be safe for 2.79a.
2018-02-21 10:42:22 +01:00
b1946e7f7a Depsgraph: Report overall number of cycles detected
Handy to quickly see if a fix fixed any of the cycles in a real rig,
or whether it's introduced new ones.
2018-02-21 10:11:43 +01:00
6535f668b4 VSE: skip non image/movie w/ proxy dir storage
This would use uninitialized filename variable,
looked into supporting this however generating proxies currently only
works for movies.
2018-02-21 18:33:48 +11:00
35f225b44c Cleanup: split normals: use different varnames for angle and its cosine.
Using same name for two different things is not the best idea ever...
2018-02-20 13:03:10 +01:00
87e37224c7 Fix T54069: Vertex groups for hair length is wrong in some cases
This is a regression in rB4f1c0a1 which only allowed cutting haior at the
second segment only, while there is nothing wrong with cutting hair at the
first segmewnt.
2018-02-20 10:47:01 +01:00
529cc364f4 Fix T54096: Subdivision Surface + Boolean Modifiers + Transform = crash
Don't use dm->get*Array for DM you don't own. This call can allocate temporary
CD layer, which is not thread safe at all.

Also removed hard-coded logic around CDDM check. new functions will do same
logic, but are mode DM-type-=independent.
2018-02-19 16:16:56 +01:00
dc65a6f63b Fix T53032: Image sequence works bad with Displace modifier
We shouldn't mix image pool acuisition with and without user provided,
the fact that internally image.c uses last frame from Image datablock
confuses the logic.
2018-02-19 14:33:48 +01:00
0e4829eb05 Cleanup: rename SequenceEditor instance to 'ed'
Name 'sequencer' & 'sequence' are too similar.
2018-02-19 22:32:41 +11:00
860939ccc2 Cleanup: remove BMeshToMeshParams.calc_tessface
This wasn't used, tessface is being phased out.
Caller can run explicitly if needed.
2018-02-19 17:41:37 +11:00
05f3e245a8 Fix T54098: Crash existing /w dyntopo sculpt
Optionally don't remap indices for objects.

Checking all objects parent's would reference a freed pointer
while freeing all objects.

In the case of dynamic topology there is no use in keeping track
of hook/vertex-parent indices.

Also disable this when creating meshes for undo storage
since adding an undo step shouldn't be modifying other objects.
2018-02-19 17:34:30 +11:00
7f65ab86e5 Cleanup: sync vertex-paint and sculpt from 2.8
Sync API changes from 2.8 to master.
2018-02-19 15:54:06 +11:00
1beb6b43c1 Fix T54089: missing GLSL material draw update when changing object pass index. 2018-02-18 19:28:46 +01:00
7ff3cd2693 Cleanup: group BLI_ghash_utils.c API in BLU_ghash.h 2018-02-18 22:12:27 +11:00
41ad08f3c3 Cleanup: split GHash helpers from implementation 2018-02-18 21:44:56 +11:00
deacb3d6b8 Cleanup: add 2d suffix to BLI files
Some of these API's can have 3D versions, explicitly name them 2D.
2018-02-18 21:27:33 +11:00
fee4b646c4 Cycles: tweak CUDA messages and avoid build errors with existing sm_2x configs. 2018-02-18 00:53:25 +01:00
1dcd7db73d Code cleanup: remove some more unused code after recent CUDA changes. 2018-02-18 00:53:03 +01:00
9e717c0495 Cycles: Remove Fermi texture code.
This should be the last Fermi removal commit, unless I missed something.
It's been a pleasure Fermi!
2018-02-17 22:56:58 +01:00
e1ef902058 Cycles: Remove fermi related defines from the code.
Did not touch Texture related defines, that comes next.
2018-02-17 22:19:54 +01:00
2eaf90b305 Cycles: Remove Fermi support from CMake and update runtime checks in device_cuda.cpp.
Fermi code in Cycles kernel and texture system are coming next.
2018-02-17 16:15:07 +01:00
75396edb31 Buildbot: Disable Cycles CUDA support on 32bit, and stop building sm_2x. 2018-02-17 15:49:37 +01:00
5bc2c17161 fix:T50079 collada matrix and blender matrix are transposed. This was not regarded by the animation importer, so it was creating very odd results 2018-02-16 16:58:20 +01:00
e1a686e444 fix: limit precision also for animation matrixes if the limit option is set (gives nicer output for inspection) 2018-02-16 16:55:20 +01:00
7fdf720fb1 Fix rotation issues due to matrix to quaternion ambiguities
Reviewers: mont29

Reviewed By: mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D3066
2018-02-16 15:19:35 +01:00
233a886ceb Code cleanup: deduplicate code for running Python scripts outside Blender. 2018-02-16 12:51:49 +01:00
3d2d58391a Tests: add OpenGL UI drawing tests.
This reuses the Cycles regression test code to also work for OpenGL UI drawing.
We launch Blender with a bunch of .blend files, take a screenshot and compare
it with a reference screenshot, and generate a HMTL report showing the failed
tests and their differences.

For Cycles we keep small reference renders to compare to in svn, but for OpenGL
developers currently have to generate the references manually. How to use:

* WITH_OPENGL_DRAW_TESTS=ON in CMake
* BLENDER_TEST_UPDATE=1 ctest -R opengl_draw
* .. make code changes ..
* ctest -R opengl_draw
* open build_dir/tests/opengl_draw/report.html

Differential Revision: https://developer.blender.org/D3064
2018-02-16 12:51:49 +01:00
0f23f618f3 Tests: split off render report test code from Cycles tests.
This renames test environment variables from CYCLESTEST_* to BLENDER_TEST_*.

Differential Revision: https://developer.blender.org/D3064
2018-02-16 12:51:49 +01:00
8dfe9ef4e3 Fix bplayer (c) 2018-02-16 10:42:43 +01:00
451d5cef0f Fix part II of T53977: Severe problem with multiple instances of a library (save and reload).
Once 'losing lib' issue is fixed (in previous commit), we have new issue
that this could lead to several copies of the same linked data-block in
.blend file. Which is not good. At all.

So had to add a GHash-based check in libraries reading code to ensure we
only load a same ID from a same lib once.
2018-02-16 10:34:00 +01:00
8165234b46 Fix part I of T53977: Severe problem with multiple instances of a library (save and reload).
The issue was that when a same lib was found several times in loaded
.blend, we'd only keep the first occurence. But since Blender expects
next data-blocks to belong to last found library, we could actually
be adding data-blocks assigned to copies of the duplicated lib to
another, totally unrelated lib.

Those data-blocks were then obviously not found when actually loading
libs content, and lost.

Note that this only fix one part of the issue, current code can
generate several copies of same linked data-block now, will fix in
another commit.
2018-02-16 10:34:00 +01:00
e03f335b1d Code cleanup: simplify switch statement, ensure we catch missing enums. 2018-02-15 18:13:07 +01:00
b1ee10aa1b Fix T54073: crash and uninitialized memory in Cycles displacement hashing. 2018-02-15 18:00:55 +01:00
ad37ccbc32 Fix crash reading deg_point_cache_transform.blend test, saved with 2.8.
In general 2.8 files may not be readable in master, but might as well fix
this case so all the lib/tests can be opened still.
2018-02-15 18:00:55 +01:00
4fd3f8db9d Cleanup: Remove debug-only code 2018-02-15 17:57:51 +01:00
b879502da4 Fix T54076: MCE in Graph mode - clip.graph_select_border does not work by header menu
While the script should be using INVOKE_PREVIEW for operators in clip view,
window manager was lacking some switch statements.

Thanks Brecht fore review!
2018-02-15 16:58:56 +01:00
2aef87bfae Cleanup: rename BLI_thread.h API
- Use BLI_threadpool_ prefix for (deprecated)
  thread/listbase API.
- Use BLI_thread as prefix for other functions.

See P614 to apply instead of manually resolving conflicts.
2018-02-16 01:13:46 +11:00
ccdacf1c9b Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
  (hint this isn't a simple getter).

See P611 to apply instead of manually resolving conflicts.
2018-02-15 23:39:08 +11:00
4da6c49613 Cleanup: Style, braces with macros
See https://wiki.blender.org/index.php/Dev:Doc/Code_Style#Braces_with_Macros
2018-02-15 12:41:35 +01:00
c0bbc4abf5 Cleanup: Remove BLI_ prefix from listbase macro
This is kind of doesn't matter where macro itself is defined.

We should stick to the following:

- If some macro is actually more an inline function, follow regular
  function name conventions.
- If macro is a macro, type it in capitals. Use module prefix if that
  helps readability or it if helps avoiding accidents.
2018-02-15 12:38:21 +01:00
6d4022f619 Simple hair children: Make twist affected by texture
This completes twist feature, which is now possible to also control by
texture. Since textures can not easily contain negative values as well,
same trick with 0.5 neutral as vertex groups is used.

All in all, this twist features allows to do following things.

Original hair:

{F2287535}

Hair with scientifically calculated twist value of 0.5:

{F2287540}

And we can also twist braids in opposite directions dependent on left/right
side:

{F2287548}
2018-02-15 12:24:48 +01:00
5ce6ca0536 Fix T54078: Adding subsurf prior to particle system breaks simple children vgroups and textures
cpa->num points to a face index on BASE mesh, but get_child_modifier_parameters()
expects index on a FINAL dm. So wrong index was used here.
2018-02-15 11:53:58 +01:00
67cec97387 Simple hair children: Make twist affected by vertex group
The idea is to give a control over direction of twist, and maybe amount of
twist as well. More concrete example: make braids on left and right side of
character head to be twisting opposite directions.

Now, tricky part: we need some negative values to flip direction, but weights
can not be negative. So we use same trick as displacement map and tangent normal
maps, where 0.5 is neutral, values below 0.5 are considered negative and values
above 0.5 are considered positive.
2018-02-15 11:53:58 +01:00
ffde74a878 Simple hair children: Initial implementation of twist control
It allows to have children hair to be twisted around parent curve, which is
quite an essential feature when creating hair braids.

There are currently two controls:

- Number of turns around parent children.
- Influence curve, which allows to modify "twistness" along the strand.
2018-02-15 11:53:58 +01:00
bb3efe6127 Blenlib: Assert when attempting to rotate point around vector and store result in the point
This isn't supported since there are subsequent reads to all point coordinates
after modification started.

Probably we need to create a temp copy of point, but that's like extra CPU
ticks.
2018-02-15 11:53:57 +01:00
ff82968a6c Particles: Wrap insane amount of arguments to child modifier evaluation
Use single structure. It seems we will need to pass more information soon,
so better to do it via the structure.
2018-02-15 11:53:57 +01:00
58ba89b5be Fix T54075: Align Objects fails w/ empty mesh 2018-02-15 11:33:47 +11:00
70f1b8cc40 Cleanup: style 2018-02-15 11:13:54 +11:00
56fa48969e Fix T54072: Crash splitting edges 2018-02-15 11:05:37 +11:00
b5fe00d1ac Cycles: restore Particle Info Index for now, keep it next to Random.
It seems to be useful still in cases where the particle are distributed in
a particular order or pattern, to colorize them along with that. This isn't
really well defined, but might as well avoid breaking backwards compatibility
for now.
2018-02-14 21:45:57 +01:00
f6107af4cf Cycles: change Index output of Hair and Particle Info to Random, in 0..1 range.
These are used for randomization, so it's convenient if the index is already
hashed and consistent with the Object Info node.
2018-02-14 14:55:46 +01:00
c8e661706f Particles: Avoid multiple function declarations in multiple places
This makes it really hard to spot errors when function signature changes.
2018-02-14 11:52:58 +01:00
8003059646 Particles: Cleanup, remove trailign whitespace 2018-02-14 11:46:33 +01:00
1c34825b4f Hair child: Use clamp function to clamp curve evaluation
Avoids redundant calls to the curve evaluation.
2018-02-14 11:42:09 +01:00
c09e4ae08a Math utils: Add clamping functions 2018-02-14 11:21:27 +01:00
a966852362 CMake: Expose Cycles devices support as CMake option
Handy to disable GPU based devices when it's needed to run Valgrind.
2018-02-14 10:32:32 +01:00
c341dd0585 CMake: Fix cimpilation error when CUDA dynload is disabled but toolkit is not installed 2018-02-14 10:20:26 +01:00
b48815a9b7 Cleanup: use prefix for tests
Allows for running all `bmesh_*` or `object_*` tests.
2018-02-14 16:02:21 +11:00
9fb1f9c5cd Add ED_object_editmode_exit_ex
Allow exiting editmode from non-active scene.
2018-02-14 00:39:39 +11:00
37f65e9dc4 Cycles: Implement index output for hair node
This is like the only way to add variety to hair which is created
using simple children. Used here for the hair.

Maybe not ideal, but the time will show.
2018-02-13 14:20:47 +01:00
d640ce40aa (Nodes) Display image name if any in the Cycles Image and Environment Texture node title 2018-02-13 00:58:26 +01:00
fc99eed5be Fix random walk SSS issues with different base and subsurface color.
Burley SSS uses a bit of strange thing where the albedo and closure weight are
different, which makes the subsurface color act a bit like a subsurface radius
indirectly by the way the Burley SSS profile works.

This can't work for random walk SSS though, and it's not clear to me that this
is actually a good idea since it's really the subsurface radius that is supposed
to control this. For now I'll leave Burley SSS working the same to not break
backwards compatibility.
2018-02-12 21:08:59 +01:00
b37dff9239 Fix part of T53080: don't use current scene world for icon previews.
This can be very slow if it contains a big texture, and it's not
necessarily setup in a useful way anyway, and materials can be used
in multiple scenes.
2018-02-12 20:39:40 +01:00
37ce77ba06 Buildbot: Remove usage of deprecated chroot 2018-02-12 17:56:19 +01:00
ce8b5bd90d Add boolean regression test. 2018-02-12 07:23:50 -05:00
657396be08 Error in last commit, disable cycles when not enabled
Would only disable when loading old preferences.
2018-02-12 17:56:14 +11:00
53431a560e Disable cycles when WITH_CYCLES=OFF 2018-02-12 17:37:39 +11:00
fc97e120f6 BKE_addon: new/free/ensure functions 2018-02-12 17:24:18 +11:00
a6968e87f1 Cycles: add random walk subsurface scattering to Principled BSDF.
Differential Revision: https://developer.blender.org/D3054
2018-02-09 19:58:42 +01:00
0df9b2c715 Cycles: random walk subsurface scattering.
It is basically brute force volume scattering within the mesh, but part
of the SSS code for faster performance. The main difference with actual
volume scattering is that we assume the boundaries are diffuse and that
all lighting is coming through this boundary from outside the volume.

This gives much more accurate results for thin features and low density.
Some challenges remain however:

* Significantly more noisy than BSSRDF. Adding Dwivedi sampling may help
  here, but it's unclear still how much it helps in real world cases.
* Due to this being a volumetric method, geometry like eyes or mouth can
  darken the skin on the outside. We may be able to reduce this effect,
  or users can compensate for it by reducing the scattering radius in
  such areas.
* Sharp corners are quite bright. This matches actual volume rendering
  and results in some other renderers, but maybe not so much real world
  objects.

Differential Revision: https://developer.blender.org/D3054
2018-02-09 19:58:33 +01:00
3ab5ef7b4f Fix (unreported) error on freeing timers which customdata pointer shall not be freed.
Looks like there was no way to avoid that so far, since
WM_event_add_timer_notifier can set mere int-in-pointer there, this can
cause issues. So added mere flags system to wmTimer to allow
controlling this.
2018-02-09 17:23:35 +01:00
ea9099473a Fix (unreported) crash when duplicating a FileBrowser window in preview draw mode.
We did not clear preview or smoothscroll timers pointers in copy code...
2018-02-09 16:15:42 +01:00
97597ed600 Doc: attempt to document RNA's FunctionFlag.
Tired of searching through code to find which is what, and how to use it
in the C callback, everytime I need anot-so-common option...
2018-02-09 13:34:18 +01:00
908ee2e0f2 Paint Dirt: remove operator call from Python
Instead of calling an operator I just call `collection.new()`. Moving the
code into a separate function also simplifies it. In its new form there is
also no undefined behaviour when me.vertex_colors is non-empty but without
active layer.
2018-02-09 12:52:46 +01:00
3c09077e3b Paint Dirt: some small fixes
- normalize → average the vector: the vector isn't normalized here, because
  it doesn't necessarily becomes unit length. Instead, the sum is converted
  to an average vector.
- angle is the acos()…: the dot product between the vertex normal and the
  average direction of the connected vertices is computed, and not the
  opposite.
- The initial `con` list was discarded immediately and replaced by a new
  list.
- File didn't end with a newline.
2018-02-09 10:35:03 +01:00
07ccb8b97c Fix crash with font on curve
Was a mistake from recent texspace changes.

Reported by Pablo here in the studio!
2018-02-09 10:14:08 +01:00
8f9386596f CMake: include missing headers 2018-02-09 13:50:05 +11:00
8a6b83d27e Fix T53958: Sequencer zoom 1:1 fails 2018-02-09 13:39:47 +11:00
5e65791516 Fix T53347: Vertex paint crash
Vertex paint was still using sculpt mode brush (which can be NULL).
2018-02-09 12:00:26 +11:00
859379ac48 Fix for missing "Use Freestyle" toggle in the Cycles "Layer" options panel.
Reviewed By: Brecht Van Lommel (brecht), Dalai Felinto (dfelinto)

Differential Revision: https://developer.blender.org/D3048
2018-02-09 02:48:21 +09:00
29d2ff7b31 Cycles: unify OSL BSSRDF closure into a single bssrdf() closure with method.
This is similar to the upstream unified microfacet() closure, and makes it
easier to extend in the future.
2018-02-08 16:56:11 +01:00
aabafece03 Code refactor: tweaks in SSS code to prepare for coming changes.
This also fixes a subtle bug in the split kernel branched path SSS, the
volume stack update can't be shared between multiple hit points.
2018-02-08 16:56:11 +01:00
28e2bc90dd Code refactor: remove unnecessary RNG offset in branched path code.
This is only needed for SSS which bounces to a different shading point.
2018-02-08 16:56:11 +01:00
8c8e53c12d Cycles tests: separate directory for sss tests. 2018-02-08 16:56:11 +01:00
d3248bb50b Disable fast adjust code. Add other end spec matching.
This fixes a few caess where new width adjustment code

was less than ideal.
2018-02-08 10:48:24 -05:00
e0597baed5 Remove Carve boolean
We've got quite comprehensive BMesh based implementation, which is way easier
for maintenance than abandoned Carve library.

After all the time BMesh implementation was working on the same level of
limitations about manifold meshes and touching edges than Carve. Is better
to focus on maintaining one boolean implementation now.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3050
2018-02-08 15:37:44 +01:00
9dc7dca3a2 Depsgraph: Fix missing camera animation after visibility changes
Synchronize code in on_visible_update with depsgraph building.

Need to update all cameras, since they might be hooked up to marker.
2018-02-08 15:12:38 +01:00
f088c6b9f6 Mesh: concave quad support
Previously quads always split along first-third vertices.
This is still the default, to avoid flickering with animated deformation
however concave quads that would create two opposing triangles now use
second-fourth split.

Reported as T53999 although this issue has been known limitation
for a long time.
2018-02-08 23:38:17 +11:00
5f2b4002f4 Dopesheet: Synchronize selection on bones when selecting everything
This is also how box selection and mouse selection is working.

Requested by Hjalti, reviewed by Joshua. Thanks!
2018-02-08 12:36:39 +01:00
1ddd03b793 Fail gracefully when editmode data doesn't exist
Sync changes from 2.8
2018-02-08 21:36:16 +11:00
611712fcc8 Linux: Add appdata.xml file for packagers
D3025 by @januz
2018-02-08 15:59:16 +11:00
00d2dfa93a Forgot to return actual value in previous own commit.
Sorry about the noise...
2018-02-07 22:26:37 +01:00
49745aa5ff Library linking code: proper early out in case there is nothing to link. 2018-02-07 22:09:44 +01:00
843271d0a5 Library reload code: add early out in case there is nothing to reload. 2018-02-07 21:52:38 +01:00
1dafe759ed Update CUEW to latest version
This brings separate initialization for libcuda and libnvrtc, which
fixes Cycles nvrtc compilation not working on build machines without
CUDA hardware available.

Differential Revision: https://developer.blender.org/D3045
2018-02-07 11:53:01 +01:00
38d35603f2 Correct header guard in last commit 2018-02-07 15:52:34 +11:00
6981861fcf Cleanup: Python context access
Avoid access from bpy when it's already declared.
2018-02-07 15:47:54 +11:00
1e4b612d6a Cleanup: add _types.h suffix to DNA headers 2018-02-07 11:14:08 +11:00
66521b382b Depsgraph: Correction to previous particle fix
The reason it appeared working was due to left-over debug code to force
time dependency.

Real fix seems to include force tagging objects used by duplication,
similar to what we do for some other modifiers already.
2018-02-06 14:51:02 +01:00
f9f64ca4a3 Use eObjectMode for function arguments 2018-02-06 23:34:58 +11:00
486e2547ee DNA: move eObjectMode into own header
Add a enum headers to DNA, to be included in other headers
so function signatures can use enums for better type safety.

Add DNA_*_enums.h matching DNA_*.types.h as needed.
2018-02-06 22:58:13 +11:00
a3409d3f53 Fix T54003: Particles - Size and random size not present in "physics" tab in Advanced mode
The check to see if `use_advanced_hair` was enabled was actually in two places
(render panel `draw` function and physics panel `poll` function). As these
properties are only in one place now the check in `draw` isn't needed anymore.

Related: T53513, a6c69ca57f
2018-02-05 20:25:08 -05:00
ce3e0afe59 Fix T54001: AMD OpenCL fails with certain resolutions, after recent changes.
We should actually be using CL_DEVICE_MEM_BASE_ADDR_ALIGN for sub buffers,
previous change in this code was incorrect. Renamed the function now to
make the specific purpose of this alignment clear, it's not required for
data types in general.
2018-02-05 22:19:49 +01:00
bd9ed0228b Fix bevel profile=1 problems, see T39132, T38458, T40278, T51010,
T53783.

Before, profile=1 ("square outside") only worked well in a few cases
(some "pipes", cube corners). This makes it work well pretty much
everywhere.
2018-02-05 14:21:43 -05:00
Nathan Letwory
f9fcda533b Fix typo in struct name obejct to object.
Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D3041
2018-02-05 11:31:33 +02:00
f911fb0744 Minor change to last commit
Keep mode checks simple, nest other checks in their body.
2018-02-05 17:56:09 +11:00
ceb645bc56 Fix T53986: Crash saving during sculpt stroke
Also remove unused struct member.
2018-02-05 17:54:13 +11:00
e84e8cb497 cycles: fix black render with cycles_cubin_cc.
I have honestly no idea how this got swapped..
2018-02-04 15:12:35 -07:00
f8236e4869 cycles: fix cxx11 usage for cycles_cubin_cc 2018-02-04 15:11:08 -07:00
36c1122b96 msvc: Use source folder structure for project file.
This patch changes the huge list of projects in visual studio into a nice tree matching the source folder structure. see D2823 for details.

Differential Revision: http://developer.blender.org/D2823
2018-02-03 16:38:27 -07:00
a5052770b8 cycles: Add an nvrtc based cubin cli compiler.
nvcc is very picky regarding compiler versions, severely limiting the compiler we can use, this commit adds a nvrtc based compiler that'll allow us to build the cubins even if the host compiler is unsupported. for details see D2913.

Differential Revision: http://developer.blender.org/D2913
2018-02-03 10:59:09 -07:00
db989e1f11 Fix more Cycles incorrect principled BSDF mixing due to missing initialization.
Spotted by Ha Hyung-jin, thanks!
2018-02-03 13:43:44 +01:00
7ea7ce970c Fix build error with CUDA 9.1 and compute capability 2.x. 2018-02-03 13:36:38 +01:00
bb6f1d159a Cycles: make displacement a supported feature.
Adaptive subdivision remains experimental, still needs more work.
2018-02-03 12:20:58 +01:00
f9ea097a87 Cycles: add Vector Displacement node and extend Displacement node.
This adds midlevel and object/world space for displacement, and a
vector displacement node with tangent/object/world space, midlevel
and scale.

Note that tangent space vector displacement still is not exactly
compatible with maps created by other software, this will require
changes to the tangent computation.

Differential Revision: https://developer.blender.org/D1734
2018-02-03 12:20:26 +01:00
37beac8eb8 Fix missing group duplicated by hair in render
Was happening when viewport visibility on the particle system is disabled.
This became an issue after c45afcf, but the actual issue goes a bit deeper
and the following aspects were involved:

- Relations builder for particle system was ignoring particle system if
  it's visibility is not enabled for viewport. This is something what
  shouldn't have been done -- depsgraph relations are supposed to be the
  same no matter if it's viewport or render.

- Relation builder was only dealing with duplication set to object, but
  was ignoring group duplication.

This is technically a regression in 2.79a-RC as well, so would need to
backport this fix to the branch after extra testing is done here in the
studio.
2018-02-02 12:05:11 +01:00
c4a19e988b fix: silence warnings about unused local variable (thanks to dfelinto for the hint) 2018-02-02 11:57:10 +01:00
fe82a09f89 Fix T53980: IK influencing REST POSE with New Depsgraph 2018-02-02 10:37:06 +01:00
88e69806b9 Cleanup: wrap function args 2018-02-02 14:11:14 +11:00
b2dc0e6970 Fix T53978: Bad memory access after recent fix to BSDF mixing
Added proper checks after BSDF allocation and cleaned up existing
inline checks.

Was introduced in 7261d675e6
2018-02-01 20:03:29 -05:00
78a77fe622 fix: unintentionally commented out collada animation export 2018-02-02 00:49:42 +01:00
7884ae6eb2 Fix T53686: VSE Render crash when zooming timeline
This is rather a workaround to avoid main thread freeing all glyph caches
at the same time as sequencer uses fonts to draw text sequences.

Ideally we need to either make cache more local, or user-counted or to make
somewhat more global locks. All this ends up in a bigger refactor which is
better for 2.8. For the meantime let's make Blender more stable with a tiny
workaround.

Downside is that keeping zooming things up and down in interface during render
will increase memory usage by unused glyph caches. It's not too bad though,
all unused caches will be freed first time at area zoom after render.

Thanks Bastien for review!
2018-02-01 16:34:30 +01:00
1a840c3e27 Fix T53951: Copy ms runtime dlls using InstallRequiredSystemLibraries.cmake
Differential Revision: https://developer.blender.org/D3032
2018-02-01 08:26:14 -07:00
7e928c3bbc Fix: msvc build error with bli_fileops.h
bli_fileops.h was using uint64_t without including the proper header.

issue triggered by rBb0af44fa4d7a2e134b315c49a4fbdf573f781004
2018-02-01 07:59:52 -07:00
0bf54dd66b Fix T53686: VSE Render crash when zooming timeline.
Epic fail from recent 'security' fixes (rBe04d7c49dca9). ;)

To be backported to 2.79a!
2018-02-01 15:55:38 +01:00
ff54dbd8fa Cycles: Attempt to fix 32 bit linux compilation 2018-02-01 15:13:54 +01:00
7bd86d74ba Cycles: Fix for non-vectorized version of bitscan()
It was doing bit search in an opposite direction comparing to a
vectorized version.
2018-02-01 15:11:17 +01:00
653746f5f8 Cleanup: pass userdef to write_userdef, const args 2018-02-01 15:16:36 +11:00
4174524cb0 Error in last commit 2018-02-01 15:15:57 +11:00
4d96202c9e Cleanup: Python code-style 2018-02-01 14:58:05 +11:00
10fec1f153 Cleanup: Python code-style (addons, wm) 2018-02-01 13:58:44 +11:00
078e012cd9 Cleanup: rename BLI_*_empty() -> clear()
Consistent with other BLI API's
2018-02-01 13:40:53 +11:00
0a4e170c28 Revert "tmp"
This reverts commit ea31f0ac3b.
2018-01-31 22:35:46 -02:00
42ca1fe89c gpu_shader_material: Correct incorrect glsl texture of Voronoi, Noise, and Musgrave on some Intel GPUs 2018-01-31 22:31:08 -02:00
ea31f0ac3b tmp 2018-01-31 22:11:01 -02:00
22faf66c8b fix T50198: The OpenCollada error handler must return true after detecting uncritical errors. 2018-02-01 00:41:39 +01:00
9d39980cfd I18n disambiguation: IRIS is both a file format and a VSE wipe effect...
At some point, we could probably think about removing IRIS file format
support, don't think there are much of those around anymore. But for
now, let's add a translation context to wipe effect. :)

Reported in T43295 by @blend-it, thanks.
2018-01-31 16:43:04 +01:00
f309becf2d Fix possible concurency issue in mesh normals computation.
Failure in own code from last December, thanks @sergey for finding it.

To be backported to 2.79a.
2018-01-31 12:30:39 +01:00
87608e66e1 WM: correct comment, variable name for addons 2018-01-31 19:02:43 +11:00
7a868d127f Fix blender player (tm) 2018-01-30 16:11:58 +01:00
7261d675e6 Fix Cycles incorrect principled BSDF mixing with some parameter variatons.
Spotted by Ha Hyung-jin, thanks!
2018-01-30 15:05:47 +01:00
b3c4a2a8da Fix T52520: Metaballs in edit mode causes infinite Cycles viewport reset
The issue was introduced by eb016eb as a fix for T41258, which added depsgraph
tagging with zero flag. The comment was saying that it's to make derived caches
to be updated, however bot sure how that could possibly work: tagging ID for
update with 0 flag only sets updated tags in bmain in old dependency graph.

In the new depsgraph, where object data is a part of depsgraph, doing such a
tag forces object to be updated, which re-triggers viewport rendering, which
is causing such an infinite viewport render rest.

Can not reproduce any crashes here, so maybe it's fine to move on with this
change.
2018-01-30 14:20:23 +01:00
c80b1f5410 Cleanup: warning, spelling 2018-01-30 21:02:27 +11:00
d0f63d402d Fix T53943: Weight paint crash in new scene 2018-01-30 20:33:20 +11:00
b0af44fa4d Fix T50630: Fluid fails on win32 w/ unicode paths
Allow overriding gzip open w/ elbeem.
2018-01-30 14:31:04 +11:00
1eeb846e78 Fix Cycles viewport render not updating when tweaking displacement shader.
This was disabled to avoid updating the geometry every time when the
material includes displacement, because there was no way to distinguish
between surface shader and displacement updates.

As a solution, we now compute an MD5 hash of the nodes linked to the
displacement socket, and only update the mesh if that changes.

Differential Revision: https://developer.blender.org/D3018
2018-01-29 17:07:08 +01:00
fb941679bb Fix Cycles allocating too much device memory, after recent memory refactoring.
Spotted by Ha Hyung-jin, thanks!
2018-01-29 17:07:08 +01:00
282b3d0fcd Revert "Fix T53914: Volumetric scattering now goes correctly through transparent surfaces."
This reverts commit 3c852ba074. This is breaking
the regression tests, and maybe requires some deeper changes to really fix.
2018-01-29 17:07:08 +01:00
cebc7bb198 Fix nan problem in previous bevel commit.
For chains, access to g_prod[0] was undefined.
And two minor style (whitespace) changes.
2018-01-29 10:01:19 -05:00
263efb0b9a Depsgraph: Correction for previous fix
Original fix only worked when there is one custom property.
2018-01-29 15:06:44 +01:00
68c1e3c28d Depsgraph: Fix missing update when property from proxy rig drives something 2018-01-29 14:53:27 +01:00
6eb2b57f5a Depsgraph: Disable labels on relations
This code was disable a while back and got re-enabled by some previous debug
process. Having relation names in dot file helps understanding what's going
on in one cases, but makes things spread too far away in others.
2018-01-29 14:45:45 +01:00
70286a7652 Depsgraph: Cleanup, line wraps 2018-01-29 14:43:12 +01:00
45fdea48c1 Fix T53614: New Depsgraph ignores NLA strips
The new depsgraph was only considering the active action
when attaching relations from the AnimData component/operation
to the properties that are affected by the animation data.
As a result, only properties animated by the active action
were working, while those animated by NLA strips did not change
when playing back/scrubbing the timeline.

This commit fixes this introducing a recursive method to properly
visit all NLA strips, and calling DepsRelBuilder::build_animdata_curves_targets()
on each of those strips.
2018-01-29 19:01:59 +13:00
79639ccd6b 3D View: use_mouse_init for zoom & trackball orbit 2018-01-29 17:01:51 +11:00
961602f7ae Cleanup: move boolean options into flag
- Rename eViewOpsOrbit to eViewOpsFlag
  since VIEWOPS_ORBIT_DEPTH isn't just used for orbiting.
- Move use_ensure_persp & use_mouse_init into the flag.
- Remove viewops_data_create_ex.
2018-01-29 15:38:37 +11:00
64888eabfd Fix: Disable leftover debug prints from earlier work on the rna path renaming/fixing code 2018-01-29 17:22:03 +13:00
d13b943853 Fix T53909: Joining armatures did not remap names on merged action data
Technically this was not a bug, as this functionality was not meant to
work. (Drivers were already handled though, as they are part of the rig)
It was assumed that there was little value in having this functionality
available, as in most pipelines, animation production only begins after
the rig has been locked down (see bug report comments for more details).

On reflection, in most common situations, there's probably no harm in
doing these rna path fixups. This commit takes advantage of some similar
code I recently put in place in the Grease Pencil branch (for joining GP
objects and their layers).

Important Note for Animators/Riggers/TD's:
Please be aware that after joining armatures, some of the animation may
still need to be redone (due to changes in the transform hierarchies/
transform spaces that the animation is applied in). We do not attempt
to correct for these problems, and it is unlikely that we will in future.
2018-01-29 17:22:03 +13:00
5dd5286995 Apply Pose as Rest Pose: Bendy Bone support
The "Apply Pose as Rest Pose" operator now affects Bendy Bone settings
too, making it possible to use interactive posing tools (e.g. Pose Sculpting
brushes) to get the desired shape for the rest-pose shape of Bendy Bones.
When such posing tools are available, this change makes it easier to get
the desired Bendy Bone shapes, as you are no longer restricted to using
buttons to get the desired effects.
2018-01-29 17:22:02 +13:00
5b67a7a2e7 Cleanup: rename user preference flags
USER_ZBUF_ORBIT -> USER_DEPTH_NAVIGATE
The name didn't make sense since it's used for all view navigation.

Also rename USER_ZBUF_CURSOR -> USER_DEPTH_CURSOR since zbuf
is an internal detail.
2018-01-29 15:07:43 +11:00
42a8799efa Cleanup: comments & whitespace 2018-01-29 14:59:56 +11:00
ca116153fa Cleanup: ViewOpsData struct members
- Group initial/previous/current members
  Was using terms old/prev/last/orig in confusing way.
- Replace x,y variables with vectors.
- Remove unused members.
2018-01-29 14:42:50 +11:00
902198a117 3D View: internal option not to use mouse location
When accessing view-port operators from widgets
we need the ability not to use auto-depth or zoom-to-mouse.

Trackball rotation still needs to be supported.
2018-01-29 13:56:35 +11:00
5964c34f8c Cleanup: minor simplification for zoom/dolly
Make args more consistent.
2018-01-29 13:42:28 +11:00
02832c4ca1 Cleanup: de-duplicate common 3D view properties 2018-01-29 13:26:35 +11:00
561d738eaa Fix T53459, inconsistent bevel on identical edges.
The old algorithm depended on vertex order.
The new one uses a global least squares solution on chains
and cycles of edges where loop slide induces a dependency.

See https://wiki.blender.org/index.php/Dev:Source/Modeling/Bevel
in the "Consistent Widths for Even Bevels" for derivation of
the new algorithm.
2018-01-28 19:19:02 -05:00
d099b1073b Usual i18n/UI messages fixes. 2018-01-28 17:27:53 +01:00
bff1dae767 Cleanup: style, spelling 2018-01-28 17:00:39 +11:00
d386d4e7c4 Cleanup: use doxy sections for view3d_view.c
Also move ..._needs_opengl functions into view3d_utils.c
2018-01-28 16:29:32 +11:00
9a5d198cd2 Use factory startup for icon generation
Avoids using local preferences.
2018-01-28 16:03:32 +11:00
1164a70634 Cleanup: move 3D view utilities into own file
Operators and utility functions were getting too mixed up,
the files were also quite large.
2018-01-28 15:01:35 +11:00
Stefan Werner
3c852ba074 Fix T53914: Volumetric scattering now goes correctly through transparent surfaces.
There was a check for volume bounces at every surface intersection. That could lead to a volume scattered path being terminated
when passing through a transparent surface. This check was superfluous, as the volume shader evaluation already checks the
number of volume bounces and once it passes the max, volume shaders will not return scatter events any more.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: brecht, #cycles

Tags: #cycles

Maniphest Tasks: T53914

Differential Revision: https://developer.blender.org/D3024
2018-01-27 21:39:19 +01:00
7b29e91711 Code refactor: make mixed small/large BSSRDF radii more robust. 2018-01-26 23:06:53 +01:00
d611cf9233 Fix mixed BSDF + BSSRDF sampling bug in path tracing, after 095a01a73a.
Spotted by Ha Hyung-jin, thanks!
2018-01-26 18:47:21 +01:00
ce4915cddb Code refactor: store RGB BSSRDF in a single closure.
Previously we stored each color channel in a single closure, which was
convenient for sampling a closure and channel together. But this doesn't
work so well for algorithms where we want to render multiple color
channels together.
2018-01-26 18:47:21 +01:00
47a3bbcc34 IMB: Add asserts that returned fps and fps base are strictly positives.
Forgot to add that in previous commit, also related to T53003.
2018-01-26 15:14:32 +01:00
567afcca20 Related to T53003: tweak scene fps range.
Move restricted 'reasonable' range to ui_range, and allow wider values
for manual settings.
2018-01-26 15:12:18 +01:00
c528b9b777 Fix T53003: IMB: Invalid framerate handling due to short integer overflow.
FFMPEG uses int for the numerator, while Blender uses a short. So in
cases people gave weird exotic framerate values and we cannot reduce
enough the numerator, we'd get totally weird values (even negative frame
rates sometimes!)

Now we add checks for short overflow and approximate as best as possible
in that case (error should not matter unless you have shots of at least
several hundreds of hours ;) ).
2018-01-26 14:59:16 +01:00
009ce8f3f4 Fix harmlness RNA warning in image texture node drawing. 2018-01-26 08:41:20 +01:00
c4a4d20d3d Fix part of T53080: all material previews re-rendering after undo.
This reverts commit dc2617130b, which disabled
writing of previews for undo. While this uses some memory, re-rendering all
previews is very expensive, especially if for example you have lots of materials
using high-res image textures.
2018-01-26 08:41:19 +01:00
848f0c5b5b Code cleanup: simpler and faster detection of BVH refit. 2018-01-26 08:41:19 +01:00
22afe88882 Fix navmesh creation w/ multiple objects
D2976 by @dertom
2018-01-26 13:10:02 +11:00
19b1b45d71 make_quickie: replace os.system w/ subprocess.call 2018-01-26 12:53:42 +11:00
9b96dd0f61 icon update: replace os.system w/ subprocess.check_call 2018-01-26 12:46:10 +11:00
0f14c72c29 project_info: replace os.system w/ subprocess.check_call 2018-01-26 12:38:07 +11:00
7980265e7e Tests: replace os.system w/ subprocess.call
Saves on process creation and avoids
being tripped up by command line parsing.

Based on D2967 by @ldo with edits.
2018-01-26 12:23:15 +11:00
65d40b3eeb Docs: invoke_search_popup uses bl_property
Also add code example in docs.
2018-01-26 11:52:01 +11:00
da4c3f30d9 Cycles: rename displacement methods, default to displace, tweak panel layout.
Differential Revision: https://developer.blender.org/D3019
2018-01-25 14:25:21 +01:00
176c0c96c2 Fix T53874: OpenGL render problem with OpenEXR in 2.8 with float buffers. 2018-01-25 14:25:17 +01:00
Dalai Felinto
43b0e61408 Fix missing broken notifiers
We can't have more than one NOTE_SUBTYPE in the same notifier.
Instead of calling both subtypes the code end up not calling either.
2018-01-25 10:10:58 -02:00
Dalai Felinto
8e341633e9 Fix T50967: When you move an icon from the outliner area object doesn't show up
We can't have more than one NOTE_SUBTYPE in the same notifier.

This is a partial revert of: cd4d5dcb46. In particular to the part concerning
"Also fixed a missing notifier of the object instancing operator".

Not only this was mixed with the original reason for the commit for no reason,
but it actually introduced a bug. Bad, bad developers ;)

Note: Although this commit is not needed for master, blender2.8 requires it for
the forementioned bug report.
2018-01-25 09:52:24 -02:00
2d46ea52cd WM: comments on wmTooltipState struct 2018-01-25 21:52:40 +11:00
7d66925c73 WM: NULL check for recent tooltip change
Caused crash dragging boolean buttons.
2018-01-25 21:52:40 +11:00
566eb60d81 Fix T53363: Blender won't update mesh's usercount when deleting object datablocks in Editmode.
Only do special handling of ob->data pointer in case we are remapping to
a valid (non-NULL) other obdata. Otherwise, handle it as any other
'remapping to NULL' case.

Hopefully not breaking anything else...
2018-01-25 10:11:12 +01:00
693b41eb17 UI: change tool-tips to be stored in the screen
Move timer and tip out of button code,
now the only requests a tooltip,
passing a creation callback to run.

Needed for manipulators in 2.8,
also helps de-duplicate logic - since we never want
multiple tool-tips showing at once.
2018-01-25 16:22:21 +11:00
9b32248894 Cleanup: correct ATTR_NONNULL use 2018-01-25 10:21:31 +11:00
9560c57e0b Fix T53874: more cases of OpenGL render to OpenEXR not working after recent changes. 2018-01-24 15:56:09 +01:00
bbc562fc69 Fix T53593: sculpt brush rake spacing bug after recent bugfix. 2018-01-24 15:56:09 +01:00
e68771fa87 Cleanup: MOD_wireframe: remove useless isDisabled callback. 2018-01-24 11:22:35 +01:00
a55a4818d6 Fix (unreported) missing feature in ccgdm pbvh generator.
Compared to usual cddm one, ccgdm one was not applying the
ob->derivedDeform deformation to the pbvh generated from the
original mesh geometry, when possible.
2018-01-24 11:22:35 +01:00
ad046efa79 Fix T53551: Weight paint crash when subsurf modifier is not first (master not 2.79).
We can only support painting from subsurf DM in a limited subset of
cases, others (like multiple subsurf, or topology-modyfying ones,
break mapping to original geometry).

This is not the most ideal fix (ideally, we should always be able to get
a mapping to original geometry from any point in modifiers stack...).
2018-01-24 11:22:35 +01:00
9112cceb5e BKE's modifier_isEnabled: add check on NULL Scene pointer.
We do not always have that one available, and even without the
isDisabled callback this func is helpful.

Note that this is a bot stupid, only modifier actually needing a valid
Scene pointer here is subsurf... :|
2018-01-24 11:22:35 +01:00
3e20ac8df3 Fix T53874: OpenGL render to OpenEXR not working after recent changes.
Multilayer EXR also failed already in 2.79 for Sequencer and OpenGL rendering.
Now we revert to single layer OpenEXR in that case.
2018-01-24 11:07:06 +01:00
bf8f7304e0 Fix T53878: Cycles bug rendering multiple render layers with different passes.
This was caused by recent pass refactoring from f78e963.
2018-01-24 10:57:32 +01:00
eb7d251cd7 Fix Cycles GLSL bump not matching final render after recent changes. 2018-01-24 10:57:32 +01:00
bd5696f857 CMake: store icon names
Without this, adding/removing icons wouldn't force cmake to re-run
making builds fail.

This is the same issue with globbing source code.
2018-01-24 11:32:58 +11:00
41945fcfe4 Cleanup: some ED_view3d functions used uppercase D 2018-01-23 23:37:55 +11:00
4a3ddd8a7a Fix Cycles assert when resizing rendererd viewport. 2018-01-23 13:07:25 +01:00
b129ea843a Cycles: change material output displacement to vector.
Previously only scalar displacement along the normal was supported,
now displacement can go in any direction. For backwards compatibility,
a Displacement node will be automatically inserted in existing files.

This will make it possible to support vector displacement maps in the
future. It's already possible to use them to some extent, but requires
a manual shader node setup. For tangent space maps the right tangent
may also not be available yet, depends on the map.

Differential Revision: https://developer.blender.org/D3015
2018-01-23 12:49:35 +01:00
4a5ee1a5a2 Cycles: add Displacement node.
This converts object space height to world space displacement, to be
linked to the new vector displacement material output.

Differential Revision: https://developer.blender.org/D3015
2018-01-23 11:12:26 +01:00
2838cf0dfe Fix T53854: branched path tracing correlation bug with transparency in split kernel. 2018-01-23 11:11:48 +01:00
9466f8f531 Cleanup: use doxygen groups for view3d_edit.c 2018-01-23 19:48:49 +11:00
f6dc7a7cf3 Cleanup: code comment for view3d_viewmatrix_set 2018-01-23 17:36:51 +11:00
41e930ac66 Cleanup: CMake whitespace 2018-01-23 17:25:09 +11:00
85ca39ec4b Fix screen split refresh issues
`Ctrl` (enable snapping) ans `TAB` (Switching direction) didn't refresh.
2018-01-22 23:07:36 -02:00
1443235aa4 Cleanup: sync w/ blender2.8 branch
Also make some args const
2018-01-23 12:14:26 +11:00
bf7e406766 Cycles: Fix optimal BVH selection. 2018-01-22 14:52:09 -07:00
2f79d1c058 Cycles: Replace use_qbvh boolean flag with an enum-based property
This was we can introduce other types of BVH, for example, wider ones, without
causing too much mess around boolean flags.

Thoughs:

- Ideally device info should probably return bitflag of what BVH types it
  supports.

  It is possible to implement based on simple logic in device/ and mesh.cpp,
  rest of the changes will stay the same.

- Not happy with workarounds in util_debug and duplicated enum in kernel.
  Maybe enbum should be stores in kernel, but then it's kind of weird to include
  kernel types from utils. Soudns some cyclkic dependency.

Reviewers: brecht, maxim_d33

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3011
2018-01-22 17:19:20 +01:00
Dalai Felinto
0f69026b1c Fix windows building (log10)
Error: math_base_inline.c(402): error C2668: 'log10' : ambiguous call to
overloaded function
2018-01-22 11:37:19 -02:00
8a2d09eb9f Fix T53854: branched path tracing correlation bug with transparency.
This was broken in d750d18.
2018-01-22 14:02:58 +01:00
b06bd20a6b Cycles: Cleanup, remove unused argument 2018-01-22 10:59:14 +01:00
fb4582134a Fix T53850: Lock to Cursor breaks 3D manipulators 2018-01-22 20:14:12 +11:00
c723e91ee1 WM: add mouse-move after smooth-view
When hot-spots moved under the pointer,
clicking wouldn't activate the correct item.
2018-01-22 14:09:17 +11:00
56fc812d1e Fix manual lookups (data is now lowercase) 2018-01-22 10:00:40 +11:00
d9c962a367 Fix T53843: Error opening online manual 2018-01-22 10:00:40 +11:00
a841e65b85 Cleanup: unused var 2018-01-22 10:00:40 +11:00
8d671f6f65 Update description of the screen_draw functions 2018-01-21 18:22:39 -02:00
46267fe7bf WM: Fix snapping on split area without preview
In addition to removing unnecessary variables and `tag_redraw` whenever the factor changes;
2018-01-21 18:18:38 -02:00
cc64872b88 Fix T49159: missing Cycles tangents for adaptive subdivision. 2018-01-21 15:43:59 +01:00
e767d21b74 Cleanup: BLI_kdopbvh avoid negative array access
It's harder to reason about array access with negative indices.
2018-01-21 20:17:29 +11:00
a7dc5e12ac Cleanup: style 2018-01-21 11:41:52 +11:00
e53447c137 Fix old files with changed node socket type not loading correctly.
This would lead to sock.default_value pointing to the wrong data type,
possibly causing crashes. Unfortunately, this bug will still exist for
older Blender versions that try to load newer files, which makes
changing the type of a node socket problematic.
2018-01-20 22:42:59 +01:00
dd35048602 Cleanup: doxy groups for screen_ops.c 2018-01-21 01:41:58 +11:00
949e56dff1 Fix screen split preview refresh issues
Switching direction didn't refresh, also cursors were flipped.
2018-01-21 00:41:48 +11:00
Dalai Felinto
431d5772bb Fixup for integer digits commit 2018-01-19 17:04:19 -02:00
Dalai Felinto
075def8fbd Util function to determine number of digits from an integer 2018-01-19 16:54:07 -02:00
fa91b43e8c Cycles: Make it more proper check on vectorization flags from DebugFlags
Mimics to checks in system_cpu_support() checks.
2018-01-19 15:48:42 +01:00
Dalai Felinto
edf053ff63 Outliner Python UI cleanup: remove KEYMAPS
This was removed since 2013 (ef765b3606). It should have been removed back
then from the UI file too.
2018-01-19 12:45:57 -02:00
ccec1e7667 Cycles: Cleanup, stop using debug flags in system utilities
Debug flags are to be controlling render behavior, nothing to do with low level
system utilities.

it was simple to hack, but logically is wrong. Lets do things where they are
supposed to be done!
2018-01-19 15:22:32 +01:00
54632dc830 Cycles: Remove util_debug include from kernel code
Not sure why it was in there, all the debug flags stuff is to be handled outside
of kernel.
2018-01-19 15:21:34 +01:00
8e1dd7ed81 Cycles: Remove unneeded include statements
Also try to move them from headers to implementation files as much as possible.
2018-01-19 15:19:45 +01:00
0fe41009f0 Fix T53830: Cycles OpenCL debug assert on macOS,
This was probably harmless besides some unnecessary memory usage due to
aligning allocations too much.
2018-01-19 11:35:07 +01:00
889321e22b Cleanup: reaname LINKLIST_FOREACH -> LISTBASE
LinkList's are a different API, no need to confuse things.
2018-01-19 21:39:18 +11:00
5a61c1de82 Fix T53786: Proportional size from redo ignored
Changing PET size while transforming stores the size in the
tool settings, but changing in the redo panel didn't.
2018-01-19 21:09:16 +11:00
0cddc7e300 WM: operator flag to check repeat/redo execution 2018-01-19 21:07:43 +11:00
53e062da94 Cleanup: sync w/ blender2.8 branch
Split screen_draw.c from screen_edit.c (avoid conflicts syncing).
2018-01-19 17:57:37 +11:00
ebf01d44ee WM: window draw callbacks and split preview snap
This moves window overlay from hard coded flags into drawing callbacks.

It also supports snapping (holding Ctrl).
2018-01-19 17:15:45 +11:00
7a24e0d175 Cleanup: typos 2018-01-19 15:34:54 +11:00
abb3a86e10 Fix T53833: Particle Info node and Displacement Crash
The displacement shared was running before particle data was copied to the
device causing bad memory access when the particle info node was used. Fix
is simply to move particle update before mesh update so the data is
available to displacement shaders.

(Altho this fixes the crash the particle info node is still mostly useless
with displacement for now...)
2018-01-18 22:40:48 -05:00
368414efac Fix T53823: Particle weight brush crash
Entering particle edit mode w/ the weight brush enabled crashed
on non-hair particle systems.
2018-01-19 12:25:09 +11:00
2b9fb723ed Fix T53832: Particle weight paint crash
Drawing hair weights read before the hair array start.
This code could be improved since it currently copy-pastes,
from do_particle_interpolation, but this would need larger changes.

For now just correct existing logic.
2018-01-19 12:14:53 +11:00
42a562496b Fix memory leak in recent curve refactor
5b25605761fb7
2018-01-18 20:54:59 +11:00
7b3e441bcf Improved docstring of mathutils.Matrix.lerp() 2018-01-18 09:58:14 +01:00
9811150952 Improve docstring for mathutils.Matrix.decompose() 2018-01-18 09:38:01 +01:00
001789d733 Fix T53808: VSE doesn't show scene strip markers 2018-01-18 14:49:09 +11:00
6880a549ba Fix weight particle brush versioning 2018-01-18 14:02:26 +11:00
9b04a47070 Cleanup: label scene flags more clearly
Also correct typo in enum name
2018-01-18 13:51:49 +11:00
2be8598fe7 Fix T53811: "bmesh.ops.split" crash 2018-01-18 12:36:25 +11:00
7ffe838473 WM: improved area resize snapping
Instead of 10px steps, snap to mid-point & adjacent edges.

Not yet implemented for split preview.
2018-01-18 11:33:51 +11:00
e6df02861e Fix buffer overflow vulnerability in curve, font, particles code.
Solves these security issues from T52924:
CVE-2017-12102
CVE-2017-12103
CVE-2017-12104

While the specific overflow issue may be fixed, loading the repro .blend
files may still crash because they are incomplete and corrupt. The way
they crash may be impossible to exploit, but this is difficult to prove.

Differential Revision: https://developer.blender.org/D3002
2018-01-18 00:54:07 +01:00
e04d7c49dc Fix buffer overflow vulnerabilities in mesh code.
Solves these security issues from T52924:
CVE-2017-12081
CVE-2017-12082
CVE-2017-12086
CVE-2017-12099
CVE-2017-12100
CVE-2017-12101
CVE-2017-12105

While the specific overflow issue may be fixed, loading the repro .blend
files may still crash because they are incomplete and corrupt. The way
they crash may be impossible to exploit, but this is difficult to prove.

Differential Revision: https://developer.blender.org/D3002
2018-01-18 00:54:07 +01:00
e0f2c7aff4 Fix Linux/GCC compiler warning in recent fixes. 2018-01-18 00:54:07 +01:00
235f578a0d Loop Cut: Allow mouse placement w/ numeric input
D2973 by @cyaoeu
2018-01-18 10:55:53 +11:00
07aed404cf Fix buffer overflow vulernability in thumbnail file reading.
Fixes CVE-2017-2908 from T52924.

Differential Revision: https://developer.blender.org/D3001
2018-01-17 20:25:42 +01:00
d30cc1ea0b Fix buffer overflows in TIFF, PNG, IRIS, DPX, HDR and AVI loading.
Solves these security issues from T52924:
CVE-2017-2899
CVE-2017-2900
CVE-2017-2901
CVE-2017-2902
CVE-2017-2903
CVE-2017-2904
CVE-2017-2905
CVE-2017-2906
CVE-2017-2907
CVE-2017-2918

Differential Revision: https://developer.blender.org/D2999
2018-01-17 19:59:47 +01:00
a6700362c7 Memory: add MEM_malloc_arrayN() function to protect against overflow.
Differential Revision: https://developer.blender.org/D3002
2018-01-17 19:59:47 +01:00
46204f843b Depsgraph: Fix for fake dependency cycle being created for shape key drivers
One thing i'm not fully happy with is all this is_same_* functions. Need to
get rid of this by probably adding explicit entry/init/whatever nodes and
maybe making node criteria aware of whether key will be used as "from" or
as "to" node.
2018-01-17 18:02:51 +01:00
5d4ffb42a3 Delete Invalid Drivers: more lenient poll function
This function is faster and also allows for deletion of invalid drivers in
nested data blocks (for example in shape keys). Thanks @sergey!
2018-01-17 17:14:39 +01:00
a8fc44299b external_libs: Add openjpeg to the mavc lib folders for cycles standalone. 2018-01-17 07:45:05 -07:00
0aaae43748 Simplified GRAPH_OT_driver_delete_invalid after feedback @aligorith
By adding the ANIMFILTER_NODUPLIS flag to the filter it'll only be
processing each F-Curve once, which means we can remove while iterating.

This also solves a potential issue when a datablock has a driver and is
shared among multiple objects.
2018-01-17 12:38:14 +01:00
c38ebf93e3 Added "Delete Invalid Drivers" operator
This operator is available in the graph editor in the Drivers mode, and
allows quick cleanup of drivers marked as 'invalid'.
2018-01-17 12:12:37 +01:00
7935a394b7 Correct simple deform versioning from D2989 2018-01-17 19:17:49 +11:00
a19e3bdad8 Fix T53810: Crash removing a scene used in render
Header drawing accesses the scene too.
2018-01-17 10:03:22 +11:00
9d1ae07d4f Cleanup: Avoid ifdefs in multiple places
Define a helper macro. Makes code read easier.
2018-01-16 17:14:57 +01:00
b55111f8f6 Cleanup: Naming of depsgraph 2018-01-16 16:38:39 +01:00
4e0673927a Alembic: don't explicitly pass NULL 2018-01-16 16:28:10 +01:00
6db0fd65ab T53711: Alembic don´t import vertex colors correctly
An index stored in Alembic wasn't used. Often this index is a no-op
(i.e. index[n] = n), in which case the result was fine. However, when it
isn't, it caused issues.
2018-01-16 16:03:21 +01:00
0bdb1eab82 Sculpting: Fix uninitialized color being left for smooth meshes with hidden mask 2018-01-16 14:46:48 +01:00
7934e7ab83 Sculpting: Fix for "Hide Mask" does not work with multires 2018-01-16 14:31:52 +01:00
67e4b1d3e9 Fix missing node tree updates when unconnected node affects output via driver
Fixes T53794: Can't control color ramp node color values with drivers
2018-01-16 12:06:22 +01:00
0b500ba147 Depsgraph: Fix fake cyclic dependencies for node tree drivers
There was a fake cyclic dependency happening when node of node tree is driving
another node of the same tree.

This is related to T53794, but more fixes is needed here.
2018-01-16 11:54:32 +01:00
45b5de9cb3 Depsgraph: Better relations name 2018-01-16 11:43:05 +01:00
1d763b5395 Depsgraph: Check for ID match when checking if operations corresponds to the same bone 2018-01-16 11:41:50 +01:00
b974d0da4d Depsgraph: Cleanup, indentation 2018-01-16 11:40:02 +01:00
b667020310 Depsgraph: Cleanup, brace placement\ 2018-01-16 11:38:44 +01:00
03223a5e7d readfile: ensure blend header follows the spec 2018-01-16 20:02:32 +11:00
e428ea3e00 Cleanup: indentation 2018-01-16 11:40:43 +11:00
6f45dea6ee UI: support canceling color ramp drag
D2997 by @oktomus
2018-01-16 11:16:50 +11:00
Karl Semich
75e2ae72c7 Allow for multi-gigapixel renders
This patch fixes a 32-bit overflow that occurs on 64-bit systems due to a numeric literal being treated as 32-bit.

This patch allows for the generation of images that occupy more than 4GB of RAM, which previously caused a crash.

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2975
2018-01-15 12:57:12 +01:00
2c2203d82a Cycles: CLeanup, remove unused function argument 2018-01-15 11:45:16 +01:00
4d8b78b0a9 Sculpting: Sdd an option to hide mask in viewport
Brushes themselves are still affected by the mask, but the viewport is not
showing the mask. This way it's easier to see details while sculpting.

Studio request by Julien Kaspar
2018-01-15 11:43:59 +01:00
6cb06501c3 GPU buffers: Use bitflag to whether we want to show diffuse color
Those fine-tuning bits will be extended soon, so makes sense to start using
some more verbose flag names when calling functions.
2018-01-15 11:43:59 +01:00
ec52e64a5d RNA: Add RNA_property_string_set_bytes
This is needed to set values that contain zero bytes
(where the length isn't fixed).
2018-01-15 15:59:10 +11:00
02a01b3505 Cleanup: BLI_ghash
Improve hashsizes comment too.
2018-01-14 17:28:15 +11:00
8d3efb2b90 Fix T53772: Presets don't support colons 2018-01-14 14:31:39 +11:00
40dbf2fc00 Fix T53771: missing view pixels when rendering multiview + FSAA.
This never worked, it's not due to recent refactoring.
2018-01-12 23:57:45 +01:00
5bd9b12dc4 Cycles: adaptive subdivision support for panoramic cameras.
Adds the code to get screen size of a point in world space, which is
used for subdividing geometry to the correct level. The approximate
method of treating the point as if it were directly in front of the
camera is used, as panoramic projections can become very distorted
near the edges of an image. This should be fine for most uses.

There is also no support yet for offscreen dicing scale, though
panorama cameras are often used for rendering 360° renders anyway.

Fixes T49254.

Differential Revision: https://developer.blender.org/D2468
2018-01-12 23:57:45 +01:00
b603792fec Code refactor: adjust camera update for easier code sharing with kernel. 2018-01-12 23:57:45 +01:00
5cf032678f Code cleanup: remove test code to disable motion blur, no longer useful. 2018-01-12 23:57:14 +01:00
a33a5880f7 Fix bmesh.utils.face_join arg parsing 2018-01-12 14:51:15 +11:00
93d30d62e6 User Prefs: app-template option to hide the cursor 2018-01-12 12:45:56 +11:00
ff4c9d69ee User Prefs: add new flag for app-template options
For experimental options, outside the scope of typical preferences.

While templates are developed we might want to make changes
to behavior which aren't fully compatible with typical work-flows.

Instead of mixing these options in with current preferences
expose separately (we could even force disable them when templates
aren't int use)
2018-01-12 12:45:56 +11:00
322f0223d0 Cycles: option to make background visible through glass transparent.
This can be enabled in the Film panel, with an option to control the
transmisison roughness below which glass becomes transparent.

Differential Revision: https://developer.blender.org/D2904
2018-01-12 01:34:28 +01:00
cce280dd67 Cycles: add offscreen dicing scale and dicing camera.
The offscreen dicing scale helps to significantly reduce memory usage,
by reducing the dicing rate for objects the further they are outside of
the camera view.

The dicing camera can be specified now, to keep the geometry fixed and
avoid crawling artifacts in animation. It is also useful for debugging,
to see the tesselation from a different camera location.

Differential Revision: https://developer.blender.org/D2891
2018-01-12 01:34:07 +01:00
2dbcc17897 Fix Cycles bevel normal baking having some random incorrect pixels.
The bevel and SSS code could result in NaNs in some cases, tweak the
formulas so this can't happen.
2018-01-11 22:30:31 +01:00
6b3d85fa51 Build: auto detection of libraries built by "make deps" on Linux.
Use the libraries if they exist in ../lib/linux_x86_64 or similar, so
that you can run "make deps && make full" to get a full static build.
Note that install_deps.sh is still the only officially supported way to
build Blender dependencies on Linux, but this may be useful to some.

Differential Revision: https://developer.blender.org/D2980
2018-01-11 22:30:31 +01:00
6104596587 Cleanup commented out OMP command. 2018-01-11 20:17:29 +01:00
6695e390c6 Nuke OMP from multires.c: forgot that one in previous commit.
Gives same kind of speedup too, 8.7ms with old OMP code, 2.7ms with new
one, with same level-4 multires monkey head.
2018-01-11 20:14:16 +01:00
90cd856ac3 Nuke OMP usage in multires.c.
New code is over three times quicker than old one here (e.g. Suzanne
subdiv level 4, 250k tris, threaded part is now 1.4ms instead of 4.5ms
with OMP).
2018-01-11 19:39:24 +01:00
713852affb Preparation step for nuking OMP from multires code.
Remove the critical OMP sections used to protect mem allocation.

First one can be done in a separate loop before main, parallelized one.

Second one only affect 'private' data, so we only need to ensure
guardedalloc thread safety is enabled.

This is committed as separated step to ease troubleshooting in case
bisecting becomes necesary.
2018-01-11 17:56:18 +01:00
c253fe5e87 Cleanup typo in comment. 2018-01-11 17:55:58 +01:00
38d480fb54 Subsurf: Allow partial threading over geometry arrays
This helps avoiding threading overhead when having lots of system threads..
2018-01-11 15:06:56 +01:00
374c4f168d Mesh evaluate: Tweak threadability criteria
Gives measurable speedup on layout scenes from Spring.

Actual value for chunk size is a subject for more scientific research.
2018-01-11 15:04:13 +01:00
cdcdae663a Mesh deform: Tweak threadability criteria
Allow threading using subset of all available threads. Makes it faster to
evaluate lower resolution mesh but with complex deform groups and such.
2018-01-11 14:51:30 +01:00
c276fef413 Subsurf: Make copyFinalLoopArray() threaded
Gives about 40% speedup of object which has simple-ish deformation applied
on top of subdivided mesh.

This might easily happen with single character animation.
2018-01-11 14:49:32 +01:00
1255f572c7 Depsgraph: Make eval initialization more friendly for threading
Helps in cases of not very complex scenes and lots of system threads available.

A bit hard to measure change on it's own, it works best with the upcoming
changes and gives measurable improvements.
2018-01-11 14:48:49 +01:00
498ffef7b0 Subsurf: Use regular mutex instead of RW one
Mutex is now local to particular CCGDM, and guarding edge hash which is only
used by a single function only. There is no need to acquire read lock after
edge hash was created.
2018-01-11 14:38:58 +01:00
b415ed55a7 Fix critical issue with our DNA ID tags (two totally different tags having same value).
Nice typo from rBc4046e9082f6, tssk. ;)
2018-01-11 14:26:44 +01:00
0edda8e4ce Fix T53311: transform edge/normal orientation
When the edge is aligned with it's own normals,
transform orientation wasn't aligned with the edge.
2018-01-11 19:25:27 +11:00
6dd164a188 Fix T53755: Cycles OpenCL lamp shaders have incorrect normal. 2018-01-11 08:48:32 +01:00
717090f40e UI: option not to show screen splitting widgets
Request for simplified Blender template,
this may be extended to limit access to other UI changes
that could be pressed by accident.
2018-01-11 16:10:46 +11:00
9d62e6e782 UI: don't draw outline when it's not calculated
Outline drawing was running even when there were no verts to draw.
Causes an assert in 2.8.
2018-01-11 13:23:55 +11:00
Stefan Werner
25b794a39d Cycles: support animated object scale in motion blur.
This was disabled previously due to CUDA compiler bugs, see T32900.

Differential Revision: https://developer.blender.org/D2937
2018-01-11 02:58:29 +01:00
ac2ebf9c54 Fix T53455: Object disappear w/ TrackTo constraint
Regression caused by own commit 16fbb47c88,
this is really an edge case though since calling normalize twice fixes.
2018-01-11 10:57:30 +11:00
d0cc5d8948 Fix T53752: Draw curve fails w/ stylus 2018-01-11 10:23:52 +11:00
c27cab268b Fix Windows compiler warning using WITH_CYCLES_NATIVE_ONLY. 2018-01-11 00:00:48 +01:00
d0892a6648 Fix issue with moving CUDA memory to host and multiple devices.
This is not expected to fix all issues. Also adds some more details
to error reporting to investigate failures.
2018-01-11 00:00:48 +01:00
0f4b46cee6 Fix T53692: OpenCL multi GPU rendering not using all GPUs.
Ensure each OpenCL device has a unique ID even if the hardware ID is not
unique for some reason.
2018-01-11 00:00:48 +01:00
f330005266 Cleanup: BKE naming conventions for datablock add/localize
Conventions were already followed nearly everywhere.
2018-01-11 10:01:01 +11:00
76bdd40bfd Subsurf: Loop array should not be called mv
mv is a mesh vertex, not loop.
2018-01-10 14:58:49 +01:00
fca202566f Subsurf: Remove increment of unused variable 2018-01-10 14:58:09 +01:00
2737837b09 Fix wrong data type used for undo memory limit 2018-01-10 13:20:36 +01:00
f21f18b572 Task scheduler: Use const qualifier in callbacks for parallel range 2018-01-10 12:53:59 +01:00
5614193745 Task scheduler: Use restrict pointer qualifier
Those pointers are never to be aliased, so let's be explicit about this and hope
compiler does save some CPU ticks.
2018-01-10 12:49:51 +01:00
518c65460e Task scheduler: Use more const qualifiers 2018-01-10 12:27:43 +01:00
f68b2fd233 RNA: Increase memory limit settings to their possible max on platform
This is quite common to have 64GB memory now, and even 128. There is no reason
to add any artificial caps on the cache and undo memory here. We can not protect
against using too much memory in one cases and allow use of full computer
potential in others.

Now 32 bit will use 2GB max (as it used to be), but 64bit will use whatever
number of megabytes fits into integer.

Reviewers: campbellbarton, mont29

Subscribers: sebastian_k

Differential Revision: https://developer.blender.org/D2972
2018-01-10 11:09:10 +01:00
f0610563ee math utils: Add size_t version of min and max functions 2018-01-10 11:06:44 +01:00
18f53d8822 Cleanup: comment block alignment 2018-01-10 19:57:02 +11:00
bc02c5de49 Alternate fix for brush user count
This reverts change to BKE_brush_add,
callers now remove the extra user.

Note this isn't very convenient for callers but
is consistent with other ID types.

In the future we will probably remove this and have new
ID's created with zero users.
2018-01-10 19:34:34 +11:00
3f837341c8 Correction to brush user commit
RNA API was compensating for the extra user.
2018-01-10 18:31:54 +11:00
98d89cef6b Fix background_job template
Update attribute and use empty file operator
2018-01-10 17:50:41 +11:00
6e6b79de35 Fix brush user count
New brushes had 2 users on adding.
Caused assert removing them after.
2018-01-10 17:45:34 +11:00
cacba951ea Correct typos 2018-01-10 12:43:29 +11:00
fdd3d969a6 Fix T53491: Absolute tablet motion detection fails
When using a tablet, detecting absolute motion only worked
when activating a tool with the tablet.

Pressing Enter to run a tool for e.g. would use relative motion.

Now store is_motion_absolute in the event,
set for new events based on the most recent motion events.
2018-01-10 12:41:45 +11:00
9aada45e52 fix t53701 minimal changes to get it working right 2018-01-10 01:51:04 +01:00
0f6ed7d111 Fix (unreported) potential crash.
RNA_pointer_as_string could return NULL instead of a valid string in some cases.
2018-01-09 19:51:50 +01:00
5fe87a0a8c Task scheduler: Use single thread branch when range fits into single chunk 2018-01-09 18:10:47 +01:00
4a3b303bb0 Task scheduler: Fix wrong tasks calculation when chunk size is too big 2018-01-09 18:07:34 +01:00
932d448ae0 Task scheduler: Use const qualifiers in parallel range 2018-01-09 16:09:33 +01:00
8cffb0a141 Task scheduler: Avoid over-allocation of tasks for parallel ranges
This seems to only cause extra rthreading overhead on systems with 10s of
threads, without actually solving anything.
2018-01-09 16:09:33 +01:00
c4e42d70a4 Task scheduler: Add minimum number of iterations per thread in parallel range
The idea is to support following: allow doing parallel for on a small range,
each iteration of which takes lots of compute power, but limit such range to
a subset of threads.

For example, on a machine with 44 threads we can occupy 4 threads to handle
range of 64 elements, 16 elements per thread, where each block of 16 elements
is very complex to compute.

The idea should be to use this setting instead of global use_threading flag,
which is only based on size of array. Proper use of the new flag will improve
threadability.

This commit only contains internal task scheduler changes, this setting is not
used yet by any areas.
2018-01-09 16:09:33 +01:00
3144f0573a Task scheduler: Simplify parallel range function
Basically, split it up and avoid extra abstraction level.
2018-01-09 16:09:33 +01:00
4c4a7e84c6 Task scheduler: Use single parallel range function with more flexible function
Now all the fine-tuning is happening using parallel range settings structure,
which avoid passing long lists of arguments, allows extend fine-tuning further,
avoid having lots of various functions which basically does the same thing.
2018-01-09 16:09:33 +01:00
d2708b0f73 Task scheduler: Get rid of extended version of parallel range callback
Wrap all arguments into TLS type of argument. Avoids some branching and also
makes it easier to extend things in the future.
2018-01-09 16:09:33 +01:00
f5d64b59f5 Fix T53691: Motion Tracking Object Solver Constraint doesn't work as Bone Constraint 2018-01-09 14:27:19 +01:00
bf8137994d Depsgraph: Move special handling of tracking constraints to a dedicated function 2018-01-09 14:11:23 +01:00
d32878b425 Depsgraph: Perform early check on constraint info NULL 2018-01-09 13:09:59 +01:00
ce0fcf1378 Correct error in last commit (versioning) 2018-01-09 15:17:00 +11:00
6554207841 Add deform axis for Simple Deform modifier
D2989 by @dmarra w/ own edits
2018-01-09 15:09:55 +11:00
850f73638c install_deps: Fix OCIO always re-cloning its whole git repository. 2018-01-08 16:34:34 +01:00
c8a989d644 No groping in Blender's Tracker!
This a small cleanup of something which I think is just a typo anyway.

With all the recent talks of harrassment and groping, I think we better avoid
that within our source code! :)

Reviewers: sergey

Reviewed By: sergey

Tags: #motion_tracking

Differential Revision: https://developer.blender.org/D2979
2018-01-08 14:12:15 +01:00
3ee2ed3049 Fix T53612: Blender crashes on CleanTracks with 'DELETE_SEGMENTS' and a disabled marker
Simple fix, which is totally safe for 2.79a!
2018-01-08 14:10:50 +01:00
96e507d989 Fix T53509: Datablock ID Properties attached to bpy.types.Material are not loaded.
Stupid mistake in material reading code, thanks to Simon Wendsche (@BYOB) for the investigation and fix!

To be backported to 2.79a.
2018-01-08 09:37:56 +01:00
a7b4f98e73 Fix T53713: User remap failed w/ texface images 2018-01-08 16:58:58 +11:00
87607254d6 (Nodes) Display image name if any in the Image and Texture Image node title 2018-01-07 22:29:25 +01:00
add580beee Fix T47212: Luminance Key not working with HDR and out-of-gamut ranges.
Differential Revision: https://developer.blender.org/D2981
2018-01-06 16:41:39 +01:00
0e59f2b256 Fix T47212: incorrect luma coefficients for Luminance Key node.
Differential Revision: https://developer.blender.org/D2982
2018-01-06 16:41:33 +01:00
c6abf41f71 Fix T53650: remove hard limits on force field size and max distance.
Differential Revision: https://developer.blender.org/D2987
2018-01-06 16:15:13 +01:00
6eb89027c3 Fix T53696: Compositor HSV limits changed 2018-01-05 20:13:17 +11:00
Dalai Felinto
95d83b9b23 Fix leak when rendering OpenGL animations
We were duplicating rectf twice :/

Patch by Clément Foucault.
2018-01-04 15:56:43 -02:00
0becc8a7dd Fix T52953: Crash removing material 2018-01-04 21:35:09 +11:00
457dc8d12c Fix T53586: Surfaces collapse when joined 2018-01-04 16:01:27 +11:00
9b65560934 Fix T53637: Keymap from app-template ignored
Addon's were also ignored
2018-01-04 14:19:00 +11:00
25418be97e build deps: llvm new website download locations 2018-01-03 14:52:25 +02:00
Dalai Felinto
ffb2c40176 New API function to call an existing menu
Thanks Campbell Barton for the help and review.
This is for Blender 2.8, so we are not using this function yet.
2018-01-03 10:17:59 -02:00
e981a7de31 Missing from last commit 2018-01-03 22:01:40 +11:00
2f8c2572ed Fix T53632: Objects outside scene shown in popup
Only show objects in current scene when not pinned.

This commit adds a filter argument to id-template
since we may want to filter by other criteria.
2018-01-03 21:54:02 +11:00
cbc7aa80d4 Fix T53678: Smart Project UV margin ignores units 2018-01-03 16:10:41 +11:00
c621832d3d Cycles: CUDA support for rendering scenes that don't fit on GPU.
In that case it can now fall back to CPU memory, at the cost of reduced
performance. For scenes that fit in GPU memory, this commit should not
cause any noticeable slowdowns.

We don't use all physical system RAM, since that can cause OS instability.
We leave at least half of system RAM or 4GB to other software, whichever
is smaller.

For image textures in host memory, performance was maybe 20-30% slower
in our tests (although this is highly hardware and scene dependent). Once
other type of data doesn't fit on the GPU, performance can be e.g. 10x
slower, and at that point it's probably better to just render on the CPU.

Differential Revision: https://developer.blender.org/D2056
2018-01-02 23:50:18 +01:00
6699454fb6 Cycles: make CUDA code a bit more robust to host/device alloc failures.
Fixes a few corner cases found while stress testing host mapped memory.
2018-01-02 23:46:19 +01:00
e84966ac42 nstall_deps: llvm downloads new website location
Patch by Lucas Walter (@lucasw), thanks.

Reviewers: mont29

Reviewed By: mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D2983
2018-01-02 15:23:45 +01:00
e59cf13b8c fix T53230: avoid Nullpointer problems in Collada Exporter 2018-01-01 15:02:26 +01:00
ac934efc5e Build: fix make deps TBB on Linux, older versions don't support GCC 7. 2017-12-30 00:07:33 +01:00
6a225a283e Build: fix make deps OpenSubdiv build on Linux. 2017-12-29 22:53:32 +01:00
Dalai Felinto
a6c69ca57f Fix T53513: Particle size showing in multiple places
Technically this was introduced in 01b547f993 when
exposing size and randomness for particles.

This "fixes" makes sure particle size and size randomness is always in the
Render panel when it affects the particle system (i.e., always unless using
advanced hair or hair that is not rendering groups/objects).
2017-12-29 13:17:55 -02:00
08b063a19f Fix T53639: text sequence strips no stamped into render.
Differential Revision: https://developer.blender.org/D2977
2017-12-29 00:25:29 +01:00
7a6967cbe6 Fix mistake in previous fix for T53600, shows we really need a smarter solution. 2017-12-29 00:07:49 +01:00
17f1ce4d4f Fix T53630: Effect strips not displaying Input data.
Fix T52977: Parent bone name disappeared in the UI in pose mode.

Regression caused by own rBc57636f060018. So instead of changing widget
type, just flag it as disabled.

Note that core of the issue is elsewhere though - there is absolutely no
reasons to have a search widget for pointers we cannot change nor
search! But fixing this is not really top priority, one of the many
glitches of our UI code, so think we can live with current code.

To be backported to 2.79a.
2017-12-28 17:57:18 +01:00
948515c21a Fix T53600: Cycles shader mixing issue with principled BSDF and zero weights.
SVM nodes need to read all data to get the right offset for the following node.
This is quite weak, a more generic solution would be good in the future.
2017-12-25 23:59:20 +01:00
e8e92dffed Fix T53607: Cycles normal map baking problem when there is no bump. 2017-12-25 23:05:45 +01:00
7e4568a939 Cleanup - Various style/typo fixes 2017-12-23 23:54:05 +13:00
d130c66db4 Fix scalability issue in threaded code of Mesh normals computation.
We tried to do as much as possible in a single threaded callback, which
lead to using some nasty tricks like fake atomic-based spinlocks to
perform some operations (like float addition, which has no atomic
intrinsics).

While OK with 'standard' low number of working threads (8-16), because
collision were rather rare and implied memory barrier not *that* much
overhead, this performed poorly with more powerful systems reaching the
100 of threads and beyond (like workstations or render farm hardware).

There, both memory barrier overhead and more frequent collisions would
have significant impact on performances.

This was addressed by splitting further the process, we now have three
loops, one over polys, loops and vertices, and we added an intermediate
storage for weighted loop normals. This allows to avoid completely any
atomic operation in body of threaded loops, which should fix scalability
issues. This costs us slightly higher temp memory usage (something like
50Mb per million of polygons on average), but looks like acceptable
tradeoff.

Further more, tests showed that we could gain an additional ~7% of speed
in computing normals of heavy meshes, by also parallelizing the last two
loops (might be 1 or 2% on overall mesh update at best...).

Note that further tweaking in this code should be possible once Sergey
adds the 'minimum batch size' option to threaded foreach API, since very
light loops like the one on loops (mere v3 addition) require much bigger
batches than heavier code (like the one on polys) to keep optimal
performances.
2017-12-22 22:12:23 +01:00
6efd58dd3e Task scheduler: Clarify why do we need an atomic add of 0 2017-12-22 16:37:25 +01:00
870840e8b7 Subsurf: Avoid possible use of partially initialized edge hash 2017-12-22 12:51:00 +01:00
df0ecd73af Subsurf: Avoid global lock for loops and orig index layers
This is a bit annoying to have per-DM locking, but it's way better (as in, up to
4 times better) for playback speed when having lots of subsurf objects,
2017-12-22 12:50:57 +01:00
50f1c9a8af Task scheduler: Start with suspended pool to avoid threading overhead on push
The idea is to avoid any threading overhead when we start pushing tasks in a
loop. Similarly to how we do it from the new dependency graph. Gives couple of
percent of speedup here, but also improves scalability.
2017-12-22 12:25:11 +01:00
c66983c5c8 Depsgraph: Sort and clam number of statistics entries
Makes log easier to read.
2017-12-21 17:16:18 +01:00
885bb5b137 Depsgraph: Bring timing statistics to the new dependency graph
This statistics is only collected when debug_value is different from 0.

Stored in depsgraph node itself, so we can always have access to average data
and other stats which requires persistent storage. This way we also don't waste
time trying to find stats from a separately stored hash map.
2017-12-21 16:33:22 +01:00
d988eae6f9 Depsgraph: Make it more clear that we dump relations into graphviz
We might implement other things to dump into graphviz, so better to
start having explicit names.
2017-12-21 16:33:22 +01:00
b7121639e9 Depsgraph: Simplify some functions in evaluaiton 2017-12-21 16:33:22 +01:00
f0a5dc63ff Depsgraph: Simplify evaluation function 2017-12-21 16:33:22 +01:00
bf1dc39679 Fix T53567: Negative pixel values causing artifacts with denoising
Now negative color values are clamped to zero before the actual denoising.
2017-12-21 14:24:23 +01:00
41b29c69c0 Depsgraph: Fix mistake in previous commit 2017-12-21 12:16:12 +01:00
6e47680077 Depsgraph: Remove confusing declaration of node method
it is only to be implemented for operation node.
2017-12-21 11:58:48 +01:00
681a102800 Depsgraph: Remove one of temporary tags in the node
No real reason to have that, better to free up space for something much more
awesome!
2017-12-21 11:47:34 +01:00
5df4950073 Depsgraph: Cleanup, move implementation away from header 2017-12-21 11:35:10 +01:00
f6b2fbb029 Depsgraph: Remove evaluation priority completely 2017-12-21 11:15:21 +01:00
f906f5cc58 Depsgraph: Remove eval priority from debugger
This needs to be redone anyway, to correspond to possibly new priorities
calculated for evaluaiton.
2017-12-21 11:14:39 +01:00
0ed3a72012 Depsgraph: Remove unused component context functions 2017-12-21 10:37:00 +01:00
93b2871cf5 Depsgraph: Remove node class stored in both type info and node
This is something deliver form node type, there is no reason to try cache it
anywhere, especially since it's not used in any performance critical code.

Lighter weight dependency graph is what we want.
2017-12-20 17:54:52 +01:00
5650fe77e4 Cycles: Cleanup, indentation 2017-12-20 17:42:50 +01:00
e5b92cd63e Depsgraph: Remove unused incldues 2017-12-20 16:45:10 +01:00
3474db4b37 Depsgraph: Move ID node to own file 2017-12-20 16:35:48 +01:00
f87c157f22 Depsgraph: Move time source node to own file 2017-12-20 16:29:13 +01:00
b2ef042793 Depsgraph: Print some statistics about transitive reduction 2017-12-20 16:19:40 +01:00
f2aacfc943 Depsgraph: Make transitive reduction to work 2017-12-20 16:16:28 +01:00
5b1404f066 Depsgraph: Add utility function to unlink relation from graph 2017-12-20 16:15:55 +01:00
1e236deab3 Depsgraph: Remove unused priority calculator
While it sounds useful, in practice it was rather causing
extra overhead and was slowing things down.
2017-12-20 15:53:39 +01:00
65128d296c Depsgraph: Remove remaining parts of old removed debugger 2017-12-20 15:50:22 +01:00
b1a036861d Fix T53572: Alembic imports UV maps incorrectly
Since in Alembic the loop order seems to be reversed when exporting and
importing, and this was the only place where it was not, I was thinking
to match this to the convention of reversing the loop order as well.

Reviewers: sybren, kevindietrich

Tags: #alembic

Differential Revision: https://developer.blender.org/D2968
2017-12-20 10:55:02 +01:00
94a3ee56c7 Fix MSVSC2017 error
The last compiler version needs this include
2017-12-20 10:23:12 +01:00
d0ac5d3810 Cleanup: remove unnecessary tooltip line limit
Also add TODO for possible future changes.
2017-12-20 17:20:33 +11:00
51f0c3fadf UI: move tooltip API to public header 2017-12-20 14:58:06 +11:00
Julian Eisel
b0d61ea770 Fix crash in RNA when accessing empty property_tags list
E.g. running `bpy.context.active_object.cycles.bl_rna.property` in the
console would crash.

Thanks @lijenstina for reporting!
2017-12-19 20:56:14 +01:00
433c74d9f7 bpy_extras: add missing colorband keymap to keyconfig_utils.py
fixes failing ctest script_load_keymap
2017-12-19 08:04:17 -07:00
7e8525663c Font objects: Support proper auto-space
Annoyingly, need to convert vfont to nurbs, do minmax and toss nurbs away.
This is likely to be fine, since this function is not intended to be used
a lot, and this is the only way to get more meaningful result.

However, it's not very clear what to do with font on curve.

This fixes rendering of font object with auto texture space in Cycles
introduced in c34f3c7.

It is probably possible to introduce new mode to vfont_to_curve which
will do boundbox without extra allocations, but that's more like an
optimization.

Reviewers: campbellbarton, mano-wii

Reviewed By: campbellbarton

Subscribers: zeauro

Differential Revision: https://developer.blender.org/D2971
2017-12-19 15:55:56 +01:00
ab1af38c74 Cycles: Fix crash opening user preferences after adding extra GPU
We can not store pointers to elements of collection property in the
case we modify that collection. This is like storing pointers to
elements of array before calling realloc().
2017-12-19 15:51:28 +01:00
b6b9351371 Tracking: Add missing animation path fix after renaming tracks 2017-12-19 13:39:37 +01:00
e1921ed871 Tracking: Add utility function to get RNA path prefix for given track
Some code could be de-duplicated with the full path case, but that's
for another rainy day i guess.
2017-12-19 13:09:39 +01:00
9fa021cdaf Tracking: Disable animation of auto-keyframe option 2017-12-19 12:59:52 +01:00
61c218fe7d Tracking: Add missing animation fix when deleting plane track 2017-12-19 12:58:42 +01:00
883e342bdb Tracking: Fix possible numerical overflow 2017-12-19 12:52:20 +01:00
28970b6ed2 Fix T53523: Keyframes for Marker weight stay, even if the track itself is deleted
Was using wrong prefix for the RNA path fix.
2017-12-19 12:51:45 +01:00
92197c24f0 Tracking: Use new RNA path utility functions 2017-12-19 12:48:53 +01:00
cf90b11d68 Tracking: Add utility function to get RNA path for given track 2017-12-19 12:45:23 +01:00
43dcf804bd Tracking: Remove duplicated functions 2017-12-19 12:22:34 +01:00
1818aa3b24 Tracking: Add plane tracks equivalents to previous commit 2017-12-19 12:18:52 +01:00
e598e55edd Tracking: Add utility function to get tracks list for given track 2017-12-19 12:14:26 +01:00
adaeb14b3e Tracking: Add utility function to find tracking object from a given track 2017-12-19 12:13:57 +01:00
71c93624e2 Cleanup: Don't use camel case for variable names 2017-12-19 11:53:11 +01:00
c34f3c777f Fix T53559: Auto texture space for text and font is wrong in Cycles
The issue actually goes a bit deeper, converting curve to mesh will
change texture space just because font and bezier curves are using CV
to calculate texture space.

So now when those objects are converted to mesh, we disable auto
texture space and copy evaluated space over.
2017-12-19 10:01:00 +01:00
a130c82f0a Cycles tests: Enable texture space tests 2017-12-19 09:54:23 +01:00
77c62c7793 UI: split out button checks from tooltip creation
Allows to make tooltips from other kinds of data.
2017-12-19 19:34:16 +11:00
a0fa404deb Fix T53547 for real now
Original fix was assuming that particle init operation is updated on every
frame, which is wrong behavior and that was fixed in previous commit to the
original bugfix.
2017-12-19 08:56:11 +01:00
e418c858ab 3D View: use shortest angle between quaternions
Gave incorrect smoothview speed changing between some axis and
axis locking.
2017-12-19 14:05:54 +11:00
7a58ff928c Math Lib: signed versions of quaternion angle
There was no simple way to get the shortest quaternion angle.
2017-12-19 14:03:29 +11:00
bb30ce0f0b Fix T53474, bevel glitchy with big objects.
A comparison should have not just have been against an epsilon,
but relative to the edge length involved.
Thanks to mano-wii for patch on which this is based.
2017-12-18 12:24:42 -05:00
443789d7c6 Depsgraph: Add facilities to store what ID recalc flag component corresponds to
The idea is to de-duplicate logic in DEG_id_tag_update() and flushing where we
need to translate depsgraph tag or component type to ID level recalc flag.

Currently unused, but is required for Blender 2.8.
2017-12-18 16:46:32 +01:00
9e424faec6 Add dedicated named constant for no ID recalc flag 2017-12-18 16:40:18 +01:00
342226a670 Depsgraph: Synchronize flushing with 2.8 branch
Not only this helps merges form master to the branch, but also:

- Allows us to production-check changes as soon as possible.
- Avoids some unnecessary editors update about ID changes.
- Adds small optimization on queue size by always keeping one of the pointers
  outside of the queue.
2017-12-18 16:33:12 +01:00
344eff9c48 Depsgraph: Add query API to traverse all dependent IDs of the given ID 2017-12-18 16:15:47 +01:00
c5d9eb88e2 Depsgraph: Replace iteration over ghash with iteration over flat array 2017-12-18 16:14:50 +01:00
8fe556a337 Depsgraph: Introduce flat list of ID nodes
The idea is to allow iterating over ID nodes in exact order of their
construction, and in order which will not change dependent on memory
pointers or anything.
2017-12-18 16:10:22 +01:00
a41fe949d8 Fix T53398: Surface deform modifier says that convex polygons are concave for big faces
Dot-product for angle check need either to be divided by vectors magnitude or be
calculated for normalized vectors.
2017-12-18 15:16:22 +01:00
076616898b Fix T53577: Rake sculpt/paint wrong on first step 2017-12-18 14:35:15 +11:00
342a322a93 CMake: bump minimum version to 3.5 2017-12-17 01:04:05 +11:00
50ef25d73f Depsgraph: Cleanup, remove unused function 2017-12-15 17:47:15 +01:00
da570fcbb4 Depsgraph: Cleanup, make naming more understandable 2017-12-15 17:46:30 +01:00
3d72b94196 Depsgraph: Use array instead of set for node factory
Avoids extra time spent on hashing and such.

Old comment is kind of weird, because types we can totally make a sequent
integer values.
2017-12-15 17:43:07 +01:00
4ce38abfcd Depsgraph: Add named constant with number of node types 2017-12-15 17:39:01 +01:00
68a7f5e594 Depsgraph: Don't use negative enum value
Not sure why it sohuld be negative, we shouldn't be using any explicit value
comparison.
2017-12-15 17:38:12 +01:00
5e28b71457 math utils: Add utilities to scan bit and clear it 2017-12-15 16:54:28 +01:00
de9e5a0926 Math utils: Go away form naive code for highest_order_bit_uint 2017-12-15 16:54:28 +01:00
412de222f8 Math utils: Add bit scan operations 2017-12-15 16:54:28 +01:00
02ec0b53df Math utils: Make it more clear what the functions are returning 2017-12-15 16:54:28 +01:00
2aa0f8a41b Math utils: Cleanup, use _uint suffix for function which operates on uint 2017-12-15 16:54:28 +01:00
ff0d3c520f Tracking: Cleanup, fix typo in variable name 2017-12-15 13:53:44 +01:00
6b62f1dcb9 Tracking: Pass all markers to autotrack at once
This solves delay before tracking actually starts.

The issue is reported by Sebastian over IRC, thanks!
2017-12-15 12:51:53 +01:00
4895bd6ace Libmv: Add C-API function to set all markers within AutoTrack structure 2017-12-15 12:51:17 +01:00
e50442418a Tracking: Cleanup, make autotrack context creation code more granular 2017-12-15 12:37:23 +01:00
4cc0f09881 Tracking: Cleanup, use more const qualifiers when appropriate 2017-12-15 12:23:53 +01:00
c4046e9082 Move ID recalc flags into dedicated field in ID
Currently this is a no-visible-changes change, but the idea is to use this
dedicated flag to tell which exact components of ID changed, make it more
granular than just OBJECT and OBJECT_DATA. Allow setting this field based
on what components new dependency graph flushed on evaluation.
2017-12-15 09:43:18 +01:00
400d59be9b DNA: Add dedicated recalc flag to ID
Currently unused, but this is where LIB_TAG_ID_RECALC* flags will go.

Also modified other DNA to make pointer property being followed by pointer.
Makes it easier to keep track of alignment and extend nested structures without
ruining anything.
2017-12-14 15:25:51 +01:00
99b7dc60be Fix missing update for particles w/ fluids
D2955 by @GonVas
2017-12-14 12:06:36 +11:00
1f95347882 Fix T53322: Collada export crash w/ shape keys
D2958 by @cmbasnett
2017-12-14 10:59:41 +11:00
a621850224 Fix T53550: E hotkey not working after the color-band picker commit
Related to D2886, the color-band picker was lacking a poll function.
2017-12-13 07:00:16 -07:00
81f135677b Depsgraph: Cleanup, use less explicit checks of LIB_TAG_ID_RECALC_DATA
This is a part of ongoing work in Blender 2.8, where we need to replace

  `object->id.tag & LIB_TAG_ID_RECALC_DATA`

with

  `object->data->id.tag & LIB_TAG_ID_RECALC`

Should be no user measurable difference.
2017-12-13 14:43:32 +01:00
João Seixas
4838512e7d Fix T53404 - Python API documentation: UI Layout Emboss description wording
Changed the suggested word

Reviewers: #documentation, #python, sergey

Reviewed By: #documentation, sergey

Tags: #documentation, #python

Differential Revision: https://developer.blender.org/D2952
2017-12-13 12:56:38 +01:00
2ac33b47dc Fix T53547: Metaballs as dupli objects are not updated with the new Depsgraph
Follow relations from old dependency graph.
2017-12-13 10:50:28 +01:00
2c64615438 Fix T53552: Unneeded particle cache reset on frame change
There shouldn't be a time dependency to cache reset operation.
2017-12-13 10:47:59 +01:00
cd845ae509 T53471: Fix crash with blender_icons_update.py
Default DPI of new inkscape caused incorrect image size.
2017-12-13 16:55:51 +11:00
be54868ec3 Fix T53529: Rip crashes w/ wire edge 2017-12-13 16:14:37 +11:00
611752ce33 UI: color-band eyedropper now combines samples
Resulting color-band was too noisy (especially with photos),
use gauss filter to take surrounding samples into account.
2017-12-13 15:38:11 +11:00
ef8bbc8cba Fix bplayer (c). 2017-12-12 14:23:19 +01:00
99069c8ae2 Revert "Node selection: Stop operator when mouse selection selected a node"
While re-route operator got fixed, node resize became broken.

This reverts commit 43f33ea300.
2017-12-12 10:34:38 +01:00
b3c147a04f Cleanup: split eyedropper into separate files
Each handles separate data-types and didn't share much logic,
better put each in it's own file.
2017-12-12 15:44:59 +11:00
58aa31a9ec Cleanup: minor edits to last commit 2017-12-12 13:37:21 +11:00
f7a1a1a700 UI: rewrite color-ramp re-sampling
Instead of picking evenly spaced pixels color-ramp simplification
now works by removing elements with the lowest cost.
2017-12-12 13:20:56 +11:00
7ae4c3a019 Add eyedropper to color-ramp widget
D2886 by @LazyDodo with edit's by @campbellbarton

The line drawn with the eyedropper is used to fill the color-ramp.
2017-12-12 13:11:38 +11:00
43f33ea300 Node selection: Stop operator when mouse selection selected a node
Previously, hitting Shift-LMB will first invoke selection operator, which
then later on is transformed to mouse tweak used for reroute operator.

This was causing problems extending selection with Shift-LMB when clicking
fast or from a tablet.
2017-12-11 17:38:47 +01:00
7719f7d27a Fix T53528: Empty thumbnails in filebrowser
Bug in recent refactor.
2017-12-11 15:47:52 +01:00
54f7bb4582 Fix for inset when accessed from spacebar search 2017-12-12 01:38:33 +11:00
1218b3fceb Cleanup: whitespace 2017-12-11 19:28:40 +11:00
dd4e0cd3e3 DNA/RNA: add 'py_instance' for ID types
Avoid creating new Python instances
every time a scene, object, mesh .. etc are accessed.

Also resolves crashes T28724, T53530
although it's only valid for ID types, not modifiers vertices etc.

Back-ported from blender2.8 branch.
2017-12-11 18:37:54 +11:00
c568985118 MSVC: Fix compiling with some system languages
Report from @cyaoeu that compiling failed for Japanese system language.
2017-12-10 15:19:50 +11:00
e6838ecc26 Fix T53512: Vertices with index 0 were not being selected
Bug introduced on rB9f5bf197a0c3.
The offset for selection of vertices (`bm_vertoffs`) starts where the offset o edges ends (`bm_wireoffs`).
However, the `bm_wireoffs` depends on the offset of face selection (`bm_solidoffs`).

Before the commit that introduced the bug, the drawn of edges (in backbuff) was always computed along with the `bm_wireoffs`:
```
bm_wireoffs = bm_solidoffs + em->bm->totedge;
```

Now that the edges are not always drawn in backbuff, `bm_wireoffs` has to start from `bm_solidoffs`.
2017-12-08 12:42:00 -02:00
f39a97fac5 Cleanup: moar busting of nasty C++ keywords-as-varnames. 2017-12-08 14:50:45 +01:00
c7ee64b2d9 Cleanup: avoid using C++ keywords as variables, even in pure C code.
This tends to make some IDE unhappy (like QTCreator)...
2017-12-08 14:36:07 +01:00
2e8914549b Cycles: Fix difference in image Clip extension method between CPU and GPU
Our own implementation was behaving different comparing to OSL and GPU,
namely on the border pixels OSL and CUDA was doing interpolation with
black, but we were clamping coordinate.

This partially fixes issue reported in T53452.

Similar change should also be done for 3D interpolation perhaps, but this
is to be investigated separately.
2017-12-08 12:03:11 +01:00
f31fb4a014 Cycles: Cleanup, split 2D interpolation function 2017-12-08 11:22:04 +01:00
4a734325f7 bl_app_override: support empty UI layout items
Returning None from ui_ignore functions creates empty labels,
allows removing items without breaking layout in some cases.
2017-12-08 12:57:25 +11:00
Dalai Felinto
237df2f860 Fix Collada building
Bug introduced in cc811d1fd6.
2017-12-07 11:51:46 -02:00
00067afa10 Fix T53419: Masking "Add" menu is not present in Image editor, but shortcut is 2017-12-07 14:46:07 +01:00
70957565dd DPX/Cineon: Report orientation when running with --debug 2017-12-07 14:38:20 +01:00
efdd8f12a0 CMake: GREATER_EQUAL is from v3.7, use GREATER 2017-12-08 00:20:48 +11:00
bfbcc5e581 Fix T53499: Cannot load DPX files
The issue was caused by unspecified color transfer. New behavior gives same
result as other viewers here, so likely is fine :)
2017-12-07 14:07:57 +01:00
9ea7d0bf44 DPX: Fix wrong flag being checked for debug 2017-12-07 14:04:27 +01:00
2e2e6e3bdb Cleanup: Use BKE_colorband prefix 2017-12-07 15:52:59 +11:00
cc811d1fd6 Cleanup: extract BKE_colorband from BKE_texture 2017-12-07 15:40:11 +11:00
6d31eb015c Array Modifier: option to offset UV's
D2912 by @Zuorion
2017-12-07 04:33:52 +11:00
Daniel Silva
2dfd795bd2 Proposed fix for T53263 -- Blender crashes when rendering with Stabilizer 2D node without movie selected
The program won't crash anymore, but a warning won't be displayed. Anyway, this gives the user the chance to save the project.

https://developer.blender.org/T53263

Reviewers: lukastoenne

Differential Revision: https://developer.blender.org/D2934
2017-12-06 14:54:51 +01:00
13e9291650 Library: Add flag top keep ID library pointer around
This only applies to ID being copied outside of bmain. Handy for cases when it
is important to check if the copy corresponds to a data block coming from
library.

Example of that is proxy evaluation with copy on write.

Thanks Bastien for review!
2017-12-06 13:00:08 +01:00
3ae6a8512d Depsgraph: Cleanup, use less geenric data type 2017-12-06 12:26:10 +01:00
b5be65dc0e Depsgraph: Forgot this in previous commit 2017-12-06 11:57:57 +01:00
5ad3cc4e03 Depsgraph: Ignore text datablocks from nodes
Those are not part of dependency graph, but still could be referenced from
the tree.
2017-12-06 11:54:52 +01:00
1027ddfa2d Depsgraph: Add missing bone properties to proxy rigs 2017-12-06 10:21:33 +01:00
99b9e23ce1 Depsgraph: Add missing NULL pointer check 2017-12-06 10:21:33 +01:00
4c5736a77f Depsgraph: Cleanup, remove unused function 2017-12-06 10:21:33 +01:00
1915c30a42 Depsgraph: Remove workaround of parameters animation in node tree 2017-12-06 10:21:33 +01:00
630ed82ff2 Depsgraph: Remove workaround of parameters animation in lamp 2017-12-06 10:21:33 +01:00
8acca0e9e1 Depsgraph: Remove workaround of parameters animation in camera
This is something what should be done by build_animation().
2017-12-06 10:21:33 +01:00
21ef8e7d29 Depsgraph: Remove workaround for animated geometry component 2017-12-06 10:21:33 +01:00
b552e03716 Depsgraph: Remove workaround for animated modifiers 2017-12-06 10:21:33 +01:00
f348b7924c Depsgraph: Leave armature animation relation to build_animation()
Needs some optimization trick to hook pose init function to animation
instead of a bone. This is how flush will work anyway.
2017-12-06 10:21:33 +01:00
cbb42fcd96 Depsgraph: Use default argument value for relations builder
Follows other function definitions.
2017-12-06 10:21:33 +01:00
18ca793ca0 Depsgraph: Cleanup, line wrapping 2017-12-06 10:21:33 +01:00
abc55bf84a Depsgraph: Use build_animation() to build relations to animated properties
Before that it was up to lots of other places to keep track on whether
something is to be dependent on time or not. Was annoying, and unreliable,
and fragile.

This commit avoids hacks in object builder. Other areas will be adopted
soon.
2017-12-06 10:21:33 +01:00
4a99cc5850 Depsgraph: Add ability to check whether relation exists before adding it
Currently not used, but this is aimed to be used when adding relations from
FCurve to property which is being animated.
2017-12-06 10:21:33 +01:00
8b3aa8ef45 Depsgraph: Cleanup, line wrapping 2017-12-06 10:21:33 +01:00
7de3c8ace7 Depsgraph: Move implementation part of relations header to own file 2017-12-06 10:21:33 +01:00
335343fe93 Fix T53408: Updating Cycles Nodes via Drivers in Material View
This is something what should be supported by the new dependency graph.

Fixed by making it so, build_animation() adds relation between Animation
component and whatever-is-being-animated. In fact, for now, only relations to
ID properties are added. Rest of the relations are kind of hacked in all over
the code and needs to be removed and verified with specific .blend files.
2017-12-06 10:21:33 +01:00
f1ad6b43b3 Depsgraph: Cleanup, split build_animation 2017-12-06 10:21:33 +01:00
9f9b666d9a Depsgraph: Correct fallback for the parameters calculation
We can't use a single component here, sine it might consist of multiple
operations. So, for example, having driver operation will confuse targets
of another driver.
2017-12-06 10:21:33 +01:00
b5a8d0acaf Depsgraph: Cleanup, split driver builder function 2017-12-06 10:21:33 +01:00
3e9cd53687 Depsgraph: Cleanup, deduplicate as much as possible in build_driver 2017-12-06 10:21:33 +01:00
8c4363e3b1 Depsgraph: Remove old comments which are likely outdated 2017-12-06 10:21:33 +01:00
8912e4faef Depsgraph: Replace last obvious part of driver builder with generic RNA code 2017-12-06 10:21:33 +01:00
b26992fe6e Depsgraph: Add criteria for RNA_Key 2017-12-06 10:21:33 +01:00
fe5e8593b7 Depsgraph: Remove confusing ID node criteria
it sometimes overrides all possible other criteria, even tho we might want to
be very specific about what component we are looking for here.
2017-12-06 10:21:33 +01:00
35364e2fb2 Depsgraph: Use generic function for shape key driver target
There was a second place for shape keys.
2017-12-06 10:21:33 +01:00
070c735b13 Depsgraph: Fix wrong relations built for drivers
When target was changed from bone to regular object, new dependency graph was
still trying to build relations as if driver was using bone.
2017-12-06 10:21:33 +01:00
f8fd8b0744 Depsgraph: Use generic function for shape key driver target 2017-12-06 10:21:33 +01:00
235a68d8f3 Depsgraph: Use generic function for modifiers driver target 2017-12-06 10:21:32 +01:00
7586266343 Depsgraph: Use existing utility function to get driver target node
Only done for pose bone for now, but the idea is to go case bu case in
build_driver and move all custom logic from there to find_node_from_pointer().
2017-12-06 10:21:32 +01:00
3795e37c62 Depsgraph: Cleanup, split build_driver function up 2017-12-06 10:21:32 +01:00
52e81de9f7 Depsgraph: Don't see reason to have special case for bone's RNA path 2017-12-06 10:21:32 +01:00
97e92d6f3e Depsgraph: SImplify chjecks in directly address bone 2017-12-06 10:21:32 +01:00
284f106c91 Depsgraph: begin use of RNAPathKey instead of re-implemented checks in driver variables 2017-12-06 10:21:32 +01:00
0cd2303e67 Depsgraph: Cleanup, don't use static qualifier inside of anonymous namespace 2017-12-06 10:21:32 +01:00
aed1320b24 Add utility function to compare PointerRNA with NULL
Thanks Campbell for review!
2017-12-06 10:21:32 +01:00
a68e10be5e Depsgraph: Correct RNA pointer criteria to deal with bone custom properties 2017-12-06 10:21:32 +01:00
e6404274a1 Fix T53441: Inset doesn't start at zero 2017-12-06 16:45:51 +11:00
9ab430e9cb Cleanup: line length 2017-12-06 16:42:34 +11:00
2480a190de CMake: remove git found message 2017-12-06 16:37:50 +11:00
2069102c56 Cycles: Fix constness for load_kernels in device_cpu.cpp 2017-12-06 00:00:18 +01:00
ee120d6293 Fix T53476: File Browser: Selection Issue with 'fill' option.
Fill-selection would only go upward in list of items to find an already
selected one and fill-select all items in-between. Now, in case upward
search fails, it will also intent to go downward, effectiviely allowing
to 'fill-select' from bottom to top.

Note that top-to-bottom keeps priority (i.e. if a top-to-bottom
fill-selection is possible, it will always happen, even if a
bottom-to-top one is also possible).
2017-12-05 22:34:49 +01:00
855799ecc1 Fix T53430: Cut at the strip end fails w/ endstill 2017-12-06 04:52:38 +11:00
a580565086 CMake: avoid checking each MSVC minor revision 2017-12-06 03:38:44 +11:00
a65695759c Fix MSVS2017 compiler version
After last update to Visual Studio 2017 15.5.0 the compiler version changed
2017-12-05 17:16:02 +01:00
3959ce0540 Types are to have explicit forward declaration 2017-12-05 16:54:39 +01:00
70c2d8a1a2 Fix T53469: Make sure that edges are drawn in the backbuff whenever you are looking for the nearest edge
Caused by rB9f5bf19
2017-12-05 11:13:53 -02:00
4f2dd5ad26 Fix for typo in previous commit 2017-12-06 01:14:20 +13:00
52dde11796 Simplify UI-names for B-Bone Ease In/Out settings
For more consistency with the other settings, and increased readability
when the UI is cramped (and it isn't possible to see the whole names).
2017-12-06 00:58:10 +13:00
5d96bc9c5a Version patching fixes for F-Curves (as required for fixes for T48988 and T52009)
* For the T48988 fix (i.e. separate Ease In/Out properties for Bendy Bones
  in Edit vs Pose modes), old animation data needed to be patched to use
  the new property names. This is needed to partially fix some of the
  issues in T53356 (though the Rigify code itself still needs to be patched).

* For the T52009 fix, old files needed to have the frame_start and frame_end
  properties on the FModifier (base-class) updated to match that of the
  FMod_Stepped type-specific class. This wasn't done in the earlier commit
  since it wasn't worth going through all animation data just for the sake
  of updating these relatively-rare settings, but since we're doing it anyway
  now, it makes sense to include this here.
2017-12-06 00:54:39 +13:00
6ebf244ace Added BKE_fcurves_main_cb(), a wrapper around BKE_animdata_main_cb to make it easier to apply fixes to all F-Curves in a file 2017-12-05 17:16:05 +13:00
41b4b8ded6 Cleanup/Style Tweaks to fit rest of code 2017-12-05 17:14:55 +13:00
1802d14394 Fix T53463: Rotation numerical input shows instable behaviour.
Inverting a number in radians when user is in degrees gives rather
unexpected results. ;)
2017-12-04 18:40:33 +01:00
40822ae4e9 Depsgraph: Cleanup, indentation 2017-12-04 15:50:38 +01:00
bdc15061fc Better bevel profile at extreme values of profile.
Patch from Richard Erhardt, with some additions & modifications.
Changes bevel profile shape parameter so that can get arbitrarily
near square profile as parameter -> 1.
Adds code to make profile=0 case work, at least for cube corners,
so changed hard min of profile parameter to 0 from 0.15.
2017-12-04 09:36:14 -05:00
3533e082a0 RNA: Use const qualifier for an utility function 2017-12-04 15:26:43 +01:00
0f8228a890 Depsgraph: Add parameters nodes for bone custom properties
Currently shouldn't make any difference, but this is something what needs to be
done to sanitize drivers relations )with the idea to re-use some generic code
to get operations for driver variables.
2017-12-04 15:10:14 +01:00
9f5bf197a0 Edit Mesh Selection: Draw the backbuff of edge selection only when requested
And make sure the width is 1
2017-12-04 12:05:06 -02:00
d974d25497 Depsgraph: Cleanup, move RNA key constructor to it's file 2017-12-04 14:17:17 +01:00
d5e491c9a7 Depsgraph: Cleanup, don't use bracers in relations names
Those don't bring any information.
2017-12-04 14:17:17 +01:00
5f86d6e6eb Depsgraph: Cleanup, node from RNA pointer search 2017-12-04 14:17:17 +01:00
6b72d87def Depsgraph: Remove unused property based update tags
Those are unused, and not clear whether we will ever support this.

Seems to be better having more like "component" tags, would be less magic
involved to guess what exactly is to be tagged.
2017-12-04 14:17:17 +01:00
0868a2b610 Cleanup: link/append: get rid of booleans in func parameters.
One or two are OK, but more make it rather unreadable, and future work
is likely to require more toggle specific behavior here. So switched to
bitflags, switching from short to int and using 16 upper bits for
'internal' ones defined in BLO_readfile.h, combined with 'public' ones
from user interaction, defined in DNA_space_types.h
2017-12-04 13:09:13 +01:00
5c27523808 Cleanup: wrap long function args in seqeffects 2017-12-04 16:49:30 +11:00
d47d263b4b Cleanup: style 2017-12-04 16:37:31 +11:00
e1eb1fbfca BLI_ghash: Description of GHash, GSet
Also some re-indenting.
2017-12-03 03:35:45 +11:00
d64d8b5be5 Fix Cycles standalone crash when saving output, after recent refactoring. 2017-12-02 05:45:09 +01:00
1d33843ea6 Removing OMP: legacy ccgsubsurf.
Performances gain is rather low this time, about 5% on average (in whole
affected functions).
2017-11-30 19:48:23 +01:00
c241d79dc8 Transform: Use single flag with more meaningful name to prevent snapping to a dependent object
The idea of this flag was to prevent snapping onto an object which depends on
currently modifying ones. Using single flag makes more sense here, and also
makes it possible to replace some ob->recalc based magic with depsgraph query
to set those flags.
2017-11-30 15:03:48 +01:00
47a4a7c8b7 Transform: Remove some legacy code about snapping in particle edit mode
It looks stupid to first force some flag being set and then have workaround
to ignore that flag in snapping code. Let's just not set the flag in the first
place.

The only useful situation where such snapping was usable is to move roots of
disconnected hair, which still works just fine. However, there might be some
other hidden corner case where this workaround was needed.
2017-11-30 14:52:34 +01:00
059b878240 Depsgraph: More full explanation for previous commit 2017-11-30 11:57:21 +01:00
Dalai Felinto
4b9b9dbf93 Depsgraph: Fix DEG_id_type_tag comment 2017-11-30 08:53:11 -02:00
28d2148b09 Haiku OS Support
D2860 by @miqlas

Even though Haiku is a niche OS, only minor changes are needed.
2017-11-30 18:05:21 +11:00
fa3d50af95 Cycles: Improve denoising speed on GPUs with small tile sizes
Previously, the NLM kernels would be launched once per offset with one thread per pixel.
However, with the smaller tile sizes that are now feasible, there wasn't enough work to fully occupy GPUs which results in a significant slowdown.

Therefore, the kernels are now launched in a single call that handles all offsets at once.
This has two downsides: Memory accesses to accumulating buffers are now atomic, and more importantly, the temporary memory now has to be allocated for every shift at once, increasing the required memory.
On the other hand, of course, the smaller tiles significantly reduce the size of the memory.

The main bottleneck right now is the construction of the transformation - there is nothing to be parallelized there, one thread per pixel is the maximum.
I tried to parallelize the SVD implementation by storing the matrix in shared memory and launching one block per pixel, but that wasn't really going anywhere.

To make the new code somewhat readable, the handling of rectangular regions was cleaned up a bit and commented, it should be easier to understand what's going on now.
Also, some variables have been renamed to make the difference between buffer width and stride more apparent, in addition to some general style cleanup.
2017-11-30 07:37:08 +01:00
df7b9fa2ee Fix T53410: 3D Text always recalculated 2017-11-30 17:08:37 +11:00
099a99dbc9 Select similar for bones by group index
D2931 by @col-one
2017-11-30 14:42:18 +11:00
9f1048481c Fix T53420: Vertex Groups: The "-" button gets a hidden function
Guess 'remove all unlocked' is new-ish feature...

To be backported to 2.79a (I think).
2017-11-29 20:19:07 +01:00
José Luis Oliveira Cunha
5ec8a9ac27 Fix T53116: default texture coordinates for volume materials are blank.
Differential Revision: https://developer.blender.org/D2935
2017-11-29 19:21:51 +01:00
e4b54f44c1 Cycles: add object level holdout property.
This works the same as the holdout shader and Z mask layer. Combined with
overrides in 2.8 this is intended to replace the Z mask layer bits.
2017-11-29 18:11:40 +01:00
Maxym Dmytrychenko
7e349f2745 Cycles: improve triangle intersection performance.
Reduces render time by about 1-2% in benchmark scenes.

Differential Revision: https://developer.blender.org/D2911
2017-11-29 18:11:40 +01:00
Maikon Araujo
4b4702ab8a Sequencer: add many more color blend modes, and a new color mix strip.
Differential Revision: https://developer.blender.org/D2872
2017-11-29 18:11:36 +01:00
4f7280da40 Fix paint float color blending bugs with alpha 1.0 and vivid light.
For some blend modes there would be no effect with factor 1.0, even if factor
0.999 would give a very different image. Now the result should have no
discontinuity.

Differential Revision: https://developer.blender.org/D2925
2017-11-29 18:01:36 +01:00
5b5939c6e6 Depsgraph: Cleanup, use explicit NULL pointer checks 2017-11-29 17:55:28 +01:00
1136dee232 Cleanup: De-duplicate code in object update routines 2017-11-29 16:26:16 +01:00
86847bf5ba Cleanup: Split depsgraph uber transform function callback 2017-11-29 16:22:59 +01:00
0af91d7fe6 Cleanup: Remove unused argument 2017-11-29 16:15:52 +01:00
dbde3c78f8 Cleanup: Make object_handle_update easier to follow 2017-11-29 16:12:39 +01:00
1f9387ef91 Cleanup: Remove unused function 2017-11-29 15:59:51 +01:00
60703e45f3 Transform: Avoid use of ob->recalc in snapping code
Do a direct update of object transform instead, without involving
manual trickery of recalc flag.

Shouldn't be functional changes as far as artists are concerned,
but will allow us to get rid of recalc flags in 2.8.

Thanks Bastien for review!
2017-11-29 15:37:09 +01:00
c8b1a83a8c Depsgraph: Fix assert failure 2017-11-29 14:58:37 +01:00
e32cfb0743 Cleanup: rename bpy_util -> bpy_capi_utils
This is for internal CAPI use only, avoid confusion w/ bpy.utils module.
2017-11-29 21:11:29 +11:00
ad7fb1c028 Cleanup: Python imports
Split over lines to diff more easily.
2017-11-29 18:05:41 +11:00
c17c6557b4 PyAPI: add function to check any mathutils type
Also add CheckExact versions of type checking macros.
2017-11-29 16:13:26 +11:00
26a64ba23a RNA: sync API changes from 2.8 2017-11-29 14:13:34 +11:00
Julian Eisel
ad625acda8 RNA: Allow structs to define tags for their properties
Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.

* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.
2017-11-29 13:53:34 +11:00
0b325ba201 PyAPI: PyC_Err_PrintWithFunc utility function
Move function error printing utility into py_capi_utils.
2017-11-29 13:41:10 +11:00
0c7fbc435f Cleanup (remove commented OMP directive). 2017-11-28 16:31:11 +01:00
bf5b931d64 Removing OMP: BKE's tracking_stabilize.
Again, 2 times quicker with BLI than with OMP (from about 5ms to 2.5ms
per frame for the parallelized loop, on a rather small video...).
2017-11-28 12:38:10 +01:00
7c64e33b01 makesdna/makesrna: silence output by default
No need to print status for basic & reliable operations,
build systems can output operations they run if needed,
or debug output changed in the source if developers are debugging.

Nice for ninja, so any printed text hints at a problem to fix.
2017-11-28 20:27:40 +11:00
2bf3825711 Fix T53145: bevel tool does not start with amount at zero. 2017-11-27 16:57:14 +01:00
63bf489734 Cleanup: indentation 2017-11-27 16:22:09 +01:00
9e658b5ebc Remove workaround for loopcut and DM stability
Neither me nor Campbell could redo the issue, lets get rid of this workaround
and fix it properly if still needed.
2017-11-27 15:52:02 +01:00
e3f2b1676c Depsgraph: Make sure unexpected configuration does not happen 2017-11-27 14:51:49 +01:00
ef439a1f7e Sequencer: Fix missing FX compositor when starting rendering from frame with DoF disabled 2017-11-27 14:24:16 +01:00
9b42b3e114 Sequencer: Add option to render OpenGL preview with DoF
The title says it all actually, controlled with DoF check box next to textured
solid check box.

Thanks Campbell for review!
2017-11-27 12:21:21 +01:00
37fc23dd9e Refactor view3d offscreen drawing to avoid having multiple boolean arguments
This is fully unreadable to have lots of boolean arguments scattered across the
whole argument list. What does `false, true, true` mean in terms of behavior?

Replace those with bitfield which has advantage of having more human readable
meaning.
2017-11-27 12:11:56 +01:00
ff9cf06645 Tracking: Cleanup. make code friendly for multi-column editing 2017-11-27 08:50:01 +01:00
7b8e89f297 Cleanup: incorrect comment 2017-11-27 15:15:56 +11:00
440aa2bf70 Cleanup: ImageEditor's mask drawing code was re-implementing BKE_maskrasterize_buffer!
So this deduplicates and simplifies code, yeah.

Also, as an odd bonus, new code seems slighly quicker than previous one
(about 5 to 10% quicker).
2017-11-26 19:18:12 +01:00
06e64058dd Removing OMP: BKE's mask_rasterize.c
Once again nothing much to say here, except that whole mask rendering
process from VSE is about 25% quicker now. ;)
2017-11-26 19:06:26 +01:00
440a49a24c Removing OMP: autotrack BKE code.
Pretty straightforward this time, we already have a single struct
pointer containing all needed data (or nearly).

And we gain about 10-15% speed on tracking! :)
2017-11-26 17:25:41 +01:00
f1ce279903 Removing OMP: bmesh_operators.c
Two more 'not really useful' cases (OMP only shows some noticeable
speedup with above 1M elements, and since this is quick operation anyway
compared to even ather basic operators, gain is in the 1% area of total
processing time in best case).

So not worth parallelizing here, we'll gain much more on tackling heavy
operations. ;)

And BMesh is free from OMP now!
2017-11-26 16:03:29 +01:00
2b6f345558 Removing OMP: bmesh_interp.c
Performances tests on this one are quite surprising actually...
Parallelized loop itself is at least 10 times quicker with new BLI_task
code than it was with OMP. And subdividing e.g. a heavy mesh with 3
levels of multires (whole process) takes 8 seconds with new code, while
10 seconds with OMP one. And cherry on top, BLI_task code only uses
about 50% of CPU load, while OMP one was at nearly 100%!

In fact, I suspect OMP code was not properly declaring outside vars,
generating a lot of uneeded locks.

Also, raised the minimum level of subdiv to enable parallelization,
tests here showed that we only start to get significant gain with subdiv
levels of 4, below single threaded one is quicker.
2017-11-26 16:03:29 +01:00
099bda8875 Removing OMP: nuke last usages in bmesh_mesh.c
Those three ones were actually giving no significant benefits, in fact
even slowing things down in one case compared to no parallelization at
all (in `BM_mesh_elem_table_ensure()`).

Point being, once more, parallelizing *very* small tasks (like index or
flag setting, etc.) is nearly never worth it.

Also note that we could not easlily use per-item parallel looping in
those three cases, since they are heavily relying on valid
loop-generated index (or are doing non-threadable things like allocation
from a mempool)...
2017-11-26 16:03:29 +01:00
Mathieu Menuet
83e80db56e Fix T53349: AO bounces not working correct with OpenCL. 2017-11-26 15:53:00 +01:00
311da4cd16 Cleanup: rename edge -> edges 2017-11-26 20:13:18 +11:00
23252eece6 Minor improvement to last commit
Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.
2017-11-26 18:38:45 +11:00
329bf8e1bf BMesh: improve edge rotate when edges share faces
Previously outcome depended on order of edges,
now the longest boundary edges are rotated first,
then the faces connected edges.

This gives more predictable results, allowing regions containing
a vertex fan to be rotated onto the next vertex.
2017-11-26 17:51:22 +11:00
5b225c59bb Cleanup: move edge-rotate into own file 2017-11-26 13:42:25 +11:00
941deaca7a Fix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated immediately instead of upon LMB 2017-11-26 13:06:16 +13:00
3c1f3c02c6 Fix for Fix (c): broken atomic lock in own bmesh code.
That was a nasty one, Debug build would never have any issue (even tried
with 64 threads!), but Release build would deadlock nearly immediately,
even with only 2 threads!

What happened here (I think) is that gcc optimizer would generate a
specific path endlessly looping when initial value of virtual_lock was
FLT_MAX, by-passing re-assignment from v_no[0] and the atomic cas
completely. Which would have been correct, should v_no[0] not have been
shared (and modified) by multiple threads. ;)

Idea of that (broken) for loop was to avoid completely calling the
atomic cas as long as v_no[0] was locked by some other thread, but...
Guess the avoided/missing memory barrier was the root of the issue here.

Lesson of the evening: Remember kids, do not trust your compiler to
understand all possible threading-related side effects, and be explicit
rather than elegant when using atomic ops!

Side-effect lesson: do check both release and debug builds when messing
with said atomic ops...
2017-11-25 23:14:54 +01:00
dd6c918b2c Fix broken atomic_cas lock in own recent commit in bmesh.
Using atomic cas correctly is really hairy... ;)

In this case, the returned value from cas needs to validate *two*
conditions, it must not be FLT_MAX (which is our 'locked' value and
would mean another thread has already locked it), but it also must be
equal to previously stored value...

This means we need two steps per loop here, hence using a 'for' loop
instead of a 'while' one now.

Note that collisions are (as expected) very rare, less than 1 for 10k
typically, so did not catch the issue initially (also because I was
mostly working with release build to check on performances...).
2017-11-25 20:28:12 +01:00
1caa267ee6 Depsgraph: Cleanup, indentation 2017-11-24 15:45:41 +01:00
5f7981243e Depsgraph: Allow finding operations after construction is done 2017-11-24 15:38:20 +01:00
a8b97b2e41 Depsgraph: Deduplicate operation node finding logic 2017-11-24 15:35:42 +01:00
d232363290 Depsgraph: Use proper return type for find_node method 2017-11-24 15:34:53 +01:00
d80c1e1e11 Depsgraph: Use get_ prefix for function which expect operation to exists 2017-11-24 15:32:29 +01:00
d8f33fc818 Depsgraph: Make has_ prefixed function to return boolean 2017-11-24 15:26:54 +01:00
93e8a045df Depsgraph: Introduce explicit method which finds operation or returns NULL 2017-11-24 15:24:33 +01:00
68654c0be5 Depsgraph: Make more clear what find_operation() is doing for component 2017-11-24 15:21:50 +01:00
8db63c6a1c Cleanup leftover timing debug prints from own recent commits.
Sorry about that...
2017-11-24 10:43:29 +01:00
c62e3a05b0 Cleanup: -Wnonnull-compare GCC warning 2017-11-24 14:29:17 +11:00
b63442e0b6 Minor cleanup for own recent commits. 2017-11-23 22:43:11 +01:00
43ddf0e9a7 Getting rid of OMP: first usage of new parallel BMesh items iteration instead.
`BM_mesh_normals_update` was converted from OMP to new parallel iterator code,
basic test with heavily subdivided cube (24.5k faces) gives:
    - old OMP code: average 10ms per run.
    - new BLI_task code: average 6ms per run.

So new code seems to be easily 40% quicker, in addition to getting rid of OMP. ;)

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D2930
2017-11-23 21:21:32 +01:00
bc3f0cfd14 BMesh: add limited support for parallelization over some basic iterators.
This merely uses new memloop/task looper over vertex/edge/face mempools.

Quite obviously, only BM_VERTS/EDGES/FACES_OF_MESH iterators are
supported.
2017-11-23 21:19:54 +01:00
cf6e8edda5 atomic_ops: add atomic_cas_float helper. 2017-11-23 21:17:16 +01:00
efb86b712d Add a new parallel looper for MemPool items to BLI_task.
It merely uses the new thread-safe iterators system of mempool, quite
straight forward.

Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.

Also added a basic gtest for this new feature.
2017-11-23 21:14:43 +01:00
b84e6dfee4 Add ability to use more than one mempool iterator simultaneously.
This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).
2017-11-23 21:12:00 +01:00
ff9eab7926 atomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.
Checking for type sizes is much nicer with a static assert!
2017-11-23 20:25:55 +01:00
d423e66d34 Add non-gcc variant of static assert macro.
Adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html.

Note that this macro just discards error message, so error when building
is much less nice than with gcc's _Static_assert... But error log will
point to right place in code, so should still be OK.
2017-11-23 20:25:55 +01:00
5e13097dc3 Fix T53145: bevel tool fails when used a second time.
Pixel size was not initial early enough. For first time this was not a problem
because the bevel amount starts at 0 then, and after the mouse moves the pixel
size is initialized. For the second time the bevel amount starts at a non-zero
value, and it failed then.
2017-11-23 20:17:31 +01:00
debd9f6ea1 Fix T53171: lamp specials strength tweak fails with renamed emission nodes. 2017-11-23 19:13:31 +01:00
56da112ae0 Fix T53360: crash with GLSL bump mapping and missing group output node. 2017-11-23 18:12:32 +01:00
f218e6d4da Fix T53276: encoding output quality UI clarification. 2017-11-23 17:55:25 +01:00
6be95f8778 Fix T53357: harmless assert after recent addition of render time pass. 2017-11-23 17:14:35 +01:00
dd04f54e84 Fix inaccuracy when storing material ID pass in half float multilayer EXR.
These and other non-RGB passes should always be stored as full float, the
precision loss is too unpredictable.

Related to T53381, but that one is about file output nodes where we don't
know the type of data being saved currently.
2017-11-23 17:14:04 +01:00
e50ed90e4d Fix T53348: Cycles difference between gradient texture on CPU and GPU. 2017-11-23 17:14:04 +01:00
e704d8a616 Moar attempt to fix bloody MSVC intrinsic mess... 2017-11-23 16:58:20 +01:00
df06f1c816 Attempt to fix bloody MSVC atomic intrinsic mess... 2017-11-23 16:53:03 +01:00
580b34e52b atomic_ops: add char versions of uint8_t atomic primitives. 2017-11-23 16:24:34 +01:00
497e2b3dfa Cleanup: use signed atomic ops when needed. 2017-11-23 16:24:34 +01:00
105b95835f atomic_ops: add signed versions of primitives.
Reason is motsly that dealing with type conversion in calling code is
not great, makes it less readable, and can generate hidden bugs in case
original type changes and atomic primitive calls are not updated
accordingly...
2017-11-23 16:24:33 +01:00
75a87abdc9 Depsgraph: Cleanup, deduplicate code around component registration 2017-11-23 15:23:19 +01:00
f2842ac65e Depsgraph: Cleanup, split build_object() a bit 2017-11-23 12:01:31 +01:00
f3fa5c1258 Depsgraph: Cleanup, always call full object 2017-11-23 11:39:28 +01:00
434ed96dd2 Revert "BLI_utildefines: Support SWAP macro with two args"
This reverts commit d749320e3b.

It's possible the container struct is larger,
we could do sizeof checks that falls back to memmove
but rather avoid complicating things.
2017-11-23 15:21:50 +11:00
3bec70ca60 Use custom SWAP macro for swapping userdef data
Avoids complicating the common case
2017-11-23 15:18:22 +11:00
326efb4319 Fix T53274: Saving template prefs overwrites default prefs 2017-11-23 03:12:00 +11:00
d749320e3b BLI_utildefines: Support SWAP macro with two args 2017-11-23 03:11:48 +11:00
69b5165902 WM: minor correction to user-pref writing
When saving templates had wrong return value.
2017-11-22 17:11:03 +11:00
d77f1d6538 Fix T53313: bevel shader with transmission render artifacts. 2017-11-22 01:59:21 +01:00
5f4058ddbc Removing OMP: get rid of usages in /bmesh/ area.
Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

Other (remaining) usages may be relevant, need case-by-case check.
2017-11-21 22:25:22 +01:00
7770c2ef87 Removing OMP: get rid of last bit in /editors/ area.
Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.
2017-11-21 22:25:22 +01:00
6c372530b4 Cleanup: We do not use camel case in Blender code
At least not for variables.
2017-11-21 17:34:44 +01:00
6785a2bd66 Fix T53371: Keying Node fails with values above 1
This was expected behavior for over-exposured lamps when the mode was originally
created for Tears of Steel. Turns out, there could be really bad green screen in
real production which will only have green (or rather screen) channel over
exposured.

Tweaked condition now so we use least bright channel to see if the area has
proper exposure or not.

Seems to work fine in tests, but further tweaks are possible.
2017-11-21 17:31:45 +01:00
Stefan Werner
58a15b2bfe Cycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit. 2017-11-21 10:43:40 +01:00
d8f80fbe72 Cycles: Fix OSL brick node after recent fix 2017-11-21 04:30:12 -05:00
Stefan Werner
1febc85855 Cycles: Workaround for performance loss with the CUDA 9.0 SDK.
CUDA 9.0.176 apparently caused some slow down on high-end Pascal cards that can be mitigated by increasing the number of registers. See https://developer.blender.org/F1142667 for a detailed comparison.
2017-11-21 10:29:11 +01:00
9325b9bf15 Fix T53365: OpenCL has wrong shading of brick texture
Looks like some weird compiler difference with signed vs unsigned ints.
2017-11-21 00:42:55 -05:00
175e8fdc1e Disable adding scene sequence strips into themselves
D2923 by @spockTheGray w/ edits, see T52586 for details
2017-11-21 16:46:27 +11:00
a591bd203e Cleanup: redundant ELEM use 2017-11-21 16:15:19 +11:00
96415cb52a Code cleanup: fix harmless compiler warning. 2017-11-20 23:32:06 +01:00
d089875c4c Fix build with OSL 1.9.x, automatically aligns to 16 bytes now. 2017-11-20 23:24:24 +01:00
51e2844387 Cycles: Fix wrong behavior of sharpness in Cubic SSS
Was giving difference when using sharpness of 1.0 and 0.999 even though the
result was expected to be really close to each other.

This SSS profile will probably be removed in the future in favor of more
physically bases Burley, but for the time being don't see anything wrong
fixing an existing code.
2017-11-20 11:40:55 +01:00
f34e03d34d Fix (unreported) Crash: broken RNA accessors to tesselated MCol data.
Regression from rB823bcf1689a3 (VPaint 2017 GSoC, this is not in 2.79 release).

Also cleanup, using fake-array-ification to access struct members is
generally not a great idea, but when we already have a totally confusing
broken struct layout, this is pure evil, as demonstrated here!

Found while investigating T53341.
2017-11-20 10:16:50 +01:00
65af15ad88 UV Cube Project: improve default behavior
- initialize the cube-size from the bounding box when it's not set.
- no longer wrap faces to keep in 0-1 bounds,
  other projection methods don't do this and calculating the scale
  prevents the UV's from being too far outside the view.
2017-11-20 19:51:19 +11:00
ed3b7a5cd4 Fix T53342: Outliner 'select hierarchy' broken
Was using cursor position from within menu,
clicking on the same position for every selected item (toggling).

Now operate on each selected outliner element, without toggling.
2017-11-20 16:02:37 +11:00
784614655f Fix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.
Odd nobody noticed this earlier, was obvious bug in code logic here... :/

To be backported to 2.79a.
2017-11-19 20:43:59 +01:00
0a69e3b307 Option not to select with un-hide
D1518 from @mba105 w/ edits
2017-11-20 02:28:07 +11:00
92ea281017 Cleanup: remove BKE_utildefines
This was meant to be used for less general macros but was never used.

Rename BKE_BIT_TEST_SET to SET_FLAG_FROM_TEST
2017-11-20 01:47:31 +11:00
d2b03d2364 Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button 2017-11-20 03:06:13 +13:00
2317fa6dcc Cleanup - Style 2017-11-20 02:56:40 +13:00
6f578740ef Fix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail 2017-11-20 02:55:17 +13:00
e2585c2342 Fix compiler warning
--> render_result.c:832 - formal parameter 6 different from declaration
2017-11-20 02:08:55 +13:00
cc1253a5d9 Fix: "Lock Markers" option was not being obeyed by the "Sync Markers (when transforming)" option 2017-11-20 01:57:22 +13:00
fc77676f33 Bake Action operator: Added missing Bendy Bones support 2017-11-20 01:57:21 +13:00
c5f59f5854 Tweaks to make it easier to update bone motion paths (without the active bone needing to have any paths itself)
This commit introduces the following changes:
* Modified the poll callback on the "Update Paths" operator for bones
  so that it only checks if there are bones that have motion paths
  (instead of checking whether the active bone has paths).

  This makes it easier to update paths without having to first select one
  that has them - useful when the paths are all on hidden/hard-to-select bones.

* Add a readonly property, "has_motion_paths" to the animviz.motion_path
  RNA struct, providing easier access to the internal flag used above.
  This makes it possible for the UI to display the "Update" button without
  having to check various bones for motion paths.


Notes:
* The flag being used in these changes already existed, and was only really
  intended for internal use. However, since it was already used in many places
  for determining if auto-update of all bone paths was needed (e.g. after certain
  editing ops), it should be safe to use here too.

* The update_paths operator currently bakes all paths when activated, so there's
  currently no loss of functionality with changing to not checking if the active
  bone has any paths (e.g. we couldn't only update the active bone only either).
  That is still listed as a todo in the code.
2017-11-20 01:57:21 +13:00
c01ffefb68 Pasting poses now updates motion paths 2017-11-20 01:57:20 +13:00
cda05639df Fix T53229: "Sample Keyframes" errors with multiple pairs of keyframes selected
There were 2 issues here (first was the one reported):
1) Curve shape changes if multiple consecutive pairs of keyframes
   are selected. The problem is that after the first pair is handled,
   subsequent pairs get sampled on the basis of the modified curve.

2) With multiple separate "islands" selected, unselected points in between
   would get ignored, causing the entire curve to get sampled.
2017-11-20 01:57:20 +13:00
Julian Eisel
3133d2d58c Swap priority of system path overrides for dev builds
Suggested by Campbell, thanks!

Also moved the exception into own function and improved comments.

Fixes T53008.
2017-11-19 13:13:37 +01:00
10a112093f Vertex Paint: missed removing settings from UI 2017-11-19 17:00:56 +11:00
a151b46627 Fix T53347: Vertex paint crash on undo/exit 2017-11-19 16:45:27 +11:00
abd5841441 CMake: remove solaris path 2017-11-19 03:46:50 +11:00
83e4e65074 Cleanup: outdated comment 2017-11-19 03:25:52 +11:00
40c8a18229 Cleanup: style 2017-11-18 17:22:54 +11:00
8f56cebe72 Fix BGE sound actuator property access 2017-11-18 17:16:25 +11:00
cd1d9950ab Add select similar custom bone shape
D2820 by @col-one w/ edits
2017-11-18 13:56:35 +11:00
119846a6bb Mikktspace: Speed up the merging of identical vertices
Previously, Mikktspace just bucketed the vertices based on one spatial coordinate and then ran full pairwise comparisons inside each bucket.
However, since models are three-dimensional, the bucketing has a massive false-positive rate, and since pairwise comparison is O(n^2), the merging process is very slow.

But, since we only care about exactly identical vertices, there is a much more efficient approach - we can just hash all values belonging to each vertex and form buckets based on the hash.
Since the hash has 32 bits and considers all values, false-positives are very unlikely - and since both hashing and the radixsort that's used for bucketing are O(n), both asymptotical and
real-world performance (as well as code complexity) are significantly improved.
2017-11-17 18:34:53 +01:00
40f528a7da Cycles: Add per-tile render time debug pass
Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D2920
2017-11-17 16:40:24 +01:00
a0c02e4d1b Cycles: Add Volume Direct and Volume Indirect passes for volume-scattered light
No color pass because it's hard to define what to use as color in a volume.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D2903
2017-11-17 16:39:45 +01:00
f78e963858 Cycles: Refactor PassType from bitflag to index in order to allow for more passes 2017-11-17 16:34:19 +01:00
9c0a38ee33 Depsgraph: Add missing checks from previous commit 2017-11-17 15:27:02 +01:00
c45afcfa81 Depsgraph: Don't make non-dynamic hair dependent on time
This way hair system used for static forest does not make playblack slow.

A bit dangerous, but let's see how far we can go!
2017-11-17 14:57:57 +01:00
759b50b20b Fix UV Projection Center Calculation
UV project mixed up global/local space,
3D cursor offset didn't take object scale into account.

Minor improvements:

- Match Cube Project 'center' behavior w/ sphere & cylinder.
- Add active-element center.
- Wrap UV's in Cube Project based on center instead of first vertex.
2017-11-17 22:30:28 +11:00
d697e3d46e BLI listbase: add bytes finding helpers.
Quite similar to string ones actually, except more generic. Used in
id_override_static branch currently.
2017-11-16 12:49:31 +01:00
470b4cb62f Cycles: Fix crash with split branched path tracing
ShaderData memory was getting clobbered in the branched path code paths.

Was caused by 087331c495
2017-11-16 04:59:31 -05:00
9c7b89241d BLI_utildefines: sync w/ 2.8 2017-11-15 23:06:34 +11:00
474362b363 Cleanup: use 'uint' 2017-11-15 22:58:39 +11:00
9cbf374814 GSet: utils to access data stored outside the set 2017-11-15 22:45:37 +11:00
556b13f03e Fix T53309: Remove default 'Clear loc/rot/scale delta transform' shortcuts.
The loc one (shift-alt-G) was same as 'remove selected from active group'
action... Clear delta transform is not a common operation, so we can
live without a default shortcut for it.

Note that using same key (G) in same space for two completely different
kind of operations is probably a rather bad thing, nice topic for future
keymap work. ;)

Probably nice to have in 2.79a.
2017-11-14 22:51:44 +01:00
67ddc28055 Smoke: Pass non-trivial arguments by const reference 2017-11-14 17:11:48 +01:00
2868dcbe2b Fix compilation error with clang-5 2017-11-14 17:11:48 +01:00
6f15554af3 Alembic: Fix mismatch in forward declaration with definition 2017-11-14 17:11:48 +01:00
0a3fa9c25c Fix missing SpinLock typedef on macOS 2017-11-14 16:51:34 +02:00
55696b56d9 Fix T53068: AMD Threadripper not working well with Blender
The issue was caused by SpinLock implementation in old pthreads we ar eusing on
Windows. Using newer one (2.10-rc) demonstrates same exact behavior. But likely
using own atomics and memory barrier based implementation solves the issue.

A bit annoying that we need to change such a core part of Blender just to make
specific CPU happy, but it's better to have artists happy on all computers.

There is no expected downsides of this change, but it is so called "works for
me" category. Let's see how it all goes.
2017-11-14 12:21:15 +01:00
7adc698eed Cleanup: order BLI before BKE headers
This was done nearly everywhere already
2017-11-14 17:23:40 +11:00
40ad1cf0b1 BLI: sync changes from 2.8 2017-11-14 16:10:48 +11:00
212a8d9e5a Cycles: Make per-object random value output also work for Lamps 2017-11-14 04:17:54 +01:00
d8066fb0f1 Cycles: Refactor closure roughness detection to fix a potential bug with Denoising of specular shaders 2017-11-14 04:17:54 +01:00
Dalai Felinto
f402638211 Cleanup on depsgraph logic 2017-11-13 12:17:14 -02:00
8a03e4d409 Depsgraph: Fix relations for metaballs
Initially spotted and investigated by Dalai and Germano.
2017-11-13 14:43:08 +01:00
d1a761c4d4 Cycles: Fix compilation error of standalone application 2017-11-13 10:49:05 +01:00
42dff6cc2e Cycles: Fix compilation error with OIIO compiled against system PugiXML 2017-11-13 10:42:29 +01:00
e568c1a975 Fix T53289: CUDA missing textures not showing pink, after recent changes. 2017-11-12 20:45:47 +01:00
ebcb880375 Fix T53273: render bake settings properties not showing correct Python path. 2017-11-12 20:30:28 +01:00
5b3c15e336 Fix T53294: bpy.ops.image.open crash 2017-11-12 16:05:28 +11:00
aae8e21100 BMesh Py API: Expose color alpha 2017-11-12 15:48:24 +11:00
e389ae9dca Cycles: Set error if a split kernel fails to load
To help catch cases where adding a new kernel is missed for one of the
device implementations.
2017-11-11 01:01:14 -05:00
d95eabf0a9 mball_tessellate: Simplify face creation
Faces that have the last two indices equal are considered triangles, and not those that the last index is 0
Improvement of 7% in performance of the `polygonize` function
2017-11-10 12:58:34 -02:00
db7a78a2be Cycles: Fix compilation error with latest OIIO
There was some changes about namespaces, which causes ambiguities.

Replaces using namespace with an explicit symbols we need. Is good idea to NOT
pull in the whole namespace anyway!
2017-11-10 10:04:33 +01:00
a466d7ae24 Cycles: better distance sampling for chromatic volume extinction.
Previously we picked one of the RGB channels with equal probability, but this
works poorly in a dense volume after many bounces. Now we take into account
the throughput and single scattering albedo.

This makes it a little more practical to do brute force SSS with volumes, but
is still very inefficient because we do direct light sampling at every volume
bounce even when inside an opaque mesh. In theory there could be a light inside
the mesh so we can't automatically disable direct lighting.
2017-11-10 01:37:10 +01:00
21a535840d Fix T53270: crash with multiscatter GGX after recent refactoring.
In fact this was an existing issue when exceeding the number of available
closure, but it's more common now that we set the number to 0 for shadows
and emission
2017-11-09 20:28:00 +01:00
1ffa01b6f8 Fix (harmless) valgrind warning. 2017-11-09 20:28:00 +01:00
bd4bea3e98 Cycles: avoid reallocating tile denoising memory many times during render. 2017-11-09 20:28:00 +01:00
Stefan Werner
df886b178c Moved alignment attributes from my last commit to BLI_compiler_attrs.h for future use. 2017-11-09 14:59:31 +01:00
Stefan Werner
83d9f8e379 Compositor: Ensured 16 byte alignment for variables accessed by SSE instructions.
Before this patch, the XBlur/YBlur compositor nodes would crash for me when run in a MSVC 2015 debug build (test scene: BMW27_cpu). I added the compiler instructions to explicitly align the local variables that the SSE instructions are accessing.
2017-11-09 14:38:17 +01:00
Dalai Felinto
08a023d7ca Cycles: Silence warning when building without OSL 2017-11-09 08:39:30 -02:00
Dalai Felinto
ee49ee24c3 Fix: unselectable objects can be selected via the NLA editor
This is not reported anywhere, but it's easy to reproduce. I ran into this
while updating this code for the blender2.8 branch.
2017-11-09 08:27:38 -02:00
Dalai Felinto
92b342d30d Fix logic for pinning textures users from context
This was wrong since it's concenption in 28ee0f9218.
The if statement was returning true when pinid was NULL, and false otherwise.

However when scene is pinned we also want to run this code.
Code snippet by Brecht Van Lommel.
2017-11-09 08:19:52 -02:00
8d7ec519df Depsgraph: Add missing handlers of node IDs
Worst thing was that point density did not pull object into dependency graph,
which could lead to wrong render results.
2017-11-09 10:33:44 +01:00
5e38ee996c Depsgraph: Remove chains of scene being passed all over in relations builder 2017-11-09 10:33:44 +01:00
f424d5b5c9 Depsgraph: Cleanup, remove scene being passed all over
Use the state one instead.
2017-11-09 10:33:44 +01:00
ad986ae29e Depsgraph: Remove bmain from internal builder API
Use the one from state.
2017-11-09 10:33:44 +01:00
887c2e5c0d Depsgraph: Make bmain part of builder state and remove bmain from public API 2017-11-09 10:33:44 +01:00
70e34ac186 Depsgraph: Cleanup, use google style for private members 2017-11-09 10:33:44 +01:00
9f0842bbe8 Depsgraph: Synchronize nodes and relations builders 2017-11-09 10:33:44 +01:00
1018683def Depsgraph: Fix wrong ID type being compared 2017-11-09 10:33:44 +01:00
98425563ed Depsgraph: Cleanup, reduce indentation level 2017-11-09 10:33:43 +01:00
449687d50a Depsgraph: Assert when node uses unhandled ID type 2017-11-09 10:33:43 +01:00
087331c495 Cycles: Replace __MAX_CLOSURE__ build option with runtime integrator variable
Goal is to reduce OpenCL kernel recompilations.

Currently viewport renders are still set to use 64 closures as this seems to
be faster and we don't want to cause a performance regression there. Needs
to be investigated.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2775
2017-11-09 01:04:06 -05:00
Dalai Felinto
6febe6e725 Silence warning from Collada 2017-11-08 18:33:17 -02:00
5fc1faa737 I18n: add Hausa languages, since we now have a few messages translated. ;) 2017-11-08 10:11:37 +01:00
3f614cda12 Fix blender player build. 2017-11-08 01:11:17 +01:00
a0478ebe37 Fix incorrect bevel shader in GLSL (should work as if there is no bevel node). 2017-11-08 00:19:24 +01:00
05b08a3b6d Fix T53092: errors reading EXR files with different data/display window.
Multilayer/multiview OpenEXRs did not read the full data window like single
layer, now it should be consistent.
2017-11-07 23:20:22 +01:00
2a097527f2 Fix various issues with (multiview) OpenEXR file save/load.
* Fix saving a multiview render from the image editor giving invalid files.
* Fix failure to load multiview images with a single view per part.
* Fix loss of multiview metadata when saving/loading a single view.
* Fix Z-Buffer writing option for single layer EXR not being respected.

Multiview EXRs are now always handled as multilayer internally, significantly
reducing the amount of code.

Reviewed By: dfelinto

Differential Revision: https://developer.blender.org/D2887
2017-11-07 23:20:22 +01:00
ed7260071b Fix EXR multilayer compositing result saving issues.
* It was saved as Combined.Combined instead of Composite.Combined.
* It was written even if no compositing was enabled.
2017-11-07 22:35:12 +01:00
e0936e74ab Fix image editor showing pass name when there is only a combined pass. 2017-11-07 22:35:12 +01:00
3dec1de275 Fix incorrect color management when saving JPG previews for EXR. 2017-11-07 22:35:12 +01:00
26f39e6359 Cycles: add bevel shader, for raytrace based rounded edges.
The algorithm averages normals from nearby surfaces. It uses the same
sampling strategy as BSSRDFs, casting rays along the normal and two
orthogonal axes, and combining the samples with MIS.

The main concern here is that we are introducing raytracing inside
shader evaluation, which could be quite bad for GPU performance and
stack memory usage. In practice it doesn't seem so bad though.

Note that using this feature can easily slow down renders 20%, and
that if you care about performance then it's better to use a bevel
modifier. Mainly this is useful for baking, and for cases where the
mesh topology makes it difficult for the bevel modifier to work well.

Differential Revision: https://developer.blender.org/D2803
2017-11-07 22:35:12 +01:00
f79f386731 Code refactor: rename subsurface to local traversal, for reuse. 2017-11-07 22:35:12 +01:00
d0af56fe3b Cycles: antialias normal baking if the mesh has a bump map. 2017-11-07 22:35:12 +01:00
ff34e48911 Cycles: add an extra CUDA synchronize before rendering.
It should not be needed as far as I know, but just in case it fixes any
of the recent issues like T52572.
2017-11-07 22:35:12 +01:00
e74b229342 Fix incorrect MIS weights in Cycles with multiple lights.
This causes some difference in the classroom scene, where ray visibility
tricks are used and break the MIS balance. Otherwise there doesn't seem
to be much effect, but better to use the right formulas. Problem originally
identified by Lukas.
2017-11-07 22:35:12 +01:00
5f2be40658 Windows: Add additional crash diagnostic information.
To help diagnose issues like T53259, it is useful to know the module causing the issue (is it us, or some opengl icd, or python module?) and while we cannot do stackdumps on release builds on windows, it is possible to display the faulting module. This commit changes the exception handler to output the following information:

Error   : EXCEPTION_ACCESS_VIOLATION (Type of exception , this we had before)
Address : 0x0000000140193726 (Address of the exception, new)
Module  : k:\BlenderGit\build_windows_Full_noge_x64_vc15_Release\bin\Release\blender.exe (module of the exception, new)
2017-11-07 07:57:59 -07:00
1a1fb5a47c Cycles: Cleanup, style 2017-11-07 13:55:58 +01:00
0e3fd70d7a Fix T53129: Cycles missing update when changing image auto refresh.
Previously auto refresh worked, but only if it was already enabled before
starting the viewport render.
2017-11-07 03:05:42 +01:00
956ee5e265 macOS: remove old OpenMP lib stuff from cmake 2017-11-06 23:54:35 +02:00
66a6d160fe Rename ID_IS_LINKED_DATABLOCK to ID_IS_LINKED.
This makes code closer to id_override/assent-engine ones, which
introduce a new type of linked data, and hence reserve
ID_IS_LINKED_DATABLOCK to real linked datablocks.
2017-11-06 17:17:10 +01:00
b28da9dbf8 Fix T53250: Crash when linking/appending a scene to a blend when another linked scene in this blend is currently open/active.
Inner DAG code would not check against NULL pointer, and in case of an
active linked scene, scene pointer will be NULL here, so we have to
check it ourself. ;)
2017-11-06 15:16:40 +01:00
8a72be7697 Cycles: reduce closure memory usage for emission/shadow shader data.
With a Titan Xp, reduces path trace local memory from 1092MB to 840MB.
Benchmark performance was within 1% with both RX 480 and Titan Xp.

Original patch was implemented by Sergey.

Differential Revision: https://developer.blender.org/D2249
2017-11-05 20:48:33 +01:00
c571be4e05 Code refactor: sum transparent and absorption weights outside closures. 2017-11-05 18:13:44 +01:00
2c02a04c46 Code refactor: remove emission and background closures, sum directly. 2017-11-05 18:13:44 +01:00
cac3d4d166 Cycles: fix inefficient attribute map storage, saves 615MB in victor scene. 2017-11-05 18:00:48 +01:00
5801ef71e4 Code refactor: device memory cleanups, preparing for mapped host memory. 2017-11-05 15:22:04 +01:00
5475314f49 Cycles: reserve CUDA local memory ahead of time.
This way we can log the amount of memory used, and it will be important
for host mapped memory support.
2017-11-05 15:22:04 +01:00
18d7fbe4f5 Cleanup: order buffer length after the buffer 2017-11-06 00:04:46 +11:00
2837a7e198 Cleanup: remove paranoid NULL check 2017-11-05 23:34:40 +11:00
914e3b1645 Cleanup: indentation, line wrapping 2017-11-05 14:50:15 +11:00
43f3cfd584 Cleanup: spelling 2017-11-05 14:33:18 +11:00
01a3c95609 UI: tool-tip refactor, don't hard code field types
Allow other kinds of tips be created w/o exceeding hard limits.
2017-11-04 21:15:18 +11:00
25f56d7a7b UI: correct flag re-use
Adding ability to show a button as pressed w/o UI_SELECT set caused
other flags to be cleared that shouldn't have been.
2017-11-04 14:13:04 +11:00
33b5e8daff Code refactor: replace CUDA array with linear memory for 1D and 2D textures.
This is a prequisite for getting host memory allocation to work. There appears
to be no support for 3D textures using host memory. The original version of
this code was written by Stefan Werner for D2056.
2017-11-04 02:23:00 +01:00
6ec599c682 Fix T53247: mixed CPU + GPU render wrong texture limits. 2017-11-03 20:32:29 +01:00
6664ee209e Scene RNA API: More global mains goes away 2017-11-03 16:28:37 +01:00
f1c78ecc63 Scene RNA API: Main from globals goes away
Bye bye..
2017-11-03 16:15:49 +01:00
2a87bd8995 Cleanup: split interface_regions.c
Each region type is quite separate and file was getting too big.
2017-11-03 20:57:09 +11:00
d19d094ca9 Fix incorrect allocation size 2017-11-03 20:52:04 +11:00
fbb9b70484 Fix Blenderplayer (tm) 2017-11-03 00:39:50 +01:00
50c129760d Fix Cycles showing empty tiles while they are being denoised. 2017-11-02 15:23:55 +01:00
25f2abf314 Cleanup: minor comment correction 2017-11-03 01:10:03 +11:00
9ece0ee5fe UI: add UI_SELECT_DRAW flag
Allow to draw as pressed w/o interfering with behavior.

Resolves issue where buttons raised on mouse-over.
2017-11-03 00:47:51 +11:00
8a3728800c Alembic: not using global in unit test.
Thanks @sergey for pointing out this fix.
2017-11-02 14:33:21 +01:00
ff97dcebf3 Fix T53182: cancelling save buffers + denoising render clears image. 2017-11-02 14:31:05 +01:00
6355d98267 UI: free up bit in uiBut.flag 2017-11-03 00:27:29 +11:00
5cb8730689 Cycles: Add another limit to OpenCL memory usage
Some drivers may report very large allocation sizes, which could cause
unnecessary memory usage. This is now limited to 2gb which should
still be enough to get the needed performance benefits without waste.
2017-11-02 08:14:21 -04:00
be5123a0a9 Space clip: Make it more clear that filter track does not use any settings from tool shelf 2017-11-02 12:33:39 +01:00
e32c1bd5d0 UI: use button_operator in operator_menu_hold
Move draw calls into UI_menutype_draw
2017-11-02 18:21:59 +11:00
765e28948e Cleanup: code style 2017-11-02 15:09:11 +11:00
8bdc391c54 Implement a new automatic handle algorithm to produce smooth F-Curves.
The legacy algorithm only considers two adjacent points when computing
the bezier handles, which cannot produce satisfactory results. Animators
are often forced to manually adjust all curves.

The new approach instead solves a system of equations to trace a cubic spline
with continuous second derivative through the whole segment of auto points,
delimited at ends by keyframes with handles set by other requirements.

This algorithm also adjusts Vector handles that face ordinary bezier keyframes
to achieve zero acceleration at the Vector keyframe, instead of simply pointing
it at the adjacent point.

Original idea and implementation by Benoit Bolsee <benoit.bolsee@online.be>;
code mostly rewritten to improve code clarity and extensibility.

Reviewers: aligorith

Differential Revision: https://developer.blender.org/D2884
2017-11-01 21:57:39 +03:00
88356a2442 Cleanup: use term shape-preset in widget code 2017-11-02 05:48:59 +11:00
a6e1f7560f UI: Option to draw button pressed
Needed to show the active tool
2017-11-02 05:02:56 +11:00
3ec4d0b51b UI: Add UILayout.operator_menu_hold
This is an operator button that opens a menu when the button is held.
2017-11-02 05:01:10 +11:00
07dbff7dc1 Fix T53217: GLSL principled BSDF black with zero clearcoat roughness. 2017-11-01 17:14:06 +01:00
71f46bc367 Cycles: Add utility function to distinguish between scatter and absorption volume ID 2017-11-01 11:10:51 +01:00
5d7138c08a Cycles: Cleanup, make it more obvious what preprocessor belongs to 2017-11-01 11:10:10 +01:00
7f45acee80 Cycles: Cleanup, delete trailing whitespace 2017-11-01 11:06:55 +01:00
a819ef65c0 Fix for T48988 - Enabling bbone easing for posemode
This fix enables the usage of bbones easing parameters for edit and pose mode seperately. This allows animators to take advantage of the functionality and may eliminate confusion as the parameters now behave similar to other bbone parameters.

Note that splitting the parameters between the modes effectively creates a new parameter set. Blend files of previous versions do not contain this information and will have the values set to 0 on load. As it broke backwards compatibility for pose mode values anyway, I also took the liberty to rename the easing parameters in some places for consistency (which breaks edit mode values).

Reviewers: aligorith

Subscribers: aligorith

Tags: #animation

Differential Revision: https://developer.blender.org/D2796
2017-11-01 14:42:08 +13:00
2ae6a93f05 Cleanup: style 2017-11-01 11:56:56 +11:00
4e33d07565 Fix bplayer (c)
Like seriously guys... twice within a few hours, compile full blender please
when you change APIs!
2017-10-31 17:15:16 +01:00
5296c2e099 Experiment with adding output file meta data from render engine
The idea is to make it possible to report extra meta data from
render engine to the file writing. This way we can provide
additional information such as number of samples rendered by
resumable Cycles rendering so we can easily combine files back.

Currently only report number of samples from Cycles when rendering
a single render-layer scene. This is something what was required
here at the studio. We can easily extend that further.

Ideally we would also need to support non-string metadata, but
that's for later.

Reviewers: mont29, campbellbarton

Reviewed By: mont29, campbellbarton

Subscribers: sybren, candreacchio

Differential Revision: https://developer.blender.org/D2502
2017-10-31 15:05:53 +01:00
022fd32126 Add ability for render engines to report extra meta data to pipeline 2017-10-31 15:05:53 +01:00
040ea95517 Add ability to specify custom fields to be saved from render result 2017-10-31 15:05:53 +01:00
a6d2fd0215 Stamp info: Use dedicated function to free up memory
This way it's more flexible to extend StampData structure
with additional stuff which might require memory free.
2017-10-31 15:05:53 +01:00
7fb393f9ba Fix bplayer (c) 2017-10-31 14:52:52 +01:00
f1c7243376 Tracking: Create mesh from selected tracks only
Patch by Sebastian Koenig. thanks!
2017-10-31 14:02:32 +01:00
46963f359d Cycles: Bump version number to 1.9.0
This matches Blender Release 2.79.
2017-10-31 13:34:34 +01:00
39671ac504 Fix crash of standalone app after recent refactor 2017-10-31 13:34:23 +01:00
076abf6cd8 MacOS: Use correct Cocoa protocol on any compiler 2017-10-31 11:30:55 +02:00
98052162e1 UI: replace UI_ITEM_O_RETURN_PROPS /w return arg
Means we can have a version of this function that returns the button
and avoids returning a struct that often isn't used.
2017-10-31 17:04:55 +11:00
fe3571b362 UI: avoid double operator type lookup 2017-10-31 12:44:41 +11:00
ca006deafe Fix T53191: Python API Reference link wrong in splash screen.
Forgot to update splashscreen links when we switched API doc naming
scheme...
2017-10-30 13:00:32 +01:00
80465ba35a Curve Decimate: new tool to simplify bezier curves
Access from the curve clean-up menu
2017-10-30 22:36:51 +11:00
e8daf2e3ea CMake: cleanup 2017-10-30 12:59:36 +11:00
475ec5269a CMake: use only absolute linker paths for msvc.
cmake's link_directories will supply forward slashes for the search paths, the msvc linker has some issues with that, while it will search for the needed libs just fine, the incremental linker gets fed forward slashes for some libs, while the previous binary has backward slashes in it's metadata, the linker assumes obj files got added and performs a full link instead of an incremental link. This change brings down the link time with newer msvc versions for a trivial edit down from a few minutes to a few seconds.
2017-10-29 13:16:22 -06:00
6099b2620d Alembic: added frame offset property
The offset is subtracted, so that it's intuitive (dragging slider pushes
the animation further that way on the timeline).
2017-10-29 17:23:50 +01:00
bbc7eb8ae5 Cycles: restore SOBOL_SKIP hack, for some cases where it helps still. 2017-10-29 16:44:20 +01:00
89eb05a890 Alembic: exporting MetaBalls as mesh
- Only basis balls are exported, as they represent the resulting mesh.
  As a result the mesh is written to Alembic using the name of the basis
  ball.
- MetaBalls are converted to a mesh on every frame, then an
  AbcMeshWriter is used to write that mesh to Alembic.
2017-10-29 15:21:36 +01:00
d9000495e1 Include file for DNA_DEPRECATED macro 2017-10-29 14:36:10 +01:00
0012d54a70 Alembic import: fixed mesh corruption when changing topology
When the mesh changed topology but kept the vertex count the same, it would
result in a corrupt mesh. By checking the face & loop counts too, this has
become less likely.

I've checked IPolyMeshSchema::isConstant(), but it returns true even when
we see that the mesh changed topology.
2017-10-29 14:36:10 +01:00
ab2d1f61a8 BMesh: use heap update for dissolve-decimate 2017-10-30 00:39:00 +11:00
512b879241 BLI_heap: add validation check, improve tests
Also minor readability changes, avoid running both heap_up/down
gives minor speedup too.
2017-10-29 18:23:33 +11:00
560fa6db17 Curve Fitting: heap reinsertion optimization 2017-10-29 16:33:44 +11:00
bd0d41059f Cleanup: move docs out of header 2017-10-29 16:08:10 +11:00
4518c0f3e8 Cleanup: const args 2017-10-29 15:47:10 +11:00
3425732926 BLI_heap: minor changes to the API
Recent addition of 'reinsert' didn't match logic for ghash API.

Rename to BLI_heap_node_value_update,
also add BLI_heap_insert_or_update since it's a common operation.
2017-10-29 15:47:06 +11:00
336885beba Use BLI_heap_reinsert for decimate and beautify
Improves performance for high poly meshes,
~70% faster for decimate, only ~10% for beautify.
2017-10-29 05:28:00 +11:00
4af1af70ad BLI_hash: add BLI_heap_reinsert
Allows avoiding remove/insert calls.
2017-10-29 04:42:58 +11:00
b84e3dc7f3 GTest: initial BLI_heap test 2017-10-29 00:56:56 +11:00
1e07f366e6 Fix T53185: After rendering an animation (Ctrl-F12), pressing F12 no longer renders single frames only 2017-10-29 02:09:57 +13:00
fdae9e1e03 BLI_array_store: correct hashing single bytes
The single byte version of hash_data was casting from unsigned char
instead of signed.

This didn't cause any errors since the result of each aren't compared.
Even so, better keep them matching.
2017-10-28 18:28:55 +11:00
8ac69ff9dc Cleanup: use uint type in BLI 2017-10-28 17:48:45 +11:00
1d409defbf Docs: clarify return value for BVH API 2017-10-27 16:14:24 +11:00
282af08fe2 Fix T53131: Incorrect vert-edge angle calculation
Vertex w/ a single edge wasn't detected
2017-10-27 13:10:36 +11:00
Julian Eisel
d245d36074 Remove SCREEN_OT_header_flip, use SCREEN_OT_region_flip instead
Basically reverts rB65c4149f203610 and fixes the issue in a better way.

Keymaps using the removed operator will be affected. Switching header
from top to bottom now has the shortcut F5, just like switching other
regions.
2017-10-26 22:40:24 +02:00
1effab7809 Fix T52984. Trackpad rotation to natural direction 2017-10-26 23:11:25 +03:00
03a582ceeb Using gtest fixtures in Alembic export tests 2017-10-26 12:43:59 +02:00
81f2e68e20 Event System: check_click was left set
Caused by own change 137586a13c
2017-10-26 16:08:45 +11:00
171c4e982f Cycles: use AO factor to let user adjust intensity of AO bounces.
We are already using the AO distance, so might as well offer this extra
control over the intensity. Useful when an interior scene is supposed to
be significantly darker than the background shader.
2017-10-25 21:46:23 +02:00
8988f383c1 Depsgraph: Cleanup, remove redundant calls to add_component 2017-10-25 14:40:38 +02:00
50d30cc5fd Depsgraph: Need to tag relations for update after new clip was added 2017-10-25 14:20:20 +02:00
ea5cf3ff7a Depsgraph: Rework debug relations update function
Make it a tag for relations update function instead, since we will not be able
to easily rebuild relations, and we wouldn't be able to iterate all scenes.

This is a part of mowing depsgraph to be per-workspace/layer in 2.8 branch.
2017-10-25 12:11:49 +02:00
0bbf2f9554 Depsgraph: Add missing forward struct declarations 2017-10-25 12:11:12 +02:00
b4ba1068c1 Depsgraph: Cleanup, trailing whitespace and braces 2017-10-25 12:07:51 +02:00
3fe534eebb Depsgraph: Make depsgraph.debug_stats to return a string
This way we can see result in the python console.
2017-10-25 12:06:56 +02:00
6ec8344243 Depsgraph: Add missing movie clip dopesheet invalidation 2017-10-25 11:45:31 +02:00
eb090d0609 Depsgraph: Use explicit opcode for shape key 2017-10-25 11:37:24 +02:00
a2e22c79cb Depsgraph: Cleanup, use explicit cloth modifier opcode
Avoids use of placeholder operation which also was involving some string
comparisons.
2017-10-25 11:34:41 +02:00
3997a157e9 Depsgraph: Cleanup, don't call explicit add_id()
This is redundant, adding components will check for ID to exist.
2017-10-25 11:31:22 +02:00
1bdc687e7a 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-10-25 11:25:10 +02:00
11d7445905 Depsgraph: Cleanup, use proper style for macro loop 2017-10-25 11:25:10 +02:00
45329ce319 Depsgraph: Remove unsued node flag 2017-10-25 11:25:10 +02:00
ea29e4c997 Depsgraph: Make operation codes more obvious
This synchronizes al lrelated changes from blender2.8 branch.
2017-10-25 11:25:10 +02:00
f29ff14d6e Depsgraph: Remove bunch of debug code
Was never actually used and implementation seems to be slow: we shouldn't be
doing per-node evaluation hash lookups, adds too much overhead. We can instead
store statistics in the node itself, and maybe even group them somehow.

Ideally such a statistics should be user-friendly so riggers and animators
can see exactly what's happening.
2017-10-25 11:25:10 +02:00
2103194f79 Fix T53004: XWayland ignores cursor-warp calls
There is currently a limitation in XWayland,
the cursor needs to be hidden during warp calls.
2017-10-25 20:12:12 +11:00
83877632a3 Fix one more assert being triggered due to recent changes. 2017-10-25 01:22:16 +02:00
34fe3f9c06 Code refactor: remove MEM_WRITE_ONLY, always use MEM_READ_WRITE.
It's unlikely the driver can do useful optimizations with this, and if
we sum multiple samples we are reading from the memory anyway.
2017-10-24 23:53:09 +02:00
fe253389e0 Fix Cycles gtests build on macOS. 2017-10-24 17:52:20 +02:00
ec49503a33 Fix T53146: incomplete multi GPU and CPU + GPU memory statistics.
Part due to recent changes, part old bug.
2017-10-24 17:40:43 +02:00
e03df90bf3 Cycles: Fix compilation in debug mode
Please check compilation before committing refactor changes!
2017-10-24 12:09:02 +02:00
eccd18a91f Cycles: Fix compilation error without C++11 2017-10-24 11:14:01 +02:00
d0f48d33f4 Cycles: Fix memory leak in test and simplify code 2017-10-24 11:12:28 +02:00
1dd33b2f23 Cycles: Fix test compilation failure after recent refactor
The test will leak CPU devices, but is all passing other than that.
Leak will be fixed shortly.

P.S. Committing code refactor without running regression tests, tsk ;)
2017-10-24 10:48:16 +02:00
136f33b09f Fix T53143: Knife Crash after Grid Fill
BM_ELEM_INTERNAL_TAG flag wasn't ensured to be cleared.
2017-10-24 17:21:25 +11:00
8661ab12a6 Fix BMesh PyAPI internal flag clearing logic
Would leave the flag set on raising an exception.
2017-10-24 16:52:54 +11:00
c93cfcbb61 Fix edge-split bmesh operator giving empty result 2017-10-24 16:31:35 +11:00
c71f2f1404 Fix T53130: NLA Tweak (moved) Tracks + Alt+RMB Select does not work in Graph Editor 2017-10-24 16:27:56 +13:00
a1aad1f8d1 Fix T53134: denoising with CPU + GPU render leaves some tiles noisy. 2017-10-24 04:09:48 +02:00
070a668d04 Code refactor: move more memory allocation logic into device API.
* Remove tex_* and pixels_* functions, replace by mem_*.
* Add MEM_TEXTURE and MEM_PIXELS as memory types recognized by devices.
* No longer create device_memory and call mem_* directly, always go
  through device_only_memory, device_vector and device_pixels.
2017-10-24 01:25:19 +02:00
aa8b4c5d81 Code refactor: use device_only_memory and device_vector in more places. 2017-10-24 01:25:13 +02:00
7ad9333fad Code refactor: store device/interp/extension/type in each device_memory. 2017-10-24 01:03:59 +02:00
ae41f38f78 Code refactor: pass device to scene, check OSL with device info. 2017-10-24 01:03:59 +02:00
cc96cdd9d4 VSE: draw grid lines at every second
Was hard-coded to 25 frames.

D2893 by @jooert
2017-10-23 22:29:49 +11:00
1aa5b63661 Docs: improve bmesh exception message
Suggested in T53131
2017-10-23 21:57:32 +11:00
af067f2305 Correct gtest error in recent beautify change 2017-10-23 14:20:35 +11:00
6dfe4cbc6b Polyfill Beautify: half-edge optimization
Was using an edge hash for triangle -> edge lookups,
updating triangle indices for each edge-rotation.

Replace this with half-edge which can rotate edges much more simply,
writing triangles back once the solution has been calculated.

Gives ~33% speedup in own tests.
2017-10-23 01:40:03 +11:00
57a0cb797d Code refactor: avoid some unnecessary device memory copying. 2017-10-21 20:58:28 +02:00
92ec4863c2 Code refactor: simplify image device memory allocation. 2017-10-21 20:58:28 +02:00
0836795a0d Fix issue with resumable rendering in recent changes. 2017-10-21 20:57:52 +02:00
6199a606a6 Cycles: disable progressive refine if denoising or save buffers is used.
Progressive refine undoes memory saving from save buffers, so enabling
both does not make much sense. Previously enabling progressive refine
would disable denoising, but it should be the other way around since
denoise actually affects the render result.

Includes some code refactor for progressive refine render buffers, and
avoids recomputing tiles for each progressive sample.
2017-10-21 20:29:21 +02:00
dc9eb8234f Cycles: combined CPU + GPU rendering support.
CPU rendering will be restricted to a BVH2, which is not ideal for raytracing
performance but can be shared with the GPU. Decoupled volume shading will be
disabled to match GPU volume sampling.

The number of CPU rendering threads is reduced to leave one core dedicated to
each GPU. Viewport rendering will also only use GPU rendering still. So along
with the BVH2 usage, perfect scaling should not be expected.

Go to User Preferences > System to enable the CPU to render alongside the GPU.

Differential Revision: https://developer.blender.org/D2873
2017-10-21 20:13:44 +02:00
Julian Eisel
efd70ab78f Move & rename uiLayoutOperatorButs to interface_templates.c 2017-10-21 16:48:42 +02:00
ebb29200d3 Cleanup: use relative imports in bl_ui 2017-10-21 12:41:42 +11:00
3df2e6d76b Fix T53109: denoising variance debug passes not working after recent changes. 2017-10-20 14:41:24 +02:00
c74c72101e Fix compositor node links getting lost on file load for custom render passes. 2017-10-20 14:41:24 +02:00
ae72a9206e Fix T46163: NLA properties with drivers aren't displayed as having drivers
While such drivers will generally get evaluated too late to be of much
use during animations, it can still be useful to allow using drivers to
control a whole bunch of NLA strip properties (i.e. syncing NLA strip
timings via a single property/control).

Keyframe insertion however is still not allowed on these properties
(and an error message will now be displayed when trying to do so,
instead of silently failing), as it is useless.
2017-10-20 17:05:50 +13:00
959a58da9e Cleanup: redundant casts 2017-10-20 14:03:22 +11:00
cb957fd8e0 Cleanup: replace gpencil tri vars w/ array 2017-10-20 09:28:12 +11:00
465b6333cc Correct last commit, use WM_exit
Without this temp directory isn't removed.
2017-10-20 00:19:58 +11:00
9ee8319cd5 Exit with invalid command line arguments
Loading blender with an unknown name would interpret it as a blend file.

This meant passing `--arg` arguments would end up creating new
blend files which could be confusing if you made a typo on a command
line argument.

Now check the string has a blend file extension,
exiting if it doesn't.
2017-10-20 00:10:40 +11:00
1cddab18de Allow non-initialized memory to be passed to BKE_id_copy_ex
This only applies when LIB_ID_CREATE_NO_ALLOCATE flag is used and guarantees
that non-memset-zero memory can be used (or, that same memory chunk might be
used over and over again without need to clean it from the calleer).
2017-10-19 13:55:08 +02:00
529d365b4d Add note about handling of root nodetree in ID copydata.
OUr beloved root nodetrees... Had to check again the code to undersand
why we copy them with bmain even though they are not in bmain, so this
is worth a comment. ;)
2017-10-19 12:33:14 +02:00
910dd7fb1b Cycles: Add extra logging in CUDA device detection code 2017-10-19 11:26:10 +02:00
7bf7b8af39 Cleanup: redundant comments
Class names are readable, no need for explanations of each one.
2017-10-19 16:19:07 +11:00
351222c26f UI: 3D View, object menu
Changes from D2876 by @meta-androcto /w own edits

- Move "Relations" into own menu.
2017-10-19 16:12:35 +11:00
0aa6d44a79 UI: 3D View, undo menu reorganization
Changes from D2876 by @meta-androcto /w own edits

Move 3x undo items into Undo menu,
these are such common operations they're typically accessed by keys.

Also add to menus which didn't have undo
(seemed random which modes had undo, undo history in their menus).
2017-10-19 15:41:57 +11:00
a8fb08b19c UI: 3D View, minor menu reorganization
Changes from D2876 by @meta-androcto

- Move "Delete" to the first menu item in most toplevel menus.
- Add separators.
- Consistent order of Undo/Redo
2017-10-19 15:10:41 +11:00
b82b55a313 UI: 3D View Mesh "Select" menu reorganization
Changes from D2876 by @meta-androcto /w own edits

- Move "Select Linked" into own menu.
- Move "Select Loop" into own menu.
2017-10-19 14:45:56 +11:00
a6fdec305a UI: 3D View "View" menu reorganization
Changes from D2876 by @meta-androcto /w own edits

- Move view axis & camera selection into "Viewpoint" menu.
- Move render border and clipping into border menu.
- Move Camera operators into own menu.
- View Selected was located in two menus,
  Only expose the "use_all_regions" version when quad-view is used.
2017-10-19 14:07:39 +11:00
c64e515f90 Cleanup: pep8/line length 2017-10-19 11:31:28 +11:00
3859f5ec28 Docs: correct descriptions 2017-10-19 11:09:27 +11:00
d85a0a722e Fix part of T53038: principled BSDF clearcoat weight has no effect with 0 roughness. 2017-10-18 23:35:54 +02:00
a2b541bd22 Fix mistake in new ID copy code in 'no allocate' case.
Spotted by @sergey, thanks.
2017-10-18 17:11:29 +02:00
264837cb46 Fix wrong comment (leftover from dev time). 2017-10-18 16:55:33 +02:00
01a0649354 Cycles: Fix wrong shading when some mesh triangle has non-finite coordinate
This is fully unpredictable for artists when one damaged object makes the whole
scene to render incorrectly. This involves two main changes:

- It is not enough to check triangle bounds to be valid when building BVH.
  This is because triangle might have some finite vertices and some non-finite.

- We shouldn't add non-finite triangle area to the overall area for MIS.
2017-10-18 12:19:53 +02:00
ab7ebf2b10 Cleanup: Use const for RNA EnumPropertyItem args
Practically all access to enum data is read-only.
2017-10-18 16:04:07 +11:00
92611dada6 Fix T53098, T53079: OpenCL world texture errors after recent changes. 2017-10-18 03:13:25 +02:00
1cb884be35 Make auto handle placement aware of cyclic extrapolation.
Cyclic extrapolation is implemented as an f-curve modifier, so this
technically violates abstraction separation and is something of a hack.
However without such behavior achieving smooth looping with cyclic
extrapolation is extremely cumbersome.

The new behavior is applied when the first modifier is Cyclic
extrapolation in Repeat or Repeat with Offset mode without
using influence, repeat count or range restrictions.

This change in behavior means that curve handles have to be updated
when the modifier is added, removed or its options change. Due to the
way code is structured, it seems it requires a helper link to the
containing curve from the modifier object.

Reviewers: aligorith

Differential Revision: https://developer.blender.org/D2783
2017-10-17 19:39:10 +03:00
7d3723a54d Fix T52959: Local view looses clip range on exit 2017-10-18 01:41:19 +11:00
0a435d49ba Fix T53074: Use the pybuffer->itemsize to get the corresponding GLtype
It seems that `typestr` does not always define the final size of the element. And it varies by operating system.

Then use the `typestr` only to know the itemtype is `float` type or not.
2017-10-17 12:06:52 -02:00
06ff970f27 Fix T53007: OpenSubdiv + transparency = artefact/crashes 2017-10-17 12:12:15 +02:00
9598bad59c GPU: Report number of compressed texture formats to help nailing crahs down in the future 2017-10-17 11:53:15 +02:00
b65fecd9a0 GPU: Fix memory corruption in GPU_debug on GTX1080
Number of texture formats is 51, which is greater than allowed size of 32.
2017-10-17 11:52:31 +02:00
b53918be39 Added alpha channel check to Alembic unit test
It was broken due to 823bcf1689, which added
alpha information and thus changed tuple size from 3 to 4 items.
2017-10-17 10:59:02 +02:00
a297e1bb93 WM: move gesture operator callbacks into own file
`wm_operators.c` is near 5k LOC with lots of mixed functionality,
extract gesture callbacks since they aren't closely related.
2017-10-17 15:16:02 +11:00
99520e3f92 Cleanup: use 'e' prefix for enum typedefs
Convention was only followed loosely,
apply to DNA where changes aren't likely to conflict.

(Skipped ModifierType for eg).
2017-10-17 13:49:20 +11:00
57ec19e0e5 WM: immediate line-gesture activation on tweak
Matches border-gesture behavior,
needed for binding bisect to tweak event.
2017-10-17 12:39:42 +11:00
d0f4d0df2a Knife Tool: add wait_for_event option 2017-10-17 11:50:59 +11:00
67e0a44e61 Replace freeing checks with MEM_SAFE_FREE 2017-10-17 00:45:14 +13:00
870b4b6735 WM: refactor gestures for use as tools
Border and circle select wait for input by default.
This commit uses bool properties on the operators instead of
magic number (called "gesture_mode").

Keymaps that define 'deselect' for border/circle select
begin immediately, exiting when on button release.
2017-10-16 22:21:46 +11:00
6d8f63a834 Fix T53054: Parentless bone + IK crashes 2017-10-16 22:21:45 +11:00
8550c2b922 Cleanup: modal operator border callback names
Use same convention as all others.
Remove 'select' since these are used for zoom as well.
2017-10-16 17:03:08 +11:00
83b60dac57 WM: store modal operator last-properties
Avoids modal operators needing to explicitly store them.
2017-10-16 16:38:02 +11:00
946a4fe85a WM: Don't save mouse-paths to operator history
In preparation for modal operators storing their properties,
no need to keep mouse-paths around.

Also use generic function for lasso properties.
2017-10-16 16:14:07 +11:00
8bda35d2f4 WM: remove hard-coded circle radius memory
Replace with operator type 'last_properties'.

Also use generic function for circle gesture properties.
2017-10-16 15:32:09 +11:00
137586a13c Event System: Prevent mouse motion in click events
Don't convert mouse button events to click if they include dragging.
Double-click events already checked for this.
2017-10-16 14:27:10 +11:00
201b02f2a7 Cleanup: simplify lasso reallocation
Remove unneeded define, double allocations when increasing.
2017-10-16 14:27:10 +11:00
cae9770954 Cleanup: rename gesture mode to is_active
Wasn't obvious what this did at a glance.
2017-10-16 14:27:10 +11:00
811dbf5525 Code cleanup: deduplicate primitive refit code. 2017-10-15 21:53:58 +02:00
383df45af9 Fix bad 'poll' prop callback API doc.
This was added to all prop types, when it is only available for Pointer ones.
2017-10-15 20:38:29 +02:00
2e50add164 Fix OpenCL performance regression after cubic interpolation.
Reorganize code to reduce register pressure.
2017-10-15 17:46:50 +02:00
49f4ac17bf Edit Mesh/Curve: Median center for click extrude
Was using bound-box center which depends on rotation.
2017-10-14 19:27:21 +11:00
f4b5d0ba3a Add some basic 4K render presets.
This difinition is becomming rather common now, time to add it to our
collection imho (requested in T53064).
2017-10-14 10:08:48 +02:00
8fb2e46193 Edit Mesh: click extrude, ensure inverse matrix
Relied on this being set elsewhere which isn't assured.
2017-10-14 19:05:12 +11:00
8bac5ea0c5 Correct bezier curve assert
Bezier curves should have v-points zero'd.
2017-10-14 17:54:43 +11:00
7cd9926fd8 Cleanup: use const for events 2017-10-14 17:30:15 +11:00
Julian Eisel
61fe8e8aca Hide "Confirm on Release" button from transfor redo options
Hide-flag wasn't set so option shows up in keymap editor. But seems like
that flag is ignored there by now anyway.
2017-10-14 01:12:30 +02:00
a51688d0b0 Fix T53052: ID decrement error when deleting a scene, either python or GUI.
User count of scenes was inconsistant, screens only have 'user_one' kind
of owning over scenes, which means they shall never increment or
decrement their real user count. And usually, scenes have no real user
at all.
2017-10-12 15:54:43 +02:00
3b4f6996a8 Fix T52999: floating (popup) panels/menus could jump around screen in some cases.
Would happen during panel's refresh drawing, if drawing code had to adjust
final panel position compared to the initial one computed based on the
mouse coordinates, and user had dragged the floating panel around.

Issue fixed by adjusting stored mouse coordinates once final panel
position is known, such that they would directly generate those
coordinates. that way, the basic offset applied to those stored mouse
coordinates during panel dragging is valid, and recreating panel based
on those won't make it jump in screen.

Note that panel will still jump in case user dragged it partially out of
view - we could prevent that, but imho it's better to keep that
behavior, since redraw can generate a popup of different size, which
could end up with a totally out-of-view one...

Hopefully this fix does not break anything else!
2017-10-12 14:50:18 +02:00
b29e37ed81 Docs: add note for bmesh face_split_edgenet 2017-10-12 23:36:42 +11:00
5ea729845d Fix T53048: OSL Volume is broken in Blender 2.79
Was a mistake in optimization commit which was disconnecting closures and nodes
which does not make sense for volume output.

OSL script we can't ignore and can't currently know in advance if it's a proper
volume shader or not. So we never disconnect OSL nodes from volume output.

This is a good candidate for corrective release.
2017-10-11 15:22:40 +05:00
4fce3c7ac0 Cycles: Speedup up tangent space calculation
This patch goes away form using C++ RNA during tangent space calculation which
avoids quite a bit of overhead. Now all calculation is done using data which
already exists in ccl::Mesh. This means, tangent space is now calculated from
triangles, which doesn't seem to be any different (at least as far as regression
tests are concerned).

One of the positive sides is that this change makes it possible to move tangent
space calculation from blender/ to render/ so we will have Cycles standalone
supporting tangent space.

Reviewers: brecht, lukasstockner97, campbellbarton

Differential Revision: https://developer.blender.org/D2810
2017-10-11 13:19:15 +05:00
a421607569 Cycles: Add utility function to calculate triangle's normal 2017-10-11 13:18:59 +05:00
552d15c976 Cycles: Add utility function to remove given attribute 2017-10-11 13:18:59 +05:00
4782000fd5 Cycles: Fix possible race condition when initializing devices list 2017-10-11 12:48:19 +05:00
d83bcf7071 Cycles tests: Don't proint braces for empty status 2017-10-11 12:36:18 +05:00
99eb13d3f7 Fix T53040: Vertex paint, texure & symmetry fail
Removed old logic for brush texture which was being applied twice.
2017-10-10 23:31:07 +11:00
d2326e888a Vertex Paint: add back missing VertProjHandle free
Also avoid passing large struct as value.
2017-10-10 22:32:30 +11:00
0592ac09ff Correct logic for vertex paint smear
Swapping gave values from the state before the last.
Thanks to @angavrilov for spotting.
2017-10-10 20:38:52 +11:00
582fbda18f Fix Sculpt 2D falloff, missing brush caused crash 2017-10-10 19:52:11 +11:00
8d73ba58b6 Cycles: Fix compilation of sm_20 and sm_21 kernels
Was broken since the bicubic commit for GPU support.
2017-10-10 12:26:02 +05:00
caba67c2fa Recent check for navigation missed NULL check 2017-10-10 02:43:56 +11:00
e9d06f0866 UI: VSE strip menu reorganization
Add Inputs and Transform submenus.
2017-10-09 13:59:49 +11:00
e360d003ea Cycles: schedule more work for non-display and compute preemption CUDA cards.
This change affects CUDA GPUs not connected to a display or connected to a
display but supporting compute preemption so that the display does not
freeze. I couldn't find an official list, but compute preemption seems to be
only supported with GTX 1070+ and Linux (not GTX 1060- or Windows).

This helps improve small tile rendering performance further if there are
sufficient samples x number of pixels in a single tile to keep the GPU busy.
2017-10-08 21:12:16 +02:00
Mathieu Menuet
5aa08eb3cc Fix T53017: Cycles not detecting AMD GPU when there is an NVidia GPU too.
Best guess is that cuInit() somehow interferes with the AMD graphics driver
on Windows, and switching the initialization order to do OpenCL first seems
to solve the issue.
2017-10-08 18:36:02 +02:00
9ea2a7c02d Fix potential string buffer overruns.
Note that our library path handling is still rather dodgy on this
regards, shall take some time at some point to seriously sanitize it...
2017-10-08 16:08:00 +02:00
cdb0b3b1dc Code refactor: use DeviceInfo to enable QBVH and decoupled volume shading. 2017-10-08 13:17:33 +02:00
4b3e6cb728 Cleanup: --help text
Sync with manual
2017-10-08 18:49:58 +11:00
c3d3483223 CMake: Re-order PYTHON_VERSION check
Missing paths would error first.
2017-10-08 14:05:22 +11:00
f61c340bc1 Cycles: OpenCL bicubic and tricubic texture interpolation support. 2017-10-08 02:55:44 +02:00
c040dedc12 Fix incorrect MIS with principled BSDF and specular roughness 0. 2017-10-07 22:10:02 +02:00
c921c3bcd0 [cmake] Add minimum python version check to cmake to prevent later build errors. 2017-10-07 07:58:54 -06:00
d7eabc6765 Code cleanup: simplify cmake kernel install. 2017-10-07 15:32:20 +02:00
2d92988f6b Cycles: CUDA bicubic and tricubic texture interpolation support.
While cubic interpolation is quite expensive on the CPU compared to linear
interpolation, the difference on the GPU is quite small.
2017-10-07 15:30:57 +02:00
23098cda99 Code refactor: make texture code more consistent between devices.
* Use common TextureInfo struct for all devices, except CUDA fermi.
* Move image sampling code to kernels/*/kernel_*_image.h files.
* Use arrays for data textures on Fermi too, so device_vector<Struct> works.
2017-10-07 14:53:14 +02:00
d013b56dde Actually force accumulate mode for the Smear brush in weight/vertex paint.
Just removing the checkbox from UI isn't enough for proper behavior.
2017-10-07 13:53:54 +03:00
6b8abefcc6 Make weight paint blur thread safe, and fix smear ignoring mirror.
Instead of trying to be clever with swaps and lazy updating the weight
data, simply recalculate one single array. To improve performance, use
threading for that.
2017-10-07 12:45:21 +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
837383ac78 Cycles: Cleanup, indendation 2017-10-06 19:33:59 +05: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
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
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
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
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
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
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
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
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
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
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
e249dfd0f6 Cleanup: Remove some old pre 2.5 IPO code 2017-09-30 16:38:53 -04: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
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
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
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
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
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
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
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
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
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
870dfb1b5a Cleanup: indentation 2017-09-27 00:17:28 +10:00
482b665e02 Cleanup: remove bounds runtime data from scene 2017-09-26 22:33:25 +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
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
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
f320d0e0a8 Fix T52840: New Depsgraph - Mask editor not working correctly 2017-09-22 13:23:21 +05: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
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
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
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
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
99c9f17098 deps build: correct sndfile fix 2017-09-20 13:20:23 +03: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
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
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
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
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
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
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
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
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
14eadf55fd RNA: expose RegionView3D clip planes 2017-09-15 13:55:52 -03: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
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
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
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
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
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
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
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
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
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
b07ee4e3a5 Update tgz script, remove deprecated GZIP use 2017-09-12 16:25:19 +10: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
c7f106cbe2 View2D: function to get view to region matrix 2017-08-29 19:36:40 +10:00
1c92ffa149 Transform: scale center override by aspect
Needed for image space.
2017-08-29 16:01:16 +10:00
b4b1397ad9 Depsgraph: Don't cast ID_Type to short 2017-08-28 11:43:36 +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
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
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
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
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
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
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
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
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
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
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
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
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
738d942d29 Correct error in recent use of PyC_Long_*
Regression in 46cf33bf0
2017-08-25 02:09:23 +10: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
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
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
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
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
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
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
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
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
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
37a5fe2d4d Fix T52479: Regression: Motion Tracking no longer works 2017-08-21 17:23:42 +02: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
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
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
b5f8063fb9 Cycles: support baking normals plugged into BSDFs, averaged with closure weight. 2017-08-20 16:51:53 +02:00
0b07c2c8a2 Code cleanup: remove copy of shader graph for bump, no longer needed. 2017-08-20 14:27:51 +02: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
f6825d333b Fix bpy library load: invalid function signature 2017-08-20 19:04:16 +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
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
1cc4033df8 PyAPI: expose matrix parsing function 2017-08-19 21:36:50 +10:00
4d428d14af Fix T52443: Cycles OpenCL build error after recent mesh lights changes. 2017-08-19 01:02:55 +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
4e468ceb71 PyAPI: Fix memory leak w/ empty, allocated enums 2017-08-18 18:29:27 +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
5492d2cb67 Cycles: Calculate correct remaining time when using a larger pixel size 2017-08-17 02:00:44 +02: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
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
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
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
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
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
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
a8fbe991cd [build_deps/Windows] Prevent writing of any files into the source tree. 2017-08-13 13:02:15 -06: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
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
d7639d57dc Fix T52368: OSL trace() crash after recent changes. 2017-08-12 14:32:52 +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
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
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
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
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
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
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
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
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
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
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
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
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
cb02f5250d Fix typo in new ID copying code. 2017-08-09 14:38:24 +02: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
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
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
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
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
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
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
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
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
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
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
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
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
0db4dab0c3 Tracking: Cleanup of transform code 2017-08-04 08:13:38 +02:00
0c48a091f9 Tracking: Cleanup, use boolean instead of integer 2017-08-04 07:21:01 +02:00
696599edac CMake: test build configuration support
D2765 by @akitula
2017-08-04 08:11:42 +10: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
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
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
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
702e9c556f Cleanup: warnings from last commit 2017-08-01 12:31:19 +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
09eac0159d Property path generation fixes 2017-07-29 15:23:01 +03:00
fb1cd7648f Cleanup: quiet picky ubsan warnings 2017-07-29 08:42:32 +10:00
393ba0cf16 Cleanup: multistatement-macros warning 2017-07-29 08:18:20 +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
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
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
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
1bd9531fda Fix UI messages... 2017-07-27 15:20:44 +02:00
4003409430 Fix factory setup using user scripts path still 2017-07-27 22:22:26 +10:00
f1d6bad4b6 Fix T51776: Make sure button icons are updated on Ctrl-ScrollWheel 2017-07-27 12:55:17 +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
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
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
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
35d9f68121 Python module test: Don't cfail the test when import failure happens in preset 2017-07-25 11:39:10 +02: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
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
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
b379f02f20 Fix T50039: texture paint soften strength not working with float images. 2017-07-24 15:02:39 +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
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
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
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
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
11204fce4e Fix strict compiler warning in BGE when linking directly to SDL 2017-07-21 16:07:59 +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
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
3b12a71972 Fix T52125: principled BSDF missing with macOS OpenCL. 2017-07-20 15:15:43 +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
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
6e90294e08 Fix topology mirror ignoring center verts
Caused select-mirror to fail with edges & faces.
2017-07-20 03:52:53 +10: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
5376b3eeca Fix T52116: Blender internal BVH build crash in degenerate cases. 2017-07-19 11:06:20 +02:00
3daa641d7f Fix T52092: Crash un-grouping nodes 2017-07-19 14:32:31 +10: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
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
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
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
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
9feeb14e91 fix T52065: Joint ID was generated wrong for bone animation exports 2017-07-17 16:39:47 +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
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
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
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
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
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
5fb5b74890 Snap System: missing change 2017-07-14 11:20:28 -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
0f793ee606 Fix unit test error on Windows 2017-07-14 09:53:27 +02: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
7daae642d8 Cleanup: Fix MSVC warning message
The const key is required by compiler to avoid warning
2017-07-13 17:54:24 +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
248bba81e7 Fix texture paint crash when painting onto stencil 2017-07-13 20:50:02 +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
2771f602e6 Snap System: remove unused function 2017-07-12 20:43:28 -03: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
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
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
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
b3f62b68a9 Style (remove characters that caused "a binary file") 2017-07-11 14:22:07 -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
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
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
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
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
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
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
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
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
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
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
3361f2107b Fix T51967: OSL crash after rendering finished (mainly on Windows). 2017-07-08 02:46:06 +02:00
dbaaff2e09 Fix build after previous commit. 2017-07-08 02:07:39 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
5b2b5a4258 Fix ED_OT_undo_redo operator 2017-07-01 10:51:26 +03: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
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
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
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
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
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
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
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
bb0e8f1c55 Cleanup: remove unused function 2017-06-27 18:05:44 +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
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
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
0172ed8fe5 Building w/o Python works again 2017-06-26 13:26:44 +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
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
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
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
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
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
22466a5bdf Fix typo in builtbot config 2017-06-21 14:05:23 +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
9e08019b74 Fix: Icon alignment for scaled pie buttons with no text 2017-06-20 20:15:04 +03:00
e3b1d562a7 Fix (unreported) missing Image usercount increase when copying UVProject modifier. 2017-06-20 13:46:09 +02: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
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
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
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
e9aaf5ed21 Fix (unreported) memory leak in Fluid modifier copying.
Also generally simplify/sanitize this copy code.
2017-06-19 12:21:14 +02: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
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
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
ed6d88f06a PyAPI: Fix warning about indent 2017-06-16 12:30:18 -04: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
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
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
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
3d03616772 Cleanup: do not use BKE_libblock_free_ex() unless needed! 2017-06-15 16:20:51 +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
9e0a253ea1 Cleanup: make Group Unlink outliner action use `BKE_libblock_delete() too.
Same as in rB2bd51474a44...
2017-06-15 13:06:31 +02: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
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
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
df7c609fda PYAPI: Fix mathutils doc structure 2017-06-14 16:47:43 -04: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
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
481cf2982b Depsgraph: Cleanup, indentation 2017-06-14 12:01:52 +02:00
20e5052a72 Remove unused bmain argument from BKE_libblock_free_data 2017-06-14 11:16:34 +02:00
97f9f90986 Cleanup: Indentation got broken in previous commit 2017-06-14 10:54:30 +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
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
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
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
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
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
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
85fafccb4c Depsgraph: Remove residue from partial updates support 2017-06-12 16:55:04 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
7bff00b522 Fix alembic tests not running with debug build on windows 2017-06-04 17:05:59 -06:00
556942ec07 Fix T51587: Blender fails to interpret a specific layer in OpenEXR multilayer file 2017-06-04 00:58:38 +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
863f0434ec Fix T51691: Shear cursor input scales w/ zoom
Use relative value from cursor movement.
2017-06-02 20:40:41 +10:00
0d8bf4bf94 Cleanup: style 2017-06-02 15:38:04 +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
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
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
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
e2b1c70b48 Fix bad index use drawing deformed face centers 2017-06-01 15:04:22 +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
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
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
ec804b1694 Libmv: Re-bundle from upstream to ensure code base is perfectly in sync 2017-05-31 11:43:39 +02: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
bddd9d809d Fix integer overflows in meshcache modifier.
Differential Revision: https://developer.blender.org/D2688
2017-05-26 06:26:21 -06:00
bf5e717ef5 Fix T51609: Bake Texture, Margin crashing Blender
Integer overflow in margin filter code.
2017-05-26 11:28:01 +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
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
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
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
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
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
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
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
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
7add6b89bc Fix T51592: Simplify AO Cycles setting remains active while Simplify is disabled 2017-05-23 10:34:03 +02: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
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
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
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
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
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
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
8d4aff31ce Cycles: Fix compilation error after recent changes
Spotted by Steffen Dünner, thanks@
2017-05-19 16:48:42 +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
a7c4b6f49c Cleanup: add braces for multi-line blocks 2017-05-19 22:18:54 +10: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
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
ffd83a34ab Fix T51502: Cycles denoising not using correctly aligned width for NLM on CUDA 2017-05-19 02:06:54 +02: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
6bf05ab2ca Install_deps: py 3.5.3, collada 22b1f4ff026881b4 (2.6.47), OCIO 6de971097c7f5. 2017-05-18 16:53:07 +02:00
49bd3d3a1a Cycles: Fix crash loading single channel texture
Was  typo in recent isfinite check.
2017-05-18 15:49:03 +02: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
102394a323 Fix T51538: Weight-paint circle select w/ clipping 2017-05-18 10:43:34 +10: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
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
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
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
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
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
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
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
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
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
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
d508b69e44 Cleanup: gcc7.1 warnings 2017-05-16 12:46:52 +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
5319571511 Cycles: Fix native only kernel since denoiser commit 2017-05-15 18:37:33 +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
df94f2f399 Fix T51180: BMesh crash using calc_uvs=True
Don't assume UV layer exist.
2017-05-15 16:53:57 +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
890d871bc3 Fix T51314: crash cancelling Cycles bake during scene sync and update. 2017-05-13 07:15:25 +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
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
868678c85f Fix T51449: empty node editor continuously redrawing and using CPU. 2017-05-11 20:32:19 +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
8eeb610832 Depsgraph: Fix/workaround crahs when fcu->rna_path is NULL 2017-05-11 16:28:21 +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
15038975a3 Cleanup: GPU PBVH naming
Use GPU_pbvh prefix.
2017-05-11 22:05:19 +10:00
Hristo Gueorguiev
90b9467861 Cycles: fix AO approximation for split kernel 2017-05-11 11:58:25 +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
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
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
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
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
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
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
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
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
98ab2c682d Fix denoiser tooltip 2017-05-09 14:44:59 +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
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
717d85fb1c Fix missing render update when building without OCIO but having GLSL image draw method 2017-05-08 17:43:32 +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
1cfc48192c Fix T51432: Find Files case sensitive on win32 2017-05-08 09:44:11 +10: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
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
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
0eef40ed51 Cleanup: unused return, redundant assignments 2017-05-06 22:43:32 +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
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
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
Hristo Gueorguiev
f3c3483242 Cycles: Workaround for AMD GPU OpenCL compiler
Fix for SSS in BPT.
2017-05-05 13:00:43 +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
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
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
d29e3ebcc6 Typo: 'Signle program' -> 'Single program' 2017-05-04 22:15:53 +02: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
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
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
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
5fde78dcad Cycles: Fix unused argument warning when building without debug passes 2017-05-04 09:33:51 +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
6abcd6cfd5 Fix error in node flag check 2017-05-04 02:57:39 +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
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
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
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
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
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
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
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
fc8f428224 fix typo in WITH_SYSTEM_GFLOG in CMakeLists.txt 2017-04-30 10:52:38 -06: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
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
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
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
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
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
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
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
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
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
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
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
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
a6b9bd023b Fix T51328: Add note to cmdline help that threads must be first 2017-04-26 22:48:18 -04: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
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
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
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
9623d93f14 Cycles: Fix access undefined macro on non-MSVC compiler
Also rremove trailing whitespace.
2017-04-26 10:00:31 +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
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
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
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
69a216d343 Cleanup: remove unnecessary texface checks 2017-04-24 22:45:40 +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
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
dc5bd2784f [cmake] Fix Alembic build errors with msvc 2017-04-21 12:18:19 -06: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
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
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
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
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
55a3d48046 Docs: diagram for reflect_v3_v3v3 2017-04-21 17:27:20 +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
ca958642fa Fix Surface Deform not unbinding if target is removed 2017-04-20 17:49:45 +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
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
31c644b657 Fix T51198: Crash with new Datablock ID Properties 2017-04-20 11:40:31 +03: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
6c26911c3d Fix T51248: user preferences window size not adapted to DPI. 2017-04-20 01:19:47 +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
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
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
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
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
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
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
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
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
70018eb16e Cleanup: missing headers 2017-04-19 00:25:31 +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
2836003f6b Fix T51187: Memory leak when exporting OpenEXR monochrome animation 2017-04-18 14:28:13 +02: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
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
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
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
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
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
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
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
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
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
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
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
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
ac880b67c3 UI: Add/Improve a few tooltips
See T51061
2017-04-13 18:07:50 -04: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
Aurel Gruber
ae7b679021 SLIM: disallowing pins to move to places that the SLIM algorithm can't handle. Also, this simplifiey the way we transfer uv coords back to native part. 2017-04-13 16:33:11 +02:00
Aurel Gruber
3cae116704 SLIM: In live Unwrap mode unpinned vertices can now be moved. Also, a single pin also invokes SLIM. That also avoids crashing minimize_stretch when invoked on chart with one pin. 2017-04-13 16:22:49 +02:00
0a032ce83b Fix Surface Deform crash with missing or freed DM 2017-04-13 15:40:50 +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
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
f5bc8ad4ce Add red alert in UI controls for datablock pointer properties 2017-04-13 12:59:04 +03: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
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
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
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
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
c29bc61829 Color management: Avoid memory copy into same buffer 2017-04-12 10:23:38 +02:00
0ebe08af34 Docs: minor improvement to code example 2017-04-12 14:21:59 +10: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
3722da3b4e Cleanup: quiet harmless but annoying overflow
Caused asan to print warnings generating RNA
2017-04-11 11:49:21 +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
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
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
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
9539cfacca Cycles: Apparently board name could be an empty string 2017-04-10 15:31:21 +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
5b873c8c24 Cleanup: use doxy code block 2017-04-09 16:26:04 +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
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
8e0cdfd0c9 Libmv: Correction to previous commit
We do need to make a copy of the values.
2017-04-07 17:57:48 +02:00
a1f8755d32 Libmv: Fix crash of keyframe selection on 32bit linux 2017-04-07 17:10:44 +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
c637e749b2 Tests: Fix compilation error with static OpenMP 2017-04-07 16:06:28 +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
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
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
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
a0799ce336 Fix T51137: Edge Rip Hangs 2017-04-07 11:47:28 +10:00
d426c335c5 Fix T51135: Cylinder primitive generated bad UVs 2017-04-06 12:20:22 -03: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
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
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
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
5e3b6e951b Cleanup: minor changes to transform-manipulator
Match stats_editbone & stats_pchan behavior to avoid confusion.
2017-04-06 12:02:32 +10:00
7ae9d092d0 Fix alembic build error with MSVC 2017-04-05 10:59:29 -06:00
f921442a44 Depsghraph: Remove unused function 2017-04-05 15:36:17 +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
e4c5441286 Locales: Some optimization work
Mainly visible for MSVC debug builds and gives about 2x speedup.
2017-04-05 11:25:58 +02: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
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
411e7abe94 Cleanup: redundant casts 2017-04-05 01:08:19 +10: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
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
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
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
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
cc93a66e71 Buildbot: SPecial branch trickery for linux slaves 2017-04-03 15:04:16 +02: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
d27ef3913a Buildbot: Some special tricks for Blender 2.8 slave 2017-04-03 14:49:07 +02: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
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
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
ff693959d8 WM: Previous commit broke common-case loading new file
Handle this in the operator
2017-03-31 23:48:10 +11:00
7f7c807a92 Keep current app-template when selecting 'New File' 2017-03-31 22:06:36 +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
4b7d95290f Cycles: More fixes after include changes 2017-03-31 10:12:13 +02: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
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
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
a88801b99b Cycles: Fix missing kernel re-compilation after recent changes
Reported by Mai in IRC, thanks!
2017-03-30 11:45:30 +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
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
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
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
61db9ee27a Cycles: Attempt to workaround compilation error on new CUDA toolkit and sm_2x 2017-03-29 11:50:17 +02: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
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
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
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
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
bd053ac7ba Cycles: Correct ifdef around float3 intrinsics 2017-03-27 16:13:07 +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
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
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
58caf3121e SLIM: reuse LSCM logic for pinning, to fix issue with multiple charts. 2017-03-25 16:55:59 +01:00
183ca1af3f SLIM: move most SLIM integration behind param_* API, reuse more code. 2017-03-25 16:55:24 +01:00
bf2603baf6 SLIM: transfer weights in construction, fix subsurf case. 2017-03-25 16:37:58 +01:00
2e662bbca4 SLIM: use operator history instead of toolsettings for remembering settings. 2017-03-25 16:37:58 +01:00
21bccefd12 SLIM: move code around, no functional changes. 2017-03-25 16:37:33 +01:00
65f32e105f SLIM: match code style. 2017-03-25 14:18:04 +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
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
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
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
Aurel Gruber
9fdc5345cd merging master into release 2017-03-23 16:44:22 +01:00
e04970b392 Fix player stubs (tm) 2017-03-23 15:47:23 +01: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
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
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
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
762319e911 fix redundant assignment
Thanks clang for the warning.
2017-03-22 16:26:53 -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
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
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
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
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
a201b99c5a Fix T50975: Cycles: Light sampling threshold inadvertently clamps negative lamps 2017-03-20 14:48:55 +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
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
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
d863b5182e Cleanup: use return args last and 'r_' prefix. 2017-03-18 09:39:36 +11: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
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
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
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
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
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
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
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
Aurel Gruber
0475c0c41e UV Unwrapping SLIM reducing SLIM iterations per live-unwrap-step to 3, taking care of memory leaks, removing packing when minimizi-stretch with non-fix border 2017-03-16 11:08:02 +01: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
375ede0f3f Comments: wmOperator.cancel & modal 2017-03-16 06:39:09 +11:00
68496c0b38 Missed BGE in recent commit 2017-03-16 06:28:20 +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
Aurel Gruber
be22fc6720 Merge branch 'live_unwrap' 2017-03-15 16:44:39 +01:00
Aurel Gruber
92d7b4b1c2 merging in master 2017-03-15 16:39:37 +01:00
AurelGruber
c1a242ab58 Merge branch 'slim' into 'master'
Slim

See merge request !3
2017-03-15 15:36:00 +00:00
Aurel Gruber
47e71e8746 taking care of compiler warnings 2017-03-15 16:33:38 +01:00
Aurel Gruber
e4e202cb1c UV Unwrapping SLIM Changing ui parameter names and showing parameters based on method 2017-03-15 16:06:40 +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
Aurel Gruber
7b59b53938 UV Unwrapping SLIM adding liveUnwrap with slim 2017-03-15 14:16:13 +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
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
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
Aurel Gruber
dbe69d982f UV Unwrapping SLIM: small bugfixes and putting char array and not just pointer into toolsettings for vertexgroupname 2017-03-14 09:37:00 +01:00
Aurel Gruber
968f1c0de3 UV Unwrapping SLIM: reordering functino definitions to remove prototypes and cleaning header files 2017-03-14 09:37:00 +01:00
Aurel Gruber
901f02b8ec UV Unwrapping SLIM: removing remainder of old minimize stretch 2017-03-14 09:37:00 +01:00
Aurel Gruber
2a76f4ea7d UV Unwrapping SLIM: space added after if 2017-03-14 09:37:00 +01:00
Aurel Gruber
c9b3e34b9a UV Unwrapping SLIM: minimize_stretch now only affects selected vertices. RESPECTS user defined pins! 2017-03-14 09:37:00 +01:00
Aurel Gruber
f5b51e4c65 UV Unwrapping SLIM: removing unnecessary ui parameters from minimize_stretch_operator 2017-03-14 09:37:00 +01:00
Aurel Gruber
c603ba9e7c UV Unwrapping SLIM: renaming slim_c_interface to slim_capi and renaming contained functions 2017-03-14 09:36:59 +01:00
Aurel Gruber
eef1392c47 UV Unwrapping SLIM: renaming src to intern 2017-03-14 09:36:59 +01:00
Aurel Gruber
c35c83a3ab UV Unwrapping SLIM: adding slim_matrix_transfer.h 2017-03-14 09:36:59 +01:00
Aurel Gruber
732159dcf8 UV Unwrapping SLIM: further refactoring according to discussion on D2530 2017-03-14 09:36:59 +01:00
Aurel Gruber
bccca31bd1 UV Unwrapping SLIM: removing old minimize stretch operator 2017-03-14 09:36:59 +01:00
Aurel Gruber
67ef01a2c3 UV Unwrapping SLIM: respecting source/blender style conventions 2017-03-14 09:36:59 +01:00
Aurel Gruber
118d63712d UV Unwrapping SLIM: removing thesis marker-comments from code 2017-03-14 09:36:59 +01:00
Aurel Gruber
3027e0bdca UV Unwrapping SLIM: adding GPL header comment 2017-03-14 09:36:59 +01:00
Aurel Gruber
99ed9041e0 UV Unwrapping SLIM: renaming another file 2017-03-14 09:36:59 +01:00
Aurel Gruber
ebae2d6aa2 UV Unwrapping SLIM: renaming files and moving headers 2017-03-14 09:36:58 +01:00
Aurel Gruber
5c4eedc91f UV Unwrapping SLIM: renaming intern/SLIM to intern/slim 2017-03-14 09:36:58 +01:00
Aurel Gruber
5681b886a0 UV Unwrapping SLIM: refactoring UVInitializer 2017-03-14 09:36:58 +01:00
Aurel Gruber
31dd611003 UV Unwrapping SLIM: adding harmonic and mvc to uvinitializer 2017-03-14 09:36:58 +01:00
810982a95c Fix T50932: depth picking w/ pose-bone constraints 2017-03-14 18:02:27 +11: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
Hristo Gueorguiev
f169ff8b88 Fix T50925: Add AO approximation to split kernel 2017-03-13 11:15:58 +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
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
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
76015f98ae Fix icon alignment for pie buttons 2017-03-11 22:34:09 +03: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
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
103ae04fbc Correct glPixelTransfer function 2017-03-11 03:03:47 +11: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
6d1ac79514 Cleanup: Grey --> Gray 2017-02-27 19:33:57 -05: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
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
Aurel Gruber
95863bbb98 Merge branch 'uv_unwrapping_slim_algorithm' of git.blender.org:blender into uv_unwrapping_slim_algorithm 2017-02-27 14:15:46 +01:00
Aurel Gruber
2f86198cee Implementation of UV unwrapping with SLIM as disdussed on T48036.
commits:

Category: UV Unwrapping SLIM Algorithm Integration

Added SLIM Subfolder

Category: UV Unwrapping SLIM Algorithm Integration

added subfolder SLIM to CMakeFile of /intern

Category: UV Unwrapping SLIM Algorithm Integration

integrating SLIM including data gathering and transfer from Blender to SLIM

This commit is huge, because I copied over the code from a different repository. Not commit-by-commit.

The Algorithm can be invoked either by choosing SLIM from the dropdown in the unwrapping settings or by
hitting ctrl. + m in the uv editor for relaxation. Tried adding it to the menu the same way as minimizing stretch is there but failed.

Category: UV Unwrapping SLIM Algorithm Integration

preserving vertex ids and gathering weights

Category: UV Unwrapping SLIM Algorithm Integration

adding more members to phandle and creating param_begin

Category: UV Unwrapping SLIM Algorithm Integration

fixing bug that causes weight-per-vertex mapping to be wrong

Category: UV Unwrapping SLIM Algorithm Integration

adjustments to the UI parameters

Category: UV Unwrapping SLIM Algorithm Integration

adding weightinfluence

Category: UV Unwrapping SLIM Algorithm Integration

slim interactive exec now only for changing parameters

Category: UV Unwrapping SLIM Algorithm Integration

taking care of memory leaks

Category: UV Unwrapping SLIM Algorithm Integration

adding relative scale, reflection mode and Vertex group input

Category: UV Unwrapping SLIM Algorithm Integration

correcting wrong comment on SLIM phases

Category: UV Unwrapping SLIM Algorithm Integration

Adding SLIM code by means of git read-tree

Category: UV Unwrapping SLIM Algorithm Integration

freeing matrix_transfer properly

Category: UV Unwrapping SLIM Algorithm Integration

adding (unsupported-) eigen files

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D2530
2017-02-27 14:04:24 +01: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
406398213c Fix missing break setting curve auto-handles 2017-02-27 13:35:03 +11: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
0561aa771b Cleanup: minor changes to array_store
- remove unused struct member.
- misleading variable name.
2017-02-26 15:29:09 +11: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
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
Aurel Gruber
16c6c8a1c4 Category: UV Unwrapping SLIM Algorithm Integration
adding (unsupported-) eigen files
2017-02-24 09:31:38 +01:00
Aurel Gruber
1cb016491a Category: UV Unwrapping SLIM Algorithm Integration
freeing matrix_transfer properly
2017-02-24 09:28:33 +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
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
50328b41a7 Cycles: Fix compilation error on 32bit Linux 2017-02-23 17:30:26 +01:00
Aurel Gruber
7e2e77714c Category: UV Unwrapping SLIM Algorithm Integration
Adding SLIM code by means of git read-tree
2017-02-23 16:34:16 +01:00
Aurel Gruber
15785145b1 Category: UV Unwrapping SLIM Algorithm Integration
correcting wrong comment on SLIM phases
2017-02-23 16:34:16 +01:00
Aurel Gruber
26fd7e084f Category: UV Unwrapping SLIM Algorithm Integration
adding relative scale, reflection mode and Vertex group input
2017-02-23 16:34:16 +01:00
Aurel Gruber
88a327d3ed Category: UV Unwrapping SLIM Algorithm Integration
taking care of memory leaks
2017-02-23 16:34:16 +01:00
Aurel Gruber
2bf059ad3b Category: UV Unwrapping SLIM Algorithm Integration
slim interactive exec now only for changing parameters
2017-02-23 16:34:16 +01:00
Aurel Gruber
9c55a8374e Category: UV Unwrapping SLIM Algorithm Integration
adding weightinfluence
2017-02-23 16:34:16 +01:00
Aurel Gruber
1f88850826 Category: UV Unwrapping SLIM Algorithm Integration
adjustments to the UI parameters
2017-02-23 16:34:16 +01:00
Aurel Gruber
9f7c4aa581 Category: UV Unwrapping SLIM Algorithm Integration
fixing bug that causes weight-per-vertex mapping to be wrong
2017-02-23 16:34:16 +01:00
Aurel Gruber
3e184a57c5 Category: UV Unwrapping SLIM Algorithm Integration
adding more members to phandle and creating param_begin
2017-02-23 16:34:16 +01:00
Aurel Gruber
b6ab20876b Category: UV Unwrapping SLIM Algorithm Integration
preserving vertex ids and gathering weights
2017-02-23 16:34:16 +01:00
Aurel Gruber
08d1b312be Category: UV Unwrapping SLIM Algorithm Integration
integrating SLIM including data gathering and transfer from Blender to SLIM

This commit is huge, because I copied over the code from a different repository. Not commit-by-commit.

The Algorithm can be invoked either by choosing SLIM from the dropdown in the unwrapping settings or by
hitting ctrl. + m in the uv editor for relaxation. Tried adding it to the menu the same way as minimizing stretch is there but failed.
2017-02-23 16:34:16 +01:00
Aurel Gruber
5793441a35 Category: UV Unwrapping SLIM Algorithm Integration
added subfolder SLIM to CMakeFile of /intern
2017-02-23 16:34:16 +01:00
Aurel Gruber
979b1b1159 Category: UV Unwrapping SLIM Algorithm Integration
Added SLIM Subfolder
2017-02-23 16:34:16 +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
9eb647f1c8 Fix T50656: Compositing node editor is empty, no nodes can be added 2017-02-23 11:23:49 +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
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
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
99947e2943 Use new api doc links
Differential Revision: https://developer.blender.org/D2522
2017-02-22 11:19:30 -05: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
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
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
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
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
31123f09cd Remove unused functions related to distance between BoundBox and ray 2017-02-17 09:49:20 -03:00
d41451a0ca Forgotten in last commit: Check the allocation 2017-02-16 23:41:38 -03: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
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
26c8d559fe Register test for mesh.split_faces() 2017-02-16 15:36:00 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
9d8a9cacc3 De-duplicate min/max calculation in F-Curve normalization 2017-02-10 18:10:26 +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
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
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
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
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
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
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
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
1158800d1b PIL_time_utildefines: also show total time in TIMEIT_AVERAGED. 2017-02-07 10:14:46 +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
9e97b00873 Fix compilation error after recent change 2017-02-06 15:29:13 +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
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
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
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
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
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
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
Aaron
3ab8895610 UI: Add missing colon 2017-02-01 14:56:11 -05: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
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
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
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
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
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
67bef6bcf6 Depsgraph: Fix typo in assert 2017-01-26 17:22:54 +01:00
fd69ba2255 Depsgraph: Link from material to object shading
This is a ground work for the upcoming changes in Blender 2.8 branch
where we need to do special actions to reconstruct shaders when
material changes.
2017-01-26 17:01:37 +01:00
c441eb27ea Depsgraph: Add relation from node tree to material it's coming from 2017-01-26 16:49:24 +01:00
331f721725 Depsgraph: Remove owner argument from relations builder as well
The idea was to link something to a parent, but the point is:
we must not pass owner deep and then have any parent-type-related
logic implemented in the "children".
2017-01-26 16:36:37 +01:00
f14e1da5aa Fix (unreported) crash when file browser attempts to show preview of some defective font
Confirmed with the Wine's bundled fonts.
2017-01-27 00:36:24 +09:00
3c3c52a74b Depsgraph: Remove owner node argument which was simply passed around 2017-01-26 16:29:09 +01:00
ac58a7fa19 Compositor: Make HSV node inputs a real sockets
This is much more flexible solution which will allow doing some
more procedural features.

Reviewers: brecht, dfelinto, mont29

Reviewed By: mont29

Subscribers: Severin

Differential Revision: https://developer.blender.org/D2403
2017-01-26 15:20:13 +01:00
Dalai Felinto
18cf3e1a38 Fix unfreed memory after cleaning render layers
The freestyle data was never freed when removing a renderlayer.

```
blender -b --factory-startup --debug-memory --python-expr "import bpy;bpy.ops.scene.render_layer_add();bpy.context.scene.render.layers.active_index=0;bpy.ops.scene.render_layer_remove()"
```
2017-01-26 11:58:51 +01:00
01527197aa Alembic: fix compile error on Linux. 2017-01-26 06:18:07 +01:00
b91edd61d0 Fix T50287: Blender crashes when open a blend that contains an alembic
file.

Missed in rB62a2ed97b.
2017-01-26 06:16:33 +01:00
64f5afdb89 [Cycles/MSVC/Testing] Fix broken test code.
Currently the tests don't run on windows for the following reasons

1) render_graph_finalize has an linking issue due missing a bunch of libraries (not sure why this is not an issue for linux)
2) This one is more interesting, in test/python/cmakelists.txt ${TEST_BLENDER_EXE_BARE} and ${TEST_BLENDER_EXE} are flat out wrong, but for some reason this doesn't matter for most tests, cause ctest will actually go out and look for the executable and fix the path for you *BUT* only for the command, if you use them in any of the parameters it'll happily pass on the wrong path.
3) on linux you can just run a .py file, windows is not as awesome and needs to be told to run it with pyton.
4) had to use the NAME/COMMAND long form of add_test otherwise $<TARGET_FILE:blender> doesn't get expanded, why? beats me.
5) missing idiff.exe for msvc2015/x64 in the libs folder.

This patch addresses 1-4 , but given I have no working Linux build environment, I'm unsure if it'll break anything there

5 has been fixed in rBL61751

Reviewers: juicyfruit, brecht, sergey

Reviewed By: sergey

Subscribers: Blendify

Tags: #cycles, #automated_testing

Differential Revision: https://developer.blender.org/D2367
2017-01-25 09:37:19 -07:00
Dalai Felinto
e5482f986c Fix T50115: stereoscopic video file memory leak 2017-01-25 15:16:36 +01:00
ced20b74e5 Fix T50032: Wrong render result when same image is used with and without alpha 2017-01-25 14:02:59 +01:00
e29a6f739d Fix T50512: Linked Backround scene with animation not updating with new depsgraph
Was missing relations for the set scenes.

Perhaps not ideal solution, but should be good enough for now.
2017-01-25 12:30:29 +01:00
e4de6e87e1 Depsgraph: Do ID tag outside of build_scene
Otherwise it was possible to get ID tags cleared in the middle
of DEG construction when there are set scenes used.
2017-01-25 12:28:27 +01:00
8ea09252c8 Fix T50517: Rendering expecting time is negative 2017-01-25 11:18:12 +01:00
4cbfaa6f3f Revert "UI: Add missing menu item"
This reverts commit 1ad842d432.
2017-01-25 01:33:10 -05:00
1ad842d432 UI: Add missing menu item 2017-01-25 01:00:28 -05:00
a7d5cabd4e Fix T49405: Crash when baking with adaptive subdivision
Blenders baking system currently doesn't support the topology used by
adaptive subdivision and primitive ids will be wrong or out of range
leading to crashes. Updating the baking system to support other
topologies would be a bit involved, so for now we simply disable
subdivision while baking to avoid crashes.
2017-01-25 00:40:45 -05:00
57f937ad5a Remove commented code 2017-01-24 16:00:15 -05:00
Julian Eisel
8a6c689f30 Fix T50386: Crash when spawning pie menus
D2455 by @raa, thanks!
2017-01-24 21:35:38 +01:00
605695de61 Depsgraph: Fix duplicated operation node when two objects are sharing same armature 2017-01-24 17:15:39 +01:00
d84df351d0 Cycles: Don't rely on indirectly included algorithm 2017-01-24 16:39:16 +01:00
b6ccba9241 Fix typo in comment 2017-01-24 14:56:35 +01:00
d4c5e366ea Install deps: Bump OpenSubdiv version to 3.1.1
Required to have some crash fixes.
2017-01-24 11:49:45 +01:00
520afa2962 GPencil: Fix unreported animation data missing when change palette name
When a palette was renamed, the animation data was not changed.

This fix is related to commit 196520fe7d
2017-01-24 09:15:41 +01:00
e5d8c2a67f Use new manual URL 2017-01-23 19:10:37 -05:00
d5c7d22bc2 Update script generating/uploading py API doc to new addresses (docs.blender.org). 2017-01-23 21:10:56 +01:00
39577403d3 Fix compilation error with legacy depsgraph disabled 2017-01-23 18:08:41 +01:00
bc096e1eb8 Cycles: Split ShaderData object and shader flags
We started to run out of bits there, so now we separate flags
which came from __object_flags and which are either runtime or
coming from __shader_flags.

Rule now is: SD_OBJECT_* flags are to be tested against new
object_flags field of ShaderData, all the rest flags are to
be tested against flags field of ShaderData.

There should be no user-visible changes, and time difference
should be minimal. In fact, from tests here can only see hardly
measurable difference and sometimes the new code is somewhat
faster (all within a noise floor, so hard to tell for sure).

Reviewers: brecht, dingto, juicyfruit, lukasstockner97, maiself

Differential Revision: https://developer.blender.org/D2428
2017-01-23 12:56:55 +01:00
b9311b5e5a Cycles: Make object flag names more obvious that hey are object and not shader 2017-01-23 12:14:17 +01:00
2ae39ff6b1 Fix strict compiler warning in the gflags code 2017-01-23 11:52:41 +01:00
7b8810b01a Silence strict compiler warnings
Similar thing to other areas where we mix Blender's char with OpenGL API.
2017-01-23 11:46:02 +01:00
77982e159c Cycles: Fix typo in the panel name
No user visible changes, it was a typo in the name of the class.

Spotted by povmaniac in IRC, thanks!
2017-01-23 10:35:15 +01:00
2268f41418 Cycles: Update current Cycles version 2017-01-23 10:25:59 +01:00
ce8889175a Fix T50491: Cycles UI breaks when pushing F8.
Cycles add-on did not actually support reloading correctly.

When you want to correctly reload sub-modules (i.e. modules of an add-on
which is a package), you need to use importlib, a mere import will do
nothing with already loaded modules (RNA classes are sort of
pre-registered when they are evaluated, through the meta-class system).
2017-01-22 12:42:14 +01:00
d2382f782e Fix T49527: Blender stalls when changing armature ghosting range with stepsize = 0
A big thanks to Steffen Mortensen (stifan) for finding the root cause of this bug!
2017-01-22 02:55:10 +13:00
82187a58f5 Fix own mistake in rB051526da6279, confusing off_t with ptrdiff_t. 2017-01-20 21:57:48 +01:00
475d536f72 Fix minor glitches in GP code.
Reported by coverity scan.
2017-01-20 18:46:06 +01:00
a97ec403c2 Fix/cleanup stupid check on array of char being non-NULL pointer...
Reported by coverity scan.
2017-01-20 18:43:42 +01:00
21e1282265 Fix float buffer of tracking image accessed outside of check that it has been correctly allocated.
Reported by coverity scan.
2017-01-20 18:41:56 +01:00
43268c1997 Cycles: Use more const qualifiers to avoid possible issues 2017-01-20 17:54:17 +01:00
a1c21e0b50 Cycles: Cleanup, split one gigantic function into two smaller ones 2017-01-20 17:52:48 +01:00
094d916c60 Fix compilation error with strict flags 2017-01-20 17:47:09 +01:00
051526da62 Cleanup/fix some BLI_string_utf8 not using size_t/off_t as expected. 2017-01-20 16:51:05 +01:00
2666a222f6 Cleanup/fix last remnant usages of int instead of size_t for string length in BLI_string_utils. 2017-01-20 16:51:05 +01:00
404e59c842 D1873: Customize style for animation motion paths
New options to define the style of the animation paths in order to get
better visibility in complex scenes.

Now is possible define the color, thickness and several options relative
to the style of the lines used to draw motion path.
2017-01-20 16:49:14 +01:00
1ad04c7d65 Cycles: Store time in BVH nodes
This way we can stop traversing BVH node early on.

Gives about 2-2.5x times render time improvement with 3 BVH steps.
Hopefully this gives no measurable performance loss for scenes with
single BVH step.

Traversal is currently only implemented for QBVH, meaning old CPUs
and GPU do not benefit from this change.
2017-01-20 12:46:18 +01:00
c4890cd354 Cycles: Add option to split triangle motion primitives by time steps
Similar to the previous commit, the statistics goes as:

BVH Steps     Render time (sec)       Memory usage (MB)
    0                46                    260
    1                27                    373
    2                18                    598
    3                15                    826

Scene used for the tests is the agent's body from one of the barber
shop scenes (no textures or anything, just a diffuse material).

Once again this is limited to regular (non-spatial split) BVH,
Support of spatial split to this feature will come later.
2017-01-20 12:46:18 +01:00
5298853e95 Cycles: Add option to split curve motion primitives by time steps
The idea is to create several smaller BVH nodes for each of the motion
curve primitives. This acts as a forced spatial split for the single
primitive.

This gives up render time speedup of motion blurred hair in the cost
of extra memory usage. The numbers goes as:

BVH Steps     Render time (sec)       Memory usage (MB)
    0               258                    191
    1               123                    278
    2                69                    453
    3                43                    627

Scene used for the tests is the agent's hair from one of the barber
shop scenes.

Currently it's only limited to scenes without spatial split enabled,
since the spatial split builder requires some changes to work properly
with motion steps coordinates.
2017-01-20 12:46:18 +01:00
d50d370755 Cycles: Add utility function to calculate curve boundbox from given 4 keys
Also fixed some issues with motion keys calculation:

- Clamp lower and upper limits of curves so we can safely call those
  functions for the very first and very last curve segment.
- Fixed wrong indexing for the curve radius array.
- Fixed wrong motion attribute offset calculation.
2017-01-20 12:46:18 +01:00
6f900c383a Cycles: Cleanup, trailing whitespace 2017-01-20 12:46:18 +01:00
26cdc64a7f Cycles: Split motion triangle file once again, avoids annoying forward declarations 2017-01-20 12:46:17 +01:00
14d343a8f9 Cycles: Move motion triangle intersection functions to own file
Mimics how regular triangles are working and makes it more clear where
the stuff is located in the kernel.

Needed to have some forward declarations because of the current placement
of things in the kernel.
2017-01-20 12:46:17 +01:00
ebc695ef2c Cycles: Cleanup, better variable name 2017-01-20 12:46:17 +01:00
20eb1fe3c1 Cycles: Add utility function to fetch motion keys while on CPU side 2017-01-20 12:46:17 +01:00
938ec3a743 Cycles: Cleanup, comments 2017-01-20 12:46:16 +01:00
461214508c Cycles: Add utility function to fetch motion triangle when on CPU side 2017-01-20 12:46:15 +01:00
811e6c2d32 Cycles: Cleanup, delete trailing whitespace 2017-01-20 12:46:15 +01:00
254fbcdd7b Cycles: Fix compilation error on with older GCC
Hopefully it works on all platforms now.
2017-01-20 11:55:48 +01:00
ff1b850081 Fix T50460. Greying out issue with Cycles culling options. 2017-01-20 10:58:03 +01:00
05ff32bd25 Fix compile error (-Werror=float-conversion). 2017-01-20 10:50:55 +01:00
2e3fda2d95 DopeSheet: Show group colours behind keyframes too
Following @AlonDan's feature request and @hjalti's screenshot yesterday,
I've decided to implement support for this to make it easier to scan which
keyframes correspond with which set of controls, especially when faced with
a large wall of keyframes.

In retrospect, I should've done this a long time ago!
2017-01-20 18:40:26 +13:00
831cfcfb3d API: Do not show "Created using Sphinx" in the footer
I talked to Campbell and he said there is no need for this
2017-01-19 16:16:04 -05:00
c91bdaf55b Build dir should be set after the sanity checks
Error here is that if do not have 2012 it switch to 2015 but not change the build dir
2017-01-19 16:00:52 -05:00
2a2ae9c3fa BMesh: remove BM_face_create_ngon_vcloud
Instead, add BM_verts_sort_radial_plane
and use regular creation API.
2017-01-20 06:09:37 +11:00
53e7a4a83c Correct asserts, un-hiding when selected is ok 2017-01-20 06:00:55 +11:00
d6cf28c5e1 Cycles: Expose diffuse and glossy depth to Light Path node
Was a bit confusing to have transparent and translucent depth
exposed but no diffuse or glossy.

Reviewers: brecht

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D2399
2017-01-19 15:09:58 +01:00
afdd756e56 Cycles: Don't use fast math for the host code
This is important for the reliable behavior or isnan/isfinite/min/max
functions to work with nan and non-finite values. Some of the issues
with fast math are possible to work around, but didn't find a way to
have reliable min/max implementation yet.
2017-01-19 14:51:11 +01:00
78b94902f8 Cycles: Add fast-math safe isnan and isfinite
Currently unused, but might become really handy in the future.
2017-01-19 14:51:11 +01:00
6d36e033ba Cycles: Remove using namespace hell
Please NEVER EVER use such a statement, it's only causing HUGE
issues. What is even worse: it's not always possible to immediately
see that the hell is coming from such a statement.

There is still some statements in the existing code, will leave
those for a later cleanup.
2017-01-19 14:51:11 +01:00
446ed355a5 GPencil: Add option to create blank frame in active layer only
Now it is possible to select if the blank frame is created in active
layer only or in all layers.
2017-01-19 13:05:23 +01:00
666cb5ddd9 Cleanup: naming, comments assert for hide+selected 2017-01-19 22:59:41 +11:00
e2d02fee30 BMesh: improve hide-flush internal logic
- flushing hidden state ran when it didn't need to.
- flushing checks didn't early exit when first visible element found.
- low level BM_*_hide API calls like this can use skip iterators
  can loop over struct members directly.

No user-visible changes.
2017-01-19 22:50:56 +11:00
b76dbf5e65 UI: Fix capitalization inconsistency 2017-01-18 19:38:55 -05:00
4a19112277 Cycles: Fix amount of rendered samples not being shown while rendering the last tile on CPU 2017-01-19 00:48:09 +01:00
1455023e64 Fix T49807: Inset faces edge rail bug 2017-01-19 10:37:04 +11:00
11187e8628 Fix face-creation with existing hidden geometry
- face-create-extend option could add hidden verts and edges into
  the selection history (invalid state).
- faces could be created that included existing hidden edges
  that remained hidden (invalid state too).
- newly created faces could copy hidden flag from surrounding faces,
  giving very confusing results (looks as if face creation failed).

Surprising nobody noticed these years old bugs!
2017-01-19 09:17:36 +11:00
fd4728c85a BMesh: Use angle_signed_on_axis_v3v3v3_v3 2017-01-19 07:59:32 +11:00
a48d3417b5 Fix strict compiler warning message 2017-01-18 15:56:40 +01:00
b059a71655 GPencil: Avoid variable shadowing 2017-01-18 15:56:04 +01:00
6d868d9f48 Reproject Strokes - To Surface/Geometry
Experimental option for the Reproject Strokes operator to project strokes on to
geometry, instead of only doing this in a planar (i.e. parallel to viewplane) way.

The current implementation is quite rough, and may need to be improved before it
is really ready for use. Potential issues:
* Loss of precision (i.e. stairstepping artifacts) from the 3D -> 2D -> 3D conversion
  as we don't have float version of one of the projection funcs
* Jagged depth if there are gaps, since it will default back to the 3d-cursor plane
  if no geometry was found (instead of doing some fancy interpolation scheme)
* I'm not sure if it's that useful for adapting GP strokes to deforming geometry yet...
2017-01-19 03:20:44 +13:00
00edc600b0 Fix: Make it possible to erase strokes (on other layers) even if the active layer doesn't have any frames 2017-01-19 03:06:43 +13:00
7452af0f86 Fix: Avoid creating redundant frames when erasing
Now the eraser checks if there's an active frame with some strokes in it
before creating a new frame. There's no point in creating a new frame if
there are no strokes in the active frame (if one exists).

This still doesn't help much if there were strokes but they weren't touched though...
2017-01-19 03:06:43 +13:00
a93881d704 GPencil: Pressing 'B' while in 'Continuous Drawing' mode will create a blank frame
This is a hardcoded keymapping that just calls the "Add Blank Frame" operator
introduced in the previous commit.
2017-01-19 03:06:42 +13:00
259447300f GPencil: "Add Blank Frame" operator (D+B)
This operator adds a new frame with nothing in it on the current frame.
If there is already a frame there, all existing frames are shifted one frame later.

Quite often when animating, you may want a quick way to get a blank frame,
ready to start drawing something new. Or maybe you just need a quick way to
add a "placeholder" frame so that a suddenly-appearing element does not show
up before its time.
2017-01-19 03:06:41 +13:00
86b6006ef8 GPencil: Cleanup - move include line to correct scope 2017-01-18 13:00:09 +01:00
196520fe7d GPencil: Fix unreported error in animation after rename items
If the layers or the colors were renamed, the animation data was wrong
because the data path was not updated.

I also have fixed a possible stroke color name update if the name was duplicated moving
the rename function call after checking unique name.
2017-01-18 12:29:02 +01:00
d216313732 Cleanup: Strict compiler flags
Also seems the new file forced trailing whitespace, which goes against

  https://wiki.blender.org/index.php/Dev:Doc/Code_Style#Trailing_Space
2017-01-18 12:20:53 +01:00
e138cdeeb6 Transform manipulator: Allow first clicking Shift before selecting axis
Avoids possible jumps when one is trying to do some really preciese tweak.

Quite striaghtforward change for mouse input initialization: take Shift
state into account. However, this will interfere with the axis exclusion
which is currently also uses Shift (the feature to move something in a
plane which doesn't have selected axis). This is probably not so commonly
used feature (nobody in the studio even knew of it) and the only downside
now would be that such a constrainted movement will become accurate by
default. That's easy to deal from user side by just unholding Shift key.

Reviewers: brecht, mont29, Severin

Differential Revision: https://developer.blender.org/D2418
2017-01-18 12:18:54 +01:00
8d4b31ce03 GP Interpolation: "Remove Breakdowns" operator
To make it faster to try different interpolation curves, there's a new operator
"Remove Breakdowns" which will delete all breakdowns sandwiched by normal
keyframes (i.e. all the ones that the previous run of the Interpolation op created)
2017-01-18 19:42:00 +13:00
65ec429d11 GP Interpolate Sequence: Tool settings for controlling the shape of interpolation
This commit introduces the ability to use the Robert Penner easing equations
or a Custom Curve to control the way that the "Interpolate Sequence" operator
interpolates between keyframes. Previously, it was only possible to get linear
interpolation between the gp frames.

Workflow:
1) Place current frame between a pair of GP keyframes
2) Open the "Interpolate" panel in the Toolshelf
3) Choose the interpolation type (under "Sequence Options")
4) Adjust settings (e.g. if you're using "Custom Curve", use the curvemap widget
   to define the way that the interpolation proceeds)
5) Click "Sequence" to interpolate
6) Play back/scrub the animation to see if you've got the result you want
7) If you need to make some tweaks, undo, or delete the generated keyframes,
   then repeat the process again from step 4 until you've got the desired result.
2017-01-18 19:41:59 +13:00
224ae23443 GP Interpolate: Move settings from "gp_sculpt" to a new toolsettings struct - "gp_interpolate"
The "gp_sculpt" settings should be strictly for stroke sculpting, and not abused by
other tools. (Similarly, if other general GP tools need one-off options, those should
go into the normal toolsettings->gpencil_flag)

Furthermore, this paves the way for introducing new settings for controlling the way
that GP interpolation takes place (e.g. with easing equations, or a custom curvemap)
2017-01-18 19:41:58 +13:00
4903a83235 GP Interpolate Code Cleanup (Second Round)
* Reduce scope of variables
* Simplify a lot of the active_gpl->actframe->...->framenum stuff
* Missed some error messages
2017-01-18 19:41:58 +13:00
fd119a3723 Code Cleanup for GP Interpolation ops (first pass)
* Reshuffled some blocks of code for better ease of navigation/flow in the file
* Improved some tooltips
* Removed "Helper" tag from some functions that serve bigger roles
* Fixed some errant formatting
2017-01-18 19:41:57 +13:00
cd8cde1a6a Code Cleanup: Move GPencil Interpolation operators into their own file
The interpolation operators (and their associated code) occupied a significant
portion of gpencil_edit.c (which was getting a bit heavy). So, it's best to split
these out into a separate file to make things easier to handle, in preparation
for some further dev work.
2017-01-18 19:41:57 +13:00
af9f6fd57e Add 'Layer Weight' node to Blender internal node items 2017-01-17 12:02:05 +03:00
d7b2093db3 Return correct alpha for environment map in GLSL 2017-01-17 11:52:02 +03:00
e0303d0297 Cleanup/refactor: move BKE_deform_flip_side_name & co to BLI_string_utils
Functions like that do not have anything to do in BKE really, even less
when actually more used for bones than vgroups!
2017-01-16 20:36:23 +01:00
7ce833af5b Cleanup/refactor: get rid of fixed name limit in BKE_deform_flip_side_name & co.
Those were forcing to use vgroup name define in bones area, or even
mixing with maxbonename... ugly, and totally avoidable.
2017-01-16 20:36:23 +01:00
b997988323 Cleanup/refactor: Add new BLI_string_util.
Things like `BLI_uniquename` had nothing, but really nothing to do in
BLI_path_util files!

Also, got rid of length limitation in `BLI_uniquename_cb`, we can use
alloca here to avoid overhead of malloc while keeping free size (within
reasonable limits of course).
2017-01-16 20:36:23 +01:00
3748defefe Cleanup: remove unused & unimplemented BLI_newname. 2017-01-16 20:36:22 +01:00
702bc5ba26 Fix T50393: Flip names working just on one side when both are selected.
Just store bones that could not get renamed to desired flipped name on the
first try into a temp list, and try to rename them a second time.

This is rather simple solution, will induce 'over numbering' in case you
flip a bone to another unselected bone's name (since number will be
incremented in both rename attempts), but think this is acceptable minor
glitch, for a corner case situation that does not have any good
resolution anyway.

Also, set `strip_numbers` option of `BKE_deform_flip_side_name` to
false, otherwise chains of bones with same names would get their numbers
completely messed up after name flipping.

Based on work by @dfelinto in D2456 (https://developer.blender.org/D2456), thanks.
2017-01-16 20:36:22 +01:00
92fbcbb4bf Cycles: Cleanup, spelling 2017-01-16 17:55:41 +01:00
d3e4eecaa5 Cycles: Cleanup, avoid shadowing 2017-01-16 17:54:39 +01:00
0a446d7276 Add 3d to 2d plane mapping functions to math lib
This adds two functions to project 3d coordinates onto a 3d plane,
to get 2d coordinates, essentially eliminating the plane's normal axis
from the coordinates.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2460
2017-01-14 00:34:51 -02:00
646aa40cf7 Fix missing user when opening text from ID UI widget.
Own mistake in recent fix for Text data-block usercount (rBa9163f7d2).

Reported by @sergey over IRC, thanks.
2017-01-13 18:12:56 +01:00
e5a665fe24 Cycles: Fix wrong transparent shadows for motion blur hair
This was a missing bit from b53ce9a.
2017-01-13 16:14:57 +01:00
14f6e27f6a Cycles: Cleanup, style 2017-01-13 15:24:56 +01:00
807b1a262f Cycles: Simplify some code in Curve BVH reference fill
makes code slightly shorter and uses idea of const qualifiers.
2017-01-13 10:59:34 +01:00
3160472a66 Cycles: Avoid shadowing in BVH code
Run into some nasty bugs while trying various things here.

Wouldn't mind enabling -Wshadow for Cycles actually..
2017-01-13 10:53:01 +01:00
bd6bd62753 Fix small spelling error 2017-01-12 23:36:08 -05:00
d464fb0996 Dynamic Paint: recursively search for island border edges.
It is quite likely in a triangulated mesh that the actual island edge
belongs to a different triangle than the current pixel; for example
consider corners of a triangulated axis aligned rectangle face that
have the additional edge: a pixel there will have to be assigned to
one of the triangles, but one of the edges of the original rectangle
can only be accessed through the other triangle.

Thus for robust operation it is necessary to do a recursive search.
The search is limited by requiring that it only goes through edges
that bring it closer to the target point, and also by depth as a
safeguard.

Differential Revision: https://developer.blender.org/D2409
2017-01-12 21:28:15 +03:00
c937c3af46 Dynamic Paint: provide margin of error for linking neighbors across seams.
The code requires the pixel on the other side of the seam to be assigned
precisely to the expected triangle. This can cause false negatives around
vertices, where a pixel is likely to touch multiple triangles and thus
cannot be said to unambiguously belong to any one of them, so check
distance to the intended triangle and accept the result if it's close.
2017-01-12 21:28:15 +03:00
99ca90e808 Dynamic Paint: improve UV island border handling in effects.
1. Forcibly symmetrize the neighbor relations, so that if A is neighbor
   of B, B is neighbor of A. The existing code is guaranteed to violate
   this if texture resolution is different between the sides of a seam.

2. In texture mode dynamic paint adds a 1 pixel wide border around the
   islands. These pixels aren't really part of the dynamic paint domain
   and thus by design can't have symmetrical neighbor relations. This
   means they can't be treated by effects like normal pixels.
   The simplest way to handle it in a consistent way is to exclude
   them from effects, but add an additional pass that recomputes them
   as average of their non-border neighbors, located on both sides of
   the seam.
2017-01-12 21:28:14 +03:00
720e564882 Cycles: Allow up to 4 motion curve primitives per BVH node
This avoids intersection AABB of different curve primitives
which makes it less ray-to-primitive intersections.

This gives about 30% speedup of hair rendering in the barber
shop scenes here. There is still some work to be done on those
files to solve major speed issues on certain frames.
2017-01-12 18:23:23 +01:00
b53ce9a1d0 Cycles: Prepare BVH traversal code to work with multiple curve primitives per node 2017-01-12 18:20:19 +01:00
f12f906dd9 Cycles: Correct assert() for cases when there are multiple curves per BVH node 2017-01-12 17:38:27 +01:00
76a4cf1941 Cycles: Use separate limit for motion primitives for BVH node limits
This way we can have different limits for regular and motion curves
which we'll do in one of the upcoming commits in order to gain some
percents of speedup.

The reasoning here is that motion curves are usually intersecting
lots of others bounding boxes, which makes it inefficient to have
single primitive in the leaf node.
2017-01-12 16:54:08 +01:00
0421ae056d Cycles: Change confusing logic of max leaf size check
Maximal number of elements is supposed to be inclusive. That is what
it was always meant in this file and what @brecht considered still
the case in 6974b69c61.

In fact, the commit message to that change mentions that we allowed
up to 2 curve primitives per leaf while in fact it was doing up to 1
curve primitive.

Making it real 2 primitives at a max gives about 5% slowdown for the
koro.blend scene. This is a reason why BVHParams.max_curve_leaf_size
was changed to 1 by this change.
2017-01-12 16:33:08 +01:00
d9cd9ff322 Cycles: Cleanup, space prior to semicolon
We don't have that in Blender style, no reason to violate it here.
2017-01-12 15:31:25 +01:00
985c121c0b Cycles: Cleanup, make curve functions private
Not only they don't really follow naming convention (we don't use
camel case) but also was not necessary to keep them in the global
symbol table.
2017-01-12 15:28:19 +01:00
83d18a2a91 Cycles: Make it more clear message why curve motion attribute was removed 2017-01-12 15:22:41 +01:00
53fa389802 Cycles: Use dedicated debug passes for traversed nodes and intersection tests
This way it's more clear whether some issue is caused by lots of geometry in
the node or by lots of "transparent" BVH nodes.
2017-01-12 13:44:35 +01:00
8daf02f134 Cycles: Remove more duplicated code in debug passes logic 2017-01-12 13:33:53 +01:00
789fdab825 Cycles: Fix wrong scaling of traversed instances debug pass 2017-01-12 13:32:13 +01:00
618b3480c8 Cycles: Cleanup, remove duplicated code 2017-01-12 13:31:35 +01:00
d1131227c5 Cycles: Cleanup, indentation within preprocessor 2017-01-12 12:54:24 +01:00
511dbe56db Cycles: Cleanup, use switch() instead of if-else chain
About to add extra debug passes, which will be more clear to use switch().
2017-01-12 12:45:37 +01:00
554024e08e Cycles: move hair particle settings to scene context
Since the beginning of times hair settings in cycles were global for
the whole scene but were located in the particle context. This causes
quite some trickery to get shots set up for the movies here in the
studio by forcing artists to create dummy particle system to change
settings of hair on the shot.

While ideally this settings should be properly become per-particle
system for the time being it will save sweat and blood to move the
settings to scene context.

Reviewers: brecht

Subscribers: jtheninja, eyecandy, venomgfx, Blendify

Differential Revision: https://developer.blender.org/D2287
2017-01-12 10:48:17 +01:00
67f68295be Cycles tests: Rework output messages
Made them closer to how GTest shows the output, so reading test logs
is easier now (at least feels more uniform).

Additionally now we know how much time tests are taking so can tweak
samples/resolution to reduce render time of slow tests.

It is now also possible to enable colored messages using magic
CYCLESTEST_COLOR environment variable. This makes it even easier to
visually grep failed/passed tests using `ctest -R cycles -V`.
2017-01-12 09:47:54 +01:00
65c8937f7e Add Add Modifiers tab to the NLA & VSE editors
This is a follow up to rBca935ab

Differential Revision: https://developer.blender.org/D2442
2017-01-12 01:03:23 -05:00
Julian Eisel
092cbcd1d2 Fix T50056: Dyntopo brush size shortcut broken using constant detail setting. 2017-01-11 23:16:02 +01:00
Julian Eisel
c4f60319d1 UI: Try limiting 'x' icon to search buttons
Reusing PROP_TEXTEDIT_UPDATE instead of adding a new property flag just for search strings. Currently it's only used for search strings anyway so seems fine for now.

Fixes T50336.
2017-01-11 22:15:50 +01:00
c910beaa21 Split interp_weights_face_v3 into specific functions for tris and quads
This splits `interp_weights_face_v3` into `interp_weights_tri_v3` and
`interp_weights_quad_v3`, in order to properly handle three sided polygons
without needing a useless extra index in your weight array. This also
improves clarity and consistency with other math_geom functions, thus
reducing potential future errors.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2461
2017-01-11 17:55:13 -02:00
0507b3e4c4 Viewport SSAO: Fix normals not normalized 2017-01-11 18:47:06 +01:00
394fa07d41 Cycles: Fix wrong motion blur when combining deformation motion blur with autosplit
The issue was that we used to compare number of vertices for mesh after the auto
smooth was applied (at the center of the shutter time) with number of vertices
prior to the auto smooth applied. This caused false-positive consideration of a
mesh as changing topology.

Now we do autosplit as early as possible and do it from blender side, so Cycles
does not need to re-implement splitting on it's side.
2017-01-11 16:32:57 +01:00
38b0141554 Cycles: Pass explicit subdivision type to object_to_mesh
This allows us to do some extra logic checks there based on particular
subdivision type.

Additionally avoids implicit cast of enum to bool.
2017-01-11 16:23:54 +01:00
2b66a17e50 Copy autosmooth mesh settings BKE_mesh_new_from_object
This way render engine can first apply all modifiers on the
new mesh and then optionally perform autosmooth face splitting
on it.
2017-01-11 16:04:39 +01:00
8576efc98a RNA: Expose autosmooth face splitting
This way render engine can request mesh to be auto-split and not
worry about implementing this functionality on it's own.

Please note that this split is to be performed prior to tessellation.
2017-01-11 15:59:32 +01:00
7bbb2292dc Cycles: Cleanup, whitespace around operator 2017-01-11 15:16:22 +01:00
e068d09a4b Cycles: Improve logging of cases when motion blur is disabled
Next logical step is to expose this somehow to the interface.
2017-01-11 14:34:56 +01:00
e041bf7579 Cleanup: Use more meaningful constants other than 0 2017-01-11 00:27:53 +01:00
1dbaf0dbcc Add mid_v3_v3_array function and remove redundant functions
Other than implementing a `mid_v3_v3_array` function, this removes
`cent_tri_v3` and `cent_quad_v3` in favor of `mid_v3_v3v3v3` and
`mid_v3_v3v3v3v3` respectively.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2459
2017-01-10 19:58:34 -02:00
da026249ab UI Layout: fix some cases mixing fixed and expandable sizes
When layout has only small buttons (buttons with icon and without label)
its size should be fixed. Code was modified to be able to add a new UI_ITEM_MIN
flag which indicates that the layout has only small fixed-width buttons.

Patch by @raa, with minor style edits by @mont29.

Reviewers: Severin, mont29

Reviewed By: mont29

Tags: #bf_blender, #user_interface

Differential Revision: https://developer.blender.org/D2423
2017-01-10 16:24:22 +01:00
d5cf90f59f Cleanup: Strict CLang warning in Smoke module 2017-01-09 13:12:43 +01:00
bb88c7af81 Cleanup: Indentation 2017-01-09 13:11:42 +01:00
1b75cd5aa8 Cleanup: Don't use C++ comments style in C code 2017-01-09 12:35:08 +01:00
378afc9830 Fix for T50373: lattices should not be able to get subsurf modifiers
Reviewers: mont29

Reviewed By: mont29

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2449
2017-01-09 12:24:34 +01:00
9c756162ae Fix T50385: Deadlock in BKE_libblock_remap_locked.
Am pretty sure node update should not touch to Main database like that,
but for now let's allow it, I guess the hack is needed for things like
Sverchok. ;)
2017-01-09 10:43:23 +01:00
e713009e9b Fix: Audio plays back incorrectly after rendering to a video file
D2365
2017-01-06 18:18:20 +01:00
62604c5c20 Make button span the full width of the properties editor 2017-01-05 15:41:14 -05:00
b2159b94bc Remove instances of old vector icons
I checked and this makes consistent with other area of blender.
See https://developer.blender.org/rBf86eccb1ca2388ae203df2a59285a2f2fb9b6aa8#131061
2017-01-04 23:24:43 -05:00
Julian Eisel
82b9e1e312 Show 'Manipulate Center Points' in weight paint mode
If the active object is in weight paint mode, but some armatures in pose mode, 'manipulate center points' still affects the transformation. See bd2034a749.

Also removed redundant check, we basically did the same check for paint modes twice.
2017-01-05 00:14:25 +01:00
b86042f21a Dynamic Paint: Fix random pixel flooding by absolute brush with spread.
If a very low wetness absolute alpha brush is used with spread and
drying effects enabled, some pixels will rapidly accumulate paint.
This happens because paint drying code applies a minimal wetness
threshold that causes the paint to instantly dry out.

Specifically, every frame the brush adds paint at the specified
absolute alpha and wetness set to the minimal threshold, spread
drops it below threshold, and finally drying moves all paint to
the dry layer. This drastically accelerates the rate of flow of
paint into the affected pixels.

Fortunately, the reason paint spread actually ends up decreasing
wetness turns out to be a simple floating point precision problem,
which can be easily fixed by restructuring the affected expression.
2017-01-04 19:44:29 +03:00
a9163f7d22 Fix (IRC reported) bad handling of Text data-block user count.
Reported on IRC by dfelinto, thanks.

Root of the issue was that opening a new text file would create
datablock with one user, when Text editor is actually a 'user one' user.

This was leaving Text datablocks in inconsitent user count, and
generating asserts in BKE_library area.

Also changed a weird piece of code related to that extra user thing in
main remapping func.
2017-01-04 14:07:38 +01:00
351a9d084f Fix T50369: Objects can't be deleted from scene when using "link group objects to scene"
Main issue here was that in old usercount system 'user_real' did simply
not allow that kind of thing to work. With new pait of 'USER_EXTRA'
tags, it becomes possible to handle the case correctly, by merely refining
checks about indirectly use objects whene removing them from a scene.

Incidently, found another related bug, 'link group objects to scene' was not
incrementing objects' usercount - bad, very very bad!
2017-01-04 10:28:59 +01:00
Dalai Felinto
c0c48cdacc Fix T50350: Quick Explode time frame problem
The settings.frame_start rna was clamping frame start to frame end when frame start was bigger than frame end.
The fix is simply to set frame end first
2017-01-04 10:13:28 +01:00
3a1b1100af Revert "Remove double menu entries"
This reverts commit e2d7efc950.
2017-01-03 10:34:05 -05:00
ff0221f5d8 Fix implicit size_t to int conversion.
Seems like it was erroring on some buildbots...
2017-01-03 15:30:59 +01:00
65582e75e3 Fix: NLA "Strip Time" setting cannot be edited
This is a hacky fix for a regression introduced sometime after 2.76.
The "Strip Time" setting on NLA Strips could not be edited without the
value immediately jumping back to the current FCurve value (or 0.0 if no
keyframes existed); even enabling autokey wouldn't let you key the property.

Until we have proper overrides (that only lose their values on frame change),
it's best that this setting is editable, even if it does mean it you have to
manually change the frame to see the updated values.
2017-01-03 11:42:50 +13:00
8f1f3a0d46 GPencil: Per-layer option to always show onion skinning
Sometimes it can be useful to be able to keep onion skins visible in the
OpenGL renders and/or when doing animation playback. In particular, there
are two use cases where this is quite useful:
 1) For creating a cheap motion-blur effect, especially when the before/after
    values are also animated.
 2) If you've animated a shot with onion skinning enabled, the poses may end
    up looking odd if the ghosts are not shown (as you may have been accounting
    for the ghosts when making the compositions).

This option can be found as the small "camera" toggle between the "Use Onion Skinning"
and "Use Custom Colors" options.
2017-01-02 23:32:13 +13:00
3c74071634 Fix: Passed wrong last argument to function 2017-01-02 23:32:13 +13:00
Dalai Felinto
070f22c440 Fix T49861: Interlace stereo is broken in 2.78
This is a regression introduced in rB5bd9e832

It looks more like a hack than a proper fix, but the shader logic
changed a lot for blender2.8, so I would rather do the elegant fix
there, while leaving master working.

If we ever do a 2.78b (or 2.79) this should get in.
2017-01-02 11:30:17 +01:00
13174df534 API: Fix rst syntax 2017-01-02 00:33:15 -05:00
42e4b0955c API: Fix redirect in bgl page 2017-01-02 00:24:40 -05:00
143d9373e4 API: Update to modern sphinx syntax 2017-01-01 23:54:55 -05:00
32c65faeb9 Cleanup: redundant assignment in rect resize 2017-01-02 13:56:19 +11:00
911544c70c API: Fix double slashes in URLs 2017-01-01 19:53:16 -05:00
7924c84c44 Fix T50305: When adding new ID with same name as existing, Blender could generate invalid utf-8 ID name.
`check_for_dupid()` would roughly truncate existing name, without doing any utf-8 validation.
2017-01-01 02:27:03 +01:00
adadfaad88 Fix (unreported) fully broken 'sanitize utf-8' helper.
That code was a joke, letting some invalid utf8 bytes pass, returning
wrong offset for some invalid sequences, not to mention length and
pointer easily going out of sync, NULL final byte being 'forgotten' by
memcpy, etc. etc.

The miracle here is that we could survive using this for so long!
Probably because we do not use utf-8 sanitizing enough in Blender,
actually... :/
2017-01-01 02:15:42 +01:00
acbb84b021 Add BLI_string_utf8 specific test.
This test should ensure we correctly detect all invalid utf-8 sequences in a given string.

DISCLAIMER:
Do not run this with current code - you'll either laugh or cry, nearly *all* checks fail!

Based on utf-8 decoder stress-test (https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt)
by Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> - 2015-08-28 - CC BY 4.0
2016-12-31 16:10:20 +01:00
bf7d7bc323 Add new operator, ED_OT_undo_redo, to allow py tools to trigger that action.
Patch D2430 by @raa, thanks.
2016-12-29 12:38:20 +01:00
934b3f3682 Fix T50334: Also select indirectly imported objects when linking/appending.
Since we create a base and instantiate them, they become directly
linked, so makes sense to also select them if requested.
2016-12-29 12:17:23 +01:00
7ba2356a53 Freestyle: fix typo in console message.
Patch D2270 by Anthony Edlin (@krash), thanks.
2016-12-29 10:34:59 +01:00
6bd245bb53 Edits to user prefs NDOF UI
Small changes:

- Remove "NDOF" from each setting
- Change tooltip for deadzone
- Unrelated typo in cmake comment

Reviewers: merwin, Severin

Reviewed By: merwin, Severin

Tags: #bf_blender, #user_interface

Differential Revision: https://developer.blender.org/D2319
2016-12-29 01:09:11 -05:00
3d243eb710 Fix T49848: bevel of spiral gets bigger and bigger widths.
This is the same issue as was fixed with T39486: the adjustment pass
that tries to equalize different widths at either end of an edge
sometimes causes the widths to get bigger and bigger.
The previous fix was to let "clamp_overlap" do double duty as a way
to limit this behavior. But clearly this is undiscoverable, as the
current bug report shows.  So I put in an "auto-limiting" mode that
detects when adjustments are going crazy and then acts as if
clamp_overlap were set.
The reason we can't always act as if clamp_overlap is set is that
certain models (e.g., Bent_test in regression tests) look bad if
that is enabled.
2016-12-28 13:55:19 -05:00
2412e67ef8 UI: Make icon-only buttons for enum items with empty label.
Patch D2420 by @raa, thanks.
2016-12-28 15:07:18 +01:00
a522469940 Various UI message and API doc tweaks and fixes.
Mostly from patch D2256 by Aaron Carlisle (@Blendify), thanks!
2016-12-28 14:37:08 +01:00
11ae06b0b7 Update manual links in 'add object' py template.
Patch D2328 by @blendify, thanks.
2016-12-28 14:25:31 +01:00
45d0231a24 Minor UI message fix.
Based on D2436 by @blendify, thanks.
2016-12-28 14:17:15 +01:00
cabd2dceca Tweak error message when external image editor launching fails.
Include idea that Blender may fail to launch it even if path is correct,
in some cases (dear Windows...).

Based on idea from @lijenstina and @blendify (D2349), thanks.
2016-12-28 14:11:47 +01:00
b1c6ddb107 Also apply similar fixes to .keyframe_delete()
- T49816
2016-12-29 01:12:25 +13:00
3cbe95f683 Fix T49816: Keyframing NLA Strip influence from Python set keyframes in the wrong place 2016-12-29 01:12:24 +13:00
c5338fd162 Fix T50184: Grease Pencil Layer synchronization between Dope Sheet and Properties panel 2016-12-29 01:12:23 +13:00
7f262acb92 Fix T49479: Freestyle inconsistent line drawing with large geometry dimension.
Ray-plane intersection routine GeomUtils::intersectRayPlane() was used with an
unnormalized direction vector as input.
2016-12-28 18:09:35 +09:00
6559ab2d51 3D View roll & orbit were scaling view-quat length
Over time roll and orbit would scale the quaternion
which is documented as unit length.

In practice any errors would be subtle,
but better normalize as other operators do.
2016-12-28 18:10:34 +11:00
d5edaac42d Comments: mul_project_m4_v3_zfac 2016-12-28 15:49:39 +11:00
d874b40a55 Fix T50240: Rendering crashes when synced to JACK Transport
Disabling synchronization while rendering.
Using G.is_rendering as suggested by bastien. ;-)
2016-12-27 20:47:01 +01:00
752a783fa4 Fix T50305: Blender truncates a long multibyte character object's name to an invalid utf-8 string.
Add logic in RNA to ensure we pass valid utf8 string to BKE ID new functions...
2016-12-27 16:39:19 +01:00
c1e3041051 Comments: hints for perspective functions
Note which GL functions these are equivalent to.
2016-12-27 15:30:11 +11:00
41ec1adb03 Correct bad cast, unused var warning 2016-12-27 15:29:55 +11:00
3a9c490531 [MSVC] Fix test for C++11 support for vc2015/2017 based on D2432 by Ulysse Martin (youle) 2016-12-24 10:37:10 -07:00
b47c912f4b Fix (unreported) crash in 'Match movie length operator' in case of lost video texture file 2016-12-23 16:51:26 +03:00
d0335796a8 Readfile: Resurrect do_versions_after_liblink.
Basic idea is to store fileversion in Library datablock, and split again
Main by libraries after lib linking, do_versions_after_liblink on
those separated Mains, and merge again.

This allows to still have correct versions for each data-block in that
second do_versions step.

Note that this is not used currently in master (might be soon, though),
but is needed for 2.8 work.
2016-12-23 12:54:51 +01:00
8db2f72997 Fix (unreported) --threads option no more respected by main task scheduler.
Main scheduler would be created way before `-t` argument would be
parsed, since it was on forth pass! Moved it to first pass of argparse,
that kind of stuff should be initialized asap on startup.
2016-12-22 22:00:48 +01:00
Julian Eisel
5e31e07230 Fix wrong return type in blenderplayer stubs 2016-12-22 02:35:34 +01:00
5fb85ef2c2 Fix strict compiler warning in generated C++ RNA 2016-12-20 12:29:41 +01:00
544f6113f8 OpensSubdiv: Cleanup, unused argument 2016-12-20 12:29:41 +01:00
1c34a7f4eb Libmv: Fix missing virtual destructor in frame access sub-class
This is undefined behavior in C++ and Clang was complaining a lot
about this.
2016-12-20 12:29:41 +01:00
4d5cd638ff String drawing function for the "simdebug" utilities.
Simple string drawing API for debug drawing, in addition to basic primitives.
2016-12-20 11:02:40 +01:00
bd42987399 Fix (unreported) linked datablocks going through do_versions several times.
When linking data-blocks from same library in several steps, the already
linked data-blocks of same lib would go again through versionning code...

Note: only fixed for libraries, I can't imagine how this could happen
with local data...
2016-12-19 16:31:06 +01:00
e30d94bb3b Cleanup: rename paramenter to right name 2016-12-19 12:28:51 +01:00
6c3d8fbeb3 Cleanup: trackball logic
Used SQRT2 and SQRT1_2 to calculate the same value,
harmless but a little confusing, set once and check instead.
2016-12-17 19:14:02 +11:00
2e15618f49 Fix T50216: Missing checks caused data transfer segfault
Data transfer was not checking if the required geometry existed, thus
causing a segfault when it didn't. This adds the required checks, and
reports errors if geometry is missing.

This also replaces instances of the words "polygon" and "loop" in error
messages with "face" and "corner" respectively, to be consistent with
the rest of the existing UI.

Reviewed By: mont29

Differential Revision: http://developer.blender.org/D2410
2016-12-16 23:53:08 -02:00
535298eea5 Fix T50264: Stroke is not painted when append Grease Pencil block
When append a datablock the default brushes were not created and only
were created when draw new strokes. Now the default brushes are created
when draw strokes if necessary.
2016-12-16 22:56:43 +01:00
Julian Eisel
4df75e536a Make Shift+LMB on transform manipulator configurable
It's now possible to change the shortcut that enables planar transformation with the transform manipulators (shift+LMB on axis).

This actually fixes the workaround added in rB20681f49801fd. Thing is that we needed to allow using the manipulators, even if a modifier key is held so things like snapping work right away. That's why normal LMB behavior uses KM_ANY. However, event handling would always execute the KM_ANY keymap handler because it's iterated over first. Simply solved this by registering the KM_SHIFT keymap item first, so it has priority over the KM_ANY one.
2016-12-16 02:49:53 +01:00
Julian Eisel
524ab96245 Fix drawing enum property with icon only flag
Enum properties with icon only flag should use minimum/fixed width in expanded layouts (alignment=UI_LAYOUT_ALIGN_EXPAND).

Differential Revision: https://developer.blender.org/D2415 by @raa (only made some really minor corrections)
2016-12-15 23:43:17 +01:00
e2d7efc950 Remove double menu entries
These were already present in the "Select" menu.
2016-12-15 22:12:29 +01:00
bd3de93557 Gtest: Fix/workaround MSVC complains about use of struct with alignment 2016-12-15 17:53:57 +01:00
26bb0ee464 Fix Playerstubs tm 2016-12-15 15:47:00 +01:00
12e1732f72 Layer Weight node support for Blender Internal Render 2016-12-15 15:03:28 +03:00
665110a414 Proper fix for strict compiler warning 2016-12-15 11:51:53 +01:00
14d17cd27a Revert "Cleanup: Remove unused variable"
This reverts commit 743165eb48.

Didn't see it is used in debug mode, sorry
2016-12-15 11:50:25 +01:00
743165eb48 Cleanup: Remove unused variable 2016-12-15 11:49:44 +01:00
Karsten Weiss
820709c14d Fix STR_String Capitalize on non Win32
Harmless since its not used, but good to fix.
2016-12-15 12:58:19 +11:00
741c4082d8 BGE: Fix T50098: Crash when useding ImageMirror
The crash was caused by a missing m_sync initialisation in the second
ImageRender constructor.
2016-12-14 20:07:51 +01:00
84a283d18c Fix World Space Shading option influence on Fresnel node for BI + cleanup 2016-12-14 19:48:01 +03:00
525673b37b Cycles: Fix uninitialized variable issue after recent changes 2016-12-14 17:31:11 +01:00
4f03d3290c Fresnel node support for Blender Internal Render 2016-12-14 18:02:38 +03:00
91bbffd379 Cycles: Move object culling helper to own files
This is a stand-alone logic, which becomes quite comprehensive now.
2016-12-14 13:01:33 +01:00
6967216485 Cycles: Fix indendation 2016-12-14 12:47:28 +01:00
c4d6fd3ec0 Cycles: Consider GGX/Beckmann/Ashikhmin of 0 roughness a singular ray
This matches behavior of Multiscatter GGX and could become handy later on
when/if we decide it would be beneficial to replace on closure with another.

Reviewers: lukasstockner97, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2413
2016-12-14 11:04:02 +01:00
72d18c195e Cycles: Tweak curve segment (un)pack to handle more curve segments
There was 16 bits reserved for primitive type, while we only need 4.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2401
2016-12-14 10:59:45 +01:00
d210755f85 Usual UI messages/i18n fixes/tweaks. 2016-12-14 10:56:21 +01:00
fbcd51aef8 Fix T50243: libmv_panography_test is broken
There was fully wrong logic in comparison: was actually accessing memory
past the array boundary. Run test manually and the figure seems correct
to me now.

Spotted by @LazyDodo, thanks!
2016-12-14 10:46:20 +01:00
c21a5139e1 Small cleanup: Remove unused code
This code has not been used for a long time if not ever.
Most of the code was removed in rB1d3609262704f88c9e30b2cebdb236110b25cdc9
however, this was forgoten.
2016-12-13 20:15:53 +01:00
Julian Eisel
c1267bb800 UI: Externally open file and path from context menu
Adds two buttons to context (RMB) menu of path buttons:
* "Open File Externally" to open a file in an external app (only visible if path contains a filename)
* "Open Location Externally" to open a path in an external file browser

The functionallity for this was already there, just hidden behind Shift/Alt click of file_browse button (folder icon next to path button).
2016-12-13 17:01:59 +01:00
ec2fd74f47 Fix strict warnings on Windows 2016-12-13 16:46:04 +01:00
8bae72d04a Fix strict compiler error when building without bullet 2016-12-13 10:18:02 +01:00
Karsten Weiss
9446b6809a Libmv: Fix typo in assert message 2016-12-13 10:16:20 +01:00
Karsten Weiss
356dacea90 Libmv: Fix copy-paste mistake in camera intrinsic parameters 2016-12-13 10:15:40 +01:00
5f852a4324 Cleanup: bad (harmless) usage of PARM_PYFUNC_OPTIONAL in new ID.make_local RNA definition.
PARM_PYFUNC_OPTIONAL is only useful in definition of callbacks for
registrable types...
2016-12-12 15:56:00 +01:00
7415b9ffa3 Fix (unreported) some RNA func definitions setting flags of other func parameters!
Both found cases where luckily harmless, though...
2016-12-12 15:54:16 +01:00
440d104279 Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.

To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.

This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).

And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).

Reviewers: sergey, Severin

Subscribers: dfelinto, brecht

Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:46:06 +01:00
62703850ad Cleanup: Get rid of unused BKE_rigidbody_relink_constraint().
Also use proper ID_NEW_REMAP macro in BKE_rigidbody_world_groups_relink()!
2016-12-12 15:05:19 +01:00
b708dce34f Cleanup: Rename BKE_libblock_relink, and move it to BKE_library_remap.h
Was a waaaaayyyyy to much generic name for such a specific func, renamed
to much more descriptive BKE_libblock_relink_to_newid().

In near future (few weeks, to limit as much as possible silent mismatch
in branches), will rename BKE_libblock_relink_ex to BKE_libblock_relink,
this is the real generic data-block relinking func!
2016-12-12 14:58:10 +01:00
efadc8051e Cleanup: Get rid of ntreeSwitchID(_ex) functions, use generic BKE_libblock_relink_ex instead. 2016-12-12 14:31:50 +01:00
968e01d407 Cycles: Cleanup, variable names
Use underscore again and also solve confusing part then in BVH smae
thing is called prim_addr but in intersection funcitons it was called
triAddr.
2016-12-12 12:10:37 +01:00
b21938f3d4 Cycles: Cleanup, variables names
Use underscore instead of camel case.
2016-12-12 10:19:49 +01:00
2bb7a135ae Added --debug-io flag to command line 2016-12-09 17:21:11 +01:00
5a8b5a0377 Land D2339 by bliblu bli 2016-12-09 08:28:04 -07:00
1846a78849 Depsgraph: Add missing relation for cast modifier
When control object is used we need to known our own transformation as well.
2016-12-09 13:40:12 +01:00
3bd94b9f45 Depsgraph: Bone parent should also include armature transform relation
It is required to have world-space bone position, which consists of armature
object transform and local bone transform.
2016-12-09 13:05:39 +01:00
dd58390d71 Fix emissive volumes generates unexpected fireflies around intersections
Discard the whole volume stack on the last bounce (but keep
world volume if present).

Volumes are expected to be closed manifol meshes, meaning if
ray entered the volume there should be an intersection event
of ray exisintg the volume. Case when ray hit nothing and
there are still non-world volumes in the stack can happen in
either of cases.

1. Mesh is not closed manifold.

Such configurations are not really supported anyway and should
not be used.

Previous code would have consider the infinite length of the
ray to sample across, so render result wasn't really correct
anyway.

2. Exit intersection is more far away than the camera far
   clip distance.

This case also will behave differently now, but previously it
wasn't really correct either, so it's not like we're breaking
something which was working as expected.

3. We missed exit event due to intersection precision issues.

This is exact the case which this patch fixes and avoid
fireflies.

4. Volume has Camera only visibility (all the rest visibility
is set to off)

This is what could be considered a regression but could be
solved quite easily by checking volume stack's objects flags
and keep entries which doesn't have Volume Scatter visibility
(or even better: ensure Volume Scatter visibility for objects
with volume closure),

Fixes T46108: Cycles - Overlapping emissive volumes generates unexpected bright hotspots around the intersection
Also fixes fireflies appearing on the edges of cube with
emissive volue.

Reviewers: juicyfruit, brecht

Reviewed By: brecht

Maniphest Tasks: T46108

Differential Revision: https://developer.blender.org/D2212
2016-12-08 17:35:43 +01:00
Julian Eisel
0a26904a75 Fix T49872: 3D cursor places with camera shift in ortographic mode 2016-12-08 12:41:27 +01:00
Julian Eisel
d5708fdad6 Fix expanding enum property in sub-layout of pie menus
//ui_item_enum_expand// function replaces all pie menu's sub-layouts with radial layout. It should replace only root layout.

To reproduce the issue paste the code in Blender's text editor and press Run Script button.
```
import bpy

class VIEW3D_PIE_template(bpy.types.Menu):
    bl_label = "Select Mode"

    def draw(self, context):
        layout = self.layout.menu_pie()
        layout.column().prop(
            context.scene.render.image_settings, "color_mode", expand=True)

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

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

if __name__ == "__main__":
    register()
    bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")
```

Differential Revision: https://developer.blender.org/D2394 by @raa
2016-12-08 12:21:57 +01:00
62a2ed97ba Fix crash when opening a Blender file containing Alembic data.
Was also affecting object linking.
2016-12-07 23:04:27 +01:00
a63108efb1 Fix install_deps.sh failing to build ffmpeg 3.
--disable-libfaac is no more ffmpeg build option.
2016-12-07 17:17:31 +01:00
fc4a51e3fa Fix (unreported) Sequencer Drop effect: wrong initial offset in second input buffer.
Reading rest of the code, it's obvious we want to start à YOFF lines
from start of rect2i, so we have to also multiply by number of
components.

Also did some minor cleanup.
2016-12-07 14:53:57 +01:00
8f29503b52 Fix T49893: Crash in Video Sequence Editor with 'drop' effect.
Code was not accounting for possibilities that width or height of given
buffers may be smaller than XOFF/YOFF...

Note that I seriously doubt that drop code actually works (as in, gives
expected results) when applied to tiles like it seems to be done
currently, but this is much more complex (and involved) topic.
2016-12-07 14:23:46 +01:00
2002167a96 Remove unused include statement 2016-12-07 11:39:12 +01:00
bfe34789d1 Use proper defaults for Hue/Saturation node 2016-12-07 11:27:27 +01:00
4b69b6d316 Cycles :Cleanup, indentation 2016-12-06 15:37:29 +01:00
0371ef16ee Depsgraph: Only re-schedule objects which are on visible layers
Otherwise it's possible to cause infinite update loop in Cycles viewport.

Gets a bit messy logic, need to revisit this..
2016-12-06 14:48:48 +01:00
1b9cae9d04 Fix T50122: SEGFAULT: OCIO configuration typo leads to segfault 2016-12-06 14:19:17 +01:00
1de79c8960 Fix T50003, Bevel makes non-manifold mesh.
Problem was setting prev/next faces for edges around
a vertex on valence-2 vertices.
2016-12-06 07:43:47 -05:00
8ce6de3bdd Fix T50020: adding a background image does not set image user data. 2016-12-06 00:04:15 +01:00
fe0520e2c8 UI: add a message to indicate when using a modifier that wasn't
compiled.

This adds a short message to the smoke, remesh and boolean modifiers' UI
when trying to use them when their compilation was turned off. This was
already implemented for the fluid and ocean simulation modifiers.

This also makes the 'quick fluid' and 'quick smoke' operator abort and
report when trying to use them when unavailable.
2016-12-05 23:33:21 +01:00
7471f09f2b Depsgraph: Use HIGH priority for scheduled tasks
This kind of keeps threads "warmer" and should in theory give better
cache coherency bringing some %% of speedup. It was already tested
few months ago and it gave few % speedup in barber shop, but was
reverted due to some bone popping. The popping is now fixed so it
should be fine to use new scheduling policy.
2016-12-05 16:31:34 +01:00
69e8e34d96 Depsgraph: avoid more transitive relations for rigid body simulation 2016-12-05 16:30:30 +01:00
d1d7217692 Depsgraph: Rigid body simulation doesn't need explicit time relation
It'll be dependent on time via Time Source -> Rebuild RB World chain.
2016-12-05 16:03:10 +01:00
2cb5dffc8d Depsgraph: Avoid transitive relation from local transform to final
There is always an uber eval node on the way. so we can avoid creating
some relations here in order to speed up both construction time and
evaluation.
2016-12-05 15:59:31 +01:00
60dae91db8 Fix depsgraph: hair collision is actually enabled, so add the relations. 2016-12-05 13:36:30 +03:00
95b224dab2 Fix compilation error on recent Debian desktop
Something funny happened here, there were missing symbols from png
library to math functions.
2016-12-05 11:35:26 +01:00
b18f83bcf4 Fix T50141: Nabla zero division on texture force field
This sets forces to zero, when Nabla is zero and a grayscale texture is
used or texture mode is Gradient or Curl.

Nabla equal to zero was causing a zero division, and forces ended up
being set to `nan`.

Reviewed By: mont29

Differential Revision: http://developer.blender.org/D2393
2016-12-04 18:01:46 -02:00
dfca1e1460 CMake: disable QuickTime with macOS SDK 10.12+, no longer supported by Apple. 2016-12-04 20:26:37 +01:00
1791697d43 Fix macOS 10.9 build when using OIIO without FFmpeg. 2016-12-04 20:26:37 +01:00
7d443ed86d Docs: Show 'Other Options' last in --help
Own error when changing order,
moving experimental features last made some sense,
but causes them to be listed twice.

Reorder and comment to avoid it happening again.
2016-12-04 21:55:17 +11:00
d9d7b5b4d0 Cleanup: simplify bitmap line drawing
- Expand overly dense & confusing delta assignments.
- Replace bit shift with multiply.

Also link to 'clipped' version of this function
which may be useful to add later.
2016-12-04 15:15:25 +11:00
923eae25d1 [msvc] Changes for new oiio/ffmpeg versions. 2016-12-03 17:38:20 -07:00
ae04d0fcb6 CMake: update for macOS 10.9 libs with ffmpeg 3.2.1 and webp support. 2016-12-03 15:30:47 +01:00
1a01ef4ae9 Fix macOS build with openimageio 1.7.8 and openexr.
These macros conflict and are no longer needed with C99 or C++ anyway.
2016-12-03 15:19:49 +01:00
a2ebc5268f Cycles: Refactor Progress system to provide better estimates
The Progress system in Cycles had two limitations so far:
 - It just counted tiles, but ignored their size. For example, when rendering a 600x500 image with 512x512 tiles, the right 88x500 tile would count for 50% of the progress, although it only covers 15% of the image.
 - Scene update time was incorrectly counted as rendering time - therefore, the remaining time started very long and gradually decreased.

This patch fixes both problems:
First of all, the Progress now has a function to ignore time spans, and that is used to ignore scene update time.
The larger change is the tile size: Instead of counting samples per tile, so that the final value is num_samples*num_tiles, the code now counts every sample for every pixel, so that the final value is num_samples*num_pixels.

Along with that, some unused variables were removed from the Progress and Session classes.

Reviewers: brecht, sergey, #cycles

Subscribers: brecht, candreacchio, sergey

Differential Revision: https://developer.blender.org/D2214
2016-12-03 05:02:21 +01:00
35d490b3f1 OCIO: Implement exposure/gamma for fallback implementation
Quite handy for debugging.

Unfortunately, this doesn't support viewport tweaks yet since those
require GLSL for colorspace conversion. Maybe this will be implemented
as well one day in the future..
2016-12-02 16:57:00 +01:00
31fbf2b74a Cycles: Implement AVX2 path for curve intersection functions
Gives little performance improvement on Linux and gives up to 2%
speedup on koro.blend on Windows.

Inspired by Maxym Dmytrychenko, thanks!
2016-12-02 12:23:38 +01:00
acc1f8fbed Cycles: Add AVX intrinsics helpers
They are defined for MSVC but seems to be missing in GCC and CLang-3.8.

Maybe some further tweaks to policy when to define those functions is
needed, but should be fine for now.
2016-12-02 12:23:38 +01:00
0c958b9f8e Fix T50062: Mask - Clicking in ActivePoint Parent makes Blender crash.
Mask primitive adding code was not initializing correctly id_type of
points' parents.
2016-12-02 10:47:18 +01:00
0ac2be7030 Cycles: Disable AVX2 crash workarounds
I can no longer reproduce crash with neither of the files where
the crash was originally visible. This is something where other
changes (light threshold, sampling) had an effect and made code
to work as it is supposed to. Could have been optimizator issue
or something like that.

Let's see if we hit same issue again.
2016-12-02 10:17:05 +01:00
a4c6558481 Fix (unreported) memleak in ImBuf mipmap code in some cases.
`IMB_remakemipmap` may 'shrink' the mipmap list without actually freeing
anything, so we need to check all possible levels in `imb_freemipmapImBuf`
to avoid memory leaks, not only those currently used.
2016-12-02 09:44:41 +01:00
0e1cf858a0 install_deps.sh: Update official (default) lib versions of py/oiio/osl/osd/ffmpeg. 2016-12-01 16:31:34 +01:00
7fe7835d13 Fix (unreported) looptri array not being recalculated in ccgDM and emDM
In ccgDM and emDM, looptri array recalculation was being handled
directly by `*DM_getLoopTriArray` (`getLoopTriArray` callback), while
`*DM_recalcLoopTri` (`recalcLoopTri` callback) was doing nothing.

This results in the array not being recalculated when other functions
that depend on the array data called the recalc function.

This moves all the recalculation code to `*DM_recalcLoopTri` and makes
`*DM_getLoopTriArray` call that.

This commit also makes a minor change to the `getNumLoopTri` function,
so that it returns the correct number without having to recalculate the
looptri array.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2375
2016-12-01 12:41:56 -02:00
69a75b0169 GPencil: Include various new operators into the 3D View menus too
Quite a few of the operators added for 2.78 were not included in the menus
2016-12-02 03:13:47 +13:00
bdceea9475 GPencil Sculpt: Numpad keys now work when doing sculpt sessions (i.e. when the operator is run using wait_for_input=True)
This just brings it in line with the drawing operator
2016-12-02 03:13:47 +13:00
d258865995 Compiler warning fix 2016-12-02 03:13:46 +13:00
87cacd3893 Buildbot: Disable glibc211 slaves 2016-12-01 15:05:53 +01:00
f812b05922 Fix T50116: Light threshold broke branched path tracer
In fact, the issue was caused by light threshold being too high for
certain scenes. Lowered it down to 0.01.
2016-12-01 14:27:10 +01:00
9d50175b6c Cycles: Fix correlation issues in certain cases
There were two cases where correlation issues were obvious:

- File from T38710 was giving issues in 2.78a again
- File from T50116 was having totally different shadow between
  sample 1 and sample 32.

Use some more simplified version of CMJ hash which seems to give
nice randomized value which solves the correlation.

This commit will break all unit test files, but it's a bug fix
so perhaps OK to commit this.

This also fixes T41143: Sobol gives nonuniform noise

Proper science paper about hash function is coming.

Reviewers: brecht

Reviewed By: brecht

Subscribers: lukasstockner97

Differential Revision: https://developer.blender.org/D2385
2016-12-01 14:19:15 +01:00
87cd56b012 Fix T50075: Assert during debug render of hair_geom_transmission.blend 2016-12-01 12:11:11 +01:00
58877d6d08 Alembic: quiet compilation warnings on Windows.
Most of them are harmless implicit conversions (e.g. Alembic deals with
doubles for storing time information when Blender uses both ints and
floats/doubles) or class/struct mismatch on forward declarations.
2016-12-01 08:32:15 +01:00
05b181fbc5 Fix T46795 : Reset GWLP_USERDATA to NULL at window destruction so any future events will not try to reference this deleted class. 2016-11-30 18:26:25 -07:00
df63195d2a Cleanup id->newid usage, initial work.
This aims at always ensuring that ID.newid (and relevant LIB_TAG_NEW)
stay in clean (i.e. cleared) state by default.

To achieve this, instead of clearing after all id copy call (would be
horribly noisy, and bad for performances), we try to completely remove
the setting of id->newid by default when copying a new ID.

This implies that areas actually needing that info (mainly, object editing
area (make single user...) and make local area) have to ensure they set
it themselves as needed.

This is far from simple change, many complex code paths to consider, so
will need some serious testing. :/
2016-11-30 15:27:59 +01:00
2f6f75613f OCIO: Cleanup style
Was a ground work for some more improvements here, but got dragged
to some other studio maintenance job here.

The plan would be to enable exposure/gamma control for fallback mode
which will definitely be really handy for development and might be
handy for cases when OCIO config can not be read.
2016-11-30 12:54:14 +01:00
2ac8c9b42e Alembic: slight cleanup, reorder mesh code a bit. 2016-11-30 09:35:53 +01:00
66a3671904 Fix T49813: crash after changing Alembic cache topology.
Crash is due by mismatching loops and faces counts between the Alembic
data and the Blender derivedmesh which does not appear so
straightforward to fix (the crash happens deep in the derivedmesh code).

So for now, try to detect if the topology has changed and if so, both
only read vertices (vertex colors and UVs won't be read, as tied to face
loops) and add a warning message in the modifier's UI to let the user
know.
2016-11-30 09:20:45 +01:00
Julian Eisel
514db9f014 UI: Remove 'x' icon from paths and lists 2016-11-29 23:41:20 +01:00
bd5ae46c19 Fix compilation error with latest OIIO 1.7.8
There are some changes in OIIO includes so now need to do some
things differently.
2016-11-29 12:40:38 +01:00
1ec5edcc96 Fix T50094: Crash when viewport rendering point density texture
The idea is simple: cache PD resolution from cache_point_density() RNA
function because that one is supposed to be called while database is
locked for original synchronization.

Ideally we would also pass array size to the sampling function, but
it turned out to be quite problematic because API only accepts int type
and passing size_t might cause some weird behavior.
2016-11-29 11:39:14 +01:00
7ea2dedd59 Cycles: Pass extra array size argument to builtin image pixels functions
This is a way to avoid possible memory corruption when render threads works
in parallel with UI thread.

Not guarantees complete safe, but makes things easier to check anyway.
2016-11-29 11:03:11 +01:00
cc1a64be36 Math lib: Fix use function of wrong dimension
Seems to be a typo in recent commit e1e49fd.
2016-11-29 10:31:54 +01:00
3b467b35a8 Fix T50029: BVHTree.FromPolygons memory leak 2016-11-29 19:32:41 +11:00
9bea39c474 [msvc] remove /opt all together and revert to the default behavior /opt:ref for release builds, /opt:noref for debug builds. 2016-11-28 19:55:07 -07:00
dd34b7a71c Comment: explain viewport & render pixel-size
It wasn't all that clear why both pixel-sizes are needed.
2016-11-29 13:18:04 +11:00
6278adc3ca [msvc] change linker options from /opt:noref to /opt:ref, saves about 20% off the executable size
Nobody appears to know why this option was on (and just on for just x64 at that)
2016-11-28 13:22:36 -07:00
Julian Eisel
e0307113a5 UI: Add 'x' icon to text buttons to clear content
This is useful e.g. for search buttons to quickly clear the filter string. We might want to make this optional for python scripts.
2016-11-28 19:03:31 +01:00
df687837f8 [msvc2017] remove eigen vector workaround for msvc2017. 2016-11-28 10:12:21 -07:00
3340acd46b Fix T50065: Audaspace: some values of the lower limit of Factory.limit causes the factory not to play
Backport of upstream audaspace bugfix (ddd9a4d).
2016-11-28 17:23:44 +01:00
96ed2b0ce0 Remove sensor-size to int conversion
Currently harmless since the value is always set at its default (32).
Even so, it's confusing since its used with floats after.
2016-11-28 17:36:37 +11:00
841f3e4972 A number of other minor RNA fixes and precautionary safeguards against further crashes here 2016-11-28 02:33:49 +13:00
452028c77c GPencil RNA API: "set_active" option for layer.new() and palette.new() is now true/enabled by default
To bring the API more into line with the UI (and the general expected behaviour of
Blender when it comes to adding stuff), newly created layers and palettes will be
made the active ones by default. It's possible to override this behaviour still
(e.g. in cases where you're auto-generating a large number of them), but otherwise,
this change will help prevent errors like T50123.
2016-11-28 02:33:48 +13:00
e2d223461e Fix T50123 - GreasePencil: Modifying name of new color in new palette via bpy segfaults
When there were no prior palettes, creating a new one didn't automatically make it active.
This caused problems when trying to rename the color, as the RNA code assumed that if there's
a color, it must come from the active palette.

This commit partially fixes the problem by ensuring that if there are no palettes, the first
one will always be made active.
2016-11-28 02:33:48 +13:00
d20f5b7de0 Typo fix 2016-11-28 02:33:47 +13:00
ce3cae81f6 [msvc2015] Fix cmake warnings regarding backslashes in path of the run-time libraries 2016-11-26 17:00:25 -07:00
d464a7c441 fix T50118: Added missing assignment of Bone Roll 2016-11-26 18:48:50 +01:00
265e5def76 Fix T50104, Race condition in SVMShaderManager::device_update_shader 2016-11-25 12:03:04 -07:00
bcd0d8584f Math Lib: avoid temp array for rotate_m4
No need to have temp array storage, avoid 2x loops.
2016-11-25 21:00:32 +11:00
e1e49fd1a8 Math Lib: rotate matrix cleanup
- Remove 'rotate_m2', unlike 'rotate_m4' it created a new matrix
  duplicating 'angle_to_mat2' - now used instead.
  (better avoid matching functions having different behavior).

- Add 'axis_angle_to_mat4_single',
  convenience wrapper for 'axis_angle_to_mat3_single'.

- Replace 'unit_m4(), rotate_m4()' with a single call to 'axis_angle_to_mat4_single'.
2016-11-25 16:39:34 +11:00
d30a0239a2 Fix Torus default UV's offset outside 0-1 bounds
When major/minor segments didn't fit evenly into 4,
the UV's would move outside the UV bounds.
2016-11-25 14:29:34 +11:00
4f4e0ecdcf Remove eekadoodle workaround for add torus
This is no longer needed since moving to MPoly/MLoop data structure.

Also use 3x3 matrix for transforming instead of quaternion
(slightly better performance).
2016-11-25 14:26:25 +11:00
729affe7c9 Cycles: Avoid divisions by zero in volume sampling code
Was giving huge artifacts in the barber shop file here in the studio,

Maybe not fully optimal solution, but committing it for now to have
closer look later.
2016-11-24 16:39:02 +01:00
Martijn Berger
4d3d2d0299 Remove unused vector icons from RNA 2016-11-24 13:43:29 +01:00
403f00e558 Fix prefs UI when built w/o Cycles 2016-11-24 11:14:45 +11:00
def365e252 Fix T50100: Cycles SeparateRGBNode Red socket defined wrong
Spotted by David (bocs), thanks!
2016-11-23 11:33:09 +01:00
f2b57c3532 Depsgraph: Fix matrix_world driver source
Reported by Dalai in IRC, thanks!
2016-11-23 11:09:05 +01:00
a537e7b426 Cycles: Fix strict compilation warnings 2016-11-23 10:59:54 +01:00
411836d97c Fix Cycles device backwards compatibility error if device type is unavailable. 2016-11-23 00:04:06 +01:00
57141ea30e Fix spelling in Cycles distance culling description. 2016-11-23 00:04:06 +01:00
99c5c8befc Fix T49718: Wrong "Make Duplicates Real" behavior with "Keep Hierarchy"
All objects were being parented to a single instance of each parent
object, instead of their respective instances, when using dupliverts or
dupligroups.

Behavior was caused by the `persistent_id[0]` (vertex/face id) being
ignored when computing `parent_gh` hash, which caused all instances to
have the same hash, and thus only the first one was included.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2370
2016-11-22 14:59:59 -02:00
9aa8d1bc45 Cycles: Fix strict compilation warnings
Should be no functional changes.
2016-11-22 16:39:03 +01:00
67b1979c91 Install_deps: fix warning message not showing up in case build fails.
Kinda stupid, but big nice warning about need to try clean build if
something fails was only showing in case install_deps completed
successfully... :P
2016-11-22 16:06:05 +01:00
751573ce6f Fix T50034: Blender changes processor affinity unauthorized 2016-11-22 16:03:16 +01:00
cb694d6595 GLog: Workaround compilation error on Hurd
There is syscall headers but no SYS_Write syscall.
2016-11-22 12:43:59 +01:00
4818b3c97e Cycles: Fix re-definition of some functions on x32 arch 2016-11-22 12:34:45 +01:00
1be717d007 Fix (unreported) crash when drawing armatures' poses in some cases.
Was affecting armatures' pose drawing code, could try to draw with
non-updated pose, which may contain NULL bone pointers (e.g. after some
data-block management tool execution, like make local, remapping, etc.).
2016-11-22 12:24:03 +01:00
edc10f5529 Cycles: Another attempt to fix compilation on 32bit Linux 2016-11-22 12:11:08 +01:00
af444e913f Cycles: Attempt to fix 32bit buildbot builds after recent commit 2016-11-22 12:06:16 +01:00
272412f9c0 Cycles: Implement texture size limit simplify option
Main intention is to give some quick way to control scene's memory
usage by clamping textures which are too big. This is really handy
on the early production stages when you first create really nice
looking hi-res textures and only when it all works and approved
start investing time on optimizing your scene.

This is a new option in Scene Simplify panel and it acts as
following: when texture size is bigger than the given value it'll
be scaled down by half for until it fits into given limit.

There are various possible improvements, such as:

- Use threaded scaling using our own task manager.

  This is actually one of the main reasons why image resize is
  manually-implemented instead of using OIIO's resize. Other
  reason here is that API seems limited to construct 3D texture
  description easily.

- Vectorization of uchar4/float4/half4 textures.

- Use something smarter than box filter.

  Was playing with some other filters, but not sure they are
  really better: they kind of causes more fuzzy edges.

Even with such a TODOs in the code the option is already quite
useful.

Reviewers: brecht

Reviewed By: brecht

Subscribers: jtheninja, Blendify, gregzaal, venomgfx

Differential Revision: https://developer.blender.org/D2362
2016-11-22 12:00:09 +01:00
927a168b07 GPU: Consider latest Gallium driver an official ATI/AMD
This will make triple buffer used by default for such configuration.

Ideally we would switch to triple buffer on all platforms, but let's
do it in 2.8 branch and don't open can of worms in master now.

This should solve issues like T49945.
2016-11-22 11:38:27 +01:00
bd8cbf5c07 Glog: Fix compilation error on ppc64el
This was fixed in upstream already. Time to re-bundle?
2016-11-21 21:04:48 +01:00
dd51ec592f CLEW: Workaround compilation error on ppc64el
Something was conflicting here, causing C++ to consider bool as
a __vector(4) bool.
2016-11-21 21:03:34 +01:00
94d8e6fc6c Partly revert own rBb97c567c1df1e, clear_proxy is actually safe.
This is very confusing, in fact, and rna tooltip was wrong,
BKE_object_make_local_ex actually ensures we never have several proxies
of same object, since it always clears proxy when it has to copy object
to make it local...

What that RNA function is probably missing, though, is same logic as in
BKE_library_make_local to actually remap proxy from old linked object to
new local one.
2016-11-21 20:57:02 +01:00
b97c567c1d Fix two very bad issues in new ID.make_local RNA function.
I) `clear_proxy` parameter was not assigned to parm in RNA define code,
so 'pyfunc optional' flag was set to `new_id` parameter of `user_remap`
func - super ugly!

II) `clear_proxy` parameter itself, when set to False, would allow to
leave .blend file in invalid state (more than one proxy of same object),
this should never, ever be allowed in RNA API imho. Left the PAI
untouched for now, just disabled any effect from this parameter (hence
always clearing proxy when copying).
2016-11-21 15:25:33 +01:00
2a78635dea Cleanup: get rid of unused BKE_constraints_relink().
Libquery/generic ID remapping code handles this now.
2016-11-21 15:25:33 +01:00
25c534f20a Fix T49981: New Depsgraph - When camera is on inactive layer, it does not evaluate constraints 2016-11-21 14:37:23 +01:00
af7343ae22 Cycles: Attempt to fix compilation error on ppc64el
There is some define conflict between system headers and clew,
so delay include of clew.h as much as possible.]

This is something which needed to be done in the code before
the refactor, hopefully such change will still work.
2016-11-21 13:32:41 +01:00
5eab3b079f Depsgraph: Fix infinite viewport object update in CYcles render mode
The issue was caused by wrong object re-tag needed to have proper dependnecies
update for OpenSubdiv.
2016-11-21 12:00:09 +01:00
b3c8ee891a Depsgraph: use more explicit parenthesis 2016-11-21 11:05:56 +01:00
83b1f24140 Fix Xcode link error, missing definitions in RNA C++ API that other compilers ignored. 2016-11-20 18:12:12 +01:00
b86c6aa6be Cycles: Don't shadow loop variable 2016-11-20 11:46:43 -05:00
f68ef05a56 Cycles: add basic backwards compatibility for device selection, move to System tab.
For the multi-GPU case users still have to reconfigure the devices they want to use.

Based on patch from Lukas Stockner.

Differential Revision: https://developer.blender.org/D2347
2016-11-20 15:45:22 +01:00
aea4ed00d5 Cycles: refactor culling code into utility class. 2016-11-20 15:25:47 +01:00
e8641d4474 Cycles: distance culling for objects.
This can be used together with camera culling to keep nearby objects visible in
reflections, using a minimum distance within which objects are visible. It is
also useful to cull small objects far from the camera.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2332
2016-11-20 15:01:11 +01:00
2c26a7b71e Cleanup: harmless mistake in rangetree 2016-11-20 09:11:26 +11:00
53a1b48321 GHOST/X11: Incorrect WM_STATE access
This worked by accident because of struct padding,
treat state as a CARD32 as documented.

Matches wine-x11 usage.
2016-11-20 09:03:51 +11:00
dd82d70bc5 Fix T50081: Grease pencil parented rotation problem
When the parent object matrix change after the layer was parented, the
inverse matrix for strokes must be updated when editing strokes or the
transformations will be wrong.
2016-11-19 22:41:37 +01:00
8c93178c96 Fix T50078: Vertex Groups not copied over when making proxy.
Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2368
2016-11-19 19:18:10 +01:00
369872a2c5 Fix T49991: reloading librairies doesn't update node groups.
We need to check node tree links are still valid, after we remapped
some NodeGroup.

Note: In fact, we have to run that for *all* ID types, since nodes may
use any kind of data-block (in theory)... :/
2016-11-19 12:31:40 +01:00
fa6a62fac2 Fix NodeGroup generic verify function crashing if node's ID pointer is NULL.
Another nice crasher - in this case, we just want to nuke all sockets...

Related to T49991.
2016-11-19 12:18:32 +01:00
bd6a9fd734 Fix (unreported) nodeRemoveAllSockets() not clearing inputs/outputs sockets lists.
Nice crasher (though seems to not be much used so far)!

Related to T49991.
2016-11-19 12:16:14 +01:00
5a6534a5bb Fix forward-compat Nodes write code being executed also for undo steps writing.
Forward compatibility code should never, ever be run during undo saving.

Note: related to T49991 (but does not fix it either, crash now happens
when doing a real file save...).
2016-11-18 22:44:05 +01:00
884693b42a Fix Node space ID remap callback not handling node trees.
Yep. Kinda ridiculous, but forgot to handle the very node trees
data-blocks in that editor!

Related (but not fixing) to T49991.
2016-11-18 22:44:05 +01:00
b6c0edcb09 Fix T50071: Radience HDR fomat does not support alpha at all. 2016-11-18 22:44:05 +01:00
b8710e1468 Fix UV layer bug in object_utils.object_data_add()
Adding a torus in edit-mode, with 'Generate UVs'
for example would either create another UV layer with the default name or
switch to the default UV layer name if it exists.

Now use the existing UV layer if present.
2016-11-19 06:57:55 +11:00
40990d52d1 Add Torus: avoid excessive attr access 2016-11-19 06:57:13 +11:00
39be226e93 BMesh: invalid return from BM_mesh_validate
Returned value was always false, even for valid meshes,
note that this is a debug-only function.

Also set internal-tag cleared.
2016-11-19 06:31:17 +11:00
a90644ed19 Minor debug-report tweak to autosave code.
Print in cosole a warning when we skip autosave due to runnning modal op.

Related to T49974.
2016-11-18 18:47:29 +01:00
Dalai Felinto
0f8e5f4fb4 Cycles: Different noise seed for stereoscopic rendering (Fix #T50024)
Patch by Sergey Sharybin.
2016-11-18 18:23:52 +01:00
ba7c11aa05 Depsgraph: Fix residue of debug-only code 2016-11-18 17:48:01 +01:00
27de0c40c5 Fix T50035: Minor interface bug: UV/ImageEditor - Paint Mode - Fill Brush
Patch by @LucaRood, added some cleanup of DRAW/FILL conditions in this
code too...
2016-11-18 15:49:41 +01:00
f6083b7bcd Fix (unreported) bad handling of brush's fill threshold value.
'1' threshold value would only allow to access a third of the basic
'color space' (from black to white, from 0.0 to 1.0 component values),
when you expect it to access the whole range.

Unfortunately, this needs a subversion bump to allow already defined
brushes to keep exact same behavior!

Also, did not change default value (0.2) for new brushes, think here
keeping current one makes more sense.

Thanks to @LucaRood for confirming the issue.
2016-11-18 15:32:50 +01:00
8f0dc3cef6 Fix T50052: bpy.utils.unregister_module doesn't unregister classes of submodules in reload scenario.
reload case would clear TypeMap before unregistering addons, which made
all calls to unregister_module() to do absolutely nothing.
2016-11-18 15:15:46 +01:00
Julian Eisel
3fb11061ba Fix T50063: Editing driver's expression eliminates "Zero" number
Disables trimming of trailing zeros in case button contains an expression.
2016-11-18 13:38:46 +01:00
Dalai Felinto
fffb1a4cfb Implement multi-view stereo support for image empties
Empty images were implemented to expand (and eventually replace)
the background images functionalities. If we are ever to drop
background images "image empties" should support stereo/multi-view as well.
2016-11-18 12:38:18 +01:00
841c4deed7 Fix potential NULL dereference in mesh sequence cache modifier.
Reported by coverity.
2016-11-18 12:03:12 +01:00
b859fef670 Fix copy/paste typo in new depsgraph object geometry builder (found by coverity). 2016-11-18 11:55:28 +01:00
03a395766a BMesh: avoid using temp array for face-area 2016-11-18 06:10:53 +11:00
46739f1e5c BMesh: minor cleanup
Comment & don't use dummy pointer.
2016-11-18 06:10:53 +11:00
a1a8343281 Cleanup: redundant index loop for monkey-create
Also rename face vars (the faces aren't temp),
and quiet old-style-definition warning.
2016-11-18 06:10:53 +11:00
d294509dd8 Depsgrpah: Fix missing animation update in movie clips 2016-11-17 16:37:25 +01:00
4dbd61cc64 Depsgraph: Move scene builder function to own file
This way it's much easier to grasp what the graph actually contains.
2016-11-17 15:44:32 +01:00
1f8762bb8e Fix T50060: New depsgraph does not update mask animation 2016-11-17 15:29:22 +01:00
0a08d8c892 Depsgraph: Use utility macro to iterate over linked list
This will be compiled into same exact code, just saves us from
doing annoying type casts all over the place.
2016-11-17 15:11:55 +01:00
0c322c3000 Depsgraph: Move rig builder functions to own files
Those routines are rather big and started to be annoying to have
one big file.

Should be no functional changes.
2016-11-17 14:41:16 +01:00
16e2c0ef3c [MSVC] Preliminary VS2017 support. 2016-11-16 20:13:58 -07:00
60409841a4 Fix T50001: auto tile size addon broken after Cycles GPU device changes.
Adds a get_num_gpu_devices() utility function for the addon to use.
2016-11-17 02:17:56 +01:00
e400f4a53e Fix T50051: Avoid crash when render grease pencil from VSE
The renderpasses for grease pencil are not necessary when render from
sequencer.

This fix solves the GPF but we need to rethink the complete render
process for grease pencil and integrate better in the render and
composition workflow.

Thanks to Dalai Felinto por helping in the debug and fixing of the
problem.
2016-11-16 21:33:47 +01:00
2a2eb0c463 Cycles: Fix different noise pattern from fix in T49838:
No need to hash subframe == 0.
2016-11-16 15:32:00 +01:00
209bc9977c Fix T50046: Segmentation fault due to out-of-range VertexGroup.weight() call.
`get_vert_def_nr()` was not checking vert index in bmesh case (aka Edit mode).
2016-11-16 12:42:17 +01:00
Martijn Berger
f86eccb1ca Remove unused vector icons
it seems to me the icons are unused:

  - VICO_VIEW3D_VEC
  - VICO_EDIT_VEC
  - VICO_EDITMODE_VEC_DEHLT
  - VICO_EDITMODE_VEC_HLT
  - VICO_DISCLOSURE_TRI_RIGHT_VEC
  - VICO_DISCLOSURE_TRI_DOWN_VEC
  - VICO_MOVE_UP_VEC
  - VICO_MOVE_DOWN_VEC
  - VICO_X_VEC

Since their code contains immediate mode GL calls and they seem to be unused i thought we could remove them.

Reviewers: mont29

Reviewed By: mont29

Subscribers: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2356
2016-11-16 12:25:14 +01:00
e17b92f535 Fix custom props not being handled correctly by manual/pyref UI menu entries. 2016-11-16 11:09:14 +01:00
4722fc5dd0 Disable possibility to flip bone names of linked armatures
Linked data should not be modified in such a way.

Reported by Nathan here in the studio, reviewed by Bastien, thanks!
2016-11-16 10:39:41 +01:00
eb9e9f7f1a Cleanup: Remove unused function 2016-11-16 10:10:07 +01:00
8b2905952e Fix T50026: "Only Insert Needed" doesn't work when using Trackball rotation
The rotation case here only covered rotation by the "Rotate" tool, but skipped
the "Trackball" tool.
2016-11-16 11:14:38 +13:00
6397319659 Fix T50023: Inverse Kinematics angle limits defaulting to 10313.2403124°
Regression from 2.77a. The units for the min/max limits were changed in RNA
but the pose channels were still being initialised with in degrees.
2016-11-16 11:10:19 +13:00
0de157a320 FIX T49899: Add EIGEN_MAKE_ALIGNED_OPERATOR_NEW to classes that use eigen's data types , to force aligned on 16 byte boundaries. 2016-11-15 13:21:01 -07:00
44b691dc65 RNA Main API: set remove's do_unlink default value to true.
On second and third thoughts, this should have been done that way since
the begining, cases were you just delete a few data-blocks without any
serious knowledge of their usages are much, much more frequent than
cases where you are deleting thousands of data-blocks and are sure they
are not used anywhere anymore...

Own fault, but really frustrated that this topic was only raised the day
after 2.78a was released. :(
2016-11-15 17:12:18 +01:00
f2690673ba Get rid of 'drivers unlinking' code in BKE_libblock_free_data()
This has nothing to do here (freeing is not unlinking/remapping!), and
was actually redoing something already taken care of by
`BKE_libblock_relink_ex()` call in `BKE_libblock_free_ex()`.

Also, gives some noticeable speedup when removing datablocks with
do_unlink=True, about 5 to 10% quicker e.g. when deleting all objects
from a py console, in a big production file...
2016-11-15 16:39:48 +01:00
af0e6b31a5 Depsgraph: Fix frash with iTaSC solver
This commit reverts part of a fix for T33275, but things are:

- I can not reproduce the original issue at all, so doesn't seem to
  cause any regressions.

- It is really bad idea to do delayed initialization in the threaded
  environment, it's a straight way to some nasty issues.

- We can't do things like this anyway because we go more granular,
  meaning such a delayed initialization will fail in the case of
  having several IK solvers (unless they properly accommodate to
  changed bone head).

- Verified the fix with various files from Mango project and all of
  them seems to work nice with new depednency graph now (old depsgraph
  has some flickering, but it's not related on DEG itself, but on
  an environment with lots of proxies and threaded evaluation and it
  is not a new behavior).
2016-11-15 16:18:59 +01:00
9019f8ca95 Revert "Proxy: Construct pchan hash when syncing armature proxy"
This reverts commit 9b5a32cbfb.

Apparently it is possible to have other thread mocking around with the hash.

Needs deeper investigation, for the time being reverting to prevent crashes.
2016-11-15 16:13:24 +01:00
cb117f283b 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
2016-11-15 16:07:32 +01:00
a828818d59 Cleanup: More explicit parentheses 2016-11-15 16:01:21 +01:00
625db1d86e Avoid interface ID remapping when freeing the whole database
This makes heavy scenes to be freed almost instantly (so now
quadbot scene takes only 0.06sec to free),
2016-11-15 15:56:40 +01:00
85e51b0638 Avoid driver target remapping when freeing the whole database
Added BKE_libblock_free_data_ex() which takes special do_id_user
argument which basically indicates whether main database was already
taken care about not having "dead" pointers.

Gives about 40% speedup of main database free with quadbot scene
(3.4sec vs. 5.4 sec on quite powerful desktop).
2016-11-15 15:56:40 +01:00
Julian Eisel
0cd1b5ef85 Fix T50022: "Mirror" in Dopesheet Crashes Blender
Just fixing crash itself. Actually operator shouldn't run in most editors (not in dopesheet either I guess), but don't want to spend time on that right now.
2016-11-15 15:30:33 +01:00
Dalai Felinto
69470e36d6 Implement grouped undo option for operators
This option makes an operator to not push a task to the undo stack if the previous stored elemen is the same operator or part of the same undo group.

The main usage is for animation, so you can change frames to inspect the
poses, and revert the previous pose without having to roll back tons of
"change frame" operator, or even see the undo stack full.

This complements rB13ee9b8e
Design with help by Sergey Sharybin.

Reviewers: sergey, mont29

Reviewed By: mont29, sergey

Subscribers: pyc0d3r, hjalti, Severin, lowercase, brecht, monio, aligorith, hadrien, jbakker

Differential Revision: https://developer.blender.org/D2330
2016-11-15 14:25:10 +01:00
445274fc4f Depsgraph: Fix typo in previous optimization commit
Was a residue from another experiment, caused infinite loop when
reporting dependency cycles.
2016-11-15 14:22:17 +01:00
a284d04093 Atomics: Add some extra utility functions
Also fixed semantic of fetch-and-add in assembler implementation,
it seemed to not match the naming.
2016-11-15 13:41:08 +01:00
4ee08e9533 Atomics: Make naming more obvious about which value is being returned 2016-11-15 12:16:26 +01:00
46b5cdaa4d BMesh: remove redundant link-list manipulation
No need to track previous edge in vert-separate cleanup
2016-11-15 12:39:59 +11:00
c418ef48cb BMesh: match BM_vert_find_first_loop with iterator logic
Use changes from previous commit for BM_vert_find_first_loop.
2016-11-15 07:55:55 +11:00
d9597ce3ba BMesh: avoid extra calls per faces-of-vert iterator
- `bmesh_radial_faceloop_find_first` & `bmesh_disk_faceedge_find_first`
  can be replaced with a single call to a new function:
  `bmesh_disk_faceloop_find_first`

- `bmesh_disk_faceedge_find_first` called `bmesh_radial_facevert_check`
  which isn't needed, since either the current or next loop in the
  cycle is attached to the edge we're looking for.
2016-11-15 07:39:39 +11:00
a3b61f0639 BMesh: use const for BM_vert_face_check 2016-11-15 07:30:18 +11:00
e6ad6ff082 BMesh: minor improvement to BM_vert_face_check
No need to perform edge-of-vert then loop-of-edge check.

Any vertex that has an edge with a face will be connected to a face.
2016-11-15 06:57:11 +11:00
77ba1ed5db BMesh: fix edge-rotate with w/ flipped faces
Edge-rotate would randomly flip one of the faces to match the other.

Also maintain active-face when rotating the edge.
2016-11-15 04:01:35 +11:00
d3919c22b0 BMesh: fix edge-rotation selection state bug
Failed edge rotation could leave unselected edge between selected faces,
also report warning when edges fail to be rotated.
2016-11-15 03:26:19 +11:00
6a2b95e1ca BMesh: replace iterator with BM_face_vert_share_loop 2016-11-15 02:44:57 +11:00
dc0a9e6535 BMesh: remove redundant argument 2016-11-15 02:44:57 +11:00
b047d79871 Cycles: De-duplicate image loading functions
The code was templated already, so don't see big reason to have
3 versions of templated functions. It was giving some extra code
to maintain and in fact already had divergency for support of huge
image resolution (missing size_t cast in byte image loading).

There should be no changes visible by artists.
2016-11-14 14:03:17 +01:00
7a4a2ed5f4 intsall_deps / OSL use c++11 ABI when install_deps is asking for c++11 2016-11-14 09:59:30 +01:00
fc9fa07c0e BMesh: BM_face_exists no longer uses return arg
Just return the face or NULL, like BM_edge_exists(),
Also for BM_face_exists_overlap & bm_face_exists_tri_from_loop_vert.
No functional changes.

Old code did some partial overlap checks where this made some sense,
but it's since been removed.
2016-11-14 04:33:35 +11:00
1b1d6ce131 Fix T50013: Blender 2.78a Link/Append Crash.
Object freeing may in some kind access its obdata (in case it has some
caches e.g.), since here obdata may have already been freed, let's set
object's data pointer to NULL (probably not ideal solution, but we don't
care much, those form archipelagos of unused linked datablocks,
we nuke'em all anyway).

Also fix stupid mistake in one of own recent commits (using ID we just
freed, tsst...).
2016-11-13 15:49:41 +01:00
7e8bf9dbd6 Fix T50007: blender offline python documentation in zipped HTML files, not shown correctly.
Stupid mistake, os.scandir is not recursive... Patch by @brecht, thanks.
2016-11-13 12:06:26 +01:00
cc8132b0c8 Fix T49997: don't flip texture users menu in texture properties. 2016-11-13 02:29:10 +01:00
43703fa4bf Fix T50008: camera DOF Distance picking from W key menu not working. 2016-11-12 22:31:24 +01:00
447fc7c4ce fix T50004: Removed check for empty mesh and adjusted the vertex import function to accept meshes without vertices as well 2016-11-12 22:20:07 +01:00
4151f12713 Fix Make Vertex Parent operator missing from vertex/curve/lattice menus.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2346
2016-11-12 19:01:13 +01:00
111e2f5aba Fix T49904: Cycles standalone missing default generated texture coordinates. 2016-11-12 17:33:07 +01:00
b5a58507f2 Fix Cycles OSL compilation based on modified time not working. 2016-11-12 17:33:07 +01:00
69288737ca Fix Cycles standalone not finding CPU device after recent changes. 2016-11-12 17:33:07 +01:00
478e59a04e Fix T49985: cycles standalone XML missing distant lights. 2016-11-12 17:33:07 +01:00
188ecee642 Fix T49985: cycles standalone using wrong socket names for XML reading. 2016-11-12 17:33:07 +01:00
Julian Eisel
627141082b Sculpt UI: Make DynTopo constant detail a resolution value
This should make it easier to sculpt in high resolutions, downside is that the new way to calculate maximum edge length is a bit less intuitive. Maximum edge length used to be calculated as blender_unit * percentage_value, now it's blender_unit / value.

Reused old DNA struct member, but had to bump subversion to ensure correct compatibility conversion. Also changed default value slightly (would have had to set to 3.333... otherwise).

Was Requested by @monio (see https://rightclickselect.com/p/sculpting/zpbbbc/dyntopo-better-scale-input-in-constant-detail-mode) and I think it's worth testing.
2016-11-12 16:53:38 +01:00
e00c3ab13f BMesh: update comments, ifdef'd code 2016-11-13 01:39:40 +11:00
7fd2efa507 BMesh: Minor improvement to face-join
Pass in loops instead of edge & faces.
Nearly all callers have the loop-pairs to pass in.
2016-11-12 10:30:32 +11:00
dad0c31ceb Fix renaming error in last commit 2016-11-12 10:30:28 +11:00
8b01a6e0f1 BKE_library_make_local(): some minor improvements.
Do not set 'real user' to groups every time we run the first clearing loop.

And do fully clear properly LIB_TAG_DOIT (this is not yet enforced in
existing code, but would love to get to that stage in future, so let's
do it at least with new code!).
2016-11-11 23:17:52 +01:00
2dbcb75ed5 Minor naming cleanup. 2016-11-11 23:17:52 +01:00
f6ab97c1ae Enhance BKE_library_make_local() to make it much quicker in complex cases.
Basic idea is to split first loop in two, and run checks before making
anything actually local, to detect data-blocks that we can directly make
local (because we are sure they are only used by already/future local
datablocks).

This allows to avoid a lot of overhead in later 'cleanup' steps of this
function, here with barbershop shot it's four times quicker (from 190s to 48s).

We are still far from the instantaneous results of MakeLocal in 2.77,
but in that version main characters lose their connection to their
armature and remain static after makelocal, so guess new code is still
better. ;)

There are probably more optimizations possible here, but would rather
polish this area of code once we get rid of proxies, those really
make it a nightmare to work on.
2016-11-11 23:17:52 +01:00
f1ad2ab85f Minor optimization to BKE_library_tag_unused_linked_data(). 2016-11-11 23:17:52 +01:00
8e4066b9d3 Switch to unsafe but quick freeing of archipelagos of linked data.
This *should* work, but do not hesitate to revert in case it creates new
crashes in append or makelocal processes.
2016-11-11 23:17:52 +01:00
674c3bf894 Fix T49996: VSE opengl render crash with grease pencil if current frame is empty
If the opengl render with grease pencil is run from VSE with the current
frame outside visible frames, the render pass is wrong and the render
must be canceled because nothing to render. Related to #T49975
2016-11-11 22:27:10 +01:00
cdeaec3b0d GPencil: Create brush set when create new datablock or layer
Before this commit, the brush set was created with the first stroke
drawing, but if the user creates the datablock or the layer manually
(not drawing) the brush list was empty.

This commit complement the python fix by Sergey:
https://developer.blender.org/rB89c1f9db37cc1becdd437fcfdb1877306cc2b329
2016-11-11 20:04:58 +01:00
ed957768a0 Fix crash happening in some cases with MakeLocal operator.
Culprit here was once more proxies. Think what was happening here was:
1) Both proxy and proxified armatures' PoseChannels were cleared
   (needed after remapping due to Bone pointers being stored in pchans).
2) Proxy PoseChannels got rebuilt in `BKE_pose_rebuild_ex()`, which ends,
   in proxy cases, by actually replacing rebuilt pchans by those from
   the proxified object... which has not yet been rebuilt.

Fixed the issue by merely adding bone pointer to data copied from
original pchan into new 'from proxy' one... Sounds much, much safer and
sanier anyway, that way we can be sure bone pointer is actually pointing
to a bone of the object's armature (this is supposed to be the same
Armature datablock between proxy and proxified objects, but that may not
be always true especially during makelocal process).
2016-11-11 18:11:30 +01:00
7d33d4439f Fix T49994: Setting dupligroup which uses indirect relation will crash
Did similar trick to old dependency graph: tag invisible relations for update.

Might need some re-consideration, see the comment.

This should solve our issues with powerlib addon here in the studio.
2016-11-11 16:16:27 +01:00
2a838c71d9 Depsgraph: Add missing NULL pointer check 2016-11-11 15:28:34 +01:00
24d89a1f77 Depsgraph: Fix missing DONE flag in relations builder
Was causing relations be build twice in certain cases.
2016-11-11 15:20:17 +01:00
7dda3cf830 Fix T49993: Indirectly used taper/bevel crashes new dependency graph
New dependency graph expects strict separation between nodes and relations builder,
meaning, if we try to create relation with an object which is not in the graph yet
we'll have an error in depsgraph.

Now, so far object nodes were created from bases of the current scene, which caused
missing objects in graph in certain cases.

Didn't find better approach than to simply ensure object nodes exists when we know
they'll be used by relation builder.
2016-11-11 14:52:05 +01:00
b1743cda5a Depsgraph: Fix typo in text on curve relation builder 2016-11-11 14:41:02 +01:00
653541ea78 Depsgraph: Fix missing ID node tag
Might have caused nodes created multiple times for the same object.
2016-11-11 14:26:11 +01:00
915c74a33b Depsgraph: Add some data builder logic to corresponding function 2016-11-11 14:24:47 +01:00
89c1f9db37 Grease Pencil: Fix python errors opening N panel -> GP with empty VSE
Solves errors, but not sure interface is indeed what users will expect.

Will ask GP team to check on this.
2016-11-11 14:04:04 +01:00
9eeca9e7cd Depsgraph: cleanup, no functional changes 2016-11-11 13:54:02 +01:00
48971da4c8 Depsgraph: Fix wrong relation names 2016-11-11 11:42:43 +01:00
4710fa700c Depsgraph: Fix wrong relations in array modifier 2016-11-11 11:41:33 +01:00
a1aa3a8b75 Cycles: Add comments to endif directives
`kernel_path.h` and `kernel_path_branched.h` have a lot of conditional code and
it was kind of hard to tell what code belonged to which directive. Should be
easier to read now.
2016-11-10 19:50:23 -05:00
80aae2b6fe Consider Numpad Enter in pose slide operators
It was annoying to only have regular Enter confirming input there.
2016-11-10 17:19:23 +01:00
e316636fa8 Fix BKE_library_make_local() trying to also make local proxified objects.
Proxified objects can never be local, we can totally ignore them here.

This 'fixes' the asserts related to usercount when trying to remap poselib
of localized proxified objects (not sure what exactly was going on wrong here,
but proxies are a giant can of worms for sane data-blocks handling anyway :/).
2016-11-10 17:09:16 +01:00
f0d53ac109 Depsgraph: Fix another issue which seems to be a bug
Similar to a previous commit.

Doing separately for an easy of bisect.
2016-11-10 15:49:33 +01:00
aef66a6be0 Depsgraph: Fix wrong relation from IK solver to pole target
Copy paste error...

How to avoid those?
2016-11-10 15:46:22 +01:00
Dalai Felinto
0b9b8ab2dd Fix Grease Pencil render in VSE crashes when no strips (#T49975)
Solution as suggested by Sergey Sharybin. Initial debugging by
Antonio Vazquez.
2016-11-10 12:24:54 +01:00
Martijn Berger
63b38848a2 buidlbot, msbuild is slightly different in that is wants to build debug anyway even if we told cmake we want release 2016-11-10 11:00:04 +01:00
Martijn Berger
1977440770 buidlbot, msbuild is slightly different in that is wants to build debug anyway even if we told cmake we want release 2016-11-10 10:55:49 +01:00
2138fdb785 Added bpy.types.ID.make_local() that can make a single ID block local.
This new `bpy.types.ID.make_local(clear_proxies=True)` allows Python
code to press the "Make Local" button on any ID block. I chose
`clear_proxies=True` as the default, since it's the default behaviour
of `id_make_local()` (defined in `library.c`).

The caller does need to take care of ensuring that linked-in objects
don't refer to local data, and that proxies aren't broken.

Reviewers: sergey, mont29

Reviewed By: mont29

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D2346
2016-11-10 10:49:57 +01:00
Martijn Berger
8b8e04cae6 let cmake handle calling msbuild for windows buildbots 2016-11-10 10:48:54 +01:00
afc8a4f9e2 Fix UI message. 2016-11-09 19:27:43 +01:00
47759b14ab BMesh: face-join, remove redundant face assignment
Keep ifdef'd out for holes, this isn't needed currently.
2016-11-10 03:21:42 +11:00
4d9562a3ae Depsgraph: Fix crash deleting bones in armature edit mode
For the new dependency graph we have to rebuild graph when
bones "topology" are changing.
2016-11-09 17:00:31 +01:00
18be39ff17 Fix some assert when making local (due to infamous PITA ShapeKey ID). 2016-11-09 16:42:28 +01:00
e72caa513a BMesh: Cleanup, remove hole ifdef 2016-11-10 01:08:12 +11:00
49a3eaa3dc BMesh: face-flip, no need for temporary edge-array
Reverse loops in-place.
2016-11-10 00:08:26 +11:00
e9689e1a20 Fix: setting an audio callback before audio device initialization. 2016-11-09 00:06:49 +01:00
4d0f7c320c Depsgraph: Use atomics to tag ID when evaluating driver
This is required since new dependency graph evaluates drivers in threads
so it was possible to have some partially written ID tag there.
2016-11-08 17:54:14 +01:00
682bcb2995 Atomics: Add 32 bit version of fetch and AND/OR 2016-11-08 17:12:04 +01:00
4f28dac872 BMesh: remove edge search when flipping faces
Replace search with direct lookup.
2016-11-09 00:18:32 +11:00
0085001eb0 Fix memory leak when Blender is build without Bullet and files with RB is opened 2016-11-08 11:54:04 +01:00
a2d78d7a46 Fix T49838: Noise randomization for frame should be done per interframes as well
Add subframe to the animated seed hash calculation.

Should be no difference for the regular files, only for cases when scene is
rendered from sequencer with a speed effect, which is not really a common thing.
2016-11-08 11:16:37 +01:00
93ace71bd7 Cycles: Only use new light sample threshold for new files
This is a late follow-up commit to the light sample threshold changes which
caused difference in rendering all existing .blend files which is not something
we are happy about: it is fine to use new optimized defaults for new files, but
existing ones should always be rendering in the same way as they used to be.

Sorry for the inconveniece, but such thing should have been done to begin with.
If this setting was modified it will not be reset to zero.

Now all render tests should be passing again.

P.S. Also really annoying to bump subversion for such reasons, but currently we
don't have better way to achieve what we want.
2016-11-08 10:58:09 +01:00
508e2f0d69 Fix T49937: Blender is crashing because of Lamp Data Node
Lamp Data node requires shadow sample array which is only enabled when
Shadows are enabled in the shading settings.

This commit prevents crash but might not give expected render results
in such a configuration.
2016-11-08 10:40:21 +01:00
f19f9be1b9 BMesh: remove redundant edge-split loop initialize
Would always set both first1 and first2.
2016-11-08 07:13:20 +11:00
9912792564 Forgot this in last commit. (Brick GLSL). 2016-11-07 20:59:09 +01:00
28639a22bc Fix Brick Texture GLSL, broken after Mortar Smooth addition. 2016-11-07 20:55:36 +01:00
535914aa46 BMesh: remove redundant array size
Correct unhelpful comment & some comment edits.

Rename 'disk_is_flagged' -> 'bm_vert_is_manifold_flagged',
since the check is quite specific.
2016-11-08 06:54:20 +11:00
7a98c43f9d BMesh: minor improvement to edge-split assignment 2016-11-08 06:49:22 +11:00
e74e622776 Fix compilation error when CUDA toolkit is not installed
After CUDA dynload changes having CUDA toolkit became required
in order to compile Cycles. This only happened due to wrong
default value to the option.
2016-11-07 14:47:10 +01:00
6f3f27c0cc Buildbot: Update copy of buildbot master configuration 2016-11-07 14:29:11 +01:00
c9efcc5e4a Cycles: Remove device settings from performance tab
This was included in the commit by accident, it doesn't belong there.
2016-11-07 13:22:53 +01:00
1d01a1a269 Depsgraph: Disable timing profile 2016-11-07 12:50:45 +01:00
Martijn Berger
f51f215bc3 fix building depsgraph after recent changes 2016-11-07 12:32:00 +01:00
37947ed552 Depsgraph: Do not rely on indirectly included cstring
Also add comment why exactly cstring is needed.
2016-11-07 12:09:42 +01:00
9b5a32cbfb Proxy: Construct pchan hash when syncing armature proxy
This makes bone lookup much faster (by avoiding liner string lookup)
and speeds up depsgraph construction time on file open.
2016-11-07 11:04:49 +01:00
21350b73df Despgraph: Optimize cycles detection algorithm
The idea is simple: when falling back to one of the nodes which was partially
handled we "resume" checking outgoing relations from the index which we stopped.

This gives about 15-20% depsgraph construction time save.
2016-11-07 11:04:49 +01:00
4c30a9ee42 Depsgraph: Speedup initial rig build time
We don't need to sort bone channels, it's all taken care about
by the depsgraph itself.

Gives up to 30% initial rig construction time speedup.
2016-11-07 11:04:49 +01:00
65a1fd975c Depsgraph: Move key implementation from header to dedicated file 2016-11-07 11:04:49 +01:00
109be7ed39 Depsgraph: Move class implementation from header to implementation files
This is more proper way to go:

- Avoids re-compilation of all dependent files when implementation changes
  without changed API,

- Linker should have much simpler time now de-duplicating and getting rid
  of redundant implementations.
2016-11-07 11:04:49 +01:00
287197c4e3 Depsgraph: Fully switch from string to const char*
This brings up to 10-20% depsgraph build time improvement in the layout
files from the studio repository.
2016-11-07 11:04:49 +01:00
c9eca0c6c9 Depsgraph: Add extra name tag for operation nodes
The idea here is to address issue that name on it's own is not
always unique: for example, when adding driver operations the
name used for nodes is the RNA path (and multiple drivers can
write to different array indices of the path). Basically, now
it's possible to pass extra integer value to distinguish
operations in such cases.

So now we've already switched from sprintf() to construct unique
operation name to pass RNA path and array index.

There should be no functional changes yet, but this work is
required for further work about replacing string with const
char*.
2016-11-07 11:04:49 +01:00
d872aeaf51 Depsgraph: Cleanup, operation has name, not description
Hopefully should make things more clear here.
2016-11-07 11:04:49 +01:00
9331930345 Depsgraph: Remove unused function
A residue from times where we thought to do partial graph updates,
which we are not committing any time soon.
2016-11-07 11:04:49 +01:00
f8d9a56aa1 Depsgraph: Use const char for component API 2016-11-07 11:04:49 +01:00
4ef45ba775 Depsgraph: Remove some includes which seems unused 2016-11-07 11:04:49 +01:00
bbd4b96fe9 Depsgraph: Use const char instead of string in part of drivers construction 2016-11-07 11:04:49 +01:00
a7f53bc512 Depsgraph: Switch away form string to const char* for node names
There is no real reason to have nodes storing heap-allocated name
and description. Doing this increases amount of allocations during
dependency graph building, which usually means somewhat slowness.

We're temporarily loosing some eyecandy in the graphviz visualizer,
but those we can bring back as a part of graphiz dump (which happens
much less often than depsgraph build).

This will happen in multiple commits for the ease of bisect in the
future just in case this causes any regression. This commit contains
ID creation API changes.
2016-11-07 11:04:49 +01:00
f64548daa6 Depsgraph: Remove prototype of unused and non-implemented method 2016-11-07 11:04:49 +01:00
c8c7414c3f Expose Bullet rotational spring settings in the UI.
Bullet spring constraint already supports rotational springs, but
they are not exposed in blender UI, likely due to a simple oversight.
Supporting them is as simple as adding a few DNA/RNA properties
with appropriate UI and passing them on to Bullet.

Reviewers: sergof

Reviewed By: sergof

Differential Revision: https://developer.blender.org/D2331
2016-11-07 12:59:12 +03:00
dd921238d9 Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).

From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.

Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: brecht, juicyfruit, mib2berlin, Blendify

Differential Revision: https://developer.blender.org/D2338
2016-11-07 03:19:29 +01:00
f89fbf580e Cycles: Fix T49952: Bad MIS sampling of backgrounds with single bright pixels
With this fix, using a MIS map resolution equal to the image size for closest imterpolation or twice the size for linear interpolation gets rid of all fireflies.
Previously, a much higher resolution was needed to get acceptable noise levels.
2016-11-06 20:34:50 +01:00
818af9c331 MSVC Runtime copy : Remove erroneously left in diagnostic message from CMakeLists.txt 2016-11-05 14:04:23 -06:00
2b1d3318f4 [msvc2015] Add support for copying the vc runtime.
There's more dll's hanging out in the ucrt folder, but  I just grabbed the ones blender requested (not sure if that's a wise idea, but it seems to work)

Reviewers: sergey, juicyfruit

Reviewed By: juicyfruit

Differential Revision: https://developer.blender.org/D2335
2016-11-05 13:58:50 -06:00
Martijn Berger
521b981575 change default for quicktime suport for macOS to off 2016-11-05 14:23:00 +01:00
Martijn Berger
c02cce7b75 cycles, cuDeviceComputeCapability is deprecated as of cuda 5.0 2016-11-04 14:49:54 +01:00
f0ac661aa8 Fix T49905: Segfault when copying object data of linked object.
We have to clear `newid` of all datablocks, not only object ones.

Note that this whole stuff is still using some kind of older, primitive
'ID remapping', would like to see whether we can replace it with new,
more generic one, but that's for another day.
2016-11-04 09:55:46 +01:00
17fb504bcf Fix (unreported) asserts in make_object_duplilist_real().
Code would try to add multiple time the same key in `parent_gh` (for this
ghash a lot of dupliobjects may generate same key).

Was making the tool unusable in debug builds.

Also optimise things a bit by avoiding creating parent_gh when only
`use_base_parent` is set.
2016-11-04 08:34:01 +01:00
4e5d251ccb Fix T49918: Make duplicates real crash on clicking operator toggles.
handle_mutex may be NULL here...
2016-11-04 08:11:40 +01:00
4a68ff150f Fix T49903: Blender crashes -> Append Group incl. Object using boolean modifier
New code dealing with getting rid of lib-only cycles of data-blocks
could add several time the same datablock to the list of candidates. Now
this is avoided, and pointers are further cleaned up as double-safety
measure.
2016-11-03 21:10:10 +01:00
e27d9facdf install_deps cleanup: some Debian stuff was still present in the 'generic compile-only' part of the script. 2016-11-03 20:08:04 +01:00
dd6fa94dcc Add 'Set From Faces' tool to custom split normals.
Feature request during bconf, makes sense to have it even as an hack for
now, since this is probably one of the most common use cases. This should
be redone in bmesh once we have proper custom noramls handling in edit mode...
2016-11-03 13:26:18 +01:00
b6980ade90 Depsgraph: Add code for timing despgraph builder 2016-11-03 13:25:07 +01:00
27c559f059 Cycles: Fix missing underscore in geom_object.h 2016-11-03 12:38:00 +01:00
647255db93 Fix T49826: NEW-DEPSGRAPH - Texture is not updated after changing its space color
The issue was caused by image ID nodes not being in the depsgraph.

Now, tricky part: we only add nodes but do not add relations yet. Reasoning:

- It's currently important to only call editor's ID update callback to solve
  the issue, without need to flush changes somewhere deeper.

- Adding relations might cause some unwanted updates, so will leave that for
  a later investigation.
2016-11-03 11:31:49 +01:00
fc1b35e44c Depsgraph: Fix wrong comparison of ID type vs. node type 2016-11-03 11:19:42 +01:00
534f11f71e Fix T49857: Blender crashes after adding texture node to compositing tree 2016-11-03 10:25:31 +01:00
f800794b97 Cycles: Fix OpenCL build error caused by light termination commit 2016-11-03 03:15:39 +01:00
9847ad977a Cycles: Fix T49901: OpenCL build error after recent light texture coordinate commit
Basically, the problem here was that the transform that's used to bring texture coordinates
to world space is either fetched while setting up the shader (with Object Motion is enabled) or
fetched when needed (otherwise). That helps to save ShaderData memory on OpenCL when Object Motion isn't needed.

Now, if OM is enabled, the Lamp transform can just be stored inside the ShaderData as well. The original commit just assumed it is.
However, when it's not (on OpenCL by default, for example), there is no easy way to fetch it when needed, since the ShaderData doesn't
store the Lamp index.

So, for now the lamps just don't support local texture coordinates anymore when Object Motion is disabled.
To fix and support this properly, one of the following could be done:
- Just always pre-fetch the transform. Downside: Memory Usage increases when not using OM on OpenCL
- Add a variable to ShaderData that stores the Lamp ID to allow fetching it when needed
- Store the Lamp ID inside prim or object. Problem: Cycles currently checks these for whether an object was hit - these checks would need to be changed.
- Enable OM whenever a Texture Coordinate's Normal output is used. Downside: Might not actually be needed.
2016-11-03 03:08:14 +01:00
643c5a24d5 Depsgraph: Fix race condition writing drivers to array property
Animation system has separate fcurves for each of array elements and
dependency graph creates separate nodes for each of fcurve, This is
needed to keep granularity of updates, but causes issues because
animation system will actually write the whole array to property when
modifying single value (this is a limitation of RNA API).

Worked around by adding operation relation between array drivers
so we never write same array form multiple threads.
2016-11-02 18:08:33 +01:00
c5510df268 tests: Update hash for OBJ
Was a recent update of UV precision.
2016-11-02 15:35:18 +01:00
c9ffb6fc91 Libmv: Update tests to make tests pass after recent Ceres update
Just a precision issue, difference is around 1e-7. Should be fine to
simply update expected value.
2016-11-02 15:32:11 +01:00
15f2a51232 Solve threading conflict when calculating smooth normals
It was possible to have synchronization issues whe naccumulating smooth
normal to a vertex, causing shading artifacts during playback.

Bug found by Dalai, thanks!
2016-11-02 15:10:40 +01:00
dac5438562 COLLADA: Removed obsolete Export select option 'Both' which created invalid data (duplicate transformation information for nodes) 2016-11-02 14:11:46 +01:00
630c0559f9 Depsgraph: Fix some errors printed to the console
They were not real issues, it's just some areas of code tried to create
relations between non-existing nodes without checking whether such
relations are really needed.

Now it should be easier to see real bugs printed.

Hopefully should be no regressions here.
2016-11-02 12:23:00 +01:00
Martijn Berger
4fdf68271c Cycles standalone, compile fix UINT_MAX is not defined in device_cuda.cpp 2016-11-02 10:56:16 +01:00
83ebf501cd CMake: Make ld.gold linker optional
Some platforms are having hard time using this linker so added an option
to not use it. The options is an advanced one and enabled by default so
should not cause any changes for current users.
2016-11-02 10:42:15 +01:00
97a8cd6883 CMake: Fix use of some option which was never defined
This way it seems more logical to me.
2016-11-02 10:32:46 +01:00
f94a460397 [msvc/make.bat] Detect spaces in the build path and error out. 2016-11-01 15:30:12 -06:00
Dalai Felinto
13ee9b8ebe Change frame for animations should not bein the UNDO stack
Request from Hjalti Hjalmarsson for the animation work.

Basically a common part of the workflow of animation is to change the pose, scrub back and forth a few times and roll back the changes when unsatisfied.
However if you go back and forth too many times the UNDO stack would be full, and it would not be possible to bring back the previous pose.

I'm leaving clip_editor change frames as it is for now. But we can
probably change the behaviour there as well.
2016-11-01 22:11:16 +01:00
4e95a9069e Add 'copy array' for rna buttons
ctrl-alt-c/v allows to copy/paste whole RNA array, e.g. location, rotation, etc., from UI buttons.

Request from Andy at the studio.
2016-11-01 14:59:12 +01:00
1ee43c5aef Fix T49856: Blender 2.78 crashes after loading data from a blendfile
Issue here was that py API code was keeping references (pointers) to the
liniked data-blocks, which can actually be duplicated and then deleted
during the 'make local' process...

Would have like to find a better way than passing optional GHash to get
the oldid->newid mapping, but could not think of a better idea.
2016-11-01 13:39:31 +01:00
bf1e9bc613 Ceres: Update to the latest actual version
Brings all the fixes and improvements done in upstream within the last 13 months.
2016-11-01 11:29:33 +01:00
cf8f6d1dbc Added 'delete unlocked vertex groups' option. 2016-10-31 15:31:47 +01:00
aad46dd175 BMesh: radial loop (internal API symmetry)
Radial append/remove had swapped args and *slightly* different behavior.
- bmesh_radial_append(edge, loop)
- bmesh_radial_loop_remove(loop, edge)

Match logic for append/remove,
Logic for the one case where the edge needs to be left untouched
has been moved to: `bmesh_radial_loop_unlink`.
2016-10-31 23:05:20 +11:00
6488ce7f33 BMesh: simplify vert & edge removal 2016-10-31 22:07:23 +11:00
60682c37dd BMesh: remove redundant walker member & assignment 2016-10-31 17:24:15 +11:00
04aa454075 Cycles: Deduplicate AO calculation
No functional changes.
2016-10-31 00:40:59 +01:00
Julian Eisel
2257e6899a UI: Don't show empty panel right-click menu 2016-10-31 00:08:13 +01:00
2e9dd1200f Cycles: Fix OpenCL compilation with the new brick texture 2016-10-30 16:25:35 +01:00
5050572e89 Cycles: Style Fix: Light sampling threshold description 2016-10-30 13:51:49 +01:00
b6d35e1fa7 Viewport smoke: add support to render the volume using a color ramp.
This is yet another debug option that allows to render an arbitrary
simulation field by using a color ramp to inspect its voxel values.
Note that when using this, fire rendering is turned off.

Reviewers: plasmasolutions, gottfried

Differential Revision: https://developer.blender.org/D1733
2016-10-30 12:29:05 +01:00
4e68f48227 Cycles: Initialize the RNG state from the kernel instead of the host
This allows to save a memory copy, which will be particularly useful for network rendering.

Reviewers: sergey, brecht, dingto, juicyfruit, maiself

Differential Revision: https://developer.blender.org/D2323
2016-10-30 11:51:20 +01:00
26bf230920 Cycles: Add optional probabilistic termination of light samples based on their expected contribution
In scenes with many lights, some of them might have a very small contribution to some pixels, but the shadow rays are traced anyways.
To avoid that, this patch adds probabilistic termination to light samples - if the contribution before checking for shadowing is below a user-defined threshold, the sample will be discarded with probability (1 - (contribution / threshold)) and otherwise kept, but weighted more to remain unbiased.
This is the same approach that's also used in path termination based on length.

Note that the rendering remains unbiased with this option, it just adds a bit of noise - but if the setting is used moderately, the speedup gained easily outweighs the additional noise.

Reviewers: #cycles

Subscribers: sergey, brecht

Differential Revision: https://developer.blender.org/D2217
2016-10-30 11:31:28 +01:00
ce785868a5 Fix compile errors for when WITH_ALEMBIC is OFF. 2016-10-30 03:42:46 +01:00
b2974d7ab7 Cycles: Add smoothing option to the Brick Texture
This option allows to create a smoother transition between Bricks and Mortar - 0 applies no smoothing, and 1 smooths across the whole mortar width.
Mainly useful for displacement textures.

The new default value for the smoothing option is 0.1 to give some smoothing that helps with antialiasing, but existing nodes are loaded with smoothing 0 to preserve compatibility.

Reviewers: sergey, dingto, juicyfruit, brecht

Reviewed By: brecht

Subscribers: Blendify, nutel

Differential Revision: https://developer.blender.org/D2230
2016-10-30 02:16:22 +02:00
5aa6a2ec06 Fix T49846: OpenCL rendering compilation failure 2016-10-29 20:06:52 +02:00
1272ee455e Cycles: Implement texture coordinates for Point, Spot and Area Lamps
When using the Normal output of the Texture Coordinate node on Point and Spot lamps, the coordinates now depend on the rotation of the lamp.
On Area lamps, the Parametric output of the Geometry node now returns UV coordinates on the area lamp.

Credit for the Area lamp part goes to Stefan Werner (from D1995).
2016-10-29 19:24:08 +02:00
d3b0977a35 Fix T49878: Alembic crash with long object name
Crash comes from writing to char array (ID::name) out its bound and thus
overriding memory in the ID struct.
2016-10-29 16:22:33 +02:00
753edafcb7 Alembic: store a pointer to the object reader in the cache modifiers and
constraints.

This avoids traversing the archive everytime object data is needed and
gives an overall consistent ~2x speedup here with files containing
between 136 and 500 Alembic objects. Also this somewhat nicely de-
duplicates code between data creation (upon import) and data streaming
(modifiers and constraints).

The only worying part is what happens when a CacheFile is deleted and/or
has its path changed. For now, we traverse the whole scene and for each
object using the CacheFile we free the pointer and NULL-ify it (see
BKE_cachefile_clean), but at some point this should be re-considered and
make use of the dependency graph.
2016-10-29 12:23:09 +02:00
0c13792437 Alembic export: fix frame range values being reset at every update, draw
call.
2016-10-29 11:04:51 +02:00
8a1b38f071 Cleanup: avoid using G.main. 2016-10-28 18:26:34 +02:00
216dec7eb1 Alembic Export: set start and end frame to that of the scene for
convenience.

Users will most likely export an entire animation rather than a single
frame, so it can save a few clicks.
2016-10-28 18:21:43 +02:00
65c481e145 CacheFile: fix missing depsgraph update. 2016-10-28 18:08:31 +02:00
194a33ff00 CacheFile: only enable scale property slider if we are editing the cache
through a constraint.

It doesn't make sense and is a bit confusing to have this property
enabled in the modifier context.
2016-10-28 18:08:30 +02:00
Nathan Letwory
03b8531cea Compile fix for Windows.
__inline instead of inline is needed.
2016-10-28 11:54:01 +03:00
216a3a3826 Fix T49743: Adding torus in edit mode local mode shows error
The 'local' layers were not correctly set when redoing 'add object'
addons using object_utils.py helper (we always want to restore layers
from view in local view, even if we set 'real' layers from operator
afterwards).
2016-10-27 13:23:29 +02:00
5f0933f07a Fix T49829: Removal of custom icon previews during add-on unregister crashes Blender.
Issue was happening when removal of custom icons was done while they
were still being rendered by preview job.

Now add a 'deffered deletion' system, to prevent main thread to delete
preview image until loading thread is done with them.

Note that ideally, calling `ED_preview_kill_jobs()` on custom icon
removal would have been simpler, but we don't have easy access to
context here...
2016-10-27 13:06:14 +02:00
f11298692b Cycles: More workarounds for weird crashes on AVX2
Oh man, is it a compiler bug? Is it something we do stupid?

For now more crap to prevent crashes. During the conference will talk to
Maxyn about how can we troubleshoot such weird issues.
2016-10-27 12:51:03 +02:00
7e380ad4c0 Cycles: Another attempt to fix crashes on AVX2 processors
Basically don't use rcp() in areas which seems to be critical after
second look. Also disabled some multiplication operators, not sure
yet why they might be a problem.

Tomorrow will be setting up a full test with all cases which were
buggy in our farm to see if this fix is complete.
2016-10-26 22:14:41 +02:00
de22e55291 Cycles: Fix compilation error of AVX2 kernel without SSE math 2016-10-26 20:49:33 +02:00
35f152358b Cycles: Completely disable transform SSE for now
Was causing issues on another frame.

On a tight schedule, disabling for now so artists are happy.

Still looking into root of the issue!
2016-10-26 15:23:58 +02:00
7c7d23691f Cycles: Fix crashes after recent optimization commits
There is some precision issues for big magnitude coordinates which started
to give weird behavior of release builds. Some weird memory usage in BVH
which is tricky to nail down because only happens in release builds and GDB
reports all variables as optimized out when trying to use RelWithDebInfo.

There are two things in this commit:

- Attempt to make vectorized code closer to original one, hoping that it'll
  eliminate precision issue.
  This seems to work for transform_point().
- Similar trick did not work for transform_direction() even tho absolute
  error here is much smaller. For now disabled that function, need a more
  careful look here.
2016-10-26 14:30:25 +02:00
72921a1e43 RangeTree API rewrite
Rewrite the current range-tree API used by dyn-topo undo
to avoid inefficiencies from stdc++'s set use.

- every call to `take_any` (called for all verts & faces)
  removed and added to the set.
- further range adjustment also took 2x btree edits.

This patch inlines a btree which is modified in-place,
so common resizing operations don't need to perform a remove & insert.
Ranges are stored in a list so `take_any` can access the first item
without a btree lookup.

Since range-tree isn't a bottleneck in sculpting, this only gives minor speedups.
Measured approx ~15% overall faster calculation for sculpting,
although this number time doesn't include GPU updates and depends on how
much edits fragment the range-tree.
2016-10-26 23:33:41 +11:00
44522a5b98 BLI_bitmap_draw_2d: optimize polygon filling
Existing method was fine for basic polygons but didn't scale well
because its was checking all coordinates for every y-pixel.

Heres an optimized version.
Basic logic remains the same this just maintains an ordered list of intersections,
tracking in-out points, to avoid re-computing every row,
this means sorting is only done once when out of order segments are found,
the segments only need to be re-ordered if they cross each other.

Speedup isn't linear, test with full-screen complex lasso gave 11x speedup.
2016-10-26 23:24:58 +11:00
8125271ddb Cleanup: rename functions in BLI_bitmap_draw_2d 2016-10-26 23:24:19 +11:00
3e36cbb3de Cleanup: move bitmap drawing into its own module
Bitmap drawing is out-of-scope for a general math API,
move to BLI_bitmap_draw_2d.
2016-10-26 20:11:09 +11:00
a1f137767f BMesh: edge-net split, edge selection error
In practice I couldn't make this cause a bug,
however it's a logical regression in fix for T48716.

Thanks to Francesc Juhe for finding.
2016-10-26 14:18:44 +11:00
bc71c2bf08 [msvc] make.bat - create a build.log in the build directory 2016-10-25 11:49:08 -06:00
f523fb43f9 Cycles: Fix for fix (tm)
Sorry guys, for some reason read the expression back-to-front
and did wrong fix :S
2016-10-25 18:29:13 +02:00
5c4113a3e4 Cycles: Fix typo in previous commit for BVH improvements 2016-10-25 18:06:38 +02:00
a39ab9cfde Fix T49815: Blender always reverts to RGBA when using Save As Image.
`BKE_imformat_defaults()` was doing some weird black magic based on
imbuf's channels, instead of merely copying imbuf's planes here...
2016-10-25 17:59:45 +02:00
cf9a6b416c API: Fix Links
Self-explanatory. to find broken links run `sphinx-build -b linkcheck sphinx-in sphinx-out`

Reviewers: mont29

Tags: #bf_blender, #python, #infrastructure:_websites

Differential Revision: https://developer.blender.org/D2297
2016-10-25 17:34:01 +02:00
42a91f7ad8 Partial fix for T49836: Camera DOF properties not updating via graph editor
Do this for the new dependency graph: was missing handle of OB_UPDATE_TIME in tag update.

Hopefully it's all correct still.

Old dependency graph needs work, but i'm tempting to call it unsupported and move on
to 2.8 branch.
2016-10-25 16:53:13 +02:00
c54381488b Cycles: Enable SSE math optimization for AVX kernels
This gives about 5% speedup for AVX processors.

Benefit of such optimization on other microarchitectures is still
under investigation.
2016-10-25 16:10:47 +02:00
8c761ff838 Cycles: Use new SSE version of offset calculation for all QBVH flavors
Gives up to ~1% speedup again.

While it seems to be small, still nice since the code now is actually more
clean that it used to be before.
2016-10-25 15:27:50 +02:00
f7cf2f659a Cycles: Move QBVH near/far offset calculation to an utility function
Just preparing for new optimization to be used in all traversal implementation.

Should be no measurable difference.
2016-10-25 15:08:33 +02:00
064caae7b2 Cycles: BVH-related SSE optimization
Several ideas here:

- Optimize calculation of near_{x,y,z} in a way that does not require
  3 if() statements per update, which avoids negative effect of wrong
  branch prediction.

- Optimization of direction clamping for BVH.

- Optimization of point/direction transform.

Brings ~1.5% speedup again depending on a scene (unfortunately, this
speedup can't be sum across all previous commits because speedup of
each of the changes varies from scene to scene, but it still seems to
be nice solid speedup of few percent on Linux and bigger speedup was
reported on Windows).

Once again ,thanks Maxym for inspiration!

Still TODO: We have multiple places where we need to calculate near
x,y,z indices in BVH, for now it's only done for main BVH traversal.
Will try to move this calculation to an utility function and see if
that can be easily re-used across all the BVH flavors.
2016-10-25 14:47:34 +02:00
81c9e0d295 Cycles: Avoid branching in SSE version of intersection pre-calculation
Similar to the previous commit, avoid negative effect of bad branch prediction.

Gives measurable performance up to ~2% in tests here.

Once again, thanks to Maxym Dmytrychenko!
2016-10-25 14:18:32 +02:00
af411d918e Cycles: Implement SSE-optimized path of util_max_axis()
The idea here is to avoid if statements which could cause wrong
branch prediction.

Gives a bit of measurable speedup up to ~1%. Still nice :)

Inspired by Maxym Dmytrychenko, thanks!
2016-10-25 13:54:17 +02:00
3e71006448 CMake: Followup to previous commit, try to ensure -ldl is always last
Seems CMake will rearrange and copy libraries which are passed to the linker
when some of the libraries is listed twice (for example, -lz from png libraries
and -l for blender itself). This was causing libopenimageio to be added somewhere
at the end of linking flags without -ldl followed after which was causing linking
issues.
2016-10-25 10:22:03 +02:00
d2fe875f8c Fix possible compilation error with OIIO enabled
OIIO library has plugin API which uses dlopen()/dlclose() so need to
link OIO libraries against dl library.
2016-10-25 09:28:25 +02:00
10a25b655a Cycles: Add AVX2 path to subsurface triangle intersection
Similar to regular triangle intersection case. Gives about 3% speedup rendering
SSS object on my desktop,

Question: how to avoid such a code duplication in a nice way without speed loss?
2016-10-24 16:56:41 +02:00
da8f5d6eac Cycles: Don't use guarded vector for statically initialized data
This will confuse hell of a guarded allocators because it is possible
to have allocation happened prior to Blender's guarded allocator is
fully initialized.

This was causing crashes and assert failures when running blender
with fully guarded memory allocator.
2016-10-24 14:18:22 +02:00
14a55bc059 Cycles: Fix shadowing variable which also causes use of uninitialized variable
Was causing wrong aperture for panorama cameras.

Seems to be a regression in 371d357.
2016-10-24 14:04:31 +02:00
cde18cf3b3 Cycles: Fix static initialization order fiasco
Initialization order of global stats and node types was not strictly
defined and it was possible to have node types initialized first and
stats after that. This will zero out memory which was allocated from
the statistics causing assert failure when de-initializing node types.
2016-10-24 13:47:39 +02:00
963aa7e270 Cycles: Fix uninitialized variable from the previous commit 2016-10-24 12:54:24 +02:00
80a6e5beb5 Cycles: Remove explicit std:: from types where possible
We have our own abstraction level on top of the STL's implementation.
This commit will guarantee our tweaks are used for all cases.
2016-10-24 12:31:11 +02:00
48997d2e40 Cycles: Cleanup, style 2016-10-24 12:26:12 +02:00
3f29259676 Fix T49818: Crash when rendering with motion blur
It was possible to have non-initialized unaligned BVH split
to be used when regular BVH split SAH was inf. Now we ensure
that unaligned splitter is only used when it's really initialized.

It's a regression and should be in 2.78a.
2016-10-24 11:47:32 +02:00
1e1811357d Cycles: Cleanup, spaces 2016-10-24 11:47:32 +02:00
0b749d57ee Fix unlikely uninitialized pointer usage.
Reported by Coverity.
2016-10-24 10:25:58 +02:00
89a3b17853 Fix T49827L Crash linking material while in Material viewport shading mode
Material linking might and does change the way how drawObject is calculated
but does not tag drawObject for recalculation in any way.

Now use dependency graph to tag draw object for reclaculation. Currently do
this using OB_RECALC_DATA taq since tagging is not very granular yet. In the
future we can introduce ore granular tagging in the new dependency graph
easily.

Simple and safe for 2.78a.
2016-10-24 10:13:22 +02:00
c013280eec Fix mistake in BKE_mesh_new_from_object handling of materials in MetaBall case.
Typo, spoted by Coverity scan.

To be backported to 2.78a.
2016-10-24 10:06:00 +02:00
1d13950ae5 API doc: enable 'split index' option. 2016-10-23 17:48:31 +02:00
Quentin Wenger
e0a34e963f Displace modifier: add global/local space option for X/Y/Z/XYZ directions.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2309
2016-10-23 14:35:46 +02:00
35fde5ff7d System info: make it more resiliant to errors.
Using context manager for output file itself, and whole try/except block
to at least catch and print error in file.

Also some minor tweaks to previous 'list add-ons' commit.
2016-10-23 13:12:58 +02:00
5d2620e9c2 System info: also report enabled add-ons.
Based on idea & patch by @lijenstina over IRC (iirc :/ ).
2016-10-23 13:05:47 +02:00
672e906d49 Add a built-in sphinx extension to allow cross-linking to the blender manual.
This works by downloading the objects.inv file (https://www.blender.org/manual/objects.inv)
and using it to resolve links with blender-manual: before them.
2016-10-23 11:15:52 +02:00
Hristo Gueorguiev
8905c5c874 Cycles: OpenCL 3d textures support.
Note that volume rendering is not supported yet, this is a step towards that.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2299
2016-10-22 23:49:29 +02:00
371d3570e0 Fix Cycles address space OpenCL error after recent fix. 2016-10-22 23:36:30 +02:00
5765deecd4 GPencil: New option to lock strokes to axis
Now, the strokes can be locked to a plane set in the cursor location.
This option allow the artist to rotate the view and draw keeping the
strokes flat over the surface. This option is similar to surface option
but doesn't need a object.

The option is only valid for 3D view and strokes in CURSOR mode.
2016-10-22 16:44:39 +02:00
9d0ac94d52 Fix T49750: Cycles wrong ray differentials for perspective and stereo cameras. 2016-10-22 16:37:26 +02:00
b5d527ff6c Fix T49656: Crash when starting playback while using JACK audio with A/V sync
When ED_screen_animation_play is called from wm_event_do_handlers,ScrArea *sa = CTX_wm_area(C); is NULL in ED_screen_animation_timer.
Informing the audio system in CTX_data_main_set, that a new Main has been set.
2016-10-22 15:00:32 +02:00
132478d4b8 Fix T49657: Audio backend "Jack" should be named "JACK". 2016-10-22 14:20:47 +02:00
d5ee031f76 Fix T49764: Audio strips crackle when animating the volume
- Implemented linear interpolation for volume changes in the software
mixer.
- Using this in the software device.
2016-10-22 13:39:55 +02:00
fd4caafc53 Fix T49789: Compositor mix node interpolation bug 2016-10-21 17:58:37 +02:00
b51874437d Fix T49804: Display grid Scale/Subdivision are sometimes disabled in View3D when they should not.
Not really possible to precisely detect all cases in which they should or
should not be active, but at least now it won't show as disabled when it
actually has some effects.
2016-10-21 16:06:53 +02:00
f7ce482385 Cycles: Fix another OpenCL logging issue
Previously an error message would be printed whenever the OpenCL build produced output.
However, some frameworks seem to print extra information even if the build succeeded, so now the actual returned error is checked as well.
When --debug-cycles is activated, the build output will always be printed, otherwise it only gets printed if there was an error.
2016-10-21 02:49:00 +02:00
0c4d949eff Alembic: only export custom data (UVs, VCols) once, on the first frame.
This would cause Alembic to throw an exception and fail exporting
animations because it was trying to recreate and overwrite the
attributes for each frame.
2016-10-20 19:43:22 +02:00
32c2cba4ef Fix T49797: Exception from scene update handler might leak external engine descriptors
This was causing memory leaks in Cycles.

Some more detailed information in the comment in the code.

Seems to be safe and nice enough for 2.78a.
2016-10-20 13:33:47 +02:00
christian brinkmann
2cd6a89d07 Python API: add full_path parameter for bpy.ops.ui.copy_data_path_button.
Also use the operator as part of the UI keymap now, to deduplicate code and let
users configure a custom shortcut.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2303
2016-10-20 00:31:08 +02:00
789ea7397f Fix T49793 : Fix enabling SSE2 globally for msvc.
When feeding msvc both /arch:sse2 and /arch:sse it's not smart enough to pick the best option, just goes with the last option
2016-10-19 10:06:45 -06:00
417847c161 Fix T49775: Appending data with internal dependency cycles prevents correct clearing of linked data-blocks.
This is not a simple fix, but imho still needs to be backported to 2.78a...
2016-10-19 14:32:08 +02:00
82f842c27f [msvc] Minor cleanup in blenkernel.
this patch resolves the following warnings;

```
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	764
Warning	C4098	'attach_stabilization_baseline_data': 'void' function returning a value		blenkernel\intern\tracking_stabilize.c	139
Warning	C4028	formal parameter 3 different from declaration		blenkernel\intern\cachefile.c	148
Warning	C4028	formal parameter 3 different from declaration		blenkernel\intern\paint.c	413
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\editderivedmesh.c	591
Warning	C4028	formal parameter 3 different from declaration		blenkernel\intern\library_remap.c	709
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	754
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	758
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	759
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	763
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	764
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	765
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	769
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\ocean.c	770
Warning	C4028	formal parameter 1 different from declaration		blenkernel\intern\DerivedMesh.c	3458
```

It's mostly things where the signature in the .h and the actual implementation in the .c do not match.  And a bunch functions who do not match the TaskRunFunction declaration cause they leave out the __restrict keyword.

Reviewers: brecht, juicyfruit, sergey

Reviewed By: sergey

Subscribers: Blendify

Differential Revision: https://developer.blender.org/D2268
2016-10-18 09:51:33 -06:00
3541f7c47d [windows] Create A Blender Desktop Shortcut in the msi installer , fixes T49522 2016-10-18 09:23:45 -06:00
7500f6c9d9 Fix: Append 'Object proxy' hack checking for local/linked usages before those flags were set!
Dummy mistake, to be backported to 2.78a.
2016-10-18 14:17:10 +02:00
ab4c921e82 Clarified warning in EnumProperty
Blender doesn't necessarily crash when Python doesn't keep references to
the returned strings. As a result, someone that implements this incorrectly
could be lulled into a false sense of correctness by Blender not crashing.
2016-10-18 11:24:33 +02:00
Dalai Felinto
cccd3eb5a8 Fixup for doversion (rB8d573aa0 and rBa7e74791) 2016-10-17 19:45:34 +00:00
5e92a0faad Fix T49722: Appending Bug (Groups).
One day we'll have to reconsider why some many 'real' ID usages are not
refcounting... :(

To be backported to 2.78a.
2016-10-17 15:00:31 +02:00
c2d0832c6e UV Editor: Add filter option to control what is visible when Draw Other Objects is enabled
Previously the editor will always try to only show UV faces with the same exact active
image or image texture, which is quite difficult to control on a production shaders, where
each material can have multiple objects assigned.

The idea of this commit is to bring option which allows to easily control what to display
when "Draw Other Objects" is enabled, so currently we can have old behavior ("Same Image")
or tell editor to show everything ("All"). In the future we can extend it with such filters
as "Same Material" and things like that.

Hopefully this will help @eyecandy's workflow of texturing.
2016-10-17 14:28:16 +02:00
7f19c4fdf9 Fix T49738: Hair Add Brush doesn't work
the issue was caused by wrong default value for brush particle count
which was clamped on display from 0 to 1. This is technically a regression
but how to port this to 2.78a?
2016-10-17 12:38:54 +02:00
cd843409d3 Fix T49630: Cycles: Swapped shader and bake kernels
The problem here was, as the title says, that the two kernels were swapped.
Since shader evaluation is only used for building the samling map when World MIS is enabled, rendering without it would still work fine, although baking also was broken.
2016-10-17 12:28:01 +02:00
d5dd12e56c Cycles: Improve OpenCL kernel compilation logging
The previous refactor changed the code to use a separate logging mechanism to support multithreaded compilation.
However, since that's not supported by any frameworks yes, it just resulted in bad logging behaviour.
So, this commit changes the logging to go diectly to stdout/stderr once again by default.
2016-10-17 11:51:18 +02:00
2a6ec00b9b Fix T49746: crash loading user preferences with missing operators. 2016-10-16 21:24:42 +02:00
Julian Eisel
2a53e0975c More fixes for keyframe theme options
Couple of issues here:
* Missing initialization for 3D view keyframe options for "Reset to Default Theme"
* Alpha values not reset correctly on "Reset to Default Theme"
* Alpha values of timeline keyframe options not reset correctly for old files
Also corrected old version patches even though they're overridden later, to avoid more issues in case people copy this code.

Corrections to d7af7a1e04 and 8d573aa0ec
2016-10-16 21:08:34 +02:00
Chase Willden
ad393e1e75 Fix assert in the wrong place, should be moved earlier to do anything.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2304
2016-10-16 16:02:31 +02:00
Julian Eisel
d59079c5e1 Cleanup: Unused parameters in Outliner
These were only passed to own recursion calls.
2016-10-16 15:19:18 +02:00
Julian Eisel
b659cb8dbc Fix missing outliner redraw when adding VSE strip
Needed for outliner "Sequence" display mode.
2016-10-16 14:39:06 +02:00
Scott Wu
7fec7eee20 Cycles: use near clipping distance in panorama camera.
Reviewed By: sergey, brecht, dfelinto

Differential Revision: https://developer.blender.org/D1952
2016-10-15 00:26:59 +02:00
05c727bb00 Prevent crash after OpenGL rendering animation to images. 2016-10-14 18:46:28 +02:00
8e80d2741d Fix T49571: 2d stabilize keys not visible in the Graph Editor and Dope Sheet 2016-10-14 17:22:57 +02:00
0ddb8d9b13 Cycles: Disable optimization of operator / for float3
This was giving some speedup but made intersection tests to fail
from watertight point of view.

Needs deeper investigation, but need to quickly get it fixed for
the studio.
2016-10-14 13:53:26 +02:00
3055ae5092 Fix T49657: Audio backend "Jack" should be named "JACK". 2016-10-14 13:22:22 +02:00
49c2dbc5db Fix T49601: Material menu length problem.
Regression from rB69b66d549bcc8, was supposed to be non-functionnal
change, so not sure why search menu was reduced here? For now, restore
to 2.77 width.
2016-10-14 10:29:51 +02:00
87a7149831 BPY Docs: Correct spelling (Addon --> Add-on)
Differential Revision: https://developer.blender.org/D2293
2016-10-14 01:25:05 +02:00
dc60fdd671 Fix T49646: Switching from large to small image can get stuck zoom at max zoom distance.
Allow for zooming in at max zoom distance.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D2291
2016-10-14 01:07:18 +02:00
625b504b23 Fix T49534: 2.78 Wrong texture scaling in material viewport
Seems to be a bug in original implementation of a830280: code was always
using tangent space instead of UV map because it had the same name. Now
prefer UVMap over tangent because this is how Cycles works. At least it's
closer to.

Not sure it the save+reload issue is still relevant after this fix, that
needs to be double-checked.

Thanks @dfelinto for looking into the report and simplifying the case.

Should be included into 2.78a.
2016-10-13 18:35:11 +02:00
02a1f15416 Fix OLD pre-git links in the API, add missing factory-startup option to blender executions.
Reviewers: mont29

Reviewed By: mont29

Tags: #bf_blender, #python, #infrastructure:_websites

Differential Revision: https://developer.blender.org/D2290
2016-10-13 17:53:30 +02:00
78817ae95c Prevent problems when appending scene with referenced proxy
Such a "referenced proxy" could be a proxy that is used in a constraint on
another object. Brings back part of 1cdc54dc7d but without the
memory leak.
2016-10-13 17:06:24 +02:00
6027550e83 Usual UI/i18n tweaks & fixes. 2016-10-13 16:20:51 +02:00
6917de6919 Fix: Grease Pencil palettes were missing a RNA path callback 2016-10-14 01:19:30 +13:00
5c651554e2 Proxy appending: re-establish link to proxies when they are made local
This allows appending of an entire scene from another blend file into this one,
even when that blend file contains proxified armatures.

This replaces the approach from commit 1cdc54dc7d.

Thanks @sergey for the help.
2016-10-13 14:10:46 +02:00
918e6cf4c9 Fix T49635: column_flow Layout - last column is too small.
Column flow layout was abuse ui_item_fit in a weird way, which was
broken for last column items.

Now rather use own code, which basically spread available width as
equally as possible between all columns.
2016-10-13 10:23:24 +02:00
786c0966ec Cleanup: UI layout: remove unsed and confusing parameter.
Things are complicated enough like that, no need to add useless noise on
top of it!
2016-10-13 10:23:24 +02:00
Dalai Felinto
8d573aa0ec wrong alpha set for timeline theme (fixup for rBf329ebe3) 2016-10-13 00:28:07 +00:00
2d03edb458 Fix T49631: radial control operators not using DPI properly. 2016-10-12 20:21:39 +02:00
7f5441b916 Fix T49640: Cycles constant folding incorrect for texture coordinates. 2016-10-12 18:42:38 +02:00
21e65d7457 Fix build error with WITH_CYCLES_NATIVE_ONLY and recent AVX2 changes. 2016-10-12 17:35:03 +02:00
5f16382195 Fix T49636: material draw mode crash with displacement and missing group input node. 2016-10-12 16:52:42 +02:00
a54242503e FFmpeg: Fix off by one error in number of detected frames in matroska container
Seems to be rounding error. Hopefully new code handles the error fixed back in
SVN revision 28901 and still have proper frame number for Hjalti.

What could possibly go wrong here..
2016-10-12 16:17:43 +02:00
22cdf44101 Cycles: Use const reference for register variables in non-OpenCL code
This is something tested by @LazyDodo and suggested by Maxym to make
MSVC happier.
2016-10-12 14:48:59 +02:00
e588106d45 Cycles: Use more SSE intrinsics for float3 type
This gives about 5% speedup on AVX2 kernels (other kernels still
have SSE disabled for math operations) and this solves the slowdown
of koro scene mention in the previous commit.

The title says it all actually. This commit also contains
changes to pass float3 as const reference in affected functions.

This should make MSVC happier without breaking OpenCL because it's
only done in areas which are ifdef-ed for non-OpenCL.

Another patch based on inspiration from Maxym Dmytrychenko, thanks!
2016-10-12 14:43:00 +02:00
42aeb608e7 Cycles: Implement AVX2 version of triangle_intersect
This commit basically vectorizes existing code using AVX2 instructions
(without modifying algorithm itself). This gives quite nice speedups:

  BMW:        -8%
  Classroom:  -5%
  Cat:        -5%
  Koro:       +1%
  Barcelona:  -8%

That's on Linux machine, reported performance improvement on Windows
goes up to 20%.

Not currently sure why Koro is somewhat slower because it mainly uses
curve intersection tests, could be a time noise? Or osmething with the
cache utilization perhaps? In any case speedup in other scenes makes
me thinking that current state is acceptable for initial implementation.

This is again inspired by Maxym Dmytrychenko.
2016-10-12 14:11:55 +02:00
6a4ec3ca43 Cycles: Add new avxf vectorized data type
Based on existing ssef data type and to my knowledge it's also what happens in
Embree nowadays.

Inspired by Maxym Dmytrychenko and required for the upcoming triangle
intersection commit.

Hopefully the copyright message is correct.
2016-10-12 13:54:13 +02:00
fa62a989b4 Cycles: Enable SSE options of math module for AVX2 kernels
Currently this does not give measurable difference, but is required
ground work for some upcoming further optimization of AVX2 kernels.
2016-10-12 12:54:31 +02:00
87d08a5dc1 Cycles: Get rid of ifdef-ed noinline policy 2016-10-12 12:15:24 +02:00
cc95172667 Cycles: Fix use of uninitialized variable in SSS
When ray hits curve segment with SSS shader it was possible to have
uninitialized hit_P variable used for sampling.

Seems that was a reason of our headache of difference between AVX2
and SSE4 render results here, so now we can revert all the nasty
ifdef-ed inline policies.
2016-10-12 12:12:28 +02:00
edd9d89673 Cycles: Cleanup, style 2016-10-12 11:54:33 +02:00
acbbcdfbb8 Fix T49622: Grease pencil not rendering out of VSE 2016-10-12 10:01:30 +02:00
dc95c31372 Fix T49502: file browser on OS X not highlighting external drives. 2016-10-12 00:07:52 +02:00
06215c71c0 Fix T49629: Graph editor normalize function doesn't work on f-curves with a constant key value
Technically it is a regression in behavior and should be 2.78a.
2016-10-11 17:08:00 +02:00
17603b9f01 Fix objects added via py being on the wrong layer when viewport is decoupled from scene 2016-10-11 15:35:14 +02:00
5322ff3b48 Make console message more clear for --scene argument 2016-10-11 14:48:15 +02:00
4370f8ffbd Fix T49623: Immediately crash trying to render attached file in Cycles
Original fix in this area was not really complete (but was the safest at
the release time). Now all the crazy configurations of slots going out
of sync should be handled here.
2016-10-11 11:55:11 +02:00
3e460b68d9 install_deps.sh: remove libglewmx from deb for now, the package is broken in deb testing... 2016-10-10 19:29:55 +02:00
611a9b1bda install_deps.sh: first attempt to support cxx11.
For now, we merely add an option that sets CXXFLAGS envvar with
'--std=c++11' option.

There is no check done to ensure compatibility with the system
libraries, mainly because:
  - It is all but trivial to get this information in a generic and
    reliable way.
  - Currently even cutting edge distributions may still distribute some c++98
    libraries.
  - With recent stdlibc++, both ABIs are supported together, which means
    that incompatibilities are rather unlikely.

To summarize: if your system is recent and built with gcc-5.1 or more,
you should not experience too much troubles with c++11.
2016-10-10 19:29:55 +02:00
cf449d377b OpenGL animation: Fix stupid mistake form previous commit
Flagging of pool to cancel was done in the wrong place, making last
frames missing in the final video.
2016-10-10 15:52:10 +02:00
f36543c5f5 Fix viewport camera gets out of sync in certain cases
It was possible to have two viewports opened and start using Ctrl-0
to make different objects an active camera for the viewport. This
worked fine for viewports which had decoupled camera from the scene,
but if viewport was locked to scene camera it was possible to run into
situation when two different viewports are locked to scene camera but
had different v3d->camera pointers.
2016-10-10 15:05:05 +02:00
54dad5c49f OpenGL render: Fix missing file output after pressing Esc
Apparently, the whole G.is_break is not used by OpenGL render, meaning
this flag will not be clear before running the operator. This was
causing missing file output after pressing Esc once for the rest of
Blender session.
2016-10-10 12:51:01 +02:00
109192b360 OpenGL: remove GLSL support query (it's always supported) 2016-10-10 01:28:30 -04:00
ba5e2270f9 remove call to GLSL support query (it's always supported)
Reworked logic in the one place that still called this. Deleted the "GLSL not supported" fallback.

(equivalent to rB78abbdf26451 on blender2.8 branch)
2016-10-10 01:28:02 -04:00
33ef28068a BGE: remove calls to GLSL support query (it's always supported)
Reworked logic in the few places that still called this. Deleted the "GLSL not supported" fallbacks.

Also removed some nearby checks for ARB_multitexture and OpenGL 1.1. Blender 2.77 removed checks like this, but game engine still has some.
2016-10-10 01:19:10 -04:00
9ea71bc674 Cycles: Split device_opencl.cpp into multiple files for easier maintenance
There are no user-visible changes, just some internal restructuring.

Differential Revision: https://developer.blender.org/D2231
2016-10-09 15:49:50 +02:00
1fad269d07 Fix T49609: Point density textures: vertex colors are not properly averaged in BI
Nice to have in 2.78a, though not a regression.
2016-10-09 13:17:09 +02:00
4cb60b14e0 CMake changes for new macOS target 10.9 / libc++ libraries.
Differential Revision: https://developer.blender.org/D2283
2016-10-09 01:54:29 +02:00
c275870673 Ammend to rB00dc0666b3fe: forgot to fix boid->ground of first particle.
This code is confusing, such dirty details should not sneak out of
particles' own private code. :(
2016-10-08 19:13:50 +02:00
00dc0666b3 Fix T49608: runtime-only particle's boid->ground Object pointer was left dangling to invalid value in read code... 2016-10-08 15:20:43 +02:00
74e0f900c5 Fix a few compile errors with C++11 on macOS. 2016-10-08 15:03:53 +02:00
0fe7446a30 BLI_task: fix case were some pool could work in more threads than allowed.
We were checking for number of tasks from given pool already active, and
then atomically increasing it if allowed - this is not correct, number
could be increased by another thread between check and atomic op!

Atomic primitives are nice, but you must be very careful with *how* you
use them... Now we atomically increase counter, check result, and if we
end up over max value, abort and decrease counter again.

Spotted by Sergey, thanks!
2016-10-08 14:51:33 +02:00
0a2a006775 Collision: skip expensive BVH update if the collider doesn't move.
Since the collision modifier cannot be disabled, it causes a constant
hit on the viewport animation playback FPS. Most of this overhead can
be automatically removed in the case when the collider is static.

The updates are only skipped when the collider was stationary during
the preceding update as well, so the state is stored in a field.
Knowing that the collider is static can also be used to disable similar
BVH updates for substeps in the actual cloth simulation code.

Differential Revision: https://developer.blender.org/D2277
2016-10-07 21:47:00 +03:00
2dccf5a6e8 Cycles: Fix OpenCL split kernel compilation after recent CUDA 8 performance fix 2016-10-07 18:50:43 +02:00
8e586c594f OpenGL render: Limit number of scheduled frames for write
Previously if the rendering is much faster than saving (for example,
when transcoding stuff via VSE) it was possible to have 100s of frames
in memory.

This isn't ideal because of limited amount of RAM, so need to have
some sort of limit. This is exactly what is implemented in this commit.
2016-10-07 17:46:13 +02:00
ae2471b850 OpenGL render: Fix non-deterministic order of frame writes for movies
By the design of task scheduler it was possible that tasks from somewhere
in the middle of scheduled list will be handled first.

For example, one thread might be iterating over the scheduled list and
ignore tasks because there is other thread is working on task from the
same pool. However, if that other thread finishes task before iteration
is over current thread will pick up task from somewhere in in the middle
of the list.

This isn't a problem in general case, but for movie rendering we do need
to have strict order of frames.
2016-10-07 17:12:27 +02:00
09b9e462b9 OpenGL: Don't write frames when rendering was canceled 2016-10-07 16:51:19 +02:00
c67a8acc72 Cleanup: Use more clear name for where allocation is coming from 2016-10-07 16:06:24 +02:00
33297db9de OpenGL: Do not schedule new frames for write if error happens
Also do not attempt to write any already scheduled frames.
2016-10-07 16:05:51 +02:00
90f5e61b72 Proxied → Proxified 2016-10-07 13:33:43 +02:00
1cdc54dc7d Re-establish link to proxies when they are made local after appending.
This allows appending of an entire scene from another blend file into
this one, even when that blend file contains proxified armatures.

Since the proxified object needs to be linked (not local), this will
only work when the "Localize all" checkbox is disabled. The appended
proxy object should also not be referenced from anything in a library
(for example in a constraint). Referencing it from the appended data
should be fine.

Fixes T49495.
2016-10-07 13:08:50 +02:00
0f88a3546c Datablock management: remove 'proxy_from' pointer from 'is ID used' checks.
Pretty much same reason as for the 'from' pointer of shapekeys - runtime
data creating loops and 'ghost' dependencies between datablocks.

We need to handle them in cases like remapping, but whall not take them
into account to check dependencies between datablocks... :/
2016-10-07 10:20:40 +02:00
e7981a3e93 Fix T49595: bpy - negative skin_vertices radius crashes Blender
This is unsigned value (negative radius does not have much sense anyway!).
2016-10-07 10:19:22 +02:00
Julian Eisel
ec6b593072 Fix wrong separator line width after drawing vec icon
Was visible in Dynamic Context Menu add-on.
2016-10-06 22:45:12 +02:00
b859557115 GPencil: Fix interpolate stroke keymap conflict with sculpt
The initial idea was to use Ctrl+E to interpolate stroke because this is
similar to Pose breakdown, but the Ctrl+E keymap is used to inverse
grease pencil sculpt effect.

The new keymap is Ctrl+Alt+E in order to fix the conflict
2016-10-06 22:21:10 +02:00
5a0f397eaa Fix T49523: very slow normal map tangent computation for rendering in 2.78. 2016-10-06 03:12:04 +02:00
3caa830c11 Fix T49501: Animations imported via alembic render with wrong or no motion blur 2016-10-05 12:37:09 +02:00
4f1f949877 [msvc] make.bat, no need to set the cuda path at all, cmake will figure it out on it's own. 2016-10-04 13:30:38 -06:00
cd320dbfba [msvc] make.bat remove mixed cuda 7.5/8.0 build for release since all kernels can now be properly build with 8.0 2016-10-04 11:51:04 -06:00
b7046b42ab Cleanup: Update links to online py API doc, and remove old commented stuff. 2016-10-04 16:45:29 +02:00
e5c3284467 Fix T49553: Blender 2.78 crashes when File->Data Previews ->Refresh Datablock Previews
New recursive iteration over IDs in BKE_library_foreach_ID_link() was
broken by the infamous nodetree case. We cannot really recusively call
this function in that case, so better to deffer handling of
non-datablock NodeTrees as if real IDs here.

Also fixed initial ID not being stored as handled, in rare cases this
could also lead to infinite looping.

To be backported to 2.78a.
2016-10-04 15:05:56 +02:00
b4f9766ed1 Cycles CUDA: make CUDA 8.0 the officially supported version for all platforms. 2016-10-03 22:15:26 +02:00
a3abb020e3 Fix Cycles CUDA performance on CUDA 8.0.
Mostly this is making inlining match CUDA 7.5 in a few performance critical
places. The end result is that performance is now better than before, possibly
due to less register spilling or other CUDA 8.0 compiler improvements.

On benchmarks scenes, there are 3% to 35% render time reductions. Stack memory
usage is reduced a little too.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2269
2016-10-03 22:15:25 +02:00
49ad4215ba Fix fluid sim build error with MSVC. 2016-10-03 22:15:24 +02:00
Julian Eisel
103fbb3afc Fix memory leak caused by unknown opeartor of keymap item 2016-10-03 18:09:22 +02:00
b9e82b5bfb Fix T49548: Entering Cycles Rendered Viewport Unlinks Material from Objects.
We *always* want to increase mat user count when from Object (and not
Data), because in that case we are moving mat from object to temp
generated mesh, material can never be 'borrowed' in that case.

To be backported to 2.78a
2016-10-03 17:38:14 +02:00
Julian Eisel
853d232928 Fix missing operator-type registration
Removed in a7dbc0704f, but only should've removed default keymap entry.
2016-10-03 16:34:51 +02:00
Julian Eisel
e8c8db4833 Fix T49506: Remove unused File Browser theme settings
If I didn't miss anything these are indeed not used. Old themes should still work (will only print info on redundant theme defines into console), but updated non-contrib themes already.
2016-10-03 13:47:00 +02:00
c5e10394b4 Fix missing new eyedropper keymap entry in keyconfig_utils.py
Missing from rBe9bcdcdbbd91d9.
2016-10-03 12:29:18 +02:00
3ee5ce155c [Windows/Cycles/Clang] Fix compilation error with clang-cl on windows 2016-10-02 14:01:23 -06:00
3f9b69287d Fluids: improve multithreaded CPU usage.
Fixes for clamp-omp, fewer shared variables, fix some cases of threads writing
to the same memory location. Issue found by Jens Verwiebe, who reports 30%
speedup with 16 core CPU, when using this with a recent clang-omp version.
2016-10-02 16:38:14 +02:00
641e586b15 Fix T49520: broken vertex colors in the game engine. 2016-10-01 22:41:46 +02:00
fd2bffd22e [Fix unreported bug] Snap align with normal was not working in derivade mesh
The `use_snapp_align_rotation` option was using only the first vertex
2016-10-01 16:50:34 -03:00
11e93c5f2b [msvc] make.bat - Fix:msbuild platform wasn't set when the architecture was auto detected. 2016-10-01 11:22:09 -06:00
ad23ee761b Fix T49502: file browser on OS X not highlighting system folders and bookmarks. 2016-10-01 19:15:57 +02:00
4a423862e9 [MSVC] Make.bat updates.
- Explicitly specify the platform for msbuild, to facilitate builds with just the Visual C++ Build Tools installed.
- When vs2013 is not found, try looking for 2015 as a fallback
- Clear up any batch variables that might have been set from previous runs
2016-10-01 10:22:28 -06:00
15e756c584 Fix wrong Cycles GLSL pointiness, still not supported but should be neutral 0.5. 2016-10-01 14:47:05 +02:00
40eedd5df9 Cycles: implement partial constant folding for exponentiation.
This is also an important mathematical operation that can be folded
if it is known that one argument is a certain constant. For colors
the operation is provided as a Gamma node.

The SVM Gamma node needs a small fix to make it follow the 0 ^ 0 == 1
rule, same as the Power node, or the Gamma node itself in OSL mode.

Reviewers: #cycles

Differential Revision: https://developer.blender.org/D2263
2016-10-01 14:37:03 +03:00
Sebastian Witt
95fa303efd Add default UV coordinates for torus primitive.
Fixes T47489.

Reviewed By: brecht
2016-10-01 01:56:16 +02:00
20c6d5e3cb Fix MSVC compiler warning due to using */* to start comment. 2016-10-01 01:55:34 +02:00
70a40ff65a Cleanup: Naming in EditNormals modifier 2016-09-30 12:15:18 +02:00
6a4ca1e5c0 Normal edit modifier: Fix relation builder for the new dependency graph 2016-09-30 11:13:28 +02:00
eb9521ae04 Depsgraph: Report proper error when modifier fails to create relation link 2016-09-30 11:05:01 +02:00
5845d52bf3 CUEW: Use latest upstream version
Fixes typo in README :)

Thanks to @jesterKing!
2016-09-30 10:36:11 +02:00
85d543b4ac Fix T49489: Pose marker in camera action + marker bound to camera -> crash.
'camera' Object pointer of TimeMarkers is a 'temp' hack since Durian project...
Would need to be either made definitive now, or removed/reworked/whatever.

But since we intend to use that object pointer for other needs, and current code
could lead to crashing .blend files, for now let's fix that mess (was missing
some bits in read code, and also totally ignored in libquery code).

Should be safe for 2.78a.
2016-09-30 10:14:12 +02:00
396a6d8a86 UPBGE: Fix crash when calling shade_light texture when mtex has no tex. 2016-09-30 07:41:18 +02:00
80837d06de Cycles: Support earlier tile rendering termination on cancel
It will discard the whole tile, but it's still kind of more friendly than
fully locked interface (sort of) for until tile is fully sampled.

Sorry if it causes PITA to merge for the opencl split work, but this issue
bothering a lot when collecting benchmarks.
2016-09-29 16:00:25 +02:00
333366dbcf Cycles: Fix typo in shader cancel routines 2016-09-29 15:48:10 +02:00
57a2015f56 Adopt referenced scene in the context when evaluating sequences within a Scene Strip
This change makes it so that when the sequences within a Scene strip are
evaluated, they use the Scene that they come from as the context as opposed
the Scene that the Scene strip is in. This is necessary, for example, in the
case of the MulticamSelector where it needs to reference strips in the original
Scene as opposed to the Scene where the Scene strip is located.

Patch by @Matt (HyperSphere), thanks!
2016-09-29 15:00:03 +02:00
31ebbe40a0 Cycles: Improve OpenCL line information handling
Previously it was falling back to just a path after #include
statement was finished. Now we fall back to a proper current
file name after dealing with the preprocessor statement.
2016-09-29 10:20:24 +02:00
94c919349b Cycles: Cleanup file headers
Some of the files were wrongly attributing code to some other
organizations and in few places proper attribution was missing.

This is mainly either a copy-paste error (when new file was
created from an existing one and header wasn't updated) or due
to some refactor which split non-original-BF code with purely
BF code.

Should solve some confusion around.
2016-09-29 10:11:40 +02:00
8deddba392 Update source tgz builder script
Was broken since splitting BKE_blender_version from BKE_blender.
2016-09-29 10:05:42 +02:00
78c380d3b8 [MSVC] make.bat updates.
- The build folder name used to be depended on the order of the parameters, this is now normalized to
"build_windows_[Release/Full/Lite/Headless/Cycles/Bpy]_[x86/x64]_vc[12/14]_[Release/Debug]" regardless of the order of the parameters.

-Use CUDA8 for all kernels when building the release convenience target with visual studio 2015
2016-09-28 19:57:25 -06:00
f1de438bba Revert "[Windows/MSVC] Blosc doesn't require debug libraries."
turns out it's a C++ lib now-days and it *DOES* require debug libs.

This reverts commit bde5eb8b63.
2016-09-28 17:27:35 -06:00
26d7d995db Fix Windows mouse wheel scroll speed
In Windows, event dispatching code is throwing out the wheel scroll count value.
Despite of how many fast you move the wheel, it only make one-notch scroll event.

This patch convert wheel event to multiple 1-notch wheel events.

This also correct the handling of smooth scroll mouse wheel (which can report smaller than 1-notch wheel movement) by accumulating the small wheel delta values.

Reviewers: djnz, shadowrom, elubie, #platform:_windows, sergey, juicyfruit, brecht

Reviewed By: shadowrom, elubie, #platform:_windows, brecht

Subscribers: dingto, elubie, brachi, brecht

Differential Revision: https://developer.blender.org/D143
2016-09-28 17:22:02 -06:00
344a669c41 Fix T49478: triangulate of face hangs Blender.
Another case of float imprecision leading to endless loop. INcreasing a bit 'noise threashold' seems to work OK.

Not a regression, but might be nice to have in 2.78a.
2016-09-28 20:05:46 +02:00
0ec87f1227 Cycles: Cleanup, indentation 2016-09-28 17:05:33 +02:00
e1bfb89da2 Cycles: Fix compilation error with minimal feature set 2016-09-28 17:03:59 +02:00
c5d7602925 Fix T49471: Vertex Connect randomly broken.
Not sure where this comes from, but code was converting BMEdge* to BMVert* to check oflags,
i.e. not accessing correct memory.

Regression, to be backported to 2.78a.
2016-09-28 16:58:11 +02:00
305fec8358 Fixes for pose library change 601ce6a89c
Apparently the keying sets system doesn't support subclassing
KeyingSetInfo subclasses. I have added a note to the top of the file to
indicate this to future developers.
2016-09-28 15:40:22 +02:00
dea7ef4dd9 Curve pinning: Allow pinning object data without animated object
Special case, so now we can pin tricky cases like animated camera DOF
without requiring to have animation on the object level.
2016-09-28 15:25:05 +02:00
cbd3827d83 Fix T49460: Particle group instance 'Use Count' value gets reset on file-load.
Regression caused rBbcc863993ad, write code was assuming dw->ob was always valid,
wich is no more the case right after reading file e.g.

Another good example of how bad it is to use 'hidden' dependencies between datablocks. :(
And another fix to be backported to 2.78a. :(((
2016-09-28 15:08:45 +02:00
601ce6a89c POSELIB_OT_pose_add: only create keyframes for selected bones.
Previously the pose library used the WholeCharacter key set, which ignores
selection and add keys for almost all bones in the rig. This is a very
slow operation on complex rigs. With this patch, only selected bones are
keyed, defaulting to keying all bones when none are selected.

Note that this fixes the FIXME previously mentioned in the source.
2016-09-28 13:54:57 +02:00
Julian Eisel
dbb8222baa Fix missing properties editor update when changing 3D View camera
Actually two errors here:
* Properties editor wasn't refreshing on (NC_SCENE | ND_RENDER_OPTIONS) notifiers
* Was using notifier info bits wrongly, needs to send two separate notifiers

Decided to remove ND_RENDER_OPTIONS rather than adding properties editor scene context refresh for it, this is more than a render option change.
2016-09-28 00:53:59 +02:00
13a4147c17 Dynamic Paint: Don't store duplicate adjacency links.
Duplicates can happen at UV seams in case of resolution mismatch
or other complications. It's better not to store them in case it
confuses some math later on.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D2261
2016-09-27 21:54:54 +03:00
9a66d0ad1b Dynamic Paint: Fix adjacency computations at UV seams.
1. When adding one pixel border to UV islands prefer grid directions.
   This is more logical as it means neighbor pixels will commonly
   share a border, opposed to just corners.
2. Don't subtract 0.5 when converting float UVs to int in computing
   adjacency across a UV seam. Pixels cover a square with corners
   at int positions and adding/subtracting 0.5 is only for dealing
   with the center point of a pixel.
3. Use the neighbour_pixel field from the correct pixel, and check
   it's not back to the origin point.
4. In the connected UV case, ensure that the returned index actually
   refers to a valid active pixel.

This fixes paint spread not traversing some UV seams, while at the
same time spreading to random unrelated points on other seams.
The first problem is primarily fixed by 2, while the second one
is addressed by item 4.

Differential Revision: https://developer.blender.org/D2261
2016-09-27 21:54:54 +03:00
bde5eb8b63 [Windows/MSVC] Blosc doesn't require debug libraries. 2016-09-27 10:24:09 -06:00
dd0de53d29 Fix T49466: Stupid typo in logicbricks new copy code from rB776a8548f03a
Moved that code forth and back a few times while creating rB776a8548f03a fix,
ended up forgetting to update it correctly for function where it layed down in the end.

Last-minute fixes are never a good thing... Now we already have real reason for 2.78 'a' release :(
2016-09-27 17:55:12 +02:00
b63e9a96df Fix T49423: Data Preview of group containing only group instances is empty.
Code was not getting correct boundbox in some cases (group only instancing other groups e.g.), now
compute our own bbox in those cases.

Based on patch by @lichtwerk, but extended the fix to include linked datablocks in some cases
(linked objects in local groups, linked objects in local scene, etc.), this was also broken in existing code.

Reviewers: mont29

Subscribers: duarteframos

Differential Revision: https://developer.blender.org/D2257
2016-09-27 17:03:03 +02:00
5d0de39238 fix Mac build for Xcode < 8
We need a long-term fix, but this will get 2.78 out the door.
2016-09-27 16:16:47 +02:00
2ebb367b0f cleanup: spacing & alignment 2016-09-27 14:56:58 +02:00
54ed22c843 Fix T49461: Dynamic paint wetmap flickers.
Regression from rBa4a968f, we would adjust current point's wetness without actually protecting it
in new multi-threaded context, leading to concurrent access mess.

Now delay applying wetness reduction to current point to end of function, allows us to avoid having
to lock current point twice together with neighbor one (and reducing spinlock awainting too).

To be backported to 2.78a.
2016-09-27 13:58:01 +02:00
e6dda514ba Fix T49464: Data Transfer modifier slows down redraw of window.
Never call function that might recompute a DM in an RNA itemf callback (or any UI-related func in general)!
There was an XXX comment asking if this was OK - well, no, it was not. :P

Could be ported back to some 2.78 flavour should we need it.
2016-09-27 12:03:18 +02:00
7f76f6f249 Fix export image generated by export UV layout
Was only happening with new dependency graph.

The issue here is that scene's depsgraph layers will be 0 unless
it was ever visible. Worked around by checking for 0 layer in the
update_tagged of new depsgraph. This currently kind of following
logic of visible_layers, but is weak.

Committing so studio is unlocked here, will re-evaluate this layer.
2016-09-26 16:46:08 +02:00
b23ffded08 Fix Scene datablocks being created with a real user while never having any real datablock user.
Now using new system dedicated to that kind of cases, id_ensure_real_user(), instead.
That way, usercount of Scenes is handled correctly at deletion time.

Reported by @sergey over IRC, thanks.
2016-09-26 16:37:17 +02:00
Dalai Felinto
eab3e0af1c Cleanup: stereo windowmanager code
This will make the changes in blender2.8 branch simpler
2016-09-26 13:56:45 +00:00
7c53260109 Fix crash in own recent rB776a8548f03a049.
New ID may be null, have to check this too!

Reported by @panzergame over IRC, thanks.

To be ported to 2.78 as well.
2016-09-26 09:49:34 +02:00
07de832e22 Cycles: Use correct light sampling PDF for MIS calculation with Branched Path Tracing
The light sampling functions calculate light sampling PDF for the case that the light has been randomly selected out of all lights.
However, since BPT handles lamps and meshlights separately, this isn't the case. So, to avoid a wrong result, the code just included the 0.5 factor in the throughput.

In theory, however, the correction should be made to the sampling probability, which needs to be doubled. Now, for the regular calculation, that's no real difference since the throughput is divided by the pdf.
However, it does matter for the MIS calculation - it's unbiased both ways, but including the factor in the PDF instead of the throughput should give slightly better results.

Reviewers: sergey, brecht, dingto, juicyfruit

Differential Revision: https://developer.blender.org/D2258
2016-09-25 23:16:05 +02:00
18b0738303 Cleanup: remove unused function. 2016-09-25 22:11:38 +02:00
04230e80d1 Alembic: only interpolate vertices when their number don't differ
between samples.

This could cause some crashes.
2016-09-25 22:11:37 +02:00
0b89b31a18 Cycles: Fix T49411: Multiscatter GGX with zero roughness when Filter Glossy is enabled 2016-09-25 22:09:38 +02:00
448ee227be Volume slice settings: tweak/fix UI enabling conditions.
It was still possible to have some properties enabled when it does not
make sense to have them so.
2016-09-25 21:55:29 +02:00
584288a97c Smoke debug draw: take adaptive domain position into account.
Eventually the various functions that deals with adaptive domain
bounding box shall de-duplicated.
2016-09-25 21:45:09 +02:00
ae69986b70 Viewport smoke: fix a couple of issues in the new display settings.
- WITH_SMOKE macro was not defined so some code was not compiled, though
it was still accessible from the UI
- some UI elements were disappearing due to bad indentation, also rework
the UI code to not hide but rather disable/grey out button in the UI
- Display thickness was not used due to bad manual merge of the code
from the patch.
2016-09-25 17:02:46 +02:00
335ee5ce5a Fix T49310: incorrect Cycles standalone normals with negative scale. 2016-09-25 05:23:52 +02:00
6dd87f2abb Curve Fitting: re-fitting heap pre-allocated too much 2016-09-25 12:19:43 +10:00
6b5ad4a4d7 Curve Fitting: 'offset' method used sign when it shouldn't 2016-09-25 12:19:42 +10:00
05dbd65098 Curve Fitting: inline dot-product (avoid temp vector) 2016-09-25 12:19:42 +10:00
d9b242f5fb Curve Fitting: de-duplicate cubic evaluation 2016-09-25 12:19:42 +10:00
5bdff9ea80 Quiet shadow warning
No need to declare new iterator for second loop.
2016-09-25 12:19:38 +10:00
d35bf3f421 Fix compile error when building without smoke support.
Also fixes possible NULL pointer dereference.

Fixes T49445.
2016-09-25 00:26:21 +02:00
14e825aa1f Viewport smoke: add options to draw velocity vectors.
This basically exposes to the UI a function that was only available
through a debug macro ; the purpose is obviously to help debugging
simulations. It adds ways to draw the vectors either as colored needles
or as arrows showing the direction of the vectors. The colors are based
on the magnitude of the underlying vectors.

Reviewers: plasmasolutions, gottfried

Differential Revision: https://developer.blender.org/D1733
2016-09-24 22:36:54 +02:00
4446acbf17 Viewport smoke: add support for axis aligned slicing.
Current approach uses view aligned slicing to generate polygons for GL
texturing such that the generated polygons are always facing the view
plane. Now it is also possible to use object aligned slicing, which
creates polygons by slicing the object perpendicular to whichever axis
is facing the most the view plane. It is also possible to create a
single slice for inspecting the volume, or for 2D rendering effects.

Settings for this, along with a density multiplier setting, are to be
found in a newly added "Smoke Display Settings" panel in the smoke
domain properties tab.

Reviewers: plasmasolutions, gottfried

Differential Revision: https://developer.blender.org/D1733
2016-09-24 22:21:02 +02:00
Peter Lu
a070a5befa Mesh: added default UVs for Monkey, improved UVs for UV Sphere and Icosphere.
Fixes T47488 and T47478.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2224
2016-09-24 16:39:23 +02:00
bf2c2d43ef Fix T49441: Grease Pencil - pie menu - brush name field crashes blender
Using context.active_gpencil_brush to access the active Grease Pencil brush
would result in a crash if trying to rename the brush, because the "ID" pointer
was not set.

To be backported to 2.78
2016-09-24 12:50:37 +12:00
36d0ea3123 Collada: Trying to get rid of some warning messages on linux 2016-09-24 01:47:55 +02:00
7a259d8422 Collada: Trying to get rif of some warning messages on linux 2016-09-24 01:27:37 +02:00
4b891b40c2 Fix: Collada Importer did not import the Blender Profile information correctly when multiple objects are bound to same armature. This caused Bone tails to be placed wrong. 2016-09-24 01:06:32 +02:00
25b61662f5 Quiet warning. 2016-09-23 19:45:33 +02:00
c3b754f9bd Alembic: only export face sets when required by the user.
Also remove deprecated face set code.
2016-09-23 19:45:33 +02:00
4e3578f470 Cycles: Prevent crash in special cases when object has less slots than mesh
This is something what was guaranteed in give_current_material(), just
copied some range checking logic from there.

Not sure what would be a proper fix here tho.
2016-09-23 15:57:39 +02:00
06b51c64ad Particles: Prevent crash when copying to an object with subsurf modifier
Probably something will be remapped wrongly, but better than crash.
2016-09-23 15:39:33 +02:00
1925b9b2fa Particle: Add option to duplicate settings together with particle system itself
This way it's possible to copy combed hair, use it as a basis for another
particle system to do some awesome artistic stuff.
2016-09-23 15:33:07 +02:00
c61cb0e076 Particle: Prevent crash duplicating hair on objects with modifiers 2016-09-23 14:51:42 +02:00
1e89a261b2 Outliner: Fix assert failure with palette ID 2016-09-23 14:49:55 +02:00
1d03bc73ce Particles: Add operator to quicly duplicate active particle system to the same object 2016-09-23 14:32:36 +02:00
776a8548f0 Fix T49430: append scene with gamelogic broken.
In fact, it was the whole remapping process that was broken in logic bricks area,
due to terrible design of links between those bricks...

Object copying was also broken in that case, fixed as well.

To be backported to 2.78.

Note that issue was actually probably there since ages, hidden behind dirty hacks
used in previous append code (though likely visible in some corner cases).

Listen kids: do not, never, ever, do what has been done for links between logic bricks. Never. Ever.
Even as pure runtime data it would have been bad, but as stored data...
2016-09-23 14:25:15 +02:00
2372e67dd6 Cycles: Don't sum up memory usage of all devices together for the stats 2016-09-23 12:43:23 +02:00
1b2b7cfa20 Cycles: Fix overflow caused by wrong size calculation in Mesh::add_undisplaced 2016-09-22 17:44:22 -04:00
Julian Eisel
56498757ce Clip Editor: Enable Continuous Grab for view panning 2016-09-22 22:50:59 +02:00
d84c55f0fa Fix T49417: Cycles crash - can't use 5 Gigabyte Tile EXR texture file
Was an integer overflow issue when calculating offsets.
2016-09-22 17:30:31 +02:00
4e031073df Fix T49427: Drivers of Shapekeys break when Append a group.
Optimization attempt with BKE_library_idtype_can_use_idtype() was not taking into account
the fact that drivers may link virtually against any datablock...

Has to be rethinked, but for after 2.78 release, this commit is safe to backport.
2016-09-22 16:12:43 +02:00
9937f28877 Buildinfo: Improve behavior with detached HEAD
Try real hard to detect which branch we've detached from.
2016-09-22 15:01:01 +02:00
ab09a80d33 Fix T49425: Freestyle in viewport keeps updating over and over.
Regression caused by rBb27ba26, we would always tag datablocks to update in G.main,
ignoring given bmain, now always use this one instead.

To be backported to 2.78.
2016-09-22 14:57:16 +02:00
f915ee8e76 CMake: Fix copy-paste error 2016-09-22 11:01:37 +02:00
c77da24116 Fix non-finite normalization factor in certain cases 2016-09-22 10:04:51 +02:00
ca1c7a0cf7 Fix T49422: Metadata not showing in OpenGL renders
Own regression since recent optimization.
2016-09-22 09:42:09 +02:00
Julian Eisel
6f80604509 RNA/UI: Allow displaying in tooltip why RNA property isn't editable
This commit allows RNA properties to return additional info on their editable state which may then be displayed in tooltips. To show how it works, it also adds some info for the editable check of proxies. For generally un-editable properties or properties of a linked data-block, RNA returns default strings.

| {F362785} | {F362786} | {F362787} |

Reviewed by brecht, thanks!

Differential Revision: https://developer.blender.org/D2243
2016-09-22 00:10:53 +02:00
9493e3b2d6 UI: Theme options for vertex/edge bevel weight colors
Drawing used colors for select (TH_EDGE_SELECT/TH_VERTEX_SELECT) which was inconsistent with crease, seam, sharp, .. (which all had their own them color -- also was a bit hard to read).

NOTE: UI team usually doesn't allow adding more theme options, this is an exception.

Differential Revision: https://developer.blender.org/D2234
2016-09-21 23:16:38 +02:00
Julian Eisel
e9bcdcdbbd UI: Make eyedropper shortcut configurable
It's now possible to change the shortcut for invoking the eyedropper while hovering a button (E by default). Also removed the keymap editor entry for the modal eyedropper keymap, it's now automatically appended to the eyedropper shortcut.
2016-09-21 22:20:24 +02:00
Julian Eisel
f6c09eadf0 UI: Make button driver and keying set shortcuts configurable 2016-09-21 20:09:37 +02:00
a3d258bfb4 fix for potential pitfall with glMatrixMode
close D696 by @jwilkins

The matrix mode should always be left in modelview mode, since a lot of code assumes it is before setting a matrix.
2016-09-21 17:41:59 +02:00
Julian Eisel
e8d953000a UI: Configurable shortcuts for keyframe operators
Adds support for editing the shortcuts for inserting (I), deleting (Alt+I) and clearing (Alt+Shift+I) button keyframes.
2016-09-21 17:06:52 +02:00
a7e7479122 FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.

{F362527}

- Clearer separation between container and codec. No more "format", as this is
  too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
  slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
  depending on the desired quality and the input. This generally produces the
  best quality videos, at the expense of not knowing the exact bit-rate and
  file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
  new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
  for reviewing videos, as it allows players to scrub through it easily. Might
  be nice in weeklies. This preset also requires control over the
  `max_b_frames` setting.

GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
  accurate. After all, FFmpeg is used when this option is chosen, which can
  also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
    - bit rate options are not used when a constant rate factor is given.
    - audio bitrate & volume are not used when no audio is exported.

Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.

After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.

Reviewers: sergey, mont29, brecht

Subscribers: mpan3, Blendify, brecht, fsiddi

Tags: #bf_blender

Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:03:11 +02:00
Julian Eisel
2476faebd7 Fix crash in space context cycling when leaving window bounds 2016-09-21 14:53:42 +02:00
Julian Eisel
bb6af17799 Make space context cycling a proper screen-level OP
This is really more of a screen level operation, UI-level is more like button handling etc.
2016-09-21 14:53:42 +02:00
Julian Eisel
d10f54ee75 UI: Support UI operators with configurable shortcuts
After all a super simple solution that allows us to get rid of hardcoded keymap items.
2016-09-21 14:53:42 +02:00
622c9ced6c Cycles: Cleanup, whitespace 2016-09-21 14:42:05 +02:00
Dalai Felinto
8ced4417f9 Fix T49393: Baking ignores backfaces
For some reason (which I can't recall), backing was doing backface
culling. Since Cycles itself doesn't ignore them (nor does Blender
Internal), they should be visible.
2016-09-21 10:39:54 +00:00
166286e6de Cycles: Make code more uniform across two versions of shadow_blocked()
Just to make it easier to research ways of possible code de-duplication.
2016-09-21 11:50:11 +02:00
e4f7bf6ccb Cycles: Remove out of date comment 2016-09-21 11:48:36 +02:00
586c58902d Fix: Grease Pencil sculpting crashes when sculpting on layers without any strokes
Reported by @loochmunz. I've also gone through checking for and fixing other places
where this was also occurring.


To be included in 2.78
2016-09-21 17:03:45 +12:00
0b9cfbf6a8 GPencil D+W Pie: Don't show editing operators when not in editmode
These operators only operate on the selected strokes, but when not in editmode,
stroke vertices are not shown.

Safe for 2.78
2016-09-21 17:03:44 +12:00
Julian Eisel
c5326958a5 UI: Fix crash using drag-toggle over window bounds with button callback
Steps to reproduce:
* Go to modifier context in properties editor
* Add modifier, collapse it
* Press down LMB over collapse button of modifier, hold it
* Drag over pin-icon in properties editor (to keep fixed data-block displayed)
* Drag outside of window bounds (should crash)

Also could've solved by getting space data from callback arguments instead of context, but this fix is much nicer (though not totally un-risky).
2016-09-21 00:44:14 +02:00
2382d1c401 regression fix for 1346482d23: The length of leaf bones should always be set to the length of the smallest bone. since the mentioned commit the importer did only recalculate the leaf bone length when the 'fix leaf bones' option was also enabled. 2016-09-20 17:33:17 +02:00
a5f14ad1a2 Cycles: Make regular bvh traversal functions close to each other 2016-09-20 16:58:39 +02:00
a6db95cd42 Cycles: Re-group ifdef so we check for particular feature only once 2016-09-20 16:58:39 +02:00
f3b94a54bc Alembic: add support to interpolate transform matrices in-between
frames.
2016-09-20 14:17:05 +02:00
386da0cc77 Cycles: Avoid conversion from bool to uint 2016-09-20 13:00:36 +02:00
Dmitry Dygalo
87c08fa681 Small speedup for blend_render_info.py
Do not close and re-open the file in case it's compressed, gzip module can now directly take a file object as parameter.

Differential Revision: https://developer.blender.org/D2235
2016-09-20 12:38:54 +02:00
075a2175d5 Fix T49391: Texture paint is not aware of disabled color management
There might be some extra missing points here, but it's all rather
a TODO than a real bug and can be tweaked further once issues are
actually discovered.
2016-09-20 12:22:50 +02:00
f64aa4e0af Fix T49343: ImageFormatSettings were not setting their rna struct path correctly
Reviewers: brecht, mont29

Reviewed By: brecht, mont29

Subscribers: brecht, sergey

Differential Revision: https://developer.blender.org/D2228
2016-09-20 12:14:53 +02:00
78c0bc52de Fix T49408: OpenGL light widget breaks viewport shading 2016-09-20 11:56:37 +02:00
f2da63cb12 Fix T49386: Blender crashes when told to load an OCIO LUT that does not exist 2016-09-20 10:48:25 +02:00
e12f5b699d OpenGL: software renderer for old Mac GPUs
We raised the minimum to GL 2.1 in Blender 2.77, and dropped support for older GPUs (pre-2012 Intel mostly). On Windows you get a popup message, but on Mac we simply crashed. Every Mac has a builtin software renderer for GL 2.1 so let's use that when the GPU is not capable!

Run blender --debug-gpu to see version detection & software fallback.
2016-09-19 20:27:12 +02:00
Julian Eisel
16ed49b26e UI Messages: Consistent spelling of term "data-block"
Was using a bunch of different spellings, mostly "data-block" though, so went with that one (would have been my #1 choice anyway ;) )
2016-09-19 16:50:45 +02:00
7d63ea4a1c Buildbot: Another attempt to have OSX builder fixed 2016-09-19 16:45:08 +02:00
12680d36f5 Buildbot: Temporary disable CUBIN compilation 2016-09-19 16:24:55 +02:00
838e0a09c7 Buildbot: Attempt to use proper Clang for CUDA binaries 2016-09-19 16:11:19 +02:00
100b2ad775 Cycles: Cleanup code style in split kernel 2016-09-19 16:05:12 +02:00
1f5cd85976 Fix T49375: align rotation with snap target isn't toggleable in edit mode.
Based on D2237, but fixed patch always hiding 'snap on self' button...

Should be safe for 2.78.
2016-09-19 15:51:05 +02:00
5c6a14f4e5 Cycles: More tweaks to make specialized BVH traversal matching 2016-09-19 15:29:37 +02:00
7901f62a9d Cycles: Avoid redundant intersection pre-calculation 2016-09-19 15:18:27 +02:00
6ba59660fb Cycles: Cleanup, sync some comments across different traversal 2016-09-19 15:18:27 +02:00
85f48216ed Cycles: Cleanup, always use parenthesis
Makes it simpler to compare different traversal algorithms.
2016-09-19 15:18:27 +02:00
Martijn Berger
cc9d0eff81 Lowercase includes for psapi.h and dbghelp.h windows includes.
This makes cross compilation a little less painful
2016-09-19 14:22:38 +02:00
25ee094226 Fix T49385: Copy buffer is not from pose mode. Report Error
Quick fix for now, need to unlock studio here as well.

Proper fix would be to modify API a bit and pass flags which will
prevent expand called on bmain perhaps. But this we should discuss
a bit,
2016-09-19 14:17:05 +02:00
2980c6ebae Cycles: Move BVH constants to an own files, so they are easily re-usable 2016-09-19 13:00:41 +02:00
b19c6f8f43 Remove null-check of argument which is attributed as non-null
This was logically incorrect and was causing warning and compilation
errors with strict compiler flags.
2016-09-19 10:18:10 +02:00
722226b610 CacheFile: make sure SpinLock is destroyed when exiting Blender.
Missed in rB62b1cdd6.
2016-09-19 09:02:41 +02:00
772dab9df1 Cycles: Fix typo that would sometimes result in subsurf modifier being disabled 2016-09-18 22:14:15 -04:00
Julian Eisel
c2d7d4764e Various cleanups related to button locking
* Rename uiBut.lockstr to disabled_info
* Remove unreachable code
* Replace duplicated check with assert
* Replace overly ambitious check with assert
* Add comments
2016-09-19 02:41:10 +02:00
Julian Eisel
976e591e93 Cleanup: Completely replace/remove uiBut.lock
Old leftover from pre 2.5 days. Now handled through UI_BUT_DISABLED button flag.
2016-09-19 01:49:17 +02:00
Julian Eisel
404a427dfd Minor corrections for previous commit
Was using wrong argument name in doxygen comment. Also reduced scope of vars.

Sorry for the noise :/
2016-09-18 21:54:24 +02:00
Julian Eisel
572bc1364c BLI_listbase: Add/use utility to move link (BLI_listbase_link_move)
We were calling BLI_remlink and then BLI_insertlinkbefore/after quite often. BLI_listbase_link_move simplifies code a bit and makes it easier to follow. It also returns if link position has changed which can be used to avoid unnecessary updates.

Added it to a number of list reorder operators for now and made use of return value. Behavior shouldn't be changed.

Also some minor cleanup.
2016-09-18 21:44:42 +02:00
6c28d3bac2 Fix T49245: Adaptive Subdivision with Auto Smooth causes weird mesh appearance 2016-09-18 13:22:54 -04:00
Julian Eisel
c0aabeede8 GPencil: Don't show error popup when strokes can't be reordered further
Was spawning error popup each time user tried to move a stroke higher or lower than the list allowed. We don't do that anywhere else and it's not really useful info for the user. So rather not bother her.
2016-09-18 19:08:20 +02:00
940f360479 Cycles: Fix update of subdivision meshes when global dice rates change
When subdivision settings were moved from meshes to objects this was missed,
should work fine now.
2016-09-18 12:44:43 -04:00
799454821e Cycles: Soft minimum for dice rates
Use 0.5 as a soft minimum for dice rates to help from setting them too
low. Lower values can still be set by typing in the value.
2016-09-18 12:44:43 -04:00
8f28441487 Cycles: Adaptive isolation
Idea here is to select the lowest isolation level that wont compromise quality.
By using the lowest level we save memory and processing time. This will also
help avoid precision issues that have been showing up from using the highest
level (T49179, T49257).

This is a pretty simple heuristic that gives ok results. There's more we could
do here, such as filtering for vertices/edges adjacent geometric features that
need isolation instead of checking them all, but the logic there could get a
bit involved.

There's potential for slight popping of edges during animation if the dice
rate is low, but I don't think this should be a problem since low dice rates
really shouldn't be used in animation anyways.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D2240
2016-09-18 12:44:43 -04:00
Julian Eisel
63b90851ce GPencil: Fix memory leak using stroke arrange OP 2016-09-18 17:25:12 +02:00
0552d5820b Fix T49384: crash in tangent space calculation with NaN mesh vertices. 2016-09-18 13:38:20 +02:00
40247ee491 [Windows/make.bat] Clean only after all parameters have been processed so the full path is known, and require a convenience target to be set. Also added a helpful error message if any of the required data is not available. 2016-09-17 09:19:54 -06:00
09925d52f5 Fix T49383: Color pickers are available if the color is locked
If the color is locked, the row is disabled, but the picker is still
available.

This error was present in older versions for layer color.
2016-09-17 09:02:03 +02:00
cade262c47 OpenGL render: Bugfix (unreported) after rB6f92604e539b2114763150fb1ace60d28e59a889
Crashes occured immediately when clicking on "OpenGL render image" because there was only a task pool created previously when it was an animation. Solved it by introducing a variable is_animation to the openglrender and omitting the task_pool call when it's no animation.

@sergey: Please check my changes, moved the pool_ok and the lock into the is_animation clause.
2016-09-17 00:21:34 +02:00
c9c933ac81 Pose Library pose list: Default to 5 rows to match the new up/down buttons
The buttons now nicely align with the pose list itself.
2016-09-16 18:21:25 +02:00
634508ca3f Buildbot: Disable QuickTime for the time being
Buildbot machine was updated to the new SDK which seems to have
QTKit removed.

For until we've installed older SDK or ported our code to a new
AVFramework disabling QuickTime.
2016-09-16 17:51:01 +02:00
716e712a83 Pose library sorting: return OPERATOR_CANCELLED when no-op
A no-op happens when trying to move the top pose further up, or the
bottom pose further down.
2016-09-16 17:33:34 +02:00
Julian Eisel
2aca1d85e6 Improve description of move operator direction properties
These may be exposed in UI (keymap editor & redo panel), so better avoid using identifiers like "UP" "DOWN". They are redundant anyway (already displayed).
2016-09-16 17:03:44 +02:00
Julian Eisel
4b39069908 Fix jumping view when expanding graph editor channel over view bounds
Didn't change versioning_250.c entries, flags will be overridden anyway.
2016-09-16 16:41:36 +02:00
Julian Eisel
df3394a386 Fix vertical scrollbar adding to region width in graph editor
Had to calculate draw region width based on region size excluding scrollbars.
2016-09-16 16:21:51 +02:00
9883899d62 Remove debug only code
Thanks Severin for spotting it!
2016-09-16 16:11:38 +02:00
9a7891da90 Tweak for pinned/always visible curves in Graph Editor
Allow such kind of pin for armature bones.
2016-09-16 16:01:38 +02:00
19268fbad3 Added buttons to move a pose in a pose library up/down.
This will break the pose library preview add-on, since that add-on uses
file indices rather than pose names.
2016-09-16 15:11:45 +02:00
Julian Eisel
661a316c72 Picky correction to previous commit
A bit nicer to do empty-string check for operator poll message as well.
2016-09-16 15:09:21 +02:00
Julian Eisel
1df115d9a3 UI: Allow showing why button is disabled in tooltip
Uses red alert color. Operators that failed poll check already did this.
2016-09-16 15:05:27 +02:00
f3058c1b66 OpenSubdiv: Remove redundant section define from shader compilation 2016-09-16 12:28:35 +02:00
a27b54f6e2 OpenSubdiv: Split shader source files
Was a bit annoying to do tweaks in a file which contained all
vertex, geometry and fragment shaders.
2016-09-16 12:28:35 +02:00
98af402357 GPencil: Remove toggle option for pop-up specials menu
According UI rules, no toggle options in pop-ups menus, so remove it.
2016-09-16 11:58:10 +02:00
b06584dbf8 Fix T49349: Baking action doesnt bake multiple objects.
Tooltip was wrong here, it can only bake a single (active) object, 'only selected' option
is for pose bones only...
2016-09-16 11:50:49 +02:00
b2f1b8ab7a GPencil: Add a new special menu for editing and replace subdivision shortcut
Replace the W shortcut for subdivision by a new menu for edit specials
in order to keep consistency in UI.

Subdivision is not used all the time, so it's better assign this
shortcut to menu.
2016-09-16 11:49:29 +02:00
4b046c530d Fix T49372: Fresnel node: difference between 2.76 and 2.78 GLSL output 2016-09-16 11:48:42 +02:00
ac7ff55f11 GPencil: New subdivide stroke operator
In some situations the artist needs to subdivide a stroke created with
few points before, specially for sculpting.

The subdivision is done for any pair of continuous selected points in
the same stroke.

The operator can be activated in edit mode with W key and has a
parameter for number of cuts.
2016-09-16 10:32:39 +02:00
6f92604e53 OpenGL render: Move file writing to a separate thread
The idea is to have a dedicated thread which is responsive for all the
file writing to a separate thread, so slow disk will not slow down
OpenGL itself.

Gives really nice speedup around 1.5x when exporting barber shop layout
file to h264 video.
2016-09-16 10:31:37 +02:00
04bfea0d67 Fix T49369: Blender crashes/closes down application at alembic export of
any object

There were a couple of crashes caused by stupid typos in
rB631af9f930d2fd2c76751204ff22239aa95f761d and
rB78ea06fea4a74181c25254ed72d50d8a743b6954, as well as a shamefull lack
of 'testing before committing' which only affect exporting.

One crash was due to using RNA_boolean_get instead of RNA_enum_get, the
other one was a tricky case of order of deletion happening in the
destructors of AbcExporter and ArchiveWriter.

Should not affect RC or release.
2016-09-16 09:27:44 +02:00
e156abe467 Cleanup: Redundant forward declaration 2016-09-15 16:46:19 +02:00
04e2e4fdc1 Fix mistake in previous commit
Was copying things in other way around and was not performing
proper color space conversion.
2016-09-15 16:34:10 +02:00
2d81e88865 OpenGL render: Avoid byte-float-byte roundtrip
It was annoyingly slow to do roundtrip from byte OpenGL render to
float render result and back to byte image format (which is used
in 99% of cases for the OpenGL previews),

Now we use render result's rect32 to store render result which is
already supposed to be in the display space.

Gives about 30% speed improvement for OpenGL previews here.
2016-09-15 15:56:47 +02:00
6fb874369c OpenCOlorIO: Add explicit linearSRGB -> sRGB lookup table
Previously converting from linear space to SRGB was doing rather
slow inverted 1D lookup. Adding explicit inverse LUT gives 20%
speedup of OpenGL render.

Next question is: why do we even bother with sRGB conversion here,
OpenGL is already in the proper space so in theory we can avoid
quite some color space conversions. In any case, having this case
optimized in nice anyway.
2016-09-15 15:56:47 +02:00
1af547a223 OpenGL render: Add developer option to easily enable time information 2016-09-15 15:56:47 +02:00
42c17cb769 Bring blender_release.cmake uptodate with the changes from D2227 2016-09-15 06:34:57 -06:00
f339d5a8ce [windows] add some helpers to make.bat to facilitate making release builds.
New features:
1) Release target that checks for both cuda 7.5 and 8 with WITH_CYCLES_CUDA_BINARIES=ON and CYCLES_CUDA_BINARIES_ARCH=sm_20;sm_21;sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61 options set.
2) Option to switch between x86 and x64 builds, the default remains (auto detect the architecture) but can be overridden.
3) Option to switch between vs12(2013) and vs14(2015) default is 2013.

Reviewers: juicyfruit, sergey

Reviewed By: sergey

Tags: #platform:_windows

Differential Revision: https://developer.blender.org/D2180
2016-09-15 06:27:58 -06:00
52181a26c6 Depsgraph: Avoid some false-positive time dependencies of scripted drivers
This was quite weak to consider all scripted expression to be time-dependent.
Current solution is somewhat better but still crappy. Not sure how can we make
it really nice.
2016-09-15 12:14:54 +02:00
ddbbcbbbba Fix filebrowser not getting back to valid dir in Release builds.
Stupid mistake wrapping path validation code inside a BLI_assert, which means it was
only called in Debug builds...

Found by Sergey, thanks.

Should be backported to 2.78.
2016-09-15 12:12:19 +02:00
a8ed9144a3 Fix crash in some cases when deleting particle systems.
Those 'never null' ID pointers are really a PITA to handle... luckily we don't have much of those around!

Found by Sybren, thanks.

Should be backported to 2.78.
2016-09-15 11:50:56 +02:00
a2a5ae5b54 Fix Py's IDs user mapping: do not consider ShapeKeys' from here.
This is internal pointer helper for scene evaluation and tools, though exposed to bpy API,
it can give false 'dependency cycles' in bpy.data.user_map() results.

That's followup to rBe007552442634 really, both should be backported to 2.78
2016-09-15 11:28:53 +02:00
21e9db9cf1 OpenGL render: Skip GP passes if viewport has GP visibility disabled 2016-09-15 11:23:11 +02:00
e007552442 Fix Py's IDs user mapping: do not consider proxy_from here.
This is internal pointer helper for scene evaluation and tools, it's not exposed to bpy API anyway,
and can give false 'dependency cycles' in bpy.data.user_map() results.

Found by sybren in his Splode work.
2016-09-15 10:16:54 +02:00
fe1342ab9b Use temp .blend file copybuffer for pose copy-paste
Uses similar way of storing temp data as object copy paste, just
uses different read entrypoint which does not modify current bmain.

This gives ability to easily copy-paste poses from one blender to
another one.

Hopefully doesn't introduce user-measurable differences.

Request from Peer here in the studio.

Reviewers: mont29

Reviewed By: mont29

Subscribers: hjalti, fsiddi

Differential Revision: https://developer.blender.org/D2229
2016-09-15 09:51:15 +02:00
ec54a08d30 Revert "Cycles: Tweak empty boundbox children"
This reverts commit ecbfa31caa.

Original commit broke logic in nodes re-fitting. That area can
access non-existing children momentarely. Not sure what would
be best solution here, for now simply reverting the change/
2016-09-15 09:39:33 +02:00
fe28e350e9 Fix T49179: Parts of mesh disappear with adaptive subdivision
Problem was zero length normal caused by a precision issue in patch evaluation.
This is somewhat of a quick fix, but is better than allowing possible NaNs to
occur and cause problems elsewhere.
2016-09-14 19:53:55 -04:00
b9d1852c5a Cycles: Deduplicate light pass code 2016-09-14 20:09:37 +02:00
b459d9f46c Cycles: Stop lamp sampling if the lamp isn't visible
Both spot and area light have large areas where they're not visible.
Therefore, this patch stops the light sampling code when one of these cases (outside of the spotlight cone or behind the area light) occurs, before the lamp shader is evaluated.
In the case of the area light, the solid angle sampling can also be skipped.

In a test scene with Sample All Lights and 18 Area lamps and 9 Spot lamps that all point away from the area that the camera sees, render time drops from 12sec to 5sec.

Reviewers: brecht, sergey, dingto, juicyfruit

Differential Revision: https://developer.blender.org/D2216
2016-09-14 19:45:12 +02:00
aae2cea28d Cycles: Also support the constant emission speedup for mesh lights
Reviewers: brecht, sergey, dingto, juicyfruit

Differential Revision: https://developer.blender.org/D2220
2016-09-14 18:53:35 +02:00
51e8c167f4 Fix T49352: Blender's file browser do not display previews.
Own stupid 'logical inversion' mistake in rBa2677100fef06af.
2016-09-14 17:26:42 +02:00
804f6bf31e fix Mac build with Xcode 8
Small issues in GHOST
- use NSApplicationDelegate protocol for our app delegate
- make sure NSApp is initialized before using
(cherry picked from commit df7be04ca6)
2016-09-14 16:35:01 +02:00
30a7e75089 Cleanup: Fix epic indent failure in previous commit :/ 2016-09-14 16:18:36 +02:00
3525fd605a Fix missing PaintCurves list in bpy.data
Minimal list features for now, no add/remove stuff, that we can add later...

Reported by sybren.

Should be safe for 2.78.
2016-09-14 16:14:32 +02:00
3b6ce4123c Fix memory leak in copy pose operator 2016-09-14 15:57:04 +02:00
ce952fd36e Fix T49342: TypeError when autocompleting bpy.app.something.
Regression from rB036c006cefe471. We can't use self here, self is bpy.app, not pydescriptor of python path getsetter...

So for now, do not try to replace getsetter by actual value in bpy.app's dict,
just return static var generated on first run.

Should be safe for 2.78.
2016-09-14 15:54:54 +02:00
ab6a3dd6c1 Fix T49341: Bad motion blur behavior in Cycles when using Speed effect in Sequencer
Cycles was thinking it always rendering integer frame, which is not correct.
2016-09-14 14:59:39 +02:00
66d4006f51 Attempt to fix broken path remapping in own rB443b3ca9b9cb. 2016-09-14 12:58:01 +02:00
48c4a5a4dd CMake: decouple WITH_CYCLES_OPENSUBDIV from WITH_OPENSUBDIV, and enable on OS X.
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2227
2016-09-14 12:02:44 +02:00
443b3ca9b9 Fix two issues related to 'partial' .blend files:
I) Filename was not put in temp Main generated to save selected data only,
this was breaking readcode when trying to open partial file, leading to missing
filename in final loaded Main data.

II) Read code would confuse partial .blend files with Undo ones, when they had no screen in them
(which happens to 99.999% of partial .blend files I guess).

Reported by @sybren, thanks.

Should be safe enough for 2.78 release.
2016-09-14 11:35:16 +02:00
a2677100fe FileBrowser: Always do full cache refresh while we are still listing...
Does not seem to be a problem with embeded filelisting code, but was breaking with some experimental asset engines.
2016-09-13 19:02:27 +02:00
0de69e56b4 Cycles: Implement threaded SVM nodes compilation
The title says it all actually. From tests with barber shop scene here
gives 2-3x speedup for shader compilation on my oldie i7 machine. The
gain is mainly due to textures metadata query from jpeg files (which
seems to requite de-compression before metadata can be read). But in
theory could give nice improvements for scenes with huge node trees
as well (i'm talking about node trees of complexity of fractal which
we had reports about in the past).

Reviewers: juicyfruit, dingto, lukasstockner97, brecht

Reviewed By: brecht

Subscribers: monio, Blendify

Differential Revision: https://developer.blender.org/D2215
2016-09-13 13:46:49 +02:00
f38f787448 Fix bpy.data.user_map() ignoring unused datablocks.
Should be backported to 2.78.
Found by Sybren here in studio, thanks!
2016-09-13 13:23:03 +02:00
d82710cc02 Outliner: Report linked datablock edit failure when trying to rename linked data in outliner 2016-09-13 13:12:44 +02:00
7f67885526 Fix T49323: Ineffective bone roll calculation with low rig scale
The code was expecting vector to be normalized, however after
applying inverted object matrix it was possible to have scale
applied to it.
2016-09-13 12:38:47 +02:00
0307369211 Fix T49336: Outliner allows to edit restrict flags for linked objects 2016-09-13 11:33:55 +02:00
ecbfa31caa Cycles: Tweak empty boundbox children
The idea here is to make assert failure to fail sooner on an incorrect
node address rather than later with stack overflow.
2016-09-13 11:05:11 +02:00
52038fd8c7 Fix T49290: Specific .blend with hair crashes in MacOS 2.78 RC1 on render
The issue was caused by some false-positive empty non-AABB intersection.
Tried to tweak it a bit so it does not record intersection anymore.

Hopefully will work for all platforms. Tested here on iMac and Debian.
2016-09-13 10:59:48 +02:00
56c798ee62 API doc update script: Fix generated zipfile name, was broken in 'release' case... 2016-09-13 08:39:01 +02:00
Julian Eisel
620724d5e2 Fix error in --debug-handlers printing
Was missing else block (and also missing newline character). Caused by e672e7a070.
2016-09-12 18:39:25 +02:00
91eb1c2e2a Fix code which was commented by accident
Well, more like some last-minute checks which i did not see before commit.

Let's increase commit ratio!
2016-09-12 16:29:54 +02:00
ad40ae1e06 Fix T49327: Cycles OSL Mode: RGB Curves node only outputs gray scale images
To be backported to 2.78 release.
2016-09-12 16:14:40 +02:00
d15899cca7 Cycles: Fix compilation error after recent commits 2016-09-12 16:06:50 +02:00
98c7e75897 Graph editor: Add channel option to make it persistent on display
The idea is to allow certain animation channels to be always visible in
animation editors. So, for example, one can pin Camera animation to the
editor so it is always possible to refine/tweak camera animation when
animating something else in the scene.

There is probably some more polishing required, and some current
limitations could be solved in the future but should be a good starting
point already.

Currently only works for object without recursing into deeper datablock
(so for example, it's not possible to pin object material animation).

Studio request by Colin Levy.
2016-09-12 15:39:40 +02:00
0f8f494d63 Fix T49296, assert failure in Bevel code.
The mesh interpolation function failed to fill a fractions-of-the-way
array properly when the distances are very small but nonzero.
2016-09-12 07:29:31 -04:00
fb2c435d86 Cycles: Fix wrong SSS in combination with hair on AVX2 platform
Not sure why exactly that happened, need a closer look.
2016-09-12 12:48:35 +02:00
91e0a16f2f Cycles: Use XDG's .cache folder for cached kernels
Basically just moves cached kernels from ~/.config/blender/BLENDER_VERSION to
~/.cache/cycles/kernels. This has following benefits:

- Follows XDG specification more closely,
  not as if it's totally crucial or measurable by users, but still nice.

- Prevents unexpected sizes of config folder, makes disk space used in more
  predictable for users way.

- Allows to share kernels across multiple Blender versions,
  which makes it easier debugging at the times close to release.

- "Copy Previous Settings" operator will no longer be copying possibly
  gigabytes of cached kernels, which used to lead to really nast disk usage
  and annoying delays of copying settings.

- In the future we can have some smart logic to clear old unused cached
  kernels.

Currently only done for Linux and OSX. Windows still follows old "cache"
folder logic, but it's not really important for now because we don't
support kernel compilation on this platform yet.

Reviewers: dingto, juicyfruit, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2197
2016-09-12 09:39:05 +02:00
49df5d0980 Cycles: Fix shading and crashes resulting from constant folding on displacement
Constant folding was removing all nodes connected to the displacement output
if they evaluated to a constant, causing there to be no valid graph for
displacement even when there was displacement to be applied, and sometimes
caused crashes.
2016-09-11 13:49:34 -04:00
013b46d6bd Cycles: Replace object index hack with actual checks for SD_TRANSFORM_APPLIED
Using ones complement for detecting if transform has been applied was confusing
and led to several bugs. With this proper checks are made.

Also added a few transforms where they were missing, mostly affecting baking
and displacement when `P` is used in the shader (previously `P` was in the
wrong space for these shaders)

Also removed `TIME_INVALID` as this may have resulted in incorrect
transforms in some cases.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2192
2016-09-11 13:49:05 -04:00
92a2c49aab Cycles: Fix bump mapping to use object space when used with true displacement
Bump mapping was happening in world space while displacement happens in object
space, causing shading errors when displacement type was used with bump mapping.

To fix this the proper transforms are added to bump nodes. This is only done
for automatic bump mapping however, to avoid visual changes from other uses of
bump mapping. It would be nice to do this for all bump mapping to be consistent
but that will have to wait till we can break compatibility.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2191
2016-09-11 11:20:21 -04:00
ac2fe8312b Revert "GPencil: Add IFACE_ macro to some strings"
This reverts commit b50a5b92c1 because BKE_report functions are already automatically handled by translation system.
2016-09-11 13:06:37 +02:00
b50a5b92c1 GPencil: Add IFACE_ macro to some strings 2016-09-11 12:28:09 +02:00
347d759c62 GPencil: Change interpolate stroke factor
Now the factor works similar to other Blender areas to make the factor
more consistent for artists. The value 0% means equal to original
stroke, 100% equal to final stroke (50% means half way). Any value below
0% or greater than 100% create an overshoot of the stroke.
2016-09-11 12:28:09 +02:00
96f28f9b50 [CMAKE/Platform/Windows] Only perform version check if the actual compiler is MSVC 2016-09-10 17:58:56 -06:00
Kai Mach
56064b508b NDOF: allow view movement for modal border and circle select operators.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2167
2016-09-10 23:37:53 +02:00
Dmitry Dygalo
9fc1cfc4f1 Fix undefined variable on errors in Cycles ctests.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2201
2016-09-10 23:04:14 +02:00
d8681c99c4 Fix OpenSubdiv related buffer overrun with multiple FVar channels.
The existing code uses the input value count of the first channel
for all of them. If the first channel is the largest, it leads to
a crash-causing buffer overrun in memcpy below. Likely this was
left since the time when only one channel was supported.

As a crash fix, probably should go into 2.78
2016-09-10 21:15:52 +03:00
037df2aaa6 Fix T49303: Fix T49314: More issues with new handling of X11 shortcuts.
This commits changes two things:
* It adds more keysyms preferably taken from XLookupKeysym than XLookupString (namely, all numpad ones).
* It falls back to keysyms from XLookupKeysym in other cases, when XLookupString does not produce anything we know of.

Finding the correct balance here is far from easy, but think we are comming rather close to it now...
2016-09-10 12:38:12 +02:00
2820ab5a8f Cleanup: Indentation 2016-09-09 13:08:21 +02:00
4c1d40d87e Cycles: Add overall timing log to SVNShaderManager 2016-09-09 12:27:27 +02:00
ff1ba0861d Fix missing 'prop_required' flags in some ID RNA funcs.
Not critical, but would rather have this in 2.78 (for API doc reasons mostly).
2016-09-09 12:00:23 +02:00
70e7c0829e Cycles: Deduplicate QBVH node packing across BVH build and refit 2016-09-09 11:32:05 +02:00
d205bc3059 Fix/Workaround T49297: Crash related to custom data draw (Blender with ASAN)
Root of the issue is that active render index became wrong. This is the actual
thing to be fixed, but as usual this is quite tricky to reproduce. Since such
bad situation might have happened more and fix isn't really difficult or
intruisive let's avoid crash for now.

Can be revisited once we figure out root of the issue.

Nice for 2.78 release.
2016-09-09 10:57:25 +02:00
b27ba26b44 Fix T49299: Removing offset object in modifiers doesn't update mesh.
Own fault in new ID management work, thought rebuild the DAG itself was
enough to actually update whole scene, but we actually need to tag datablocks
for update as well, when we change (or remove) one of their ID pointers...
2016-09-09 10:44:49 +02:00
2fe0125fcd Smoke viewport: remove dead code.
OCD commit, but cleans the code a bit:
- the first `if 0` block was supposed to draw collision objects but is
vastly outdated as most of the SmokeCollisionSettings member variables
were removed a few years ago and collision objects are drawn like other
objects anyway. Also it was committed already commented out back in
2009.
- the second `if 0` block was doing pretty much the same thing as the
few lines above it.
2016-09-09 06:05:58 +02:00
0053a91165 Alembic streaming: initial support to interpolate data between frames.
Pretty self-explanatory, allows to get some slow motion type of playback
and animations.
2016-09-09 05:59:20 +02:00
631af9f930 Alembic: add option to triangulate meshes upon export. 2016-09-09 05:30:43 +02:00
78ea06fea4 Alembic, cleanup: split archive opening code in their own classes and
files.

Also helps keeping platform specific code in separate from the rest of
the code.
2016-09-09 05:06:06 +02:00
1558f5b660 Cycles: Don't run full shader evaluation for constant emission lamps
Most of the time, Lamps in Cycles are just a constant emission closure, no texturing etc. Therefore, running a full shader evaluation is wasteful.
To avoid that, Cycles now detects these constant emission shaders and stores their value in the lamp data along with a flag in the shader.
Then, at runtime, if this flag is set, the lamp code just uses this value and only runs the full shader evaluation if it is neccessary.

In scenes with a lot of lamps and with "Sample all direct/indirect" enabled, this saves up to 20% of rendering time in my tests.

Reviewers: #cycles

Differential Revision: https://developer.blender.org/D2193
2016-09-09 01:39:09 +02:00
6de08f6cd1 Cycles: Fix regular BVH nodes refit
For proper indexing to work we need to use unaligned node with
identity transform instead of aligned nodes when doing refit.

To be backported to 2.78 release.
2016-09-08 15:08:35 +02:00
27e2317513 Cycles: Add asserts to BVH node packing 2016-09-08 15:03:55 +02:00
3598a3d1d5 Cycles: Cleanup: line wrapping 2016-09-08 14:26:10 +02:00
45f833c21d Fix T49283: Crash in BKE_ptcache_make_particle_key.
This is really hack-fix actually, not sure why `get_pointcache_keys_for_time()` seems to assume
it will always find key for given part index at least for current frame, and whether this assumption
is wrong or whether bug happens elsewhere...

Anyway, this is to be wiped out in 2.8, so no point loosing too much time on it, for now merely
returning unchanged (i.e. zero'ed) ParticleKeys in case index2 is invalid. Won't hurt anyway,
even if this did not crash in release builds, would be returning giberish values.
2016-09-08 10:24:56 +02:00
a2e8b7e216 Fix compilation error: Shadowing of variable 2016-09-08 09:40:25 +02:00
a6f733310b Fix strict compiler warnings 2016-09-08 09:39:18 +02:00
ace92854b2 Fix compilation error: missing forward declaration 2016-09-08 09:38:24 +02:00
18ae1504ea Fix T49286: Compilation error with XCode 7.0
Weirdly enough, this version of XCode seems to have static_assert()
even when NOT using C++11. This is totally weird and counter intuitive
since static_assert() is supposed to be C++11 onlky feature.

Can XCode stop using future, please? :)
2016-09-08 09:27:51 +02:00
7e7a9d146c Cycles: Fix OpenCL speed regression introduced with the improved bump mapping
The two SVM nodes added with e7ea1ae78c caused a slowdown on AMD cards when rendering with OpenCL, whether displacement was used or not.
In the Barcelona Pavillon scene on a RX480, this would cause a 12% slowdown.

Therefore, this commit adds a additional flag for feature-adaptive compilation so that the new SVM nodes are only enabled when they are needed (Node tree connected to the Displacement output and Displacement type set to Both).

Also, the nodes were also added to shaders when the Displacement Type was set to Bump (the default), which was unneccessary and is fixed now.

Thanks to linda2 on IRC for reporting and testing and to maiself for help with the displacement shader code.

This fix might be relevant for 2.78, but it should be tested further before including it.
2016-09-08 01:33:41 +02:00
afd3a55e3e GPencil UI: Ensure "Move to Color" can be found from the colors panel dropdwon too 2016-09-08 01:42:16 +12:00
19e6321ac0 GP Interpolation: Mark created frames as being "breakdowns"
This brings this tool more in line with the Breakdowner for armature animation,
with which it shares many commonalities.
2016-09-08 01:24:02 +12:00
4b65662483 Fix: GPencil drawing sessions now respect limits for maximum undo steps
When drawing with Grease Pencil "continous drawing" for a long time
(i.e. basically, drawing a very large number of strokes), it could be
possible to cause lower-specced machines to run out of RAM and start
swapping. This was because there was no limit on the number of undo
states that the GP undo code was storing; since the undo states grow
exponentially on each stroke (i.e. each stroke results in another undo
state which contains all the existing strokes AND the newest stroke), this
could cause issues when taken to the extreme.
2016-09-08 01:14:53 +12:00
5b42e07e18 Code Cleanup: Deduplicate undo node freeing code 2016-09-08 01:14:52 +12:00
bcc863993a Fix T49273: Crash during access to dupli weights at launch time.
See commit's comments for details, but this boils down to: do not try to use
purely runtime cache data as a 'real' ID pointer in readcode, it's likely
doomed to fail in some cases, and is bad practice in any case!

Thix fix implies dupliweight's object will be invalid until first scene update
(i.e. first particles evaluation).
2016-09-07 12:48:22 +02:00
1263965f83 GPencil: New interpolate strokes operators
Two new modal operators to create a grease pencil interpolate drawing
for one frame or a complete sequence between two frames.  For drawing
the temporary strokes in the viewport, two drawing handlers have been
added to manage 3D and 2D stuff.

Video: https://youtu.be/qxYwO5sSg5Y

The operator shortcuts are Ctrl+E and Ctrl+Shift+E. During the modal
operator, the interpolation can be adjusted using the mouse (moving
left/right) or the wheel mouse.
2016-09-07 10:02:52 +02:00
008afa446f OpenSubdiv: Support multiple materials drawing in Cycles textured view
Consider for inclusion into 2.78.
2016-09-07 09:48:13 +02:00
d0e7c7a032 Add XK_ISO_Left_Tab to ghost's known X11 keydefines... 2016-09-06 22:32:17 +02:00
f298c9ea1a Cleanup previous commit... 2016-09-06 18:01:14 +02:00
87b3faf557 GHOST X11 keyboard: Attempt to fix issues with modifier keys on some systems.
Could not reproduce it here, but since users having the issue claims it comes from
rB16cb9391634dcc50e, let's try to use again ugly `XLookupKeysym()` for those modifier keys too...
2016-09-06 17:54:40 +02:00
049ed1f4e7 [cmake/cpack] allow override of package name
Cpack generates a standard filename with git information in it, which might not always be wanted for release builds, this patch adds an option to override that default filename.

Reviewers: sergey, juicyfruit

Reviewed By: juicyfruit

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

ammended to fix: wrong variable name in main CMakeLists.txt
2016-09-06 08:47:45 -06:00
c02f9bc569 Revert "Depsgraph: Prioritize evaluation of the new scheduled nodes"
This reverts commit 9444cd56db.

This commit caused some flickering in the bones when swapping IK to Fk.

While it's unclear why such change caused any regressions, let's revert
it to unlock the studio.
2016-09-06 16:45:03 +02:00
abd54f1ed2 [cmake/cpack] allow override of package name
Cpack generates a standard filename with git information in it, which might not always be wanted for release builds, this patch adds an option to override that default filename.

Reviewers: sergey, juicyfruit

Reviewed By: juicyfruit

Differential Revision: https://developer.blender.org/D2199
2016-09-06 07:22:04 -06:00
b40d1c1903 Fix T41883: Strip keyframes not respected for scenes rendered by other scenes 2016-09-06 14:08:11 +02:00
e3e8ce08a6 Add script which scales splash screen down
Based on reading documentation around. This particular version
is based on the ImageMagic documentation which could be found
there:

  http://www.imagemagick.org/Usage/filter/
  http://www.imagemagick.org/Usage/filter/nicolas/

Current filter is based on measuring mean error with the current
splash screen and choosing combination of parameters which
gives minimal mean error.
2016-09-06 12:27:58 +02:00
14e47472fe cleanup: macro whitespace \ alignment
Gotta be careful mixing tabs & spaces. This commit uses 4-space indent
to align the line continuation markers.

Follow-up to 3b52c4056a
2016-09-05 13:30:57 -04:00
8f509698d7 Fix cast shadows (material option) in the viewport
Fix cast shadows options (in material tab) not working in the viewport.
An off-by-one error. See D2194 for more.

Committing for Ulysse Martin (youle) who found & fixed this.
2016-09-05 13:05:47 -04:00
56d2f4c20a Fix T49252: Crash when image textures used with true displacement 2016-09-05 12:57:33 -04:00
Julian Eisel
718bf8fd9d UI: Ctrl+Tab and Ctrl+Shift+Tab to cycle through space context "tabs"
In User Preferences, Properties Editor and toolshelf, Ctrl+Tab and Ctrl+Shift+Tab now activates the next or previous space context (or category in case of toolshelf tabs), respectively.

For Properties Editor such functionality was completely missing, only toolshelf allowed cycling using ctrl+mousewheel (or only mousewheel while hovering tab region). Ctrl+Tab and Ctrl+Shift+Tab are common web browser shortcuts, so they're a reasonable choice to go with.
Reaching the first/last item doesn't cause the cycling to stop, we continue at the other end of the list then. (I didn't add this to Ctrl+Mousewheel toggling in toolshelf since I wanted to keep its behavior unchanged.)

We could get rid of (Ctrl+)Mousewheel cycling in toolshelf, but this may break user habits.

The cycling happens using a new operator, UI_OT_space_context_cycle, for toolshelf tabs it's hardcoded in panel handling code though.
Generalized rna_property_enum_step a bit and moved it to rna_access.c to allow external reuse.

Reviewed By: venomgfx
Differential Revision: https://developer.blender.org/D2189
2016-09-05 17:28:41 +02:00
922aefba25 OpenSubdiv: Fix missing ORCO when enabling OSD but having dependency to the geometry
Was causing huge viewport lags.

Reported by angavrilov in IRC, thanks!

Safe and nice for 2.78.
2016-09-05 17:08:09 +02:00
a31eca3fdd Fix T49251: moving smoke domain with additional resolution causes crash.
This is a bug in the multithreaded task manager in negative value range.

The problem here is that if previter is unsigned, the comparison in the
return statement is unsigned, and works incorrectly if stop < 0 &&
iter >= 0. This in turn can happen if stop is close to 0, because this
code is designed to overrun the stop by chunk_size*num_threads as
the threads terminate.

This probably should go into 2.78 as it prevents a crash.
2016-09-05 15:50:12 +03:00
c51cfbbc7f Fix own mistake in recent rB8b2a45052093, broke saving render results as images in some cases.
Reported by sebastian_k over IRC, thanks.

To be backported to 2.78.
2016-09-05 13:13:49 +02:00
1df4f792db Attempt to fix compilation error with static boost on certain platforms
This was reported in T49231.
2016-09-05 13:10:19 +02:00
33fcd0444d Fix T35333: Update some WM/UI API functions docstrings.
Based on patch by @codemanx, but with slightly less verbose descriptions.

More detailed behavior etc. rather belongs to doc/python_api/examples/bpy.ops.x.py imho.
2016-09-05 11:04:33 +02:00
7f682dd704 Fix T49226: Incorrect Material viewport shading of Cycles Normal Map node in Edit mode for an object with Array modifier
Was incorrect indexing done in the array. Caused by 5abae51.

Not sure why it needed to be changed here, but array here is supposed to be
a loop data, so bringing back loop index as it originally was. The shading was
wrong in edit mode with BI active as well (so it's not like it's needed for
BI only).

Patch in collaboration with Alexander Gavrilov (angavrilov), thanks!

Should be double-checked and ported to 2.78.
2016-09-05 10:20:43 +02:00
3b52c4056a Fix glUniform called from glBegin/glEnd blocks
Was causing some invalid operations in OpenGL.

After more testing should be fine for 2.78.
2016-09-05 10:14:07 +02:00
062732905a Fix T49220: Vertex paint doesn't work with OpenSubdiv
It's a bit tricky to align vertex color data between Blender and OpenSubdiv
so for now we simply disable OpenSubdiv in the paint modes.

Safe for 2.78.
2016-09-05 10:14:07 +02:00
83ae39cc2e CMake: Skip addons_contrib for release candidate builds
Nowadays release candidates are supposed to be as close to the final
release as possible.

Safe for 2.78 release branch.
2016-09-05 10:14:07 +02:00
e35a87c5ff API doc: add new pure-rsync py script to update API doc on Blender server.
The other one (sphinx_doc_gen.sh) needs an ssh account on the server to work - and I hate bash, too! :P
2016-09-05 09:38:53 +02:00
f50ddbf60a We are in bcon again, so master goes back to alpha in release cycle. 2016-09-05 09:23:49 +02:00
0bd87b1976 Cycles: Fix unreported - Missing node group for the Camera Node
Thanks to linda2 for reporting in IRC.
2016-09-05 04:08:51 +02:00
569a13f4b2 Alembic: fix parenting issues when an object has multiple curves/points
subobjects.
2016-09-05 03:46:25 +02:00
2024cd09a0 Fix T49249: Alembic export with multiple hair systems crash blender
Crash was due to a name collision in Alembic objects caused by the fact
that names derive from the one of the Blender object. An object having
multiple particles system would thus give its name to various
subobjects.

Now use the name of the particles system for the Alembic object.
2016-09-05 03:32:36 +02:00
Julian Eisel
0351e701ce Correction to previous commit (PEP 8) 2016-09-05 00:55:44 +02:00
Julian Eisel
2b240b0430 Combine all Proportional Editing options under one menu
Image of the result of this patch:

{F352849}

The only thing different from the above image and this patch is I added a colon after "Falloff" after I took the screen shot.

Reviewers: Severin, meta-androcto

Subscribers: plyczkowski

Tags: #bf_blender, #user_interface

Maniphest Tasks: T33436

Differential Revision: https://developer.blender.org/D2195
2016-09-05 00:27:11 +02:00
Julian Eisel
c126a5179f Fix menu drawing printing 'unknown operator' warning when building without WITH_BULLET 2016-09-05 00:11:12 +02:00
e76e8fcdcc Fix a few OpenCL compiler warnings. 2016-09-03 23:06:12 +02:00
95cb714511 fix: not initialised variable can crash blender (related to modifiers with cage editing enabled) 2016-09-03 18:01:04 +02:00
16cb939163 Fix T48911: Fix T48847: Issues with some shortcuts on non-US latin keyboards, and with non-first layouts.
This is a tentative fix, own tests here seem to be working OK,
but don't think it's safe enough to be backported to 2.78.
2016-09-03 17:50:56 +02:00
6c0307f888 Fix T49228: Separate by material, materials dissappear after reload.
Yet another mismatch where code would decrease usercount (of Material here) but never increase it again
when re-assigning the datablock...
2016-09-03 12:51:50 +02:00
27c64e3f46 Fix T49229: ID user decrement error when deleting group instance twice.
Another great example of inconsistency in usercount handling - dupli_group was considered
as refcounted by readfile.c code (and hence by library_query.c one, which is based on it),
but not by editor/BKE_object code, which never increased group's usercount when creating
an instance of it etc.

To be backported to 2.78.
2016-09-03 11:47:17 +02:00
ad400006d3 Point submodules to latest master branches
We did not update them for really long time and the currently used
hashes are quite old and probably wouldn't work without manually
updating all submodules.

Not as if it's something totally crucial (we ask to update submodules
all the times and that's what `make update` does) but updating hashes
will save some cloning/checkout time.
2016-09-02 11:44:22 +02:00
98d28a8a6c Blender 2.78 commit!
Includes:

- Version bump to 2.78
- Doxy file update
- New splash screen
- Wrapped some do_versions with version check
- Updated template to use proper font

After poking around a lot it seems Droid Sans was used during 2.7x series.
(or at least difference between using this font and comparing to previous
splash screens gives none visible difference).
2016-09-02 11:37:25 +02:00
b399a6d33f Fix T49180: Cycles MIS Map for Animated Environment Texture Movie Doesn't Update on Frame Change
Not really ideal fix at all, but we are at RC today, so better to play really safe.
2016-09-02 09:58:41 +02:00
fce8f24628 Cycles: Silence strict compiler warning in release build 2016-09-02 09:14:34 +02:00
8b2a450520 Fix T49222: Image Save settings are overridden by the File Save Screen ones.
There were two inconsistencies in how 'save image' op initiated its settings:
* It would always use ImBuf->planes value.
* It would always use Image views settings.

Both of those settings should come from scene->r.im_format (as everything else)
when saving render/compo result...
2016-09-02 08:37:57 +02:00
e7ea1ae78c Cycles microdisplacement: Improved automatic bump mapping
Object coordinates can now be used in the displacement shader and will give
correct results, where as before bump mapping was calculated from the displace
positions and resulted in incorrect shading.

This works by evaluating the shader in two parts, first bump then surface, and
setting the shader state to match what it would be if the surface was
undisplaced for the bump shader evaluation. Currently only `P` is set as if
undisplaced, but other shader variables could be set as well, such as `I` or
`time`. Since these aren't set to anything meaningful for displacement I left
them out of this patch, we can decide what to do with them separately.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2156
2016-09-01 22:45:49 -04:00
62aecbdac1 Cycles: Store undisplaced coordinates for meshes when needed
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2156
2016-09-01 22:45:29 -04:00
9f1c42392e Cycles: remove duplicate shader storage
Storing multiple copies of a shader was needed when the displacement method was
a mesh option and could be different for each mesh. Now that its a shader option
this is unnecessary.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2156
2016-09-01 22:44:42 -04:00
f0159d1d48 Fix T49215 2016-09-01 14:00:20 -06:00
159ac3f638 Fix T49224: Crash due to dangling value in 'Object.proxy_from' pointer.
Why/how this may happen remains a mystery, so for now simply clearing this runtime-only
pointer on Object reading...
2016-09-01 21:16:54 +02:00
ff57589afc Curve Fitting: correct initial handle sign
In practice the initial values are almost never used.
2016-09-02 02:58:34 +10:00
2d589e8549 Math Lib: avoid char > int conversion w/ line plot 2016-09-02 02:54:16 +10:00
Julian Eisel
96dd1943af Fix crash calling wm.open_mainfile from menu with --debug-memory enabled
Didn't do any bisecting, but guess it's caused rBb54e95a5c8dcb7 (2.74 is fine, 2.75 isn't).
I think this fix makes some other hacks redundant but need to check details (will do when we're back to bcon1 to avoid regressions).
2016-09-01 16:55:01 +02:00
Julian Eisel
e240025276 Fix T49199: Combination of dialog + wm.open_mainfile causes crash
Issue was that the wm.open_mainfile OP caused all handlers to be removed and since rB45592291 cancelled (which is correct in general), the menu that triggered the OP should not be cancelled though.
Not sure if this is a nice fix or not, it's however the safest fix I found. A different fix would be to call UI_popup_block_close before WM_operator_call_ex (in dialog_exec_cb), but not sure how safe this is and want to further investigate if it makes other hacks/fixes redundant.

There's still a crash with --debug-memory that confused the heck out of me (since I always have --debug-memory enabled), but I'll commit fix for that separately.
2016-09-01 16:37:45 +02:00
40d072ca7f D2184 Stamp: Make drawing stamp labels optional.
When using metadata stamping, it's often handy to have "Camera" in
front of the camera name, "Marker" in front of the marker text, etc.,
but sometimes those get in the way. This patch allows an artist to
turn those labels on/off.

Reviewed by: sergey, mont29, venomgfx
2016-09-01 15:45:54 +02:00
718f8ae141 pydoc: added missing 'compress' parameter to b.t.BlendDataLibraries.write 2016-09-01 15:30:05 +02:00
9e39488fa6 OpenSubdiv: Fix missing object ORCO when Subsurf uses OpenSubdiv but disabled fore viewport 2016-09-01 15:27:08 +02:00
f7263b8b1a Cleanup: Reduce amount of misleading indentation
Was polluting compile output too much.
2016-09-01 12:14:16 +02:00
475b43ad4a Fix T49175: GLSL material crash with environment maps. 2016-08-31 20:13:08 +02:00
bfd8da753d Fix T49210: Issue with User Count on Images in some shader nodetrees when rendering previews
Our usercount handling was really... infuriating :|

Here, localization (i.e. 'shalow' copy that should not touch to usercounts) was incrementing
usercounts of the sole Textures IDs of lamps and worlds (on the weak and fallacious pretext
that related BKE_free... functions would decrement those counts)... Seriously...

So now, localize funcs do not increment any usercount anymore (since matching BKE_free... ones do
not decrement any either), and we do not call anymore that stupid unlink when freeing temp
localized copies of lamps/materials at end of preview generation.

Note that we probably still have a lot to do to cleanup that copy/localize code, pretty sure
we can dedpulicate a lot more.
2016-08-31 16:48:27 +02:00
8fb9f2dbe9 [Windows] Add support for code signing the final binaries.
The option is controlled with the WITH_WINDOWS_CODESIGN option and needs:

- Signtool must be found on the system, the standard windows sdk folders will be searched for it.
- The path to the pfx file (WINDOWS_CODESIGN_PFX)
- The password for the pfx , this can either be set by the WINDOWS_CODESIGN_PFX_PASSWORD variable but given that ends up in CMakeCache.txt (which might be undesirable) there is a backup option of setting the PFXPASSWORD environment variable on the system.

Reviewers: sergey, juicyfruit

Reviewed By: juicyfruit

Tags: #bf_blender, #platform:_windows

Differential Revision: https://developer.blender.org/D2182
2016-08-31 06:26:23 -06:00
b06a70323c Cycles: don't crash if OSLRenderServices::osl_ts is unset 2016-08-30 20:50:22 -04:00
23e3b9f35b Correct render pass identifier usage in toolitps 2016-08-30 22:08:09 +02:00
c5a66b7872 Fix stupid mistake in previous commit 'cleanup' part.
Thanks to sergey for spotting it.
2016-08-30 21:09:33 +02:00
a0cdebde11 Fix bad usercount handling of materials in BKE_mesh_new_from_object().
Curves and meshes (when no modifier application required) would increase their material usercount twice.

Not sure how/why it worked in previous code, but with new, stricter ID handling we need more
careful check of ID 'ownership' handling.

Reported by Sergey over IRC, thanks.
2016-08-30 20:38:53 +02:00
7aedd0e6b0 Cycles: Fix calculation of normals for subdivision meshes
Not sure what happened here. Will have only effected Cycles standalone with
linear subdivision in use.
2016-08-30 12:24:57 -04:00
959b06b3c8 Fix type mismatch causing the buffer overflow in D810 2016-08-30 17:15:26 +03:00
43dcfcb27a Fix T49201: Mesh with OpenSubdiv subsurf and a texture disappears in Material viewport mode 2016-08-30 12:12:46 +02:00
c376878e54 Fix T49187: inconsistent Normal Map node output for backfacing polygons.
There basically are two issues here: in smooth mode (and all non-tangent
normal map types) it doesn't invert the normal for backfacing polys;
on the other hand for flat shaded tangent type it is inverted too soon.

This fix does a brute force correction by checking the backfacing flag.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Differential Revision: https://developer.blender.org/D2181
2016-08-30 12:48:59 +03:00
3a0c0c1b54 Fix node editor to display node group names in the bottom left corner.
Currently it pointlessly repeats the material name there, separated by
slashes. That obviously should display the nested group path instead.
2016-08-30 12:32:31 +03:00
47b87e1f3b Usual i18n/UI messages fixes... 2016-08-30 10:43:37 +02:00
de64f66a2f Fix T49158: Take II, some more untranslated UI messages... 2016-08-30 10:43:37 +02:00
062cf99fd1 Cleanup: Indentation 2016-08-30 10:29:53 +02:00
5f14bc1b47 GPencil: Fix segment fault when undo
When undo in UV/Image editor and press ESC key, there was segment fault
in Toolsettings because the reference was missing. Now the toolsetting
is loaded from context and not from local operator data.
2016-08-29 22:17:57 +02:00
fa092da377 GPencil: Replace strcpy by BLI_strncpy 2016-08-29 21:57:08 +02:00
5c04b4fdfb Fix T49196 2016-08-29 13:33:30 -06:00
2090ed164f Cleanup/refactor spacefile's 'check dir' code.
Was kinda split in two different places (one allowed to modify given path to always get a valid one,
the other only checking for validity of given path), not nice - and broken in asset branch case.

So rather extended a bit FileList->checkdirf to handle both cases (modifying and non-modifying path).
2016-08-29 16:42:49 +02:00
8f215d9b52 Fix for Bevel segments bug T49183; but doesn't fix whole report yet. 2016-08-29 08:51:04 -04:00
09dc8a7954 Fix T49181: Movie clip animation lost when invoking action which reloads the clip
Was a bug since the very beginning of movie clip animation support
which was done on Feb 2012.
2016-08-29 13:09:03 +02:00
a9f8e384f1 Movie clip: Add missing animation data RNA declaration
Was missing since the beginning of the days.
2016-08-29 13:04:24 +02:00
cc2faa409f Fix T49172: mixdown sound op not exporting full length
Thanks Flavio Perez for the fix.
2016-08-29 10:55:17 +02:00
5af58faf79 Fix compilation error caused by wrong array initialization
We usually don't silence migh-be-uninitialized warning (which is the only
thing which could explain setting matrix to all zeroes) so we can catch
such errors when using tools like Valgrind.

I don't get warning here and the initializer was wrong, so removing it.

If it-s _REALLY_ needed please do a proper initialization.
2016-08-29 09:40:15 +02:00
936a2c6459 GPencil UI: Move the "quick toggles" for colors into their own row below the list
Previously, they were in a column alongside the list, but because the lists were
rarely that long, there would always be a large gap left below the list.
2016-08-29 17:10:53 +12:00
195c7797e6 Fix: Some settings (e.g. "volumetric strokes") from old files were not getting correctly ported to GPv2 2016-08-29 17:00:18 +12:00
f5ddcd4ce9 Code Cleanup: Fixes for some issues noticed during previous fix 2016-08-29 16:39:27 +12:00
cea8f024ec Fix: GPencil Paste couldn't be used to paste strokes from one datablock to another
This was because the poll callback was checking for the presence of an active layer.
If you just create an empty datablock and try to paste, nothing would happen.

However, this check was kindof redundant anyway, as the operator would add a layer for
you if it didn't find one.
2016-08-29 16:27:23 +12:00
44524f7519 Small optimisation: Only calculate the inverse_diff_mat once per stroke instead of for every point
(Later this calculation should be moved into the iteration macro instead, since
it only needs to be applied once per layer along with the diff_mat calculation)
2016-08-29 14:51:31 +12:00
299bb019b5 GPencil: "Reproject Strokes" operator
A common problem encountered by artists was that they would accidentally move
the 3D cursor while drawing, causing their strokes to end up in weird places in
3D space when viewing the drawing again from other perspectives.

This operator helps fix up this mess by taking the selected strokes, projecting them
to screenspace, and then back to 3D space again. As a result, it should be as if
you had directly drawn the whole thing again, but from the current viewpoint instead.
Unfortunately, if there was originally some depth information present (i.e. you already
started reshaping the sketch in 3D), then that will get lost during this process.
But so far, my tests indicate that this seems to work well enough.
2016-08-29 14:51:30 +12:00
dec7145032 GPencil: Include basic brush settings in "Grease Pencil Settings" panel for 2D Editors
After the GP v2 changes, it wasn't possible to easily set the thickness of strokes
if you didn't know about the pie menus already. This just exposes the same set of
settings.
2016-08-29 14:51:29 +12:00
71eaa28d0e Code Cleanup: Just some fixes for whitespace/typos that I noticed while working on other stuff 2016-08-29 14:51:29 +12:00
20c708d471 GPencil UI: Make "Tint" settings take full width of panel in 2D editors
Parenting options are not visible there (i.e. they're only for the 3D view),
so reserving space that isn't going to be used in those editors doesn't really
make much sense. Furthermore, those property regions are often quite narrow
too, so it doesn't help too much to keep these settings so narrow there.
2016-08-29 14:51:28 +12:00
8a02c5fc62 Fix T49163: let Cycles only hide particles with missing motion data, not regular objects. 2016-08-28 21:26:03 +02:00
116bab702e Fix T47639: OpenGL render with smoke and fire incorrect when using
transparency.

The issue is that we are rendering to a 0..1 clamped sRGB buffer with
unpremultiplied alpha, where the correct thing to do would be to render
to an unclamped linear premultiplied alpha buffer. Then we would just
make fire purely emissive without affecting the alpha channel at all,
but that doesn't work here.

So for now, draw fire and smoke separately using different shaders and
blend modes, like it used to before the smoke programs were rewritten
(see rB0372b642).
2016-08-28 16:50:59 +02:00
a5261e06a3 Fix T49167: Normals in wrong coordinate space when adaptive subdivision is used
Meshes with Cycles subdivision were being transformed to world space leading to
normals to sometimes be calculated in that space, while they should be in
object space. Also caused dicing to happen at the wrong rate for scaled meshes.
2016-08-27 18:07:04 -04:00
Julian Eisel
4ebfb700ba Fix missing viewport update changing BI lamp shadow method 2016-08-27 23:23:17 +02:00
0a8344e843 GPencil: Added entry for the "Select Strokes Using Active COlor" operator to the Colors panel dropdown
It was already present in a few of the Pie Menus, but it was hard to find it,
so I've included it here too for good measure.
2016-08-28 00:09:16 +12:00
7bc9353957 Code Cleanup (Non-functional tweaks)
General reshuffling of defines and spacing/brace usage for consistency.
In particular:
* When defining types, don't mix pointers and non-pointer types on same line
  to avoid confusion
* As much as possible, have all defines at the top of each block instead of
  scattered haphazardly throughout the code
2016-08-27 22:58:09 +12:00
2a6362255d GPencil: Cleanup change color operator
It is faster to assign the color to the pointer instead to force the new
lookup in drawing function.
2016-08-27 12:52:30 +02:00
fef0cd8191 Fix T49151: ParticleSettings' usercount not decremented when removing a psys from an object. 2016-08-26 20:29:40 +02:00
5849651a46 Cycles: Make UI for subdivision more clear
Users have been getting a bit confused by the way things are worded/arranged in
the UI. This patch makes a few changes to the UI to make it more clear how to
use subdivision:

- make Subdivide UVs option inactive when adaptive subdivision is enabled as UV
  subdivision is currently unsupported
- add "px" to dicing rates in the Geometry Panel
- display the final dicing rate in the modifier
- reworded "Dicing Rate" in the modifier to "Dicing Scale" to make more clear
  that this is a multiplier for the scene dicing rate and added a note the the
  tooltip pointing the user to that setting in the Geometry Panel

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2174
2016-08-26 12:14:07 -04:00
e9c5359f43 Usual i18n/UI messages fixes... 2016-08-26 16:14:56 +02:00
1a1bcad43a Fix T49158: Untranslatable elements in UI.
We cannot skip 'collections clesse' when generating i18n messages from RNA, some of them
are visible and UI...
2016-08-26 15:46:56 +02:00
fcffb14d7b Fix linking issue with OpenEXR and Zlib.
Link Zlib after OpenEXR.

Differential Revision: https://developer.blender.org/D2176
2016-08-26 14:28:51 +02:00
62b1cdd66e Fix over creation of cache files handles (leading to memory leaks).
Multiple threads could create multiple handles for the same cache file,
so protect handle creation with a mutex, to make sure only one is
created.
2016-08-26 14:28:50 +02:00
8870c454a1 Fix cache constraint not reference counting cache files. 2016-08-26 14:28:50 +02:00
f2f107572c Fix T49168: crash when evaluating a cache constraint with a NULL cache
file.
2016-08-26 14:28:50 +02:00
1ada3231ec Depsgraph: Report number of objects to which update as flished
This is an easiest way in the new depsgraph to get an idea how much objects
were handled on update.
2016-08-26 14:05:24 +02:00
72b24d9c6c Cleanup: Remove unused variable 2016-08-26 14:01:03 +02:00
5f1b580edc Depsgraph: Report overall number of updates objects 2016-08-26 14:00:15 +02:00
86e0485b2e Cleanup: Use more meaningful names and move calculation into am if statement 2016-08-26 13:58:17 +02:00
a80977cd21 Fix T49139: Memory leak in UV image editor related to Undo (and possibly Waveform and Vectorscope).
Assigning NULL to scopes' data pointer in 'non-UI readfile' context was terribly wrong for sure,
if we'd really want to reset them here we should freed them first.

But we can rather just ignore them here, those are purely runtime data managed by image editor,
no need to touch them here.
2016-08-26 12:54:49 +02:00
f73c4b421d Fix: Use submenu for GPencil -> Select Grouped 2016-08-26 16:38:31 +12:00
274e1c4f1f Code Cleanup
* Stroke editing functions should be in gpencil_edit.c not gpencil_data.c
  (the latter is only for handling "CRUD" operations on things like
   layers, brushes, and palettes)
* Deduplicate the GP_STROKE_BUFFER_MAX define
2016-08-26 16:25:39 +12:00
2ac75fe035 Fix: Color of frame/selected object indicator in 3D View didn't indicate GPencil keyframes
when there was no active object
2016-08-26 16:15:48 +12:00
84cd137503 GPencil: Select Grouped -> By Color
Added a way to select all the currently visible strokes that use the same
color as the selected stroke. This can be accessed via the Select Grouped (Shift-G)
operator as an alternative to selecting by layer.
2016-08-26 16:15:48 +12:00
56360a3ddf GPencil RNA: Set pressure and strength to 1.0 by default for new stroke points added via stroke.points.add()
This commit adds optional "pressure" and "strength" arguments to the
stroke.points.add() method. These are given default values of 1.0,
so that old scripts can be ported over to the new API with less effort
while reducing confusion about why auto generated strokes won't appear.
2016-08-26 16:15:47 +12:00
50a44edca4 Cycles: Remove some redundant checks 2016-08-25 10:52:00 -04:00
2d1f522a74 Fixed little error in comment
"amount" is for uncountable things, "number" is for countable things.
2016-08-25 16:22:37 +02:00
9444cd56db Depsgraph: Prioritize evaluation of the new scheduled nodes
The idea here is again to finish objects evaluation as soon as possible.

Seems to be giving another 3% speedup in the barber scenes.
2016-08-25 16:08:41 +02:00
84be763be2 Depsgraph: Merge some traversal back on
After previous commit there is no longer measurable difference
in speed and doing all stuff in one go is preferrable here anyway.
2016-08-25 15:51:19 +02:00
eb2cfc3a25 Depsgrpah: Use deque for the flush queue
The idea of the change is to avoid queue growing too long
and handle all the operations as quick as possible.

Gives about 3% speedup on one of the barber shots here.
2016-08-25 15:13:36 +02:00
adfd58aa49 Fix T48788: Diffuse color in BI Textured Solid mode is not updating properly in Sculpting mode
Was caused by 6276726, so for the time being revert the optimization part of change.
2016-08-25 13:48:23 +02:00
6a48318163 Cycles: Cleanup, indentation 2016-08-25 12:33:07 +02:00
86c719f796 Cycles: Fix crash after recent subd fixes
Was happening when object only had curves (doe example, object with hair
particle system and emitter rendering disabled).
2016-08-25 11:31:36 +02:00
086ec8af48 Cycles: Support proper visibility check in single volume intersection step for QBVH 2016-08-25 11:13:35 +02:00
99451698d3 Cycles: Implement proper visibility check in QBVH volume all intersection 2016-08-25 11:09:06 +02:00
29c733e6f2 Fix T49078: Cycles tries to render volume from another render layer when camera is in volume 2016-08-25 10:55:59 +02:00
3c533be77e Fix T49112: Alembic unicode path issues on Windows.
Now we pass streams to Alembic instead of passing the filename string.
That way we can open the stream ourselves with the proper unicode
encoding.

Note that this only applies to Ogawa archive, as HDF5 does not support
streams.

Differential Revision: https://developer.blender.org/D2160
2016-08-25 05:19:41 +02:00
bfc5a94292 Windows Packaging : Make package-name confirm to the windows[32/64] naming scheme we use. 2016-08-24 09:37:42 -06:00
438bcc6d28 Cycles: Fix crash when empty mesh has subdivision
OpenSubdiv doesn't like empty meshes, so we need to be careful not to
subdivide when the mesh is empty.
2016-08-24 10:39:00 -04:00
74bd809962 Cycles Standalone: Fix support for subdivision meshes
Changes from microdisplacement work broke previous support for subdivision
meshes, sometimes leading to crashes; this makes things work again. Files
that contain "patch" nodes will need to be updated to use meshes instead, as
specifying patches was both inefficient and completely unsupported by the new
subdivision code.
2016-08-24 10:39:00 -04:00
0ca4e39424 Fix T49148: Blender Crash With B select on Skeleton Sketching 2016-08-24 14:17:26 +02:00
8d8316a057 Cycles: Consolidate the various split CL kernel feature defines within the AMD platform
Reviewers: sergey

Differential Revision: https://developer.blender.org/D2172
2016-08-24 12:32:40 +02:00
389b4feec1 Fix T49128: Ghost of Previous Mask appears in Double Edge Mask
Patch by Ted Schundler (tschundler), thanks!

Differential Revision: https://developer.blender.org/D2163
2016-08-24 11:20:13 +02:00
262adf7d91 Fix T49130: "Inner Edge" / "Buffer Edge" options in the Double Edge Mask are wired to the wrong settings
Patch by Ted Schundler (tschundler), thanks!

Differential Revision: https://developer.blender.org/D2141
2016-08-24 11:00:21 +02:00
22b913a278 Fix T49121: VSE and border render incompatible
For now just check for such incompatible configuration, real fix
requires quite some work to be done.
2016-08-24 10:24:24 +02:00
d99c513afa Cycles OpenCL: use AoS rather than SoA storage for ShaderData.
Fixes part of the performance regressions compared to 2.76b, see T49046, T48876.
2016-08-24 01:45:27 +02:00
e484fe84cd Usual i18n/UI messages fixes. 2016-08-23 22:03:18 +02:00
fe8b197269 Fix T49150: make new 'operator categories' in search menu i18n-aware. 2016-08-23 21:48:16 +02:00
7dc328e8a1 D2078 Windows : add option to prevent find_package from picking up the wrong libraries and use hardcoded paths instead. 2016-08-23 08:48:27 -06:00
36b80b185f Cycles: Fix/workaround for missing AA on Pascal (GTX10x0) cards 2016-08-23 16:32:09 +02:00
eb5cd578b8 Cleanup: Output argument name and const qualifier 2016-08-23 15:56:10 +02:00
a853367fbf Fix T49140: Noise and jitter present at some areas when using ambient oclusion in Blender internal renderer 2016-08-23 15:54:36 +02:00
f732293147 OpenCL: Support multiple ABI libraries on Linux
Solves issue reported in T49144.
2016-08-23 12:23:37 +02:00
e2f323c3ec attempt to fix compilation error on windows 2016-08-23 12:01:55 +02:00
9c3b9f6a83 2D stabilization: Fix broken auto-scale all the recent work
Auto-scale is expected to work just fine now.

Only thing changed now is the pivot point for the scale: it is now
the same as rotation pivot, so scaling happens around weighted median
of the translation tracks. This seems to be what is actually required
for the VFX workflow.
2016-08-23 11:53:35 +02:00
baaa2d6d39 Change Request: use weight centre of location tracks as pivot
Previously, this extension used the translation compensated image centre
as reference point for rotation measurement and compensation. During
user tests, it turned out that this setup tends to give poor results
with very simple track configurations.

This can be improved by useiing the weighted average of the location
tracks for each frame as pivot point. But there is a technical problem:
the existing public API functions do not allow to pass the pivot point
for each frame alongside with the stabilisation data. Thus this
change implements a trick to package a compensation shift into
the translation offset, so the rotation can be performed around
a fixed point (center of frame). The compensation shift will then shift
the image as if it had been rotated around the desired pivot point.
2016-08-23 11:53:35 +02:00
498ba756ab 2D stabilization: by default init anchor_frame to frame 1
It is common in blender to use 1-based counting for
frame sequences (while 0-based is allowed). Thus
initializing to use frame 1 as reference for stabilization
is likely to produce smooth start values in most cases
2016-08-23 11:53:35 +02:00
fd65a64930 2D stabilization: change presentation of target_scale in UI
Alongside with this change, we fix disabling of Autoscale,
because this feature works even when rotation/scale is disabled.
2016-08-23 11:53:35 +02:00
3dbe174440 2D stabilization: flip orientation of the scale parameter
values > 1 will zoom in and values < 1 zoom out

Rationale: the changed orientation is more natural
from a user POV and doing it this way is also more
consistent with the calculation of the other
target_* parameters.

Compatibility: This will break *.blend files saved
with the previous version of this patch from the
last days (test period). It will *not* break any
old/migrated files: Previously, the DNA field "scale"
was only used to cache autoscale. Only with the
Stabilisator rework, "scale" becomes a first class
persistent DNA field. There is migration code to
init this field to 1.0
2016-08-23 11:53:35 +02:00
95d3ca8bc6 Fix inconsistency: expected scale not be subject to scale influence
We should treat all three "target" ("expected") parameters in a similar way:
The "influence" control should only work on the measurement part of stabilisation,
i.e. it should only control the automatic part of stabilisation, while
the target parameters are deliberately set by the user and thus should
even be in effect when the automatic stabilsation is turned down.

It used to be so for location and rotation, but for the scale part,
I re-used the existing code for autoscale, which also had the scale influence
work on the autoscale factor. This was sensible in the old version,
since scale_influence was the only way to control the result. But now,
the user has always total control trough the "target_*" parameters
and thus we should prefer to treat all similar.
2016-08-23 11:53:35 +02:00
0dec3d6e22 Build Packaging : Set proper package name on Windows. 2016-08-22 08:15:03 -06:00
eb2ee7212e Fix T49136: full constant Curves with zero Fac input crashes in assert.
The if branches were reordered when the original patch was
committed, which broke the implicit non-NULL guarantee on link.

To prevent re-occurrence, add a couple of unit tests.
2016-08-22 11:11:45 +03:00
28cf9cfd15 NDOF: fix crash on Mac with old drivers
For best results use the latest 3Dconnexion driver. But latest is only
supported on Mac OS 10.9+. We go all the way back to Mac OS 10.6 so
have to deal with older driver versions.

See the original dlclose line for my faulty assumption. Waiting to
unload the driver later fixes the crash. Newer drivers don’t seem to
have this issue.

Also removed WITH_INPUT_NDOF guards as NDOFManager.h takes care of
this. Follow-up to b10d005 a few days ago.
2016-08-21 23:09:30 -04:00
Julian Eisel
ea69d471c8 Sculpting: Avoid calculating and chaching viewport matrices
Really couldn't find where this was used.
2016-08-21 23:59:18 +02:00
ced66f1da9 Update .gitignore to some more generated/non-git-stored files. 2016-08-21 22:40:57 +02:00
0f01f7bb54 Update sphinx_doc_gen.py to work with recent changes (GPv2). 2016-08-21 22:38:06 +02:00
81b1792fb7 Icons: Fix small alignment and shadow issue in prvicons. Add missing copyright notice. 2016-08-21 19:10:02 +02:00
ff8d16399c Cleanup: let's try to avoid too much indirect header imports, makes things harder when some cope changes... 2016-08-21 13:20:49 +02:00
43bb8f12f4 Fix T49060: crashes during render with no apparent reason...
Was a concurrent access of pointcache from both particle system and UI (time space).

Pointcache not being threadsafe is really an issue to be addressed for its next version,
for now simply locking spacetime (like we already do with 3DView), not ideal fix
but it's working and safe for release.
2016-08-20 16:03:33 +02:00
67dcad4011 Fix T49119: Batch-Generate Previews operator fails.
previews render utils needed to be updated slightly against new behavior of maindata.remove.
2016-08-20 14:49:44 +02:00
8e02b024c0 Fix OpenSubdiv driver crash due to recently added uninitialized field.
For some reason my NVidia linux driver crashes in
glDeleteTextures when the ID is total garbage.
2016-08-20 13:48:29 +03:00
0e5e53c651 Fix crash in OpenVDB highres smoke cache when seeking to frame 0.
This code obviously should also use the cache_fields flag variable,
like the code for reading the lowres data in the same function.
This is because fluid_fields actually represents the old state before
smoke was reallocated to match cache_fields read from the file, and if
it has some fields enabled that aren't allocated any more, it crashes.

This also fixes a reverse glitch: when a file was loaded with
the current frame in the middle of a baked smoke+fire simulation,
smoke appeared immediately, but the fire didn't until the frame
was changed. The reason is the same: after file load no fields
are initially allocated and thus fluid_fields is 0.
2016-08-20 12:13:20 +03:00
36ab737ef7 Alembic export UI: avoid displaying empty box. 2016-08-20 09:30:38 +02:00
cf53389425 Fix T49090: color picking draws wrong when using subsurf in material draw mode.
ccgDM_drawMappedFacesMat was missig a smooth shade model restore, some other
functions were redundantly setting it since we can assume it to be the default
state already.
2016-08-19 23:20:24 +02:00
62e3849f40 Fix T49105: Array modifier displayed in Edit mode crashes on selection, with End Cap enabled.
Origindex can be invalid, code was not fully protected against it...
2016-08-19 17:00:34 +02:00
33fbf9b7e0 Fix broken keymap loading with disabled ndof - revert part of recent rBb10d0058d72da30
ifdef’ing out defines in DNA/RNA is not a good idea, was breaking alternative keymaps loading
from splash screen e.g. (reported by Sergey over IRC, thanks).
2016-08-19 15:51:44 +02:00
793900d46c 2D stabilization: Make interface more compact
Joins some things to the same row and uses aligned columns to get
minimum use of vertical space.

Probably still some tweaks required, but getting there :)
2016-08-19 12:21:13 +02:00
5f7611a8f1 Alembic: fix crash accessing invalid objects. 2016-08-19 05:22:46 +02:00
bf4875001d Fix T49111: Automatically add file path suffix for Alembic and Collada
export.

This aligns the behaviour of the file selection with the other
exporters. The Alembic case would fail if the filepath did not have an
extension set.

Also set a default file name for the Alembic export operator in case the
Blender file was not saved before exporting.
2016-08-19 04:42:45 +02:00
Julian Eisel
4d8ac1eaa5 Cleanup: Remove redundant comment 2016-08-19 01:20:35 +02:00
ca5271e637 Cycles: Fix wrong allocator used for spatial builder 2016-08-18 20:47:48 +02:00
f4e4009afd Cleanup: some bad sizeof() usages. 2016-08-18 16:18:58 +02:00
2e6d4270cd Cleanup/security fix: do not use strcpy (at least in new code).
This function is only really secure in a very limited amount of cases,
and can especially bite you later if you change some buffer sizes...
So not worth bothering with it, just always use BLI_strncpy instead.
2016-08-18 16:06:11 +02:00
7b4ba65a87 Cleanup for previous commit (nasty IDE replacing tads with spaces, tsst)
Sorry for the noise :|
2016-08-18 15:21:53 +02:00
b4d36c77da Two fixes for optional ndof & fix bplayer for that...
Seriuosly, guys... Please always check that kind of changes with and without affected option, and in full build case.
2016-08-18 15:18:26 +02:00
7b78532950 Freestyle: fix wrong arg order, and cleanup confusing loop (both reported by coverity).
Error: `origin` and `edge` args were swapped in final `FindOccludee()` call of `ViewMapBuilder::ComputeRayCastingVisibility()`

Cleanup: main for loop in `Strip::createStrip()` was really confusing (though correct),
generated a false positive in coverity scan, now should be cleaner how it loops over its vprev/v/v2
triplet of consecutive items.
2016-08-18 14:37:48 +02:00
26f4f7edca Final UI messages fixes (for this session...). 2016-08-18 14:37:48 +02:00
8a72ec80a0 Fix bplayer (c) after NDOF changes from merwin 2016-08-18 11:28:41 +02:00
12c3002618 Cleanup: ifdef function which is only used from ifdef-ed code 2016-08-18 10:36:06 +02:00
b10d0058d7 NDOF: compile 3D mouse code only if WITH_INPUT_NDOF
When WITH_INPUT_NDOF is disabled, 3D mouse handling code is removed
from:

- GHOST (was mostly done, finished the job)
- window manager
- various editors
- RNA
- keymaps

The input tab of user prefs does not show 3D mouse settings. Key map
editor does not show NDOF mappings.

DNA does not change.

On my Mac the compiled binary is 42KB smaller after this change. It
runs fine WITH_INPUT_NDOF on or off.
2016-08-18 00:22:18 -04:00
a195dd15d4 NDOF: suppress buttons debug log
Accidentally left this in the 3D mouse code. Mac only.
2016-08-18 00:22:18 -04:00
f92a6b8d1b Fix compiler warning after fix for T48913. 2016-08-18 02:24:24 +02:00
e8b5e66db1 Code cleanup to use array.data() rather than &array[0]
(Now without the build errors)
2016-08-18 02:24:13 +02:00
7baf93c711 Revert "Code cleanup to use array.data() rather than &array[0]."
This reverts commit 40b367479c.

Didn't build or solve any known issue. Please don't push changes without
testing them first.
2016-08-17 18:49:18 -04:00
40b367479c Code cleanup to use array.data() rather than &array[0].
These latter can cause MSVC debug asserts if the array is empty. With C++11
we'll be able to do this for std::vector later. This hopefully fixes an assert
in the Cycles subdivision code.
2016-08-17 23:54:47 +02:00
c0161a1bab Fix T48913: cycles viewport render stuck in loop due to non-unique dupli ID. 2016-08-17 23:16:37 +02:00
11e9c5e10a Fix T49104: normal problem in imported Alembic objects
Recompute the normals if the normals are supposed to be varying (e.g. in
the ISchema).
2016-08-17 23:03:34 +02:00
8e7bbe66dd Alembic import: fix scene min/max time computation to take objects with
transform animations into account.
2016-08-17 22:26:50 +02:00
294b0756b4 Fix T49081: Alembic sampling times are not taking start frame into
account.

This resulted in animations always starting at frame 0.
2016-08-17 22:26:50 +02:00
c783e65762 Fix/add some tooltips to 'Object Align' operator options. 2016-08-17 21:24:13 +02:00
e3b5aa9bb1 Fix Bevel crashes T49088 and T48858.
Was calling the fast path for finding edge order in cases
where it should not have been called.
2016-08-17 11:24:31 -04:00
8cac980a28 Cycles: Fix regression where smoke wouldn't show in renders 2016-08-17 10:43:13 -04:00
ab775b6ae9 Fix T49102: Angle option of new GP brush settings is too restricted in value
Now the range is between -90 to 90 degrees to give more customization
options.
2016-08-17 16:23:30 +02:00
47e08ee924 Fix T49086: UV Along Stroke can be set as vector input for environment texture 2016-08-17 14:51:25 +02:00
294eac2991 CMake: Move main platform checks to separate files
Basically title says it all.

The goal is to make platform maintenance easier, so you don't have
to constantly scroll back and forth looking for if() branches to
check which exact platform you're currently working on.

Ideally we also would move option defaults to a platform files,
but that i'm not sure how to implement in a nice way yet.

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2148
2016-08-17 14:00:29 +02:00
186ee0934f More UI messages fixes and cleanup. 2016-08-17 12:53:24 +02:00
acbef397ac 2D stabilizer: Cover rotation tracks label with enabled flag 2016-08-17 10:55:41 +02:00
1fb8bbcd3e 2D stabilizer: Use exact getter instead of regular one followed with frame check 2016-08-17 10:49:42 +02:00
1e605357b5 2D stabilizer: Remove check for markers count in the track
This would be a real disaster if track has no markers, which we should
not masquerade and detect such weird cases as soon as possible.
2016-08-17 10:47:05 +02:00
069bc4086c 2D stabilizer: Remove redundant rows from the interface 2016-08-17 10:45:52 +02:00
83d94ef4d0 2D stabilizer: One more occurrence of len() in the drawing code 2016-08-17 10:40:34 +02:00
1c633dea1c 2D Stabilizer: Use more consistent RNA naming for properties
Annoying i did not notice this originally, but for RNA we need to keep
things as much consistent as possible.
2016-08-17 10:37:55 +02:00
de28940b15 2D Stabilzier: Don't use len() for checking whether something is enabled or not
This code runs on every redraw and iterates the whole tracks list, which
is something we should avoid.
2016-08-17 10:37:55 +02:00
e392658405 Fix T49100: Replace old tooltip for GPencil brush iterations 2016-08-17 09:11:58 +02:00
34928ca98a GPencil: Change ruler line thickness to make it thicker 2016-08-17 09:05:37 +02:00
d41dfe36e5 First set of UI/i18n messages fixes (mostly new GP code). 2016-08-16 22:36:59 +02:00
b90421019b Fix T49097: GP ruler data reinstances GP_Palette Color
If the ruler is saved, a new color was created for each ruler. With the
change, a color is created for the first instance, and it reused in the
following instances. The default color is the current default color for
GP.
2016-08-16 22:29:13 +02:00
a67ca5e30c Cleanup unused return value (was making coverity sad). 2016-08-16 18:22:03 +02:00
1e4e140efb More fixes from coverity report. 2016-08-16 18:19:52 +02:00
64a6a86d57 Fix two memleaks found by coverity. 2016-08-16 16:16:22 +02:00
ae475e3554 Fix release build after recent fix for debug one
It's becoming annoying to have public API dependent on build type
and everything. Let's just always have API defined and do stubs
in the function implementation instead.
2016-08-16 15:06:16 +02:00
9368bdab01 Fix depsgraph to compute more accurate links for collision & force.
Current implementation more or less indiscriminately links physics
objects to colliders and forces, ignoring precise details of layer
checks and collider groups. The new depsgraph seemed to lack some
such links at all. The relevant code in modifiers suffers from a
lot of duplication.

Different physics simulations use independent implementations of
collision and similar things, which results in a lot of variance:

* Cloth collides with objects on same or visible layer with dupli.
* Softbody collides with objects on same layer without dupli.
* Non-hair particles collide on same layer with dupli.
* Smoke uses same code as cloth, but needs different modifier.
* Dynamic paint "collides" with brushes on any layer without dupli.

Force fields with absorption also imply dependency on colliders:

* For most systems, colliders are selected from same layer as field.
* For non-hair particles, it uses the same exact set as the particles.

As a special quirk, smoke ignores smoke flow force fields; on the other
hand dependency on such field implies dependency on the smoke domain.

This introduces two utility functions each for old and new depsgraph
that are flexible enough to handle all these variations, and uses them
to handle particles, cloth, smoke, softbody and dynpaint.

One thing to watch out for is that depsgraph code shouldn't rely on
any properties that don't cause a graph rebuild when changed. This
was violated in the original code that was building force field links,
while taking zero field weights into account.

This change may cause new dependency cycles in cases where necessary
dependencies were missing, but may also remove cycles in situations
where unnecessary links were previously created. It's also now possible
to solve some cycles by switching to explicit groups, since they are
now properly taken into account for dependencies.

Differential Revision: https://developer.blender.org/D2141
2016-08-16 15:46:36 +03:00
a74dab86ee Fix redundant declarations after recent changes in GPU debug 2016-08-16 14:40:23 +02:00
b7d656c3b2 2D stabilizer: Revert majority of UI change
For now simply reshuffle option so they keep proper dependency flow.

Benefits:

- Has an ability to hide tracks lists to work with other sliders around.
  Could be really handy to quickly get rid of lenghty lists.

- From a feedback seems to be fitting workflow better.

Things to doublecheck on:

- Feels a bit misordered: first you define whether one want to have
  rotation stabilized, then have tracks, then scale options.

  While this follows dependency flow (which is really good and which
  we should not violate) it has weird feeling on whether things are
  really where they have to be.

- Autoscale controls visibility of max-scale, can we just make it
  active/inactive instead?

- Autoscale replaces slider with label. Can it be disabled slider
  instead to reduce visual jumping (disabled slider prevents user
  input)

Hopefully we'll still want to have collapsable box after re-iterating
over this points, so we don't waste bits in DNA.
2016-08-16 14:25:55 +02:00
cd5116e914 2D stabilizer: Fix compilation error in debug mode 2016-08-16 14:24:06 +02:00
e3576c7bf4 Correct previous commit, need to indent verisoning code 2016-08-16 13:53:29 +02:00
5e8c09921e 2D stabilization: Modify interface so dependency goes strictly from top to bottom 2016-08-16 13:32:11 +02:00
b1677201f9 Rework 2D stabilizator
See this page for motivation and description of concepts:
https://github.com/Ichthyostega/blender/wiki

See this video for UI explanation and demonstration of usage
http://vimeo.com/blenderHack/stabilizerdemo

This proposal attempts to improve usability of Blender's image stabilization
feature for real-world footage esp. with moving and panning camera. It builds
upon the feature tracking to get a measurement of 2D image movement.

  - Use a weighted average of movement contributions (instead of a median).
  - Allow for rotation compensation and zoom (image scale) compensation.
  - Allow to pick a different set of tracks for translation and for
    rotation/zoom.
  - Treat translation / rotation / zoom contributions systematically in a
    similar way.
  - Improve handling of partial tracking data with gaps and varying
    start / end points.
  - Have a user definable anchor frame and interpolate / extrapolate data to
    avoid jumping back to "neutral" position when no tracking data is available.
  - Support for travelling and panning shots by including an //intended//
    position/rotation/zoom ("target position"). The idea is for these parameters
    to be //animated// by the user, in order to supply an smooth, intended
    camera movement. This way, we can keep the image content roughly in frame
    even when moving completely away from the initial view.

A known shortcoming is that the pivot point for rotation compensation is set to
the translation compensated image center. This can produce spurious rotation on
travelling shots, which needs to be compensated manually (by animating the
target rotation parameter). There are several possible ways to address that
problem, yet all of them are considered beyond the scope of this improvement
proposal for now.

Own modifications:

- Restrict line length, it's really handy for split-view editing
- In motion tracking we prefer fully human-readable comments, meaning we
  don't use doxygen with it's weird markup and comments are supposed to
  start with capital and end with a full stop,
- Add explicit comparison of pointer to NULL.

Reviewers: sergey

Subscribers: kusi, kdawg, forest-house, mardy, Samoth, plasmasolutions, willolis, sebastian_k, hype, enetheru, sunboy, jta, leon_cheung

Maniphest Tasks: T49036

Differential Revision: https://developer.blender.org/D583
2016-08-16 13:30:40 +02:00
c00b2d8991 OpenGL: ignore deprecated API warnings
Reduces noise from --debug-gpu so we can spot serious errors.

Blender 2.7x uses OpenGL 2.1, we don't care if features are deprecated.

I'll re-enable these warnings for blender2.8 after next merge.
2016-08-15 14:55:09 -04:00
76b6c77f2c Cycles microdisplacement: Allow kernels to be built without patch evaluation
Kernels can now be built without patch evaluation when not needed by the
scene (Catmull-Clark subdivision not in use), giving a performance boost
for some devices.
2016-08-15 11:13:18 -04:00
33c83a289d Fix Cycles OpenCL textures after recent CUDA fix.
kernel_textures.h is included in device_opencl.cpp, so we can't check
__KERNEL_OPENCL__ there.
2016-08-15 16:28:48 +02:00
ad4a01ec0f Fix OpenGL backtrace build errors, without disabling warnings. 2016-08-15 15:36:01 +02:00
988b4e2c80 Tentative compile fix after recent gpu debug changes 2016-08-15 13:46:38 +02:00
2c03d0186a OpenGL: debug context on Windows
Enable based on --debug-gpu at the command line. Linux already works
this way.

This commit in master (2.78 timeframe) is the smallest change that gets
the desired result. I did a similar commit in blender2.8. Most ongoing
GL debug work will go into 2.8, not 2.7x.

In support of T49089
2016-08-15 04:49:07 -04:00
ad6e7a0be1 OpenGL: backtrace on errors (--debug-gpu)
Backtrace so we can pinpoint where the GL error came from. Then fflush
on severe errors in case it's severe enough to crash Blender.
2016-08-15 04:10:54 -04:00
55eb8ce873 OpenGL: enhance debug output
When running blender --debug-gpu

Display which debug facilities are available. One of these, in order of preference:
- OpenGL 4.3
- KHR_debug
- ARB_debug_output
- AMD_debug_output

All messages are logged now, not just errors. Will probably turn some of these off later.

GL_DEBUG_OUTPUT_SYNCHRONOUS lets us break on errors and backtrace to the exact trouble spot.

Callers of GPU_string_marker no longer pass in a message length, just the message itself (null terminated).

Apple provides no GL debug logging features.
2016-08-15 04:06:14 -04:00
9b0f6fa7f7 Revert "Cycles: Use half storage for 16bit files (e.g. 16bit pngs) as well."
After discussion in IRC, 16bit int should not be converted to half, too much precision loss.
2016-08-15 01:01:43 +02:00
4d41d8be79 Fix CUDA compilation after OpenCL changes. 2016-08-15 00:04:19 +02:00
a18b2ba643 Cycles: Use half storage for 16bit files (e.g. 16bit pngs) as well.
Note: This only works for textures loaded from disk via OIIO, not packed textures. That's still a ToDo.
2016-08-14 22:24:29 +02:00
9396e11180 Cycles microdisplacement: Move call to tessellate() from addon to Cycles
By calling `tessellate()` from the mesh manager in Cycles we can do pre/post
processing or even threaded tessellation without concerning client side code
with the details.
2016-08-14 15:04:21 -04:00
5c0a67b325 Cycles: Add single channel texture support for OpenCL.
This way OpenCL devices can also benefit from a smaller memory footprint, when using e.g. bumpmaps (greyscale, 1 channel).

Additional target for my GSoC 2016.
2016-08-14 20:21:08 +02:00
Luca Rood
da77d9873f Prevent max stiffness values from going under normal stiffness values in cloth stiffness scaling.
When updating the max values under stiffness scaling, they clip at the normal stiffness values
as expected, however when updating stiffness values, you could set them higher than the max
values, and the max values weren't updated accordingly. As the stiffness scaling computes using
the absolute difference between the max values and the stiffness values, you got higher
stiffnesses in scaled areas even though your max is actually lower than the normal stiffness.

This diff fixes that behaviour, by updating the max values to be equal to the stiffness whenever
you set a higher stiffness than the max value.

Also, I have initialized the max values to the same as the stiffnesses, as they were previously
just set to zero, and caused the same problem described above.

Reviewers: lukastoenne

Reviewed By: lukastoenne

Tags: #physics

Differential Revision: https://developer.blender.org/D2147
2016-08-13 19:48:33 +03:00
35a6e540b1 GPencil: Cleanup code 2016-08-13 17:09:19 +02:00
c395d044fc Fix T49082: Intermediate update call when making links can change group socket layout.
Node tree update calls in the middle of a socket loop are dangerous, they can change sockets
on group nodes and link instances in particular. Updates should only happen after the operator
has finished.

Simply removed the extra convenience check for validity now. Worst case an invalid (red) link
is created which can be removed by the user as well and should simply be ignored by node systems.

The update system in nodes needs a complete rewrite to handle complex cases like this, where an
operator may need to react to changes during its execution.
2016-08-13 16:35:34 +02:00
Julian Eisel
fcb78f2402 Add DNA_struct_find (useful for version patching) 2016-08-13 01:40:19 +02:00
Julian Eisel
25872cae29 Fix error in GPencil V2 version patching
GPencil conversion would just always run for file version 2.77.3. This wasn't an issue in master, but possibly for other branches that used the 2.77.3 block.

Wasn't aware that you have to add the asterisk for pointers either, this is kinda weird. Anyway, it's running correctly now.
2016-08-13 01:35:12 +02:00
04c7d9d566 Depsgraph: tag relations for update when aterial slots changes
New dependency graph puts materials to the graph in order to deal with animation
assigned to them and things like that. This leads us to a requirement to update
relations when slots changes.

This fixes: T49075 Assignment of a keyframed material using the frame_change_pre handler
                   doesn't update the keyframe using the new dependency graph
2016-08-12 14:59:11 +02:00
82268fa100 Depsgraph: Tag relations for update when making datablocks single user
This is mainly required for the new dependency graph where non-object
datablocks are a part of dependency graph.

This solves issue when making mesh shared by multiple objects a single
user one.
2016-08-12 13:58:48 +02:00
bac1279b03 Fix T49045: splash not working correctly on OS X, after recent bugfix. 2016-08-12 01:19:22 +02:00
f3bff6a1a1 Fix T49071: Cycles OSL build problem with oslc compilers that can't find their own stdosl.h. 2016-08-12 01:01:09 +02:00
9d236ac06c Cycles: Enable half float support (4 channels and 1 channel) on CUDA.
Atm OpenEXR half files benefit from this and will use only 1/2 of the memory now. More space for HDRs!

Part of my GSoC 2016.
2016-08-11 22:47:53 +02:00
5ac7ef873b Cycles: Change code order for Image Data Types.
Now we have the 4 component ones first (float4, byte4, half4) followed by the 1 component ones (float, byte, half).
Makes code a bit more consistent and also reduces code a bit when enabling half support on GPU in next commit.

This also exposed a typo in half CPU images for 3D textures, which wasn't used yet, but good to have that one fixed anyway.
2016-08-11 22:30:03 +02:00
3aed54dbd5 Cycles: Fix change of sign warning 2016-08-11 15:09:58 -04:00
013a5c27a5 Cycles: Remove odd definition from CMake file
This was causing Cycles standalone to fail to build from Blender repo.
Hopefully nothing breaks from removing this.
2016-08-11 14:35:43 -04:00
1fe9d671cf Fix T49004 and motion blur of cloth, softbody, etc past the end frame.
Point cache read code contains checks designed to prevent it reading
stale data when the relevant simulation code should instead compute
the next frame from the previous one. However in some situations like
motion blur subframes the simulation can't possibly do it and just
exits. This causes completely incorrect motion blur at or after the
last cached frame.

To fix, add a parameter that tells the cache code whether it should
apply the checks and exit, or read what it can even if stale (true
means exactly same as old behavior).

Doing this in cache rather than clamping the frame number better in
the caller lets it handle the case of incomplete cache that stops
before the official last frame.

Reviewed By: mont29, lukastoenne

Maniphest Tasks: T49004

Differential Revision: https://developer.blender.org/D2144
2016-08-11 13:36:29 +03:00
fdc43f993d Cycles: Use static assert to control structures alignment 2016-08-11 10:12:06 +02:00
a501668cc5 Revert "Cycles Tests: Add test for correct 16 byte alignment of KernelData structs"
Using unit tests is a wrong way to control static behavior of the
application. They should only be used for checking dynamic behavior,
all the rest is easily controllable at compile time.

Doing tests at ocmpile time are actually more robust approach since
we don't have strict policy of runnign unit tests before accepting
any change.

Proper alignment control is coming shortly.

This reverts commit 7c3a06c349.
2016-08-11 10:08:23 +02:00
7c3a06c349 Cycles Tests: Add test for correct 16 byte alignment of KernelData structs 2016-08-10 20:49:45 +02:00
4d1bf1472e Cycles Standalone: Fix building after microdisp changes 2016-08-10 14:08:13 -04:00
82e65abfef Cycles: Fix KernelIntegrator padding to 16-byte boundary 2016-08-10 20:04:52 +02:00
498b7bd7ce Updated install_deps.sh to OSD 3.0.5 (and switch from git repo to download archive of sources). 2016-08-10 19:19:46 +02:00
ef27d8ec5a Cycles Standalone: Add option to set the tile size from the command line
Since the optimal values depend on the device used, this option doesn't make much sense in the XML.
Therefore, it's now specified via the command line, just like the device itself.
2016-08-10 19:17:03 +02:00
bbbc079a6c Cycles: Correct maximum number of textures on pre-Kepler CUDA cards
Commit c96ae81160 added three data textures and therefore removed three image texture slots, but the value in util_textures.h wasn't updated.
2016-08-10 17:19:16 +02:00
ebdb5490b3 GPencil: Avoid segment fault if new stroke function is called without colorname 2016-08-10 15:51:40 +02:00
774beb7c3c GPencil: Rename color name property to keep consistency in naming 2016-08-10 12:21:18 +02:00
c19d527ed8 Fix crash in id remapping of Graph editor.
dopsheet data pointer is not guaranteed to be set it seems...
2016-08-09 20:00:53 +02:00
0433ae3026 Cycles: Use proper property getter 2016-08-09 16:37:40 +02:00
02719521d2 Attempt to fix previous commit for non-c++11 builds 2016-08-09 15:47:51 +02:00
3bbf8fbaeb Fix for isfinite breaking builds when WITH_CXX11 is enabled.
This happens when cmath.h is included after math.h in cpp code.
Kudos to Sergey for pointing this out.
2016-08-09 15:34:38 +02:00
d5a0ae00d0 Fix T48916: Proxy Custom File is broken 2016-08-09 14:58:34 +02:00
1647d89cf1 Fix T49027: Sequence uses too much memory when rendering scene with lots of movie strips
Now we free sequencer cache and close all unneeded FFmpeg handles when rendering.
This is the same logic as image sequence memory freeding.
2016-08-09 14:33:00 +02:00
f990518041 CMake: Once again, don't use find_package to get hardcoded libraries 2016-08-09 12:38:09 +02:00
62b670633c CMake: Remove hardcoded DIR_ROOT for alembic and MinGW
Do it for until precompiled libraries are there so we can allow
MinGW users to compile their own library and pass it via ROOT_DIR.
2016-08-09 12:38:09 +02:00
f0bf33fd1b CMake: Use proper way to define debug/release libraries for alembic
Please do not spread platform+library specific code all over the CMake file,
we already have sections dedicated to that.
2016-08-09 12:38:09 +02:00
bccaa994f1 CMake: Do not force set root folder for Alembic
it is incorrect to set ROOT_DIR and then call find_package.

If something is expected to be in a given location use hardcoded
locations (for the precompiled libraries). Otherwise just use
find_package() and let users to set ROOT_DIT when it is required.
2016-08-09 12:38:09 +02:00
a7f6f900f3 Cycles: avoid making NaNs in Vector Math node by normalizing zero vectors.
Since inputs are user controlled, the node can't assume they aren't zero.
2016-08-09 13:20:22 +03:00
c2a7317d1f CUDA: We don't support Toolkits < 7.5, update error message. 2016-08-09 11:41:25 +02:00
151390069a Bugfix. glDisable with bad enum argument in GPU_texture_unbind
Reported by @panzergame in D1414.

`glDisable` calls with bad enum argument `GL_TEXTURE_2D_MULTISAMPLE` that came from this line:
`tex->target = (n == 1) ? GL_TEXTURE_1D : (samples ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D);`

Reviewers: brecht

Reviewed By: brecht

Subscribers: AlexKowel, yurikovelenov, panzergame

Differential Revision: https://developer.blender.org/D2145
2016-08-09 12:34:52 +03:00
Julian Eisel
b53eca1711 Cycles: Fix crash in empty scenes
To recreate, just delete default cube and render.

Simple fix, but @maiself or @sergey may want to double-check ;)
2016-08-09 04:32:38 +02:00
040fa75d7b Fix Cycles CUDA adaptive kernel not working correctly after recent closure changes. 2016-08-09 01:31:07 +02:00
d1b9306cd5 Alembic: fix finding boost headers for win32 2016-08-08 16:57:04 -06:00
903e9ce0c9 Make previous alembic fix only apply to MSVC 2016-08-08 14:17:43 -06:00
01350910fd Fix extra ; warning for OpenCL as well. 2016-08-08 20:01:21 +02:00
8534071521 Alembic/ msvc : Link alembic_d.lib instead of alembic.lib when doing debug builds. 2016-08-08 11:19:41 -06:00
b745a2401b Fix ID types DAG update tagging.
The first character of the ID type was used to tag IDs for updates which
is weak since different IDs can have the same first character (for
example meshes, materials and metaballs), causing unnecessary updates of
unrelated IDs.

Now we use a unique index per ID type to tag for updates, unifying IDs
arrays indexing along the way.

Reviewers: sergey, mont29

Differential Revision: https://developer.blender.org/D2139
2016-08-08 17:51:15 +02:00
5e5d3d6391 BGE: Call DNA_sdna_current_init when launching blenderplayer.
Don't calling DNA_sdna_current_init was creating a crash because a global uninitialized
variable was used when reading blender files.
2016-08-08 15:41:19 +00:00
308cc491cd Cycles: Fix compilation on Cycles unit tests after recent changes 2016-08-08 15:10:03 +02:00
f1040d7d94 Disable depth buffer writes while rendering smoke in the viewport.
Depth buffer values are used by the viewport pan and zoom code to
adjust response scaling factors between mouse and viewport movement.
Letting smoke write to the buffer confuses it and causes the camera
to get stuck and move very slowly inside smoke domains, because it
thinks it is very close to an object.
2016-08-08 13:48:59 +03:00
444422120f GPencil: Cleanup - Rename function for better naming
The old function name was not clear enough
2016-08-08 11:26:28 +02:00
31c34acff0 GPencil: Move polygon to back only if something was drawn
If the user enable polygon draw and press ESC before drawing something,
the last stroke must not be moved back.
2016-08-08 11:26:28 +02:00
5c815a6d78 Cycles: Remove set but unused variable 2016-08-08 10:50:23 +02:00
Julian Eisel
a0c187667e Cycles: Quiet warning with WITH_OPENSUBDIV disabled
Checked with @maiself, for now going with this simple solution.
2016-08-07 23:20:22 +02:00
aa30f993d2 Cycles: fix objects disappearing when starting or stopping movement.
Another issue with the modified particle motion blur fix: since
pre and post are used as validity markers, they must be set even
if there is no actual motion, like the original bool flags were.
Otherwise an object starting to move or stopping is interpreted
as having invalid blur data and hidden.
2016-08-07 22:45:28 +03:00
Julian Eisel
e635f0413d Fix local view editing broken after changing object's layer from non-local view
Wasn't copying back local view bytes to object after changing layer.

Steps to reproduce were:
* Split 3D view in default startup.blend
* Enter local view in one of the 3D views
* Move default cube to different layer *in the other 3D view* (the one that's not in local view)
* Try transforming object from 3D View that's in local view (should lag)
2016-08-07 20:58:26 +02:00
a58fe05c05 Cycles microdisplacement: Move displacement options from mesh to material settings
Displacement is now a per material setting, which means old files will have to
be updated if they had used displacement. Cool side effect of this change is
material previews now show displacement.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2140
2016-08-07 14:15:20 -04:00
dd1929754f Set WIN32_WINNT for all windows platforms, not just x64 2016-08-07 11:00:35 -06:00
0b68c68006 Cycles microdisplacement: Support for Catmull-Clark subdivision via OpenSubdiv
Enables Catmull-Clark subdivision meshes with support for creases and attribute
subdivision. Still waiting on OpenSubdiv to fully support face varying
interpolation for subdividing uv coordinates tho. Also there may be some
inconsistencies with Blender's subdivision which will be resolved at a
later time.

Code for reading patch tables and creating patch maps is borrowed
from OpenSubdiv.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2111
2016-08-07 11:13:11 -04:00
fc9747fa89 GPencil: Handle drawing on back for polygons
The polygons must move the stroke to back only when polygon is complete
2016-08-07 16:45:02 +02:00
97b0d23357 GPencil: Add option to draw new strokes on back of layer
For artist point of view is very useful to have an option to draw by
default the new strokes on back of all strokes in the layer.
2016-08-07 16:45:02 +02:00
0e25dc4acc GPencil: Fix error in arrange strokes
During code review a field was renamed, but one line was missing.
2016-08-07 16:45:02 +02:00
945b9f4c3f GPencil: Do not disable continuous drawing if click out of drawing area
Do not clear continuous drawing. This code was related to a previous
test and must be removed.
2016-08-07 16:45:02 +02:00
bc7d331767 Don't hide on/off buttons of the Softbody modifier when there's Collision.
From source code history, it seems this behavior is a relic of a very
old limitation when the same object couldn't be both a Softbody and a
Collision object. In those times if somehow both modifiers were added
to an object, Softbody auto-disabled itself and buttons were hidden.

Now however there is no problem having both modifiers on an object,
so there is no point hiding the buttons. The same exact buttons are
available on the physics tab in any case.
2016-08-07 16:45:31 +03:00
e1cdde5d14 Particles: don't output nonsense UV data for Grid distribution particles.
As reported in T48928, From Dupli UV is not supported for grid
distribution, and running the normal code as usual simply produces
nonsense data, because fuv is used to hold orco instead of
interpolation factors for uv, and num is zero.

Since support won't be added in 2.78, just stop outputting nonsense.
2016-08-07 13:48:25 +03:00
912f46d309 Fix pretty stupid mistake in last 'append fix' commit (rB50c017b6eabd). 2016-08-07 10:02:17 +02:00
566dd4e8a5 Cleanup: add missing ID types to BKE_library_idtype_can_use_idtype(). 2016-08-06 12:56:15 +02:00
b4cd289cdf Fix T49028: crash when copying a scene without grease pencil data. 2016-08-06 12:43:52 +02:00
28c3bdf50b Cleanup: better not split UI strings when possible... 2016-08-06 11:27:05 +02:00
604302a271 Cleanup some new gpencil rna functions names.
Convention for properties callback names is to prefix them with a version of the RNA struct name.
2016-08-06 11:22:34 +02:00
61050f75b1 Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.

A more in-depth documentation is to be found on the wiki, as well as a
 guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.

Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.

Reviewers: sergey, campbellbarton, mont29

Reviewed By: sergey, campbellbarton, mont29

Differential Revision: https://developer.blender.org/D2060
2016-08-06 10:58:13 +02:00
4158737cb2 Add the collision group option to the UI for boid particle physics.
The option already works, just missing from the ui since it
has completely different option set from newtonian and fluid.
2016-08-06 10:49:42 +03:00
277b1d76ff Fix T26658: particles stopped or bounced by 100% permeability colliders.
There were two issues here. One is that the fix done originally for this
bug only checks for colliding with the same face as the single preceeding
hit. If the particle hits an edge or vertex of the collider, it in fact
hits two or more faces, so the loop ends up cycling between first two
of them and reaches the max collision limit.

The fix is to disable the collider for the sim step once a permeability
roll succeeds, by adding it to a skip list. Skipping just one face causes
some particles to bounce at odd angles in case of partial permeability.

The second problem was that the collider bounced back a small percentage
of particles, and the cause seemed to be that the code was set to flip
the velocity if the particle was just past the collider but still within
collision distance. Inverting both values causes a half permeable collider
to stop particles, so it seems that this if branch shouldn't bounce at all.

Test file: {F327322}

Reviewers: lukastoenne, brecht

Reviewed By: brecht

Subscribers: brecht, #physics

Maniphest Tasks: T26658

Differential Revision: https://developer.blender.org/D2120
2016-08-06 10:11:33 +03:00
Julian Eisel
b988309028 Fix wrong property type usage
Prints error on startup.
2016-08-06 06:33:28 +02:00
cd809b95d8 Cycles: Add AttributeDescriptor
Adds a descriptor for attributes that can easily be passed around and extended
to contain more data. Will be used for attributes on subdivision meshes.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2110
2016-08-05 23:49:21 -04:00
734e0aca38 Fix for Cycles particle motion blur hiding fix.
My mistake in modifying the patch.
2016-08-06 01:14:32 +02:00
df7be61438 Fix T49023: Segfault when switching brushes while renaming another brush.
rna_GPencilBrush_name_set() was trying to use a mere bGPDbrush as a complete ToolSettings,
was doomed to fail...
2016-08-05 23:36:43 +02:00
8adcd93769 GPencil: Tweaks to layout to try and get the spacing a bit nicer
Currently, the lack of spacing (or rather, odd spacing/clumping) in places
seemed a bit off.
2016-08-06 03:49:14 +12:00
3971c83c96 GPencil: Various UI name fixes
* "Flip direction" -> "Flip Direction"
* "Show drawing direction" -> "Show Directions"
* "Grease Pencil Curves" -> "Brush Curves"
  (I was considering "Brush Response Curves" instead, but that seemed like too much
   of a mouthful)
* "X" for removing a palette. The UI there was more similar to a standard datablock
  selector, so it should use the "+X" combo instead of "+-" combo for consistency.
  (Note though, presets tend to use "+-" instead - e.g. see the Render Settings)
2016-08-06 03:49:14 +12:00
83ee537398 GPencil: Added Ctrl-J hotkey for Joining strokes
(Ctrl-Shift-J is for "Join and Copy")
2016-08-06 03:49:13 +12:00
d4bdb99f26 GPencil: "Join Strokes" tool doesn't leave gaps by default now
Previously, it would insert "invisible" points after the endpoints of the strokes,
so that they wouldn't appear to be joined, but that behaviour could also get quite
confusing as you wouldn't be sure whether the strokes were really joined or not.

To keep the previous behaviour, simply enable the "Leave Gaps" option on the operator
after running it. This setting will get saved between runs of the operator.
2016-08-06 03:49:13 +12:00
50c017b6ea Fix T49022: Crash in BKE_libblock_remap_locked.
Previous check to skip non-linkable IDs resulted in not clearing those skipped ID's newid member,
wich lead to try to remap it later in code.
2016-08-05 17:09:56 +02:00
b7bf9ed2b4 Cleanup: add missing entries to library_query.c ID types switch case. 2016-08-05 16:13:11 +02:00
a2a7316d92 Fix T48366: Freestyle will unnecessary exclude some linked objects.
Group membership testing for including/excluding feature lines was not
accounting for object names possibly further qualified by library file
paths.

Also fixed a few potential (but unlikely) references of uninitialized
variables.

A big thank to Bastien Montagne for the insight on the cause of the
problem and how to fix it.
2016-08-05 22:25:16 +09:00
bed32bf004 Freestyle: minor code cleanup (whites pace). 2016-08-05 22:25:12 +09:00
a0e72a0996 Fix T49014: Append does not work in some cases.
There were actually two issues, one in recent changes and one existing... forever?

I) id_make_local() would never proceed over indirectly linked data, which is required in specific 'append' context.
II) BKE_image_copy() was not setting id->newid pointer of newly copied ID.

About II: don't really know why image copy does its own cooking instead of using generaic ID copy helpers.
Think this should be changed, but that would be after 2.78 now.
2016-08-05 14:48:22 +02:00
c5eb400b7c Cycles: Fix embarrassing typo
Spotted by Mai Lavelle, thanks!
2016-08-05 14:45:54 +02:00
61d7289023 Cycles: Correction to previous commit
The change didn't fix difference render result on CUDA as i've hoped,
so reverting change for GPU rendering for now.

Sorry for the noise.
2016-08-05 12:16:24 +02:00
470cc98945 Cycles: Fix/workaround for wrong/noise render results with GCC6 2016-08-05 11:56:20 +02:00
a8b3ff9e16 Curve Fitting: fix off by one error
In practice this wasn't likely to cause problems, but better fix.
2016-08-05 18:50:49 +10:00
633e93e270 VSE sound strips: draw either the waveform or text label, not both.
Drawing both text and the wave onto a sound strip makes both hard to read,
which is a concrete issue for Hjalti at the moment. This was the simplest
fix I could think of to give him control over what he sees.
2016-08-05 09:33:04 +02:00
1f19fba566 Cycles: hide particles with broken motion blur traces.
Currently cycles cannot correctly render motion blur for objects that appear or
disappear during the shutter window. Until that can be fixed properly, it may be
better to hide such particles rather than let them render as if they were
stationary for half of the frame.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2125
2016-08-05 01:00:41 +02:00
2ce9bab8ce Fix python error when OSL file has wrong extension. 2016-08-05 01:00:41 +02:00
7812d821a5 Add upstream information to curve_fit_nd library 2016-08-05 08:36:17 +10:00
e1a4219523 Curve Fitting: sync with upstream
Correct accidental float use
2016-08-05 08:36:17 +10:00
Julian Eisel
357480f8c3 Cleanup: Use BKE_gpencil prefix
This is a good point to change this as grease-pencil-v2 branch was just merged, so I hope merge conflicts with other branches are minimal.
2016-08-04 15:11:21 +02:00
5f63797c09 Cycles: copy shader node names over in the blender sync code.
This makes constant folding logs with --debug-cycles more meaningful.
A tiny fix is needed in OSL generator to match recent node refactoring.
2016-08-04 15:19:58 +03:00
29dc04d9bb Cycles: Report human-readable string of compilation error code
It is possible that compilation will fail without giving anything in the
log buffer. For this cases giving a tip about error code will be really
handy.

Patch by @Ilia, thanks!
2016-08-04 12:14:43 +02:00
Julian Eisel
14720e2e62 Cleanup: Use bool 2016-08-04 03:10:28 +02:00
Julian Eisel
9a8c572121 Minor whitespace correction for eaea4ea51f
Caused by merge conflicts, slipped throug when double checking.
2016-08-04 01:45:00 +02:00
42f6252f2d Fix T47782: popups with wrong size when switching from retina to non-retina on OS X. 2016-08-04 01:11:09 +02:00
Julian Eisel
7830ec5418 UI: Correct tooltips for properties region toggle OP
Now all consistent and using term "properties region" instead of "properties panel". Ideally we had a more generic operator for all those.

Fixes T49006.
2016-08-04 00:26:49 +02:00
eaea4ea51f Grease Pencil v2 Branch
Improve current Grease Pencil in order to get a better 2D animation tool.

More info in WIKI pages: https://wiki.blender.org/index.php/User:Antoniov

Reviewed By: Severin, aligorith, campbellbarton

Patch by @antoniov, with edits by @Severin.

Differential Revision: https://developer.blender.org/D2115
2016-08-03 23:39:36 +02:00
9d4ea84277 Fix T48164: messed up interface switching between retina and non-retina display on OS X. 2016-08-03 22:45:14 +02:00
Julian Eisel
980fbb35e2 Boolean modifier UI improvement
This patch improves UI of a recently added solver preference in boolean modifier:

{F331776}

Issue with the current UI is that it shows user unnecessary information and breaks established grid layout.

Reviewers: carter2422

Reviewed By: carter2422

Subscribers: carter2422

Tags: #user_interface, #bf_blender

Differential Revision: https://developer.blender.org/D2136
2016-08-03 19:48:01 +02:00
99b1c1018a Cycles: Recent SSS inline changes broke CPU tests
Very weird, but let's just fall back a bit for now.
2016-08-03 15:27:48 +02:00
285e082a77 Fix T49010: Portals don't work in recent Blender versions 2016-08-03 12:38:25 +02:00
960db4c961 Cycles: Revert recent inline changes for CUDA 8 and sm_50+
This changes actually lead to 2x slowdown. It's getting a bit annoying
because those are the changes to make pre-maxwell cards render with the
same speed.
2016-08-03 11:41:58 +02:00
70100b4ec7 Fix T48283: on OS X, mouse clicks not working properly if application launch takes a long time. 2016-08-03 02:39:29 +02:00
Julian Eisel
75f37feb5c Viewport: Make lights in local view behave like BI and Cycles
Ignore that lights are not included in local view, always render them if they are on the correct layers. BI and Cycles do this as well.
2016-08-02 21:52:08 +02:00
41a4967b30 Fix T49003: Cycles volumes have wrong results after recent microdisp commits
Problem was that sd->prim can be -1 for volumes and was causing check in subd
code to access out of bounds
2016-08-02 15:28:07 -04:00
f593333099 Fix T43220, T47551: collider scaling or rotation causes smoke to explode.
The problem happens because smoke collides only with the surface of the
collider and uses incompressible fluid solver. This means that scaling
the collider tries to compress or decompress fluid within the volume of
the collider, which can't be handled by the simulation. Fast rotation
likely also causes transient scaling due to emulation of arcs by chords.

This can be fixed by finding compartments completely isolated by obstacles
from the rest of the domain, and forcing total divergence within each one
to be zero so that equations are solvable. Physical validity is somewhat
dubious, but without this the solver simply breaks down.

From the physics point of view, the effect of the correction should be
similar to opening a hole from every cell to another dimension that lets
an equal amount of air to pass through to balance the change in volume.

Reviewers: miikah, lukastoenne

Reviewed By: lukastoenne

Subscribers: dafassi, scorpion81, #physics

Maniphest Tasks: T43220, T47551

Differential Revision: https://developer.blender.org/D2112
2016-08-02 19:47:31 +03:00
ae9e9700c2 Fix T43782: smoke simulation problems with multiple touching colliders.
When the colliders are joined, each cell that touches them only gets
velocity contribution once. When there are multiple objects, velocities
are summed, which causes some cells to get 2x, 3x or more than the actual
object velocity.

Fix this by using the average velocity of all colliders touching a cell.

Reviewers: miikah, lukastoenne

Reviewed By: lukastoenne

Subscribers: dafassi, scorpion81, #physics

Maniphest Tasks: T43782

Differential Revision: https://developer.blender.org/D2112
2016-08-02 19:45:45 +03:00
f2d5295abf Cycles: log how many nodes were deduplicated for use in tests.
To make the number more meaningful, also skip deduplicating
obviously unused nodes with no outgoing links.
2016-08-02 19:26:57 +03:00
e54320c488 Cycles: add folding for redundant A to B to A conversions.
As a result of other folding simplifications it may happen that
two type conversion nodes end up directly connected. In some
cases it may be possible to then remove both. A realistic case
might be an optimized out Mix RGB node used to blend vectors.

It seems it's safe to optimize when B is a float3 type
(color, vector), and A is float3 or float.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2134
2016-08-02 18:41:15 +03:00
2f5db2e45b Fix T48986: Incorrect normals or tangents when using custom split normals.
(Re)-setting custom normals could cause some unwanted splitting of some of them, leading
to slightly different tangent space. Simply enlarged slightly the threshold detecting
similar normals as identical ones for now, afarid this is the kind of issue that cannot
get a full complete solution for until we drop floats...
2016-08-02 16:08:00 +02:00
08ebd72851 Buildbot: Use annoying hybrid setup of two CUDA toolkits
This is for until we'll solve issues with toolkit 8.0.
2016-08-02 15:32:03 +02:00
500e0e9a3d Cycles: Some more inline policy tweaks for CUDA 8
Makes it so toolkit does exactly the same decision about what to inline,
but unfortunately it has really barely visible difference on GTX-980.
2016-08-02 15:13:34 +02:00
b416168d85 Cycles: Cleanup, trailing whitespace 2016-08-02 14:09:34 +02:00
7b8b16a18c Cycles: Some cleanup in CUDA device file 2016-08-02 14:09:34 +02:00
ad48f13099 Cycles: Include NVCC compiler flags into md5 hash
This way we can easily switch between toolkits without worrying
whether some kernel was compiled with old or new CUDA toolkit.

It's also now possible to switch machine architecture and have
proper cached kernel detected. Not as if it happens every day,
but i did such a bitness switch back in the days :)
2016-08-02 14:09:34 +02:00
fb94f4b884 Fix T48998: 'header input' of rotation transform was clamped in [-PI, PI[ range.
Can't see any reason for this behavior (inherited from 2.4x code), so for now just removing it.
2016-08-02 12:43:03 +02:00
c6398a525d Fix T47591: Smoke keeps both .bphys and .vdb cache files
Delete old caches when changing cache type.
2016-08-02 12:20:54 +02:00
3c70c4f970 Fix T47520: Compositor Node "Filter" Outputs clear image
Make 'Laplace' filter an edge filter operation, since this what it is
typically used for, and such operation does not affect the input's alpha
channel.

Reviewers: sergey, campbellbarton

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D1817
2016-08-02 11:38:03 +02:00
ca6f53d15e Cycles: tweak some folding tests to avoid unnecessary type conversion.
It's easy to connect a simple value to output without forcing
conversion to color by using the Strength socket of Emission.
2016-08-02 12:08:48 +03:00
Julian Eisel
de3181bc38 Fix tmp screen becoming permanent after going fullscreen
Doubt this is intentional.
2016-08-01 22:57:12 +02:00
4067ab38ab Fix T48991: some particles emitted at a distance from object.
The cause seems to be that despite dt_frac being computed as
1/(subframes+1) with integer subframes value, it doesn't always
add up to exactly 1.0 due to precision limitations. If the sum
is similar to 1.00000???, the last subframe is skipped, and all
particles that were supposed to be emitted in that interval are
emitted next frame, with the code working incorrectly due to
skewed time range.

To fix, separate the code from the dynamic timestep feature that
adjusts the last subframe length into a separate function, and
use it even when dynamic timestep is disabled.
2016-08-01 22:14:56 +03:00
538b30250d Audapsace: Make it work with Jack and no libjack-dev package installed
@neXyon, mind backporting it to your upstream? :)
2016-08-01 20:39:54 +02:00
8e015e30b5 Buildbot: Enable proper Pascal architecture 2016-08-01 18:26:53 +02:00
b1d0432bb7 Fix strict compiler flags with older GCC 2016-08-01 18:01:27 +02:00
138362a3c9 Cycles: add unit tests for supported constant folding rules.
Code coverage of different combinations of secondary conditions
is obviously not complete because there are so many of them, but
all main rules should be there.

The reason for CORRECT vs INVALID is that both words have the same
number of characters so calls line up, but look quite different.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: dingto, sergey, brecht

Differential Revision: https://developer.blender.org/D2130
2016-08-01 18:53:20 +03:00
473fc0cf0e Buildbot: Seems quotes are not really needed when passing list 2016-08-01 16:25:03 +02:00
98b8a68f9d Buildbot: Attempt to enable sm_60 CUDA architecture for build slaves 2016-08-01 16:05:33 +02:00
6353ecb996 Cycles: Tweaks to support CUDA 8 toolkit
All the changes are mainly giving explicit tips on inlining functions,
so they match how inlining worked with previous toolkit.

This make kernel compiled by CUDA 8 render in average with same speed
as previous kernels. Some scenes are somewhat faster, some of them are
somewhat slower. But slowdown is within 1% so far.

On a positive side it allows us to enable newer generation cards on
buildbots (so GTX 10x0 will be officially supported soon).
2016-08-01 15:54:29 +02:00
7065022f7a Fix T48901: Blender ignores xinput cursor matrix 2016-08-01 13:51:44 +10:00
a3ce64be5a Cleanup: unused vars, imports, pep8 2016-08-01 11:55:06 +10:00
83ebec7322 Replace pep8 with flake8 checker 2016-08-01 11:02:01 +10:00
8c74ebb64f Support Auto-Clamped Handle for Curve-Mapping
This patch supports auto-clamped handles for curves,
useful since without this it can be difficult to have 'flat' sections of a curve.
2016-08-01 09:06:40 +10:00
36a790653c Fix T48980: crash when loading a file that contains a custom node tree.
Syupid logical mistake in own recent rB018d336cbd51...
2016-07-31 20:07:33 +02:00
Julian Eisel
dda2d1dbea Correction to 0f2ff52c08
This info is shown while dragging, so should stay where it was.
2016-07-31 18:38:21 +02:00
Julian Eisel
0f2ff52c08 Enable Undo for "Add background Image"
Enabled the Undo option for the operation "Add background Image". This is to treat adding a background image like opening an image. This behavior is useful when a background image is add using 'drag and drop'.

Reviewers: Severin

Reviewed By: Severin

Subscribers: brecht

Tags: #bf_blender

Maniphest Tasks: T47050

Differential Revision: https://developer.blender.org/D1725
2016-07-31 17:55:32 +02:00
feac208557 Fix mistake in Cycles mix node multiply constant folding. 2016-07-31 15:00:40 +02:00
81f4bc1665 Cleanup: reduce Vector_getseters size using macros 2016-07-31 20:43:52 +10:00
4734781653 Correct own error in last commit 2016-07-31 19:12:40 +10:00
64d4d6b134 Support limiting collisions by group for softbody and particles
This feature is extremely useful for layering multiple cloth objects,
and there is no reason there shouldn't be the same kind of feature for softbody.
2016-07-31 18:57:19 +10:00
710ab5be36 Cleanup: spelling, style 2016-07-31 17:41:05 +10:00
a96c9def6f PyAPI: minor optimization for dictionary creation
Pass size when its known.
2016-07-31 17:22:04 +10:00
e97ab8347a PyAPI: fix leak in unlikely case converting idprops fail 2016-07-31 16:59:08 +10:00
2dfc954c4a PyAPI: Add PyC_UnicodeAsByteAndSize
Read the string length from Python directly when assigning id-properties
2016-07-31 16:52:44 +10:00
409316434c Docs: add initial idprop.types API docs 2016-07-31 15:40:40 +10:00
516f890b63 Docs: simplify EXCLUDE_MODULES handling 2016-07-31 15:40:40 +10:00
0ec1be1816 Cleanup: capitalize Blender & Python 2016-07-31 15:40:40 +10:00
fc36c2f70e simplify redundant conditionals
The redundant terms were harmless but check an expression we already
know to be true (from earlier in the same conditional).

Found by PVS-Studio T48917
2016-07-31 01:22:36 -04:00
6fffe6cfcc Improve description for use_self py-driver option 2016-07-31 14:23:14 +10:00
3fe7aacdf7 Curve Fitting: circular fit could give NAN handles
Fitting lines that exactly double back on themselves could give NAN length handles.
2016-07-31 13:58:14 +10:00
8fab198aae Cleanup: rename btree (incorrect & confusing) 2016-07-31 12:05:53 +10:00
b2e16c5700 Fix Cycles OpenCL compile error on Windows. 2016-07-31 02:02:28 +02:00
01d5d2853b Py-Driver: re-use self PyObject when its unchanged. 2016-07-31 11:46:36 +10:00
55f481d052 Py-Driver: use intern strings
Avoids managing strings inline
2016-07-31 11:46:36 +10:00
873a623be4 Fix for previous commit changing the addons submodule. 2016-07-31 03:23:51 +02:00
9b6ed3a42b Cycles: refactor kernel closure storage to use structs per closure type.
Reviewed By: dingto, sergey

Differential Revision: https://developer.blender.org/D2127
2016-07-31 02:34:43 +02:00
1776f75c3b Cycles: constant fold add/mul type nodes with known 0 and 1 arguments.
These values often either turn the node into a no-op, or even make it
evaluate to 0 no matter what the other input value is, thus allowing
deletion of a branch of the node graph that otherwise is not constant.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2085
2016-07-31 02:34:34 +02:00
ea2ebf7a00 Cycles: constant folding for RGB/Vector Curves and Color Ramp.
These are complex nodes, and it's conceivable they may end up constant
in some circumstances within node groups, so folding support is useful.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2084
2016-07-31 02:18:23 +02:00
f4bcc97729 Fix Cycles OpenCL not always allocating enough space for closures. 2016-07-30 23:21:03 +02:00
34a639bd0f Fix CUDA warning, due to extra ; at the line ending. 2016-07-30 21:37:20 +02:00
1e2efbc908 Cycles OpenCL: use #line directives for better error messages. 2016-07-30 18:25:52 +02:00
6dc72b3ce6 Cycles OpenCL: detect incorrect usage of SOA members in the split kernel. 2016-07-30 18:25:52 +02:00
c937a42c61 Fix Cycles OpenCL address space compile error with amdgpu-pro drivers on Linux. 2016-07-30 18:25:17 +02:00
e20d306ffa Cleanup: pep8 2016-07-30 18:41:07 +10:00
de103497c4 Fix bplayer (c) 2016-07-30 10:35:30 +02:00
8018f5bd35 Cleanup: pep8 2016-07-30 18:17:11 +10:00
6e9ad094b2 Cleanup: minor changes from last commit
Un-indent blocks, rename vars.
2016-07-30 16:48:44 +10:00
4e845e0670 Py-Driver: add 'self' option
Drivers can use this to refer to the data which the driver is applied to,
useful for objects, bones, to avoid having to create a variable pointing to its self.
2016-07-30 16:46:13 +10:00
362b3bbe58 Cloth Simulation: add time scale property
This setting can also be animated, to create a "time warp" effect.

D2122 by @LucaRood
2016-07-30 15:14:26 +10:00
7a4353160c Cloth: option to use dynamic base mesh
This adds the ability for cloth simulations to respect changes in the underlying mesh.
So you can for instance, animate shape keys, armatures, or add any deformation modifiers (above the cloth modifier).

This is mainly useful for (but not limited to) cartoon animations,
where your character might stretch or change shape, and you want the clothes to follow accordingly.

D1903 by @LucaRood
2016-07-30 14:57:48 +10:00
ca93ebee7f Cloth: UI cleanup & quality hard limit removal
D2121 by @LucaRood
2016-07-30 14:55:07 +10:00
ca983d1825 Cleanup: pep8 2016-07-30 09:00:41 +10:00
3d7cf808b8 Add copy/make_local to movieclip datablock.
As title says... Copying tracking data from movieclip was not the simplest thing...

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2126
2016-07-29 23:13:31 +02:00
4d79fa8382 Gtests: Re-apply strict compiler fixes 2016-07-29 22:19:30 +02:00
37933cb048 Cycles: Add fundamentals to test constant folding
This commit adds some easy to use way to check whether the graph
was properly optimized. The idea is based on using mock glog sync
which keeps track on all messages and expects specific log message
to appear in the logging.

This means each optimization step should report that it optimized
something (specifying what exactly was optimized) and what was used
for optimization.

There's also some ease-ish way to define shader networks which we
might want to make a bit more global and available for all tests
in the future.

For now only RGBToBW node is covered as an example, really hope
to get help from active guys in the community to finish covering
all existing optimization cases. Ready to fix any possible issues
with builder when needed tho :)
2016-07-29 22:19:30 +02:00
ac655be0e3 Add GMock library which is responsive for dealing with mock objects 2016-07-29 22:19:30 +02:00
c6f468d8ed GTests: Update to a newer Git version
Required to get GMock working with GTest.
2016-07-29 22:19:30 +02:00
Julian Eisel
574bbf5d1d Fix missing redraw of timeline when changing GPencil layer settings 2016-07-29 20:42:57 +02:00
e4255a9535 Cleanup space/tabs, Grrr. 2016-07-29 18:49:50 +02:00
8e00406261 Fix a bunch of missing expand calls in object/particle physics area, was breaking linking of those.
Initial report/patch by Alexander Gavrilov (@angavrilov), found more on the road.

Nice demo of why we should use libquery ID looper in read code too - but that's for another day
(also because read code needs to take care of some deprecated pointers sometimes)...
2016-07-29 18:47:43 +02:00
ceb03a4d32 Cycles: Fix wrong projection coordinates for points behind the camera
Points behind camera will be flipped on projection, but that did not
happen.

This solves second issue reported at T48848.
2016-07-29 17:30:24 +02:00
1d154fe271 Cycles: Fix wrong check for object is behind camera after recent fixes 2016-07-29 17:30:24 +02:00
cdc7a24d7b Fix T48971: Append creates linked image textures if object has shape keys.
Hating all those not-so-real ID types... Here there were two causes for the issue:
1) Linked shapekey ID was made local twice (once from mesh's make local, once by itself).
   Solved by not explicitely making shapekeys (nor any other non-linkable datatype) local.
2) Key->from 'back pointer' to its owner was messing 'still in used' detection of linked data
   after localization. Fixed with a hack for now, thinking correct solution might actually
   be to not consider this pointer at all in libquery ID looper, since it's nothing like
   and actual usage of mesh/lattice/curve.

Again, shapekeys as ID is a joke, those should be mere struct, they have absolutely nothing to do in Main, period. :(

Point 2) still demonstrates the need for better handling of IDs dependencies though,
so far we only hit corner cases, but think there could also be valid cases generating those
'dependency cycles' between IDs (ID a using ID b which uses ID a), this will have to be addressed some day...
2016-07-29 17:00:29 +02:00
821394937f Remove "debug build only" event printing.
This makes no sense since user usually only has release build... And those noisy printings are
behind debug flag anyway, so really no reason to only print them out in debug build.
2016-07-29 15:12:56 +02:00
c9134d86f0 Cycles: Fix strict compilation warning 2016-07-29 15:06:13 +02:00
899947c89e Fix T48679: Bone transform only alters between translation and rotation
There was some smart code in the transform which would alter between translation
and rotation based on whether bone is connected or not and whether translation is
locked or not.

It could be handy to also fallback to scale if both rotation and translation are
locked.
2016-07-29 14:47:23 +02:00
992257cfa0 Cycles: remove narrowing conversion from recent commit 2016-07-29 04:00:37 -04:00
66e2e2484c Cycles microdisplacement: move subdivision options to subsurf modifier
Subdivision options can now be found in the subsurf modifier. The modifier must
be the last in the stack or the options will be unavailable. Catmull-Clark
subdivision is still unavailable and will fallback to linear subdivision instead

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2109
2016-07-29 03:37:55 -04:00
c96ae81160 Cycles microdisplacement: ngons and attributes for subdivision meshes
This adds support for ngons and attributes on subdivision meshes. Ngons are
needed for proper attribute interpolation as well as correct Catmull-Clark
subdivision. Several changes are made to achieve this:

- new primitive `SubdFace` added to `Mesh`
- 3 more textures are used to store info on patches from subd meshes
- Blender export uses loop interface instead of tessface for subd meshes
- `Attribute` class is updated with a simplified way to pass primitive counts
  around and to support ngons.
- extra points for ngons are generated for O(1) attribute interpolation
- curves are temporally disabled on subd meshes to avoid various bugs with
  implementation
- old unneeded code is removed from `subd/`
- various fixes and improvements

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2108
2016-07-29 03:36:30 -04:00
f74645578c Missing free for single-sided edge-slide failure 2016-07-29 14:24:03 +10:00
e0c7aaf5ad Fix Cycles OSL hair BSDF inconsistencies with SVM. 2016-07-29 03:29:05 +02:00
52fb441c13 Fix Cycles ctests not always deleting fail.png files on success. 2016-07-29 03:29:05 +02:00
e30f9b04fc Fix use of uninitialized variable in Cycles, mostly harmless. 2016-07-29 03:29:02 +02:00
66552ca586 Make ID types typed enum, to easily spot missing ones in core switches of library.c
Note that all deprecated/non-real ID types are kept as defines.
2016-07-28 19:32:36 +02:00
035b40337a Fix T48965: Cannot Append Palette As Local Datablock.
Palette and PaintCurve were totally missing from id_copy/id_make_local switch... :/
2016-07-28 19:32:36 +02:00
d834759423 Cycles: Fix difference in Ashikhmin Shirley shader between CPU and GPU
The issue was caused by some NaN appearing in calculations.

Visible with scifi_armor_concept.blend from the cloud.
2016-07-28 18:46:29 +02:00
85ccdf37c0 Cleanup: Indentation 2016-07-28 14:17:35 +02:00
f86aa6a879 Fix T48838: Tiling sculpt problem with custom brush 2016-07-28 14:01:15 +02:00
cba8e03672 Fix T48962: Edge-slide, random edge switch order 2016-07-28 21:50:41 +10:00
df00529648 Cycles: Fix missing mesh flags update when tweaking shaders
This is a bit weak, but better than tagging whole mesh manager for update.

Maybe we'll solve such dual-look up in the future.

This commit finally solves T48963: Noise when changing Diffuse node to Emission node
2016-07-28 12:37:44 +02:00
9f18e3acd6 Cycles: Fix wrong order of light manager update tag
Shader's has_surface_emission will only be known for sure after compilation.
2016-07-28 12:31:01 +02:00
d3d1313ca4 Cycles: De-duplicate more checks around light emisive meshes
Once again, should be no functional changes.
2016-07-28 12:28:31 +02:00
87717c6449 Cycles: De-duplicate check for MIS shaders in meshes
Should be no functional changes.
2016-07-28 12:27:05 +02:00
aaac4e965e Cycles: Add some extra logging for light debugging 2016-07-28 12:13:11 +02:00
402d4ea0b6 DupliObject: Remove unused and confusing index argument from the context 2016-07-28 10:49:31 +02:00
3673a5adba Curve Fitting: Use normalized projection function 2016-07-28 18:33:14 +10:00
5ecc6a824a Fix T48404: Translate fails w/ snap orientation option
Rotate the object around the snap-target so it meets the snap-point.
2016-07-28 18:16:31 +10:00
8df5f97c2c Cleanup: unused transform member 2016-07-28 18:16:31 +10:00
d66a27de2e Fix T48961: Material slots become easily desynced over linked duplicates.
Own mistake in recent changes (split to test_object_materials()/test_all_objects_materials()).
2016-07-28 09:23:46 +02:00
d60acd0e94 Fix crash fitting single point curve 2016-07-28 14:37:55 +10:00
3a4c307652 Use COMPAT_ENGINES instead of RenderEngine.use_game_engine for panel poll methods
This mostly affects physics panels. Any engines relying on
RenderEngine.use_game_engine flag to show/hide panels will need to be
updated. The COMPAT_ENGINES technique is how we usually deal with this.
One issue with use_game_engine is that I cannot find a way to set it; it
appears only the BGE can set it. This means (without this commit)
external RenderEngines cannot get rid of the default physics panels.

The RE_GAME flag (the C flag behind use_game_engine) is pretty hacky
and we should look into removing its usage where possible.
2016-07-27 19:00:35 -07:00
a27acefd0c Fix T48951: Crash refreshing some popups
Fix for T48874 caused popups to be tagged to be refreshed, that didnt support it.

Tag popups that can't be refreshed.
2016-07-28 11:16:11 +10:00
Julian Eisel
8f16181e9c Add comments on behavior of spacedata and regionbase lists 2016-07-28 02:36:12 +02:00
Julian Eisel
c59b21feec Fix own mistake from c05363e889
Didn't know slink->regionbase is removed when area is active. Don't see why this is done, but it's confusing :S
2016-07-28 02:27:39 +02:00
b645e7081d Fix T48790: Cycles render bug with zero strength lights. 2016-07-27 23:09:38 +02:00
Julian Eisel
c05363e889 Fix crash closing Blender while in rendered local view
Happens because it was always using regionbase of active/visible area, not the correct one of the (possibly inactive) 3D view. Was pretty hidden because you had to be in local view to trigger it.
Could also remove ScrArea * argument from SpaceType.id_remap now, but leaving in there to avoid bigger changes (might also be useful for some case).

Steps to reproduce:
* Default startup.blend
* Enter local view with default cube (/-key)
* Render (or open a different editor where the 3D View is)
* Close Blender - should invoke crash
2016-07-27 21:05:44 +02:00
Julian Eisel
4559229163 Fix memory leak when closing Blender with operator popup open
Steps to reproduce:
* Default startup.blend
* RMB-Click on "Cube" item in outliner
* Select Remap Users
* Close Blender using window 'x' button
2016-07-27 19:45:43 +02:00
e4646c52c0 Fix T48946: Blender+Tahiti+DRI3+Unity+Linux GUI corruption/not rendering
Enable triple buffer by default for AMD cards on opensource driver.

Should be safe now, since it was only old cards causing problems,
which we don't support now most likely anyway.
2016-07-27 16:06:18 +02:00
25bd01f2f7 Avoid creating multiple outputs connected to the same socket when creating a node group
This patch fixes the annoyance that when creating a node group where one of its nodes is connected
to several other nodes, a separate output will be created for each link, even though they're all
connected to the same socket in the group.
Now, before adding an output for an outgoing link, the existing outputs are checked to find whether
any output is already connected to the same socket. If such an output is found, it is reused instead of
creating a new one.

Reviewers: Severin

Subscribers: Blendify

Differential Revision: https://developer.blender.org/D1836
2016-07-27 15:56:48 +02:00
d7bd64df5d Fix T48061: Crash with adaptive domain and cases when there's no smoke 2016-07-27 15:40:32 +02:00
ae881ddf43 Fix T48760: Changing Renderlayer Compositor node Layer does not update enabled outputs until script is finished 2016-07-27 15:17:15 +02:00
2e38c07e48 Cycles: Style, placement of asteric in pointers
Seems we are using `void *` much much more often in Cycles.
2016-07-27 14:10:09 +02:00
183874841b Cycles: Some minor tweaks to emission sharder
- Nodification of shader nodes changed default strength from 10 to 1.
  If that was intentional, IMO should happen as a separate commit.

- Fixed indentation.
2016-07-27 14:05:22 +02:00
5f95ffe350 Fix T48829: Memory leak on Blender Exit
It was possible to have missing outlink but GPUNodes in material.
2016-07-27 10:59:09 +02:00
3d8c2e25a3 Fix T48950: Movie Clip mode segfaults
Missing linking code in blenloader.
2016-07-27 10:18:54 +02:00
Julian Eisel
24b8e781f6 Correct UI names of ID types
Also correct typo.
2016-07-26 20:25:55 +02:00
Julian Eisel
3c59a5068f More useful block name for report popup blocks
Report popups simply reuse popup menu code, so their blocks got "UI_popup_menu_begin" assigned as name, which was a bit misleading. Now uses "UI_popup_menu_reports".
Ideally they'd have their own popup code.
2016-07-26 20:25:55 +02:00
c1fd97f15d Fix T45936: invalid cycles motion blur for particle rotation and children.
Commit rB709ca0ece changed how rotation was handled for particles so
that unless actual rotation physics is enabled, there is no rotation.
However it only updated ptcache_particle_read, forgetting to change
exactly the same code in ptcache_particle_interpolate.

This means that for subframes old code that computes a rotation from
velocity is used, resulting in completely different rotation than for
integer frames. This causes rotational motion blur by itself, and also
mangles motion blur paths of child particles.

Reviewers: sergey, lukastoenne

Maniphest Tasks: T45936

Differential Revision: https://developer.blender.org/D2124
2016-07-26 18:06:42 +02:00
f3f10e4515 Fix T48813: Custom icon is not drawn on header / addons prefs panel.
For now use 'brute force' and refresh whole UI when new icons get rendered.

See comment of T48813 for ideas about how to handle that in future (2.8 project ?).
2016-07-26 17:55:18 +02:00
f31f740bd0 Cycles: Proper fix for buffer overflow in volume intersect all 2016-07-26 17:16:23 +02:00
7030794171 Cycles: Revert previous fixes to intersect_all functions
While they prevent legit write past the array boundary error
those fixes introduced regression in behavior when having exact
max_hits transparent intersections and nothing else.

Previous code would have considered such case a totally opaque,
but it's not correct.

Fixes T48941: Some materials don't get transparent shadows anymore
2016-07-26 17:16:23 +02:00
b91aea6096 Fix issues in ID usages checks - we are not interested in self-usages here.
Drivers or constraints referencing self object could break deletion of proxy objects
(due to their ambiguous, half-local, half-linked status).
2016-07-26 15:12:43 +02:00
01e3141ce6 Fix T48902: MCE Dopesheet does not respect Left Click select
Make the operator consistent with animation dopesheet now.
2016-07-26 14:39:06 +02:00
711d3a8a2b Depsgraph: Use proper check whether ID is an object
Fixes bug which resulted in making it so layers from all
layers are getting updated.

Reported by Juan Pablo Bouza.
2016-07-26 10:49:54 +02:00
40a0fa8a8f Depsgraph: Use proper unsigned int bitfield for layers flags 2016-07-26 10:45:07 +02:00
eececb0d80 Curve Drawing: use more closely spaced samples
Re-fitting makes better use of more samples.
2016-07-26 06:43:59 +10:00
4da8543d0d Resolve undefined M_PI w/ MSVC2013 2016-07-26 05:28:13 +10:00
6e131ce075 Call to python3 for stand-alone scripts
Needed since Debian & FreeBSD both move away from keeping a synlink to `python`.
2016-07-26 05:18:00 +10:00
1ea410c559 OpenSubdiv: Fix opensubdiv option obscuring the interface 2016-07-25 18:36:14 +02:00
1870e166de Cleanup: factorize the 'ensure local' part of datablock copy into a single BKE_id_copy_ensure_local function. 2016-07-25 16:16:35 +02:00
d9cc3ea2c6 Cycles: Fix rays parallel to the surface in the triangle refine and MultiGGX code
In the triangle intersection refinement code, rays that are parallel to the triangle caused a divide by zero.
These rays might initially hit the triangle due to the watertight intersection test, but are very rare - therefore, just skipping the refinement for them works fine.

Also, a few remaining issues in the MultiGGX code are fixed that were caused by rays parallel to the surface (which happened more often there due to smooth shading).
2016-07-25 16:14:25 +02:00
83ae0a0e06 Cycles: Calculate differentials in the Multiscattering GGX closures
The Multiscattering GGX closures didn't set the omega_i differentials, which could cause undefined behaviour.
2016-07-25 16:14:25 +02:00
988ec3c40c OpenSubdiv: Support shadeless shading 2016-07-25 15:38:28 +02:00
c967a381fa OpenSubdiv: Fix missing support of flat shading in textured viewport 2016-07-25 15:27:38 +02:00
27db7ef81d OpenSubdiv: Use proper material index 2016-07-25 15:17:37 +02:00
e7721f5ec8 Cycles: Fix SSS with spatial splits and motion blur 2016-07-25 13:55:03 +02:00
a4db868092 Resolve build error on OSX 2016-07-25 20:30:24 +10:00
bbf62931de Cleanup: debug-only variable. 2016-07-25 09:31:56 +02:00
f4cb6d45d5 Error in curve update, uninitialized var use 2016-07-25 15:12:46 +10:00
2aa5e44b5d Curve Drawing: Use cyclic for stroke with near start/end points 2016-07-25 14:55:16 +10:00
a323d8edbf Curve Drawing: Add option to use new refit method 2016-07-25 14:55:16 +10:00
2418daede5 Curve Fitting: Add alternate 'refit' method
This is an alternative method for fitting a curve which incrementally simplifies the curve, then re-fits.

Generally gives better results, also improves corner detection.
2016-07-25 14:55:08 +10:00
f23fecf306 Fix use of uninitialized variable in recent SSS fix. 2016-07-24 16:40:30 +02:00
f283aa61c5 Fix T48397: Can not bake tweaked NLA
We need to leave tweak mode before trying to modifiy the action as doing
so will leave Blender in a semi-corrupted state.

Reviewers: #animation

Reviewed by: aligorith

Maniphest Tasks: T48397

Differential Revision: https://developer.blender.org/D2119
2016-07-24 03:18:40 +02:00
e4efa16b00 Fix T48663: The Soft Light blend type layer make the color darker in the
3D view

There was a misusage of the `outcol` and `texcol` params. The actual
formula should have been:

  incol = facm * outcol + fact * ((one - outcol) * texcol * outcol +
outcol * scr);

To make sure the result is consistent with material mode, reuse the
material blend function (mix_soft), similarly to what most other texture
blend modes do.
2016-07-24 01:04:54 +02:00
4cbefde47c Audaspace: fix incorrect parameter check in python API.
Found by PVS-Studio T48917
2016-07-23 13:35:36 +02:00
8001854083 Cleanup: style 2016-07-23 18:52:18 +10:00
6ef37faa58 Cleanup: warning 2016-07-23 18:52:18 +10:00
bd11d917c1 fix atan2f input conditional
Suspicious conditional found by PVS-Studio T48917

Original code (from Blender’s initial open-source commit!) looks like
it’s testing inputs to atan2f, to avoid undefined function values.
Passing xn=0 does *not* always evaluate to 0 though… I’m not sure if
this is a coding error or was done for a desired visual result.

Also changed xn==0 to xn>=0 to avoid function call in more cases.

Good description and visualization of atan2f function:
http://en.cppreference.com/w/c/numeric/math/atan2
2016-07-22 21:00:12 -04:00
164575af29 OpenSubdiv: Properly respect Subdivide UVs option 2016-07-22 17:53:00 +02:00
Julian Eisel
7ca4cf2be5 Fix crash using ID remapping on invalid ID pairs
Missing NULL checks caused crash in BKE_reportf formatting.
2016-07-22 17:13:23 +02:00
9c63878085 OpenSubdiv: Initial support of UV maps in material shading mode 2016-07-22 16:12:03 +02:00
b2f91d8acf OpenSubdiv: Use BLI module math functions
It became rather annoying to have those functions duplicated.

Surely, it's not really nice it's actually a bad level call,
but similar thing is happening in OCIO and Cycles.

IMO, it's better than having functions re-implemented, and
have this solved with new OpenGL pipeline.
2016-07-22 15:13:42 +02:00
165f710519 OpenSubdiv: Make drawing code a bit more flexible for FVar width 2016-07-22 15:08:18 +02:00
ccd51bb922 OpenSubdiv: Properly support active UV layer in textured view 2016-07-22 14:56:15 +02:00
48c4b700dc OpenSubdiv: Lay down fundamentals to support multiple UV maps 2016-07-22 14:56:15 +02:00
98970f71fe OpenSubdiv: Get number of UVs from topology refiner
This allows us to store more than one UV layer in the UVs array.
2016-07-22 14:56:15 +02:00
177c4aff8b OpenSubdiv: Cleanup, please don't use insanely long lines 2016-07-22 14:56:15 +02:00
adf97edc8f OpenSubdiv: Cleanup, don't use camel case for variable names 2016-07-22 14:56:15 +02:00
e8037867b6 Correct mistake comparing vertices 2016-07-22 18:18:59 +10:00
a7e742f9c4 use bool consistently, fix redundant conditional
Redundant conditional (line 939) found with PVS-Studio T48917

There’s still a lot of true/false, 1/0, SELECT/DESELECT usage nearby.
Not a problem, just confusing to read.
2016-07-22 02:17:52 -04:00
2b77b1ce46 remove double-checked conditions
Checking a condition right after we’ve checked it (and it hasn’t
changed). Most of these are trivial to understand.

split_quads in convertblender.c:
It seems quads should be processed and triangles should be marked as
not needing split. So I removed the outer vlr->v4 check.

Found with PVS-Studio T48917
2016-07-22 02:17:52 -04:00
bd52875dd6 Add Subdivide Edge-Ring to menu 2016-07-22 15:51:02 +10:00
192df299d9 Fix T48926: Subdivide edge-ring crash
Also resolves: T34294
2016-07-22 15:45:04 +10:00
08e1bba10c fix confusing operator precedence
Assigning within a conditional is confusing and error prone so I
rewrote in a more straightforward way.

Found with PVS-Studio T48917
2016-07-21 18:52:44 -04:00
9ff8d4a957 fix enum type / values mismatch
Found with PVS-Studio T48917
2016-07-21 18:26:54 -04:00
7c99b7110e fix null pointer dereferences
Found with PVS-Studio T48917
2016-07-21 18:16:08 -04:00
23f1b2073f fix comparison of identicals
Some of these check that dimensions match before running code that
assumes they do match.

For imb_stereo3d_write_anaglyph I *assume* this change reflects the
intended behavior. Before it was always grabbing alpha from buffer 0.

Found with PVS-Studio T48917
2016-07-21 18:16:08 -04:00
d1f9342e37 Cleanup: pass pointer to texture draw state 2016-07-22 07:33:29 +10:00
cddef5589a BMesh: compare face angles as angles cosine 2016-07-22 07:22:47 +10:00
875c1313b1 Fix broken proxy object deletion.
Check to ensure we do not delete last instancing of an indirectly used object (forbidden
because it creates 'ghost' objects user have no real way to re-instance) was defeated by
the backward pointer 'proxy_from', which generated a 'false' indirect usage of (local)
proxy object itself (the one we are trying to delete).

Fixed by actually considering that ID usage as local if proxy object itself is local
(because that pointer actually does not 'pertain' to the object holding it, but to its proxy).

Yeah, it's... complicated, twisted and ugly - it's proxy.
2016-07-21 23:07:14 +02:00
6ebce7e948 fix typo in condition
(A - A).norm() is always 0 so condition is always true.

(A - B).norm() and (B - A).norm() both compute the same distance so I
picked one to match surrounding code.

Found with PVS-Studio T48917
2016-07-21 15:53:39 -04:00
b5ba14ef70 Fix T48915: Wrong threshold on scaled objects and ortho view.
`ray_is_normalized` == true in DerivedMesh
2016-07-21 16:36:20 -03:00
14995c5617 Fix crash w/ auto-insert offset 2016-07-22 04:22:26 +10:00
1cc0ce58fd Cleanup: warnings 2016-07-22 04:06:10 +10:00
9279bee583 remove repeated codec-supports-alpha check
I don’t think any other codec enum makes sense here, so probably just
an extra copy/paste. Here are the video codecs:

AV_CODEC_ID_NONE
AV_CODEC_ID_MPEG4
AV_CODEC_ID_MJPEG
AV_CODEC_ID_DNXHD
AV_CODEC_ID_MPEG2VIDEO
AV_CODEC_ID_MPEG1VIDEO
AV_CODEC_ID_DVVIDEO
AV_CODEC_ID_THEORA
AV_CODEC_ID_PNG <— alpha
AV_CODEC_ID_QTRLE <— alpha
AV_CODEC_ID_FFV1 <— alpha (if enabled)
AV_CODEC_ID_HUFFYUV <— alpha
AV_CODEC_ID_H264
AV_CODEC_ID_FLV1

Found with PVS-Studio T48917
2016-07-21 13:50:35 -04:00
9d0cbbe1dd Tracking: Fix bug when tracker will keep trying tracking past the footage 2016-07-21 17:02:33 +02:00
aedff9dbef Add BKE_mesh_calc_islands_loop_poly_uvmap and use it in new OSD UV subdiv.
Also renamed BKE_mesh_calc_islands_loop_poly_uv to BKE_mesh_calc_islands_loop_poly_edgeseam,
to avoid confusion...
2016-07-21 16:54:36 +02:00
db0c2be55e BKE mesh mapping: add new BKE_mesh_edge_loop_map_create().
Maps edges to all their pair of loops.
2016-07-21 16:54:36 +02:00
d4342b3897 Fix (unreported) memleak in image copy function. 2016-07-21 16:54:36 +02:00
2969b30813 Fix stupid (harmless) mistake in recent commit. 2016-07-21 16:54:36 +02:00
77ff125232 BKE_library_make_local: clear behind us no more used linked datablocks.
This is really not elegant solution, but simplest for now.

Ideally, we'd check all IDs first and directly 'make local' (without need to copy)
those only indirectly used by other datablocks to be made local. Would also save us from the
need of the extra 'lib_local' parameter recently added to id_make_local.

Current code seems to work well enough though, and this is not high priority to fix imho.
2016-07-21 16:54:36 +02:00
af2deb5438 Fix (unreported) crash in some case when remapping armature data.
Those bone pointers in object's pose bite again - turns out they can be accessed
before pose actually gets rebuilt in some cases (e.g. from undo writefile), so
we need to clear the pointers immediately.
2016-07-21 16:54:36 +02:00
b156674251 Fix missing datablocks types in id_make_local.
Adding make_local for vfont/gpencil/group/freestyle linestyle/mask/scene/sound/text.

Note that there are still some lose ends here, since some type are not handled by id_copy
(Scene, Sound and VFont), which means in case a datablock of that type is used both
directly and indirectly, localization will fail.

Scene copying might be doable though (maybe with a simple new 'full shalow' mode to existing BKE_scene_copy?),
not sure about sounds and vfonts... Situations where this becomes an issue should be very rare corner cases anyway.
2016-07-21 16:54:36 +02:00
5dc7dc70ea Cleanup: get rid of lib_indirect_test_id.
id_make_local and later remapping are supposed to handle that already,
and in a much much saner and more complete way.
2016-07-21 16:54:36 +02:00
d8d4bef6cc Refactor/deduplicate even more make_local code (and fix part of T48907).
Turns out most BKE_foo_make_local datablock-specific functions are actually doing
exactly the same thing, only two currently need special additional operations
(object and brush ones). So added a BKE_id_make_local_generic instead
of copying same code over and over.

Also, changed a bit how make_local works in case we are localizing a whole library.
We need to do the 'remap' step (from old linked ID to new local one) in the second loop,
otherwise we miss some dependencies. This fixes main part of T48907.
2016-07-21 16:54:36 +02:00
2977dcf2f7 Tracking: Fix possible cases when tracker will try tracking failed tracks 2016-07-21 16:54:18 +02:00
1deb01a9b9 Attempt to fix compilation on Windows, take 2
Previous patch was wrong apparently... :|
2016-07-21 16:12:31 +02:00
be1c854019 Attempt to fix compilation error on Windows.
Patch from @fjuhec.
2016-07-21 15:45:07 +02:00
aa316c73e0 OpenSubdiv: Prepare majority of things to have proper subdivided UV
Mainly the changes are related on establishing API to feed UV islands
to OpenSubdiv, so it will know all the connectivity information and
will be able to do proper interpolation.

Island calculation is currently rather slow, not sure how to make it
fast and not use lots of allocations.

Shouldn't be THAT bad, since this code is only runs once when creating
OSD mesh, and it's probably still faster than our orientation code.
2016-07-21 12:34:57 +02:00
e44fa4e6a9 Fix another Cycles OSL script node issue with shaders using bump. 2016-07-21 04:40:28 +02:00
ecd33bacf0 Cleanup: use const, move comments to enum 2016-07-21 11:52:41 +10:00
1c6b8c6675 Fix Cycles OSL script node not working in shader using bump, after node type refactoring. 2016-07-21 02:56:17 +02:00
97ef8777fc Fix T48908: gray out Cycles motion vector pass if motion blur is enabled, doesn't work then. 2016-07-21 01:03:12 +02:00
a2a1b34cd1 Cleanup: warnings 2016-07-21 07:38:15 +10:00
a96c7daf80 Cleanup: unused brush DNA 2016-07-21 07:17:43 +10:00
21425e54bc Cleanup: spelling 2016-07-21 07:16:59 +10:00
5ef1821a0f Fix copy-materials resetting objects material indices 2016-07-21 06:03:02 +10:00
e0f16bdcc2 Cleanup: use BKE naming convention for object materials
Also remove unused 'material_from' function (which isn't very useful).
2016-07-21 06:02:34 +10:00
dd020caa04 Cleanup: remove completely call to test_object_materials in BKE_mesh_new_from_object.
Don't know why this was ever added to start with, BKE_mesh_new_from_object shall never affect ob->data!
2016-07-20 16:42:09 +02:00
1270ab91be Fix T48898: shaders are removed from metaballs on cycles render.
Note that issue has several levels here actually, first one was metaball's materials
not being properly copied into new mesh (code was commented out because of some crash it
seems, made it a bit closer to mesh one and got no crash at all...).

Then, we were calling test_object_materials when ob->data is actually *not* new tmpmesh!

Will remove this call completely in next commit (to make it easier to bisect), I cannot see
any case where object would be assigned with newly generated tmpmesh in this func.
2016-07-20 16:42:09 +02:00
4e5ee5b75e Fix own error in recent heap update 2016-07-21 00:35:42 +10:00
f0f60d775d OpenSubdiv: Initial work to support UV maps in textured OSD viewport
A bit work in progress, currently the following limitations:

- Texture shading only, Material shading will come later

- No UVs subdivision yet

- Always uses active UV and currently changing active UV will
  not properly update the viewport.

Well, need to start somewhere :)
2016-07-20 14:16:38 +02:00
9a0634a253 OpenSubdiv: Wrap OSD's TopologyRefier with own struct
This is a way for us to store extra data, such as UVs which we can
collect now on topology refiner stage.
2016-07-20 12:38:33 +02:00
690063edb9 Fix T48897: Flatten brush fails on first stroke
The flatten brush depended on accumulate being disabled,
Adding dynotopo support for accumulate caused problems for this tool (see T44390).
Enable for existing files.
2016-07-20 13:54:55 +10:00
f2fa73786b possible fix for crash mentioned in T48887 - Adjust the depth min to the object scale 2016-07-19 22:25:13 -03:00
5f7fd0444d BMesh: improve BM_face_splits_check_legal
- remove edge scaling, instead avoid checking intersections with connected edges.
- replace local line intersection functions with BLI_math
- center the projection for more precise calculation.
2016-07-20 10:00:35 +10:00
6ff7a891e7 Update tracker URL
Also wrap line-length
2016-07-20 06:37:21 +10:00
5f4a3785c6 Add 'reload' function to libraries' RNA API. 2016-07-19 17:49:33 +02:00
6921bb7a4a Improved warning message when creating empty export file 2016-07-19 16:34:22 +02:00
b9e4e69a4d Fix (IRC reported by Sergey) assert regarding icon_id of newly copied datablocks.
BKE_previewimg_copy() would simply copy PreviewImage's icon_id, without bothering about
ID one.

When we duplicate an ID, we want to reset its icon_id to zero (and regenerate it on-demand),
not keep same icon_id as original, so added new BKE_previewimg_id_copy helper to handle that.
2016-07-19 16:27:40 +02:00
eeedcf3892 Usual i18n/UI messages fixes... 2016-07-19 15:41:28 +02:00
307250723b Fix building on NetBSD 2016-07-19 22:04:14 +10:00
eac9d2d430 OpenSubdiv: Fix wrong shading in BI texture mode
This probably makes code somewhat slower, but we can't easily know
whether we can use a shortcut and only use directional lighting from
the scene.

Need some better integration between GPU and OpenSubdiv for that.
2016-07-19 12:49:37 +02:00
c883946441 OpenSubdiv: Fix broken structure alignment when using color material 2016-07-19 12:49:37 +02:00
d8de018398 update player stub 2016-07-19 19:31:27 +10:00
95da68822b Fix missing break in libblock relink 2016-07-19 10:27:37 +10:00
3948f65686 Cleanup: style, spelling 2016-07-19 10:27:33 +10:00
bd59206b5c Cleanup: style, spelling 2016-07-19 09:16:38 +10:00
5234e9ddd3 Cycles: add ConstantFolder class for constant folding boilerplate.
Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D2089
2016-07-18 22:54:30 +02:00
10b0e33de1 Cycles: add support for motion blurring of fluid meshes.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2063
2016-07-18 22:40:08 +02:00
20ec6bc166 Fix Cycles kernel build without render passes support. 2016-07-18 22:40:08 +02:00
277cb12395 Fix T48874: Nested pop-up didn't update its parent 2016-07-19 06:01:56 +10:00
399c978a55 fix breakage caused by D2094 / rB404f41d22de46119ee8afb409011eb1ba1840092 2016-07-18 13:09:41 -06:00
ffe106a56a Docs: improve bpy.props.EnumProperty reference 2016-07-19 05:03:50 +10:00
a99dbb9aa0 Fix T48885: Wheel in image space changes wrong window 2016-07-19 02:46:12 +10:00
de0f371528 Fix missing release w/ mouse wheel over layer menu 2016-07-19 02:46:12 +10:00
404f41d22d [bf_intern_ghost/Windows] Cleanup
This patch addresses the following issues in bf_intern_ghost

```
Warning	C4312	'type cast': conversion from 'GHOST_TEmbedderWindowID' to 'HWND' of greater size	bf_intern_ghost	K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp	179
Warning	C4312	'type cast': conversion from 'GHOST_TEmbedderWindowID' to 'HWND' of greater size	bf_intern_ghost	K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp	198
```

GHOST_TEmbedderWindowID is defined as long, handles are however of pointer size,
so this should have been an issue when we moved to 64 bits, guess we got lucky.
fixed by turning GHOST_TEmbedderWindowID from long into void*

```
Warning	C4302	'reinterpret_cast': truncation from 'HKL' to 'LANGID'	bf_intern_ghost	K:\BlenderGit\blender\intern\ghost\intern\GHOST_ImeWin32.cpp	67
```

reinterpret_cast emits warnings on truncation, LOWORD does the job just
as well with no warnings.

```
Warning	C4838	conversion from 'int' to 'DWORD' requires a narrowing conversion	bf_intern_ghost	K:\BlenderGit\blender\intern\ghost\intern\GHOST_ContextWGL.cpp	734
Warning	C4838	conversion from 'int' to 'BYTE' requires a narrowing conversion	bf_intern_ghost	K:\BlenderGit\blender\intern\ghost\intern\GHOST_ContextWGL.cpp	734
```

Weird warning, it does a really bad job at telling you what parameter is
causing the warning , tuns out there's a bunch of parameters that cause it
but it still only yields a single warning, the problem is that every
(somevar ? a : b) construct results in an integer type. which needs to be
properly cast to get rid of the warning.

```
Warning	C4996	'GetVersionExA': was declared deprecated	bf_intern_ghost	K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp	105
Warning	C4996	'GetVersionExA': was declared deprecated	bf_intern_ghost	K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp	107
```

The warning was clear, the code not as much. The version check in place
here is quite convoluted and could be replaced by including VersionHelpers.h
and calling IsWindows7OrGreater, However, CreateInstance will just return NULL
in m_Bar if the interface is not supported, so the whole check is useless.
This however did require that the CreateInstance call actually asked for
ITaskbarList3 and not ITaskBarlist . (You're not really allowed to assign
different interface types to each-other, a roundtrip through QueryInterface
is required there, we were violating spec here by asking for ITaskBarlist and
storing it in ITaskbarList3*  )

Reviewers: sergey

Reviewed By: sergey

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2094
2016-07-18 15:48:51 +02:00
a76e69f5f7 Additional Waveform Drawing Mode
This diff adds a 6th drawing mode to the Waveform Scope.

The new mode shows the RGB colour channels overlaid as a "Full colour" waveform.

The old "Red Green Blue" mode is renamed "Parade" which is the standard industry
term for RGB channels shown side-by-side.

This full colour style of waveform is very much more useful for colour grading than the
Parade mode and is the default waveform for many artists.

Files from older Blender versions which show scopes open as expected.

Patch by John Cox (johnedwardcox), thanks!

Reviewers: sergey

Reviewed By: sergey

Subscribers: campbellbarton, tmw, Blendify

Differential Revision: https://developer.blender.org/D1936
2016-07-18 15:42:21 +02:00
3e882c91e0 [MSVC2015/Cycles] MSVC2015 before update 3 produce invalid builds
I'm not quite sure where the codegen bug gets triggered but it's easily
noticeable in the barcelona scene. (extra saturated leafs and illumination
on the right ledge of the pool)

2013 buildbot reference image:
{F320792}

2015 With no updates (compiler version 19.00.23026)
{F320793}

2015 With Update 2 (Compiler version 19.00.23918)
{F320794}

2015 With Update 3 (Compiler version 19.00.24210)
{F320795}

This patch blocks all compiler builds before update 3 in a similar way we
did for msvc 2013 update 4

Reviewers: campbellbarton, brecht, juicyfruit

Reviewed By: juicyfruit

Tags: #bf_blender

Differential Revision: https://developer.blender.org/D2100
2016-07-18 15:26:52 +02:00
6239afd36f [MSVC/LNK4199/Cleanup] Delay loading is causing linker warnings.
We recently added delay-loading of the openmp dll's so we no longer had to use
the stub loader, we however put these linker flags on the global linker flags
causing any sub projects not using openmp to spit linker warning 4199 while building,

```
Warning	LNK4199	/DELAYLOAD:vcomp140.dll ignored; no imports found from vcomp140.dll	datatoc	k:\BlenderGit\build_windows_2015a\source\blender\datatoc\LINK	1
```

This patch makes the delay-load only apply to the blender project.

Reviewers: sergey

Subscribers: sergey

Tags: #bf_blender

Differential Revision: https://developer.blender.org/D2092
2016-07-18 15:20:29 +02:00
65e7caf950 Fix (unreported) ED_region_tag_redraw_partial() could override a previously defined partial redraw, instead of extending it.
Probably not an issue currently, since partial redraw is not much used
(only from sculpt code and box-rendering it seems?), but logic was broken here.
2016-07-18 14:41:56 +02:00
bbc1507871 Fix T48848: Cycles - Camera Culling - Camera Culling removes objects which are still in frame 2016-07-18 14:29:37 +02:00
6533d72056 Fix T48877: Lightmap Pack fails w/ 1-3 faces
Unnecessary limit was applied.
2016-07-18 19:44:51 +10:00
d42cb44ea2 CMake: correct py-module on OSX 2016-07-18 19:30:32 +10:00
9946cca146 Fix T48860: Cycles SSS artifacts with spatially split BVH
The issue was caused by SSS intersection code gathering all
intersections without check for duplicated ones. This caused
situations when same intersection will be recorded twice in
the case if triangle is shared by several BVH nodes.

Usually this is handled by checking intersection distance
after sorting intersections (in shadow_blocked for example)
but for SSS we don't do such sorting and using number of
intersections to calculate various things.

Didn't find anything smarter than to check intersection
distance in triangle_intersect_subsurface().

This solves render artifacts in the cost of 1.5% slowdown
of extreme case rendering (SSS object filling in whole
FullHD screen).

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2105
2016-07-18 10:04:20 +02:00
a2c82f5e5d Cycles: Fix OpenCL compilation after the recent numerical fixes 2016-07-17 19:24:53 +02:00
c974def837 BLI_heap: replace memarena w/ local allocator
- Since element size its known it's less work to do inline.
- In test with high-poly model, gave ~9% overall speedup for decimate modifier.
2016-07-17 19:29:30 +10:00
c57d823683 Cleanup: minor edits to BLI_heap 2016-07-17 19:29:30 +10:00
d9281a6332 Cycles: Fix three numerical issues in the fresnel, normal map and Beckmann code
- In fresnel_dielectric, the differentials calculation sometimes divided by zero.
- When the normal map was (0.5, 0.5, 0.5), the code would try to normalize a zero vector. Now, it just uses the regular normal as a fallback.
- The approximate error function used in Beckmann sampling sometimes overflowed to inf while calculating r^16. The final value is 1 - 1/r^16, however,
  so now it just returns 1 if the computation would overflow otherwise.
2016-07-16 20:54:14 +02:00
5ba78d76d4 Cycles: Deduplicate geometric factor calculation in the Beckmann distribution
Also, this fixes a numerical issue where A would be inf.
Since later G is set to 1 if A is larger than 1.6, the code now checks the reciprocal of A for being smaller than 1/1.6 - same effect, but no inf involved.
2016-07-16 20:54:14 +02:00
a40073ffcc Fix use after free error from ab993e37 2016-07-17 03:03:22 +10:00
c885cea7bb Cleanup: spelling 2016-07-16 17:48:57 +10:00
f0f9a87614 Cleanup: line length 2016-07-16 17:29:08 +10:00
4e9409c087 Use the value VIEW_PROJ_PERSP in the remaining places
also changes the name of the callbacks:
- walk_parent_snap_project_cb to cb_walk_parent_snap_project;
- cb_leaf_snap_vert to cb_walk_leaf_snap_vert;
- cb_leaf_snap_edge to cb_walk_leaf_snap_edge;
- test_vert_depth_cb to test_vert_ray_dist_cb;
- test_edge_depth_cb to test_edge_ray_dist_cb;

and cleanup:
2016-07-15 21:25:44 -03:00
ac061de20d Cycles: Fix refitting of regular BVH
Was causing CUDA issues on viewport edits.
2016-07-15 18:12:34 +02:00
69787cb7bd UI: modifier keys now trigger number button updates
Number buttons & sliders weren't updating when shift/ctrl were pressed.

Note that this is a regression in 2.77 but hard to track down since it worked unreliably for some time.
2016-07-16 01:20:16 +10:00
12cdc67d83 Bump maximum threads number to 1024
This commit contains all the changes required for most optimal maximum threads
number bump. This is needed to avoid possibly unneeded initialization or data
allocation on systems with lower threads count.

TODO: Still need to review arrays in render data structures from render_types.h,

P.S. We might remove actual bump of max threads from this patch, so when we'll
be applying the patch we can do all the preparation work and then do actual
bump of max threads.

Reviewers: mont29, campbellbarton

Reviewed By: mont29, campbellbarton

Maniphest Tasks: T43306

Differential Revision: https://developer.blender.org/D1343
2016-07-15 16:47:30 +02:00
6cd675af30 Cycles: Add option to disable new Hair BVH
While it's an extra option added to the interface which might not be
fully obvious for artists, it allows to save up to 20% of memory in
hairy scenes.

This is high enough memory saver in my opinion which might become
handy for some production files where it's more important to make
scene to fit into memory rather than trying to use more optimal BVH
structure but go into swap or crash.

Reviewers: dingto, brecht

Reviewed By: dingto, brecht

Differential Revision: https://developer.blender.org/D2090
2016-07-15 16:29:28 +02:00
b679767656 fix T48857: Improved the handling of Material Alpha, based on patch D1949 with some small modifications 2016-07-15 16:14:53 +02:00
27641b51e7 Collada: changed specification of material alpha from using transparency to using transparent with opaque=A_ONE 2016-07-15 16:14:51 +02:00
e3b79544be Re-initialize source/tools submodule 2016-07-15 15:12:51 +02:00
711fca1db5 missed from last commit 2016-07-15 20:00:18 +10:00
fafb8aaaf1 Object Snap: make normal argument optional
Often its not needed, setting correctly takes some extra calculation - so allow for it to be left unset.
2016-07-15 19:46:59 +10:00
e68f068682 Fix T48855: Ruler thickness broken in ortho view
Don't do ray-casts from the view unless cursor coords are passed.
2016-07-15 19:27:45 +10:00
3eb7d41c67 Object Snap: replace perspective bool with enum
Allows to set the projection as none,
to make it more obvious when we don't want to handle viewport projections in some cases.
2016-07-15 19:27:23 +10:00
dec59618b4 Correct error in snap commit 2016-07-15 18:40:16 +10:00
e5e128e30c Cleanup: use BLI_math for paint smooth-stroke 2016-07-15 17:17:42 +10:00
0deb7e6c15 Cleanup: rename snap vars 2016-07-15 17:12:43 +10:00
91556cb973 Add "Snap Selection to Active" option in menu
D1963 by @wisaac, re-worked to de-duplicate logic
2016-07-15 17:11:58 +10:00
ccee251a40 Support for loading multiple images from the file selector
D2035 by @jside, extended to support mixing single images and sequences in the one selection.
2016-07-15 16:06:11 +10:00
e56aa5d788 Fix select grouped parent, extend option was ignored
D2067 by @mangostaniko
2016-07-15 15:56:28 +10:00
97f894f3fa UI: Remove spaces around '/'
D2093 by @Blendify
2016-07-15 15:50:42 +10:00
10f5a6a57e Sequencer: Remove add effect strip filesel properties
D2096 by @chadf

Unused, copy-paste error.
2016-07-15 15:47:42 +10:00
3bfa8d9fd4 Fix py-driver in startup.blend crash in background mode
Obscure regression in own commit from b34929786.
While this could be considered correct, it introduces a crash so disable the update call.
2016-07-15 15:41:38 +10:00
71bbf0e1b5 Code cleanup: show unused arguments names for ShaderNode::constant_fold. 2016-07-14 22:59:44 +02:00
558f85473e fix T48857: Added support for transparency (used Patch D1949 from bwrsandman with some slight changes) 2016-07-14 21:43:26 +02:00
902d4c92ac Use BMesh solver for new boolean modifiers 2016-07-15 02:46:04 +10:00
8343518272 Cleanup: comment blocks 2016-07-15 02:39:45 +10:00
39dee8a201 Fix T48844: Nodetrees of appended materials/textures/etc. were not correctly made local.
Previous commits now allow to use id_make_local() here, as one would expect.

Note that I also checked T36003 case, working fine as well with new code.
2016-07-14 18:33:12 +02:00
bcfd8d9ab8 Correct recent own fix to id_clear_lib_data_ex().
Datablocks' nodetree are *never* in main, while shapekeys are...
2016-07-14 18:33:12 +02:00
e7d4d661f3 Cleanup/refactor: handle shapekeys exactly like 'owned' nodetrees in make_local process. 2016-07-14 18:33:12 +02:00
018d336cbd Cleanup: use BKE's ntreeFromID in readfile instead of local same function.
Also, no need to set ntree->id.lib to NULL after BKE_libblock_copy_nolib(),
generic datablock copy function always make copy local.
2016-07-14 18:33:12 +02:00
54ed0bb653 Fix bad handling of datablock's nodetree id_clear_lib_data_ex().
Those data blocks are never shared, exactly as with shapekeys, much simpler
to also clear their lib_data (especially since they have no user!).
2016-07-14 18:33:12 +02:00
e10ddc7a91 Get rid of BKE_key_make_local().
This function was only a wrapper around id_clear_lib_data(), and shapekeys
are not linkable nor shareable anyway, no point keeping this currently,
was only adding confusion about shapekey 'status' as a datatblock.
2016-07-14 18:33:12 +02:00
f87603662d Add option to id_make_local to force localization of datablock, even if not used locally.
Will be used by link/append code.
2016-07-14 18:33:12 +02:00
f2509e764e Fix T48843: Sequencer crash with many effects
Switch from a fixed stack to a linked list,
since guessing the maximum possible size may fail with invalid/overlapping strips.
2016-07-15 02:30:37 +10:00
3ba83e247a Add developer tools submodule
This is intended for utilities to help with development,
which aren't needed for building.

See https://wiki.blender.org/index.php/Dev:Doc/Tools/Blender_Tools_Repo for details
2016-07-15 01:28:00 +10:00
7faf76a618 Cleanup: line length 2016-07-15 01:26:26 +10:00
34642fe532 PyAPI: minor cleanup with library linking 2016-07-15 00:06:33 +10:00
17e40f821e Consolidate multiple checks for out->rect_float in prepare_effect_imbufs()
Many checks for out->rect_float being [non-]NULL are done back-to-back.
Combining them into a single check for slightly more efficient code and
less code clutter for easier readability/understanding.

Differential Revision: https://developer.blender.org/D2097
2016-07-14 14:17:54 +02:00
Julian Eisel
3a5eff95c5 Cleanup: Use BKE_scene_base_add for creating bases
And use __func__ macro.
2016-07-14 14:00:24 +02:00
274795045c Cycles: Give better idea which OpenCL kernel is currently compiling 2016-07-14 12:49:20 +02:00
95a0bff83a Cycles: Avoid strings passed by value in OpenCL device
Also use more const qualifiers in the code.
2016-07-14 12:46:57 +02:00
af53fee4b4 Make --debug-all include --debug-cycles and --debug-libmv 2016-07-14 12:14:55 +02:00
c183f0c94e Libmv: Fix some strict compiler warnings
One of them was a real bug!
2016-07-14 11:49:38 +02:00
56c9c1ab43 Cycles: Fix wrong size of sobol texture
After reformulation of SSS indirect rays it became possible to
try accessing dimension higher than was pre-calculated on scene
preparation.

This is because we're traversing rays backwards, which means we
are using higher dimensions first now.
2016-07-14 11:26:20 +02:00
3637cbbcf8 Cycles: Fix wrong termination criteria in intersect_all functions
It was possible to miss bounces termination criteria in this functions,
mainly when max_hits was set to 0.

Made the check more robust in traversal functions (which should not
affect performance, it's an operation of same complexity AFAIK).

Also avoid doing ray-scene intersection from shadow_blocked when
limit of transparent bounces was already reached.
2016-07-14 11:26:20 +02:00
103a515043 CMake: per-target CFLAG & CXXFLAG support
Applying cflags globally can be problematic especially with extern, intern libs.

Now flags from target named will be used when defined,
allowing for developers to define flags for modules they maintain.

Convention is CMAKE_CFLAGS_${UPPERCASE_TARGET_NAME}, (CXXFLAGS for C++).

eg: CMAKE_CFLAGS_BF_BLENDER, CMAKE_CFLAGS_MAKESDNA, CMAKE_CXXFLAGS_CYCLES_KERNEL

On Linux run `make help` for full list of names, MSVC shows these in the solution.
2016-07-14 19:17:34 +10:00
036c006cef PyAPI: Leak fix caused crash w/ attr swap trick
Accessing `bpy.app.binary_path_python does search, then swaps its getset with the string it finds.
This caused a freed pointer to be stored in bpy.app's dictionary.

Fix by using the same string for get/set access.
2016-07-14 18:32:28 +10:00
b00bc3cbc1 PyAPI: fix leak linking library data 2016-07-14 17:38:22 +10:00
f5e020a7a6 PyAPI: fix memory leaks in dictionary assignment
Thanks to Kévin Dietrich for spotting driver leak,
checked other uses of PyDict_SetItem and found more.
2016-07-14 17:30:52 +10:00
cca57bf04c PyAPI: Use module names on initializaton
No need to re-convert from C strings to PyUnicode.
2016-07-14 15:51:56 +10:00
06908955c3 Improves the accuracy of snap to edges
Recently the snap to edges has been changed to work with coordinates 2d. Thus, the lambda of the snap pointon on edge becomes different from the actual lambda in a 3d edge.

The solution to correct the lambda was this:

```
if (is_persp) {
	const float fac = depth_a / (depth_a + depth_b);
	lambda *= (1.0f + (fac - 0.5f) * (1.0f - lambda));
````

...
But the lambda was still not very accurate.
Now the function uses the `dist_squared_ray_to_seg_v3` to get the coordinate of the snap point on the edge. And then tests that point.

The accuracy returned to normal values.
2016-07-14 00:47:32 -03:00
6771165229 Cleanup: style 2016-07-14 13:37:49 +10:00
1b8e7b5cb0 Use BLI_endian_switch in dna_genfile 2016-07-14 13:28:24 +10:00
b014f03077 Simplify snapping functions
from D2104: reference all repeated (and strange) equations (example: mul_m4_m4m4(pmat_local, pmat, obmat)) in the function `precalc_project.

This is useful for maintenance.
2016-07-14 00:02:21 -03:00
743f931584 Fix T48846: Ruler/Protractor crash in ortho mode
Error in recent snap changes.
2016-07-14 11:14:03 +10:00
91bda21cfe Fix T48845: Crash when right-clicking on a curve property
Caused by typo in rBd2312602125a452e6562a76ab91779943c67396d
2016-07-14 00:24:31 +02:00
029de800a4 Fix T48734: Driver not updating when using Single From Driver within same object 2016-07-13 15:00:57 +02:00
afe954e64c Fix T48839: Selection from pose mode gives wrong snap results
Current code changes the selection then then runs ED_armature_sync_selection
to copy to the bones rootsel flag from the parents tipsel.

Use this logic for entering edit-mode too.
2016-07-13 22:24:20 +10:00
2aa0569861 Boolean Modifier: Add back BMesh option
There are still issues with overlapping geometry,
however some of the issues reported are are causing problems,
or fail entirely with Carve too.
2016-07-13 19:55:31 +10:00
95b1cf6f7d Depsgraph: Make proxy behavior closer to old depsgraph
Fixes possible missing update of proxy_from pointer before using
it in relations builder.
2016-07-13 10:55:35 +02:00
c0d8166f82 Revert "Depsgraph: Russian electric tape bodge to have multiple proxies work"
This reverts commit 47d0d9cca4.

Reverting the commit. Not only it did not solve all the cases of proxy popping,
but also broke real cases with single proxy involved.
2016-07-13 10:41:09 +02:00
527674b316 Depsgraph: Accumulate object layers from all bases
This solves bug when same object is instanced from multiple bases.
2016-07-13 10:07:09 +02:00
8939787bfb Use BLI_bvhtree_walk_dfs for snapping
The snapping functions when performed in the perspective view,
have some problems in the threshold (a distortion) and in the clip plane (the normal is incorrect).
These problems can be only observed when making the snap to edges or to vertices (nearest to ray function).

This patch propose a totally different solution.
The idea is to project the edges of bvh nodes and test the 2d projection of the snap element.

For this it used the BLI_bvhtree_walk_dfs function.

It is important to pay particular attention also to the changes in `ED_transform_snap_object_project_view3d_ex`
2016-07-13 14:45:35 +10:00
7a633d7c4f Vertex/Weight Paint: Support view-selected on last-stroke
D1875 by @lichtwerk
2016-07-13 13:57:46 +10:00
eb04908ccd Fix 48831, Step II: UI icon code was not able to update/generate 'auto ID icon' from non-ID icon draw code.
Now using generic icon rendering system in that case too, instead of custom code
which was only handling 'deferred' custom file-loaded icons.
2016-07-12 21:11:38 +02:00
51812fb502 Fix 48831, Step I: Mismatch issues bewteen ID icon and preview system.
- icon_id from ID and PreviewImage were not guaranteed to be in sync.
- PreviewImage one was not reset on file read.
- Through RNA e.g., it was possible to ensure an ID icon via its preview image,
  which was running code designed for custom previews/icons system, instead
  of generating correct 'auto ID icon'.
2016-07-12 21:11:38 +02:00
5fae2503bf Revert "OpenJPEG: update to 2.1 from 1.5"
This reverts commit f12204196f.

Campbell, sorry. have to revert this for the time being.

We've missed some very important bits, such as:

- FFmpeg is usually linked against OpenJPEG
- OIIO needs OpenJPEG as well.

For FFmpeg issues we can either disable OpenJPEG there (since
we don't really use it), or bump FFmpeg to version 3.1.1 which
can use either of OpenJPEG 1.5 or 2.1.

For OIIO we do need OpenJPEG support (otherwise Cycles will
not be able to use j2k/j2c textures) and currently there is
NO solution to make OIIO working with OpenJPEG 2.1.

According to Matthias Fauconneau (aka mfv) Larry is working
on the patch to get OIIO work with OpenJPEG 2.1, but it'll
take some time still.

I've tried to look into support of some sort of build system
flag and do ifdefs, but it all becomes quite nasty, especially
with bundled OpenJPEG bumped to 2.1.

Surely such an update is something we'll have to apply to
but at this exact moment it causes quite some pain for all
developers.

Suggest to wait for until OIIO supports OpenJPEG 2.1 and then
go with the updates for real.
2016-07-12 17:38:26 +02:00
51b274a6be Fix T48818: Objects with alpha maps cast wrong ray shadows in BI 2016-07-12 15:41:00 +02:00
f12204196f OpenJPEG: update to 2.1 from 1.5
Stream handling has changed so this required changes to how files & memory are accessed.
2016-07-12 23:13:30 +10:00
5798301291 Fix saving jpeg2k images from Python
Quality was defaulting to lowest and no codec was set.
2016-07-12 20:35:02 +10:00
59c59cc402 Cleanup: remove redundant check 2016-07-12 17:59:25 +10:00
b8f217ef21 Fix T48830: Outliner draw crash, missing NULL check
Fix from @cheleb
2016-07-12 14:44:59 +10:00
0708b9aba8 writefile: reuse SDNA between writes
Avoids decoding the SDNA string every undo step.
2016-07-12 13:03:04 +10:00
4db1db327a readfile: report SDNA decoding errors on file read
This was printed to the stdout, however the error case wasn't checked or well supported.
Also, errors decoding SDNA would sometimes call exit(1).
2016-07-12 12:28:06 +10:00
0b3183d13c writefile: remove SDNA last-hit, optimize DNA reconstruct
- Move last-hit index out of SDNA struct
  (allows for access by multiple threads).
- Replace O(n^2) search with hash lookup in DNA reconstruction.
2016-07-12 11:56:45 +10:00
7212ebd09f Remove usercount handling from BKE_id_expand_local.
Idea looked good, but we have too much custom situations here (some half-fake-sub-ID
being copied with their 'owner', animdata, etc.), let's let datablock copy functions
handle that themselves.

Also allows to safely call BKE_id_expand_local from all copy functions now (only when
copying linked data).
2016-07-11 21:30:02 +02:00
3b8e0606e1 Cleanup: remove call to BKE_id_lib_local_paths() in make_local functions.
This one is already called by matching copy functions, no need to call it twice!
2016-07-11 21:30:02 +02:00
5b2bc1d713 Use new generic BKE_id_expand_local() for make_local() for object. 2016-07-11 21:30:02 +02:00
3c8f22a528 Use new generic BKE_id_expand_local() for make_local() for image/material/texture/world.
As said in previous commits, did not touch to copy functions for now, due to ntree issues...
2016-07-11 21:30:02 +02:00
c3996b792a Revert 'use new BKE_id_expand_local()' change for Lamp's copy function.
ntree is once more time a PITA - actually, all sub-IDs that get copied together with the 'main' one are
(shapekey was workedaround, as was animdata/action issue, but nodes are more touchy).

For now, better not to touch that, needs careful check & rethink.
2016-07-11 21:30:02 +02:00
eac7faa0e6 Use new generic BKE_id_expand_local() for make_local() for nodetree.
Did not changed ntree copy for now, this func is a mess of expand/non-expand/bmain/non-bmain cases...
Keep it for later!
2016-07-11 21:30:02 +02:00
13f0b59f11 Use new generic BKE_id_expand_local() for both make_local() and copy() functions of actions, brushes and particles.
This greatly simplifies said code, once again no change expected from user PoV.
2016-07-11 21:30:02 +02:00
2ec17e655c Use new generic BKE_id_expand_local() for both make_local() and copy() functions of obdata
(armature, mesh, curve, mball, lattice, lamp, camera, and speaker).

This greatly simplifies said code, once again no change expected from user PoV.
2016-07-11 21:30:02 +02:00
439ccca1e0 Add an exception/hack to new BKE_id_expand_local(), to ignore actions datablock in its usercount handling.
Reason is, typically those actions datablock usercounts have already been adjusted in BKE_animdata_copy()
(called by generic iddata copy function).

Think this needs to be reworked a bit too, there are way too much ways to copy animdata currently,
it's rather confusing. But not the goal here, so for now we'll live with the hack!
2016-07-11 21:30:02 +02:00
62ea383622 Fix (unreported) memory leak when making local linked databock which has a preview image.
Also cleaned-up/synchronized code across al ID types that support preview.
2016-07-11 21:30:02 +02:00
4569e19b83 Add generic 'BKE_id_expand_local' to BKE_library,
will be used by both make_local() and copy() datablock functions.

Note that this new func make 'extern' all IDs used by localized datablock,
not only refcounted ones as it used to be in each type's functions (with a few exceptions).
2016-07-11 21:30:02 +02:00
c06d3b6c36 Cycles: Fix compilation error on Windows with OSL enabled
Seems there's some conflict around `near` identifier in that configuration.
2016-07-11 18:15:51 +02:00
7602b6bf62 Cycles: Fix typo 2016-07-11 18:01:40 +02:00
ea32a03801 Fix T48824: Crash when having too many ray-to-volume intersections
Code might have writing past the array boundaries.
2016-07-11 17:59:46 +02:00
8bc6f8bf20 Fix T48812: Brush size invalid with HIDPI
Missed from c5b2f12b
2016-07-12 01:19:07 +10:00
bbe33ecc88 Depsgraph: Fix crash in Weight VG modifier 2016-07-11 15:15:26 +02:00
0f457a3f8d Depsgraph: Fix shape key nodes trying to be added multiple times 2016-07-11 15:07:39 +02:00
96dd4cdb9e Cleanup: line length 2016-07-11 23:06:14 +10:00
b99f7a9b2a Cycles: Fix Extend image extension mode on OpenCL 2016-07-11 14:46:42 +02:00
cb3b19730c Cycles: Use utility define for restrict pointers
This way restrict can be used for CUDA and OpenCL as well.

From quick tests in areas i've been testing this it might give some
barely measurable %% of speedup, but it increases registers pressure.

So use of this qualifier is still really limited.
2016-07-11 13:58:47 +02:00
cf82b49a0f Cycles: Cleanup, variables name
Using camel case for variables is something what didn't came from our original
code, but rather from third party libraries. Let's avoid those as much as possible.
2016-07-11 13:58:47 +02:00
2ecbc3b777 Cycles: Add _all suffix to shadow traversal file
Matches better naming of volume traversal files, where we've got
optimized versions of a single step of volume intersection and
traversal which will gather all volume intersections.
2016-07-11 13:58:47 +02:00
4355603790 Cycles: Move BVK kernel files to own directory
BVH traversal is not really that much a geometry and we've got
quite some traversals now. Makes sense to keep them separate in
the name of source structure clarity.
2016-07-11 13:58:47 +02:00
c58ae20f6c Dyntopo: fix lop-sided edge collapse
When an edge was collapsed, one of the vertices would be removed.
Edges attached to the deleted vertex wouldn't be considered for collapsing again,
making the outcome from collapsing edges depend on the edge-vertex order.

Use a hash to lookup the final vertex when collapsing edges, instead of skipping them.
2016-07-11 21:59:15 +10:00
6ea43f9aca Fix sculpting high poly meshes
Attempted to free unallocated memory,
interestingly nobody noticed this for ~7 years (error from 3078c806).
2016-07-11 17:17:08 +10:00
0eb61baecc Dyntopo: possible modified option was incorrectly set 2016-07-11 17:17:08 +10:00
12d2329d0e Dyntopo: remove redundant existing face check
Gives minor speedup
2016-07-11 17:17:02 +10:00
b32408eff8 BLI_math: move interp_*_cubic to its own function 2016-07-11 17:16:35 +10:00
e41abdb907 CMake: suppressing indentation warning for extern 2016-07-11 17:16:35 +10:00
47c47c7e78 Fix T48822: Crash when I try to use "Join" (Ctrl Key + J) with two meshes.
Own stupid typo in recent refactor work...
2016-07-10 20:12:58 +02:00
8df92988cf Refactor/enhance BKE_action_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
406309cd8c Refactor/enhance ntreeMakeLocal().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
ad5918d278 Refactor/enhance BKE_image_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
f35320bddf Refactor/enhance BKE_material_make_local() and BKE_image_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
8932b5945e Refactor/enhance BKE_lamp_make_local() and BKE_camera_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
0f0eeffece Refactor/enhance BKE_brush_make_local() and BKE_speaker_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
c8c00636bf Refactor/enhance BKE_particlesettings_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10 17:14:45 +02:00
bb8bfdd4b6 Cycles: Fix failed assert with isotropic Ashikhmin-Shirley distribution in the Glossy node
The shader sync code used the anisotropic version of the Ashikhmin-Shirley closure for both
Anisotropic and Glossy BSDF, which caused a failed assert because the anisotropic closure
expects an addiitonal SVM node.
2016-07-10 16:41:21 +02:00
e0c163661d Add missing braces 2016-07-11 08:45:16 +10:00
885870be51 Fix T48815: Translate node's 'Relative' checkbox has the same tooltip as blur node's 'Relative' checkbox.
Differential Revision: https://developer.blender.org/D2099
2016-07-10 14:57:31 +02:00
87b974caa1 Cleanup/Refactor: pass Main pointer to all ID copy functions.
Also allows us to get rid of a few _copy_ex() versions...
2016-07-10 14:52:00 +02:00
ae2033aca2 Add BKE_key_copy_ex() that takes a Main as parameter. 2016-07-09 15:44:12 +02:00
429394078b Refactor/enhance BKE_lattice_make_local(), and add BKE_lattice_copy_ex() that takes a Main as parameter.
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-09 15:44:12 +02:00
338121e2a0 Refactor/enhance BKE_mball_make_local(), and add BKE_mball_copy_ex() that takes a Main as parameter.
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-09 15:44:12 +02:00
11f64f494b Refactor/enhance BKE_curve_make_local(), and add BKE_curve_copy_ex() that takes a Main as parameter.
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-09 15:44:12 +02:00
9044ccec5f Cleanup to shapekeys' make_local (and copy) functions.
Mostly pass bmain and do not check for NULL key, keys' make_local is
suspiciously simple in fact, but think until those behave like real
full-featured IDs, it's doing enough!
2016-07-09 15:44:12 +02:00
8bb7a339f7 Minor fix/cleanup to object's make_local. 2016-07-09 15:44:12 +02:00
1b45c52734 Fix: Apply Scale to Delta Scale was doubling the effect 2016-07-09 12:00:28 +12:00
245f97d7dc Clear Transforms and Deltas
* Alt-G, Alt-R, Alt-S  --> These don't clear delta transforms by default anymore,
  making it possible to use these to properly store a "rest" pose

* Alt-Shift-G, Alt-Shift-R, Alt-Shift-S  --> These WILL clear both the normal
  transform and the delta, should you need to do so.
2016-07-09 12:00:28 +12:00
8662f583da Fix (unreported) broken shapekeys after 'make_local' of datablocks used both directly and directly.
At first thought it was own recent work, but think issue is there since ages actually...

Basically, id_make_local() would always localize mesh/curve/lattice shapekeys, even in case
obdata localization actually made a local copy instead of localizing original datablock.

This was causing shapekeys being localized twice, and other odd nasty effects.
2016-07-08 19:53:57 +02:00
282de867d4 Initial fix for proxy issues regarding new libquery/libremap ID handling code.
libquery now passes an extra flag info to the callback, in case that specific
ID usage is considered as indirect.

In most cases, it's just set from ID_IS_LINKED_DATABLOCK() result on datablock owner,
but in proxy object case we also consider ob->data, materials and pose usages as indirect.

Does not fixes all issues yet, but should already make behavior with proxy object saner.
2016-07-08 19:33:22 +02:00
77680abaf9 Refactor/enhance BKE_mesh_make_local().
Now using modern features from libquery/libremap areas.

Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).

Note: this enlightened broken case of proxy objects regarding make_local
(and also whole remapping, in fact). Will be fixed in near future.
2016-07-08 18:19:34 +02:00
db79537dbc Fix own very stupid mistake in BKE_library_idtype_can_use_idtype() usage (inverted arguments). 2016-07-08 18:11:20 +02:00
f34fc60aa4 Libquery: fix missing image pointers from Mesh's UV layers.
Not really happy with this, could lead to a **lot** of callback executions...
But libquery foreach looper must go over **all** ID pointers,
otherwise remapping & co is broken!

A possible fix for future would be to have 'image slots' defined at root of poly/facetex layers,
and just a (short) index in each face/poly item - would also save a reasonable amount of memory...
2016-07-08 18:11:20 +02:00
d1a4ae3f39 Refactor/enhance BKE_object_make_local().
Now using modern features from libquery/libremap areas.

Also, it should handle much better cases where localized ID was also indirectly used by non-refcounting users
(typical case: object used as modifier/constraint/whatever target from another linked object, previous
code would not take those into account and just localize original object instead of making a local copy.
Would result in local object used by linked one, which would be partially 'undone' on next file reload... Crappy behavior).

And it fixes some obvious errors too (nullifying all proxy pointers unconditionnaly,
some missing refcounted usages cases in extern_local_object(), etc.).
2016-07-08 18:11:20 +02:00
f3fe1f9c44 Refactor: pass Main to id_make_local.
Totally stupid to not pass it, and then let (some) BKE_foo_make_local() use G.main!

Note: unused for now, much more refactoring still to come in make_local area!
2016-07-08 18:11:20 +02:00
cf19055236 Fix (unreported) missing special updates in case we are remapping obdata (mesh/curve/metaball at least). 2016-07-08 18:11:20 +02:00
ab993e373c Rework/split test_object_materials().
Now test_object_materials only handles one object. New test_all_objects_materials
checks the whole bmain->object list for cases where it is actually needed.

Should avoid some useless looping over all objects!
2016-07-08 18:11:20 +02:00
71f5df9f44 Refactor remapping's pre/post process of special cases.
Main issue was that BKE_libblock_relink_ex was pretty much ignoring all those...
Also, unlinking of objects was not handling correctly indirect-related flags.

Refactored code into helper functions to avoid too much duplicated code.
2016-07-08 18:11:20 +02:00
3b7bce42d7 Fix T48799: Particles set as objects cast wrong ray shadows in BI 2016-07-08 18:10:47 +02:00
8bb69b6157 BMesh: add decimate edit-mode tool
Support applying decimate to the mesh selection.
2016-07-08 23:38:52 +10:00
c206b7cbb6 Correct error in non-uniform scale IK commit
Rename arg to avoid confusion
2016-07-08 21:13:19 +10:00
a62967787c Fix T48808: Regression: Cycles OpenCL broken after Hair BVH commit 2016-07-08 09:41:36 +02:00
d5d26338b5 Mesh/Curve Join: remove edit-mode toggle
Toggling edit-node after joining objects is redundant as far as I can see -
(dates back to first revision).

Also caused all edges to be drawn w/ meshes, redundant undo step w/ curves.
2016-07-08 16:52:10 +10:00
83fe139b2b Undo: use system memcmp
`my_memcmp` didn't work properly comparing memory sizes not aligned to 4 bytes,
this worked while we used guarded-alloc (which always wrote a guard at the end of each allocation).
Since moving to lockfree allocator it could read uninitialized memory.

It also consistently performed ~10-30% worse then glibc's.
This is typically well optimized, no need to do ourselves.
2016-07-08 15:54:34 +10:00
dda96e3472 Fix T48807: Each stroke halves brush size
Missed from c5b2f12b
2016-07-08 14:51:12 +10:00
a02915c0f3 writefile: optimize undo memory use
Slop-space on Linux wasted ~20% of memory for undo storage.
2016-07-08 14:36:55 +10:00
a92fc348f4 Fix/Workaround non-uniform scaled bones failing w/ IK solver
Scaling a bone on the Y axis (for a stretch effect), wasn't supported by the IK solver.

Support this by solving as uniform scaled bones by matching the X,Z axis to the Y.

Requested by @pepeland, see D2088 for details.
2016-07-08 10:28:07 +10:00
7a3ea87bbf Cleanup: use normalize_v#_length 2016-07-08 10:14:49 +10:00
6035cf05bf BLI_math: add normalize functions which fit to a length
Convenient since its common to normalize then scale,
since these are inlined, use for regular normalize w/ 1.0 length.
2016-07-08 09:52:29 +10:00
30d951ce34 Cleanup: spelling 2016-07-08 09:49:01 +10:00
3fb2c1e4a2 Make use of new 'idtype can use idtype' check (in ID usages code, and ID remapping one too).
Reduces calls to BKE_library_foreach_ID_link() from 312 to 105 when relocating a library in a
rather simple lib reload test...
2016-07-07 21:21:33 +02:00
e2d469f878 libquery: add new 'BKE_library_idtype_can_use_idtype()' helper.
This should allow us to avoid a lot of useless processing when iterating over the
whole main database (unlink/remap/usages checks/etc.).

Note that some ID types report they can use any type for now, due to
fuzzyness/indefined nature of some usages (like constraints/modifiers/game logic,
or ID pointer of nodes...). Maybe we could address this (like e.g. adding defines
in relevant headers to restrict ID types used by constraints, by modifiers, etc.).
But don’t think this is top priority for now.
2016-07-07 21:21:33 +02:00
b651812721 Cleanup/fix animsys 'id_type_can_have_animdata()'.
This func now actually takes an ID type as argument, added new 'id_can_have_animdata()'
to check whether a datablock may be animated or not.
2016-07-07 21:21:33 +02:00
25e3657970 Extend libquery checks to test wether an ID is used locally and/or indirectly. 2016-07-07 21:21:33 +02:00
f36741c2eb Fix T48793: Bilinear filter clamps at edge pixels 2016-07-08 02:14:54 +10:00
1bb145e023 Fix single threaded compositor define 2016-07-08 01:41:36 +10:00
4beae09bae Cycles: Enable unaligned BVH builder for scenes with hair
This commit enables new unaligned BVH builder and traversal for scenes
with hair. This happens automatically, no need of manual control over
this.

There are some possible optimization still to happen here and there,
but overall there's already nice speedup:

                      Master                 Hair BVH
  bunny.blend         8:06.54                 5:57.14
  victor.blend       16:07.44                15:37.35

Unfortunately, such more complexity is not really coming for free,
so there's some downsides, but those are within acceptable range:

                      Master                Hair BVH
  classroom.blend     5:31.79                5:35.11
  barcelona.blend     4:38.58                4:44.51

Memory usage is also somewhat bigger for hairy scenes, but speed
benefit pays well for that. Additionally as was mentioned in one
of previous commits we can add an option to disable hair BVH and
have similar render time but have memory saving.

Reviewers: brecht, dingto, lukasstockner97, juicyfruit, maiself

Differential Revision: https://developer.blender.org/D2086
2016-07-07 17:25:48 +02:00
a08e2179f1 Cycles: Implement unaligned nodes BVH traversal
This commit implements traversal of unaligned BVH nodes.

QBVH traversal is fully SIMD optimized and calculates orientation
for all 4 children at a time, regular BVH might probably be optimized
a bit more.
2016-07-07 17:25:48 +02:00
b03e66e75f Cycles: Implement unaligned nodes BVH builder
This is a special builder type which is allowed to orient nodes to
strands direction, hence minimizing their surface area in comparison
with axis-aligned nodes. Such nodes are much more efficient for hair
rendering.

Implementation of BVH builder is based on Embree, and generally idea
there is to calculate axis-aligned SAH and oriented SAH and if SAH
of oriented node is smaller than axis-aligned SAH we create unaligned
node.

We store both aligned and unaligned nodes in the same tree (which
seems to be different from what Embree is doing) so we don't have
any any extra calculations needed to set up hair ray for BVH
traversal, hence avoiding any possible negative effect of this new
BVH nodes type.

This new builder is currently not in use, still need to make BVH
traversal code aware of unaligned nodes.
2016-07-07 17:25:48 +02:00
1a2012145d Cycles: Switch node address to absolute values in BVH tree
This seems to be straightforward way to support heterogeneous nodes
in the same tree.

There is some penalty related on 4gig limit of the address space now,
but here's are the thing:

Traversal code was already using ints to store final offset, so
there can't be regressions really.

This is a required commit to make it possible to encode both aligned
and unaligned nodes in the same array. Also, in the future we can use
this to get rid of __leaf_nodes array (which is a bit tricky to do since
trickery in pack_instances().
2016-07-07 17:25:48 +02:00
17e7454263 Cycles: Reduce memory usage by de-duplicating triangle storage
There are several internal changes for this:

First idea is to make __tri_verts to behave similar to __tri_storage,
meaning, __tri_verts array now contains all vertices of all triangles
instead of just mesh vertices. This saves some lookup when reading
triangle coordinates in functions like triangle_normal().

In order to make it efficient needed to store global triangle offset
somewhere. So no __tri_vindex.w contains a global triangle index which
can be used to read triangle vertices.

Additionally, the order of vertices in that array is aligned with
primitives from BVH. This is needed to keep cache as much coherent as
possible for BVH traversal. This causes some extra tricks needed to
fill the array in and deal with True Displacement but those trickery
is fully required to prevent noticeable slowdown.

Next idea was to use this __tri_verts instead of __tri_storage in
intersection code. Unfortunately, this is quite tricky to do without
noticeable speed loss. Mainly this loss is caused by extra lookup
happening to access vertex coordinate.

Fortunately, tricks here and there (i,e, some types changes to avoid
casts which are not really coming for free) reduces those losses to
an acceptable level. So now they are within couple of percent only,

On a positive site we've achieved:

- Few percent of memory save with triangle-only scenes. Actual save
  in this case is close to size of all vertices.

  On a more fine-subdivided scenes this benefit might become more
  obvious.

- Huge memory save of hairy scenes. For example, on koro.blend
  there is about 20% memory save. Similar figure for bunny.blend.

This memory save was the main goal of this commit to move forward
with Hair BVH which required more memory per BVH node. So while
this sounds exciting, this memory optimization will become invisible
by upcoming Hair BVH work.

But again on a positive side, we can add an option to NOT use Hair
BVH and then we'll have same-ish render times as we've got currently
but will have this 20% memory benefit on hairy scenes.
2016-07-07 17:25:48 +02:00
1eacbf47e3 Cycles: Support visibility check for inner nodes of QBVH
It was initially unsupported because initial idea of checking visibility
of all children was slowing scenes down a lot. Now the idea has changed
and we only perform visibility check of current node. This avoids huge
slowdown (from tests here it seems to be withing 1-2%, but more tests
would never hurt) and gives nice speedup of ray traversal for complex
scenes which utilized ray visibility.

Here's timing of koro.blend:

                  Without visibility check         With visibility check
Original file           4min 20sec                      4min 23sec
Camera rays only        1min 43 sec                       55sec

Unfortunately, this doesn't come for free and requires extra data in
BVH node, which increases memory usage of BVH nodes by 15%. This we
can solve with some future trickery of avoiding __tri_storage created
for curve segments.
2016-07-07 17:25:48 +02:00
a19da5c10d Quiet gcc warning-as-error about non-const pointer passed to const parameter. 2016-07-07 17:23:59 +02:00
b9dbcf406e Fix T48802 Unwrap buttons, can't add hotkey in 3DView's UV Unwrap menu.
Those unwrap operators are a bit tricky, some are available from both 3DView and UVEditor, others only from 3DView...

Hacked around this by returning Mesh keymap for UV_OT ops for specific 3DView/MeshEditMode context.
2016-07-07 17:06:53 +02:00
c8be112523 RNA: rename sorting -> sort
Shorter and consistent with other RNA.
2016-07-08 00:56:01 +10:00
6e6073e13c Skip the ID part of object names when comparing
Also no need to calloc arrays which are immediately filled
2016-07-08 00:50:08 +10:00
124bfa4d2d Cleanup: spelling, style 2016-07-08 00:48:45 +10:00
bef034e154 Cleanup: use static sets, remove redundant copy 2016-07-08 00:28:41 +10:00
91533b6f34 Revert "ChildOf Constraint: Hide the Loc/Rot/Scale toggles"
This reverts commit 4fd78bb06f.

After further testing, it turns out that these options are less-broken than
I remember them being (and have been hearing about). Specifically, as long
as you disable all 3-axes of a transform component (i.e. all location, all
rotation, all scale) you're not likely to have problems, whereas if you only
disabled one axis (i.e. y-rotation), you may have problems in some cases.

So, restoring these to the UI.
2016-07-08 01:59:43 +12:00
4bf19e163f Code Cleanup - Split out the FCurve auto-color code into a separate function 2016-07-08 01:49:27 +12:00
7793d1d26f Fix T48747: Stuck in edit mode after selecting another object in the animation editors 2016-07-08 01:49:26 +12:00
7f03c9de7e Fix: Keyframe click-selection threshold in Dopesheet was still hardcoded to 7px 2016-07-08 01:49:25 +12:00
f3b3eb70a6 Dopesheet: Added "Moving Hold" as a keyframe type
Currently "long keyframes" are only useful for indicating where stationary
holds occur. If however you try to create a "moving hold" (where the values
are slightly different, but in terms of overall effect, it's still a hold)
then it could get tricky to keep track of where these occur.

Now it's possible to tag such keyframes (using the keyframe types - RKEY)
as being part of a moving hold. These will not only be drawn differently
from normal keyframes, but they will also result in a "long keyframe"
being drawn between each pair of them, just like if they had been completely
stationary instead.

Currently the theming/styling of these is a bit rough. They reuse the existing
theme colours for long keyframes.
2016-07-08 01:49:25 +12:00
2ba2860e11 Transforms to Delta Transforms
* Added new operators to take the current transform value (loc/rot/scale or all 3)
  and convert/apply that transform to a corresponding delta transform value. By default,
  the transform value will be zeroed out again afterwards, so you don't end up with a
  double transform.

* These operators can be found in the "Apply" menu (Ctrl-A)

* The "Animated Transforms to Deltas" (which does a similar job, except it adjusts all
  existing animation data instead of the current transform) has also been moved to the
  Apply menu (it was in the Transform menu instead)
2016-07-08 01:49:24 +12:00
92c9bdbbb9 Animation Editors: Object datablocks are now sorted alphabetically by default
A long requested feature has been to have objects appear in alphabetical order
in the animation editors, so that it is easier to find where they occur. This
commit implements support for this.

The main sticking point has been the performance impact of having this sorting
happening all the time (as the actual list of "bases" cannot be modified, as the
old depsgraph still needs random-looking unsorted order of objects for scheduling
updates). However, it recently occurred to me that perhaps by restricting it to
the one case where the ordering actually matters (i.e. when we're getting the channel
list for drawing all channels, vs operating on them), and adding a toggle to turn the
sorting off in heavy scenes when it might bog down things, that it will probably
be acceptable enough in general.  Furthermore, if things get really bad, we can investigate
putting in place some sort of caching scheme for this too - though hopefully the
new depsgraph will make that unnecessary (i.e. it doesn't sort the bases directly anymore).
2016-07-08 01:49:23 +12:00
2910e288ab Code Cleanup: Move out logic for checking if an object can be included in the dopesheet 2016-07-08 01:49:23 +12:00
095c8dbe69 Dopesheet: Keyframe size can be adjusted as part of theme settings
This commit introduces a scale factor setting for scaling all keyframe indicators
in the Dopesheet Editor up/down, in order to make them easier to select. It is perhaps
most useful for keyframe types which are usually indicated using smaller keyframes
(e.g. breakdown), which may get tricky to quickly select.
2016-07-08 01:49:22 +12:00
fab4b907f6 NLA: Indicate position of action-local markers on strips
To make it easier to synchronise timing across multiple strips, if you add
markers locally to an action, these will show up in the NLA strip in the
NLA Editor. These markings can then be used to line up the start/end of
another strip, or even to make sure that the markers from two different
strips end up lining up.

By default, this is turned on, but it can be disabled (via the View menu)
if it adds too much visual noise.
2016-07-08 01:47:32 +12:00
514700b307 Fix (unreported) crash when remapping armatures.
Objects' Pose holds references to the armature bones, so we have to force POSE_RECALC in those cases...
2016-07-07 15:07:51 +02:00
8443628e66 Outliner: Match search length w/ id name length 2016-07-07 16:36:25 +10:00
dac125b8ec writefile: call undo flush after writing the windowmanager
Data here is constantly changing, avoids outliner data being included in those changes for undo.
2016-07-07 16:27:33 +10:00
2b5c93d8fe Cleanup: move write flush into its own function
No point passing dummy args to existing function, split out logic instead.

Also add flush after writing mesh data too.
2016-07-07 16:10:51 +10:00
fd43b7077f Fix memory leak switching sculpt mode + dyntopo
Auto-enabling dyntopo w/ mode switching leaked memory when undo was used.
2016-07-07 15:48:25 +10:00
003365df0e Transform Snap: fix vert & edit object in ortho view
The callback used in `BLI_bvhtree_find_nearest_to_ray` was wrong and could result in crash.

Also de-duplicate vert/edge logic.
2016-07-07 15:24:58 +10:00
74518b6e88 Fix failing script_load_addons test after recent code cleanup. 2016-07-06 21:57:53 +02:00
04b3d682bb Cycles tests: Don't create fail file on idiff warning 2016-07-06 17:39:09 +02:00
d501d0f91e Revert rB961ebfa8c40b9909 - do not set Main's versions directly in do_versions().
This breaks any post-versionning (like IPO conversion, python handler, etc.).

rB961ebfa8c40b9909 mentions some Main being do_versionned several times (which is not desired for sure),
will try to reproduce again and find another fix.
2016-07-06 17:16:34 +02:00
Dalai Felinto
1640796ccc Fix Python API error message (do_unlink, instead of unlink) 2016-07-06 11:32:46 -03:00
2fcb9ef919 writefile: add flushes
Flush on grease pencil and data with image preview or packed data.
2016-07-06 23:28:52 +10:00
a0793765ef writefile: avoid adding SDNA to every undo step
Since SDNA was allocated for each undo step,
the new address meant it was considered different and included again.

Add an option not to duplicate the DNA string when calling DNA_sdna_from_data,
as well as avoiding a redundant copy, it writes the same address each time.
2016-07-06 23:07:37 +10:00
94e84f5be4 Fix memleak with recent Outliner writefile changes. 2016-07-06 14:45:06 +02:00
b7e84f32ad Cleanup/simplify/fixes BKE_object_is_libdata and BKE_object_obdata_is_libdata.
Removed checks for ob->proxy from the equation, you can totally have proxy objects
linked into another .blend file!
2016-07-06 14:37:03 +02:00
d231260212 Replace of (id->lib != NULL) check by meaningful macro.
Idea is to replace hard-to-track (id->lib != NULL) 'is linked datablock' check everywhere in Blender
by a macro doing the same thing. This will allow to easily spot those checks in future, and more importantly,
to easily change it (see work done in asset-engine branch).

Note: did not touch to readfile.c, since there most of the time 'id->lib' check actually concerns the pointer,
and not a check whether ID is linked or not. Will have a closer look at it later.

Reviewers: campbellbarton, brecht, sergey

Differential Revision: https://developer.blender.org/D2082
2016-07-06 14:11:01 +02:00
b98b331d04 writefile: simplify outliner treestore workaround
Instead of keeping a list of allocations, write to unique addresses
based on the BLI_mempool address since we know this is unique.
2016-07-06 21:58:47 +10:00
95ff9e9904 Cleanup: redundant 4th index in sculpt PBVH
Since moving to MLoopTri this is no longer needed.
2016-07-06 19:15:47 +10:00
674756bfce Dyntopo: optimize edge collapsing
Checking if faces exist was a bottleneck,
use a simpler version of this function for triangles.

Gives approx 1.6x overall speedup (when many edges are being collapsed).
2016-07-06 16:43:29 +10:00
8f1b8611f5 Cleanup: group dyntopo utility functions 2016-07-06 16:32:17 +10:00
950c2eaf61 Transform Snap: Replace pixel limit w/ 'dist_to_ray_sq'
When snapping to edge/vert, check the distance to the ray
instead of the screen-space pixel projection.

This also corrects the conversion of `dist_to_ray_sq` to `dist_px` which was being done incorrectly.

While this change was planned, it fixes T48791, caused by error in b01a56ee.
2016-07-06 11:42:26 +10:00
1d81f69f5e Code cleanup: for Cycles compatible panels, use exclusion rather than inclusion list.
This shortens the list, and Blender render specific panels are added less often
than other panels anyway, so less chance to miss things.
2016-07-05 22:26:15 +02:00
5b99dd5859 Render border: don't disable when drawing around the entire camera.
Differential Revision: https://developer.blender.org/D712
2016-07-05 21:59:02 +02:00
29c38335a1 Render border: skip unnecessary uncropping if the border covers the entire image. 2016-07-05 21:59:02 +02:00
7fcab3324b Render border: make it work together with with cache result / save buffers / full sample.
Differential Revision: https://developer.blender.org/D2080
2016-07-05 21:59:02 +02:00
037aa544cc Dyntopo: missing PBVH update collapsing an edge
PBVH-nodes attached to the vertex to be deleted were updated,
but not nodes attached to the other vertex in the edge.
2016-07-06 03:47:18 +10:00
06c1e782b0 Dyntopo: avoid redundant vector copy 2016-07-06 03:17:06 +10:00
4a61d21f61 Dyntopo: inline lookups, remove type check
This was checking vert/face for every lookup,
so far the type is always known, do a direct lookup instead.
2016-07-06 03:17:06 +10:00
3c7f3d27e0 Dyntopo: use inline iterators
Gives small performance boost.
2016-07-06 03:16:56 +10:00
8a648c1913 Dyntopo: compare masks when collapsing
Was just checking the value of the first
2016-07-05 18:56:21 +10:00
020a420fe3 Dyntopo: verify had over zealous asserts 2016-07-05 18:56:21 +10:00
39ae324918 Cycles: remove extended precision hacks, no longer needed with SSE2 requirement.
Differential Revision: https://developer.blender.org/D2079
2016-07-04 18:22:11 +02:00
1ba90582f5 Fix a few compiler warnings on OS X / clang.
Two were actual bugs, though they existed only in unused code:
* In Freestyle it was unintentionally copying a scene rather than referencing it.
* In BLI_array_store_is_valid there was use of uninitialized memory.
2016-07-04 18:22:10 +02:00
439fe6568f Fix use of uninitialized variable introduced in fix for T48755. 2016-07-04 17:30:52 +02:00
99683f25e8 And one more fix to particle distribution!
As pointed by Brecht, previous fix in rB61b49de44940 was actually incomplete,
we could still hit float rounding issue and hence same value in more than one consecutive
items of element_sum.

New solution is a bit different, we remove the 'minimal weight' check, and rather simply
ignores an item when the sum of its normalized weight to previous item's sum does not add
anything. Shall be safe and 100% effective this time!
2016-07-04 16:10:40 +02:00
d3b27bd19c Fix bmesh test after recent refactor. 2016-07-04 11:48:48 +02:00
d4eb28ab7e BI Viewport(GLSL): support for envmap in Texture node
This patch is another step to achieve BI and it's Viewport consistency for cubemap textures.
{F318879}

To test world_space_shading flag D2072 is required.

Alexander (Blend4Web Team)

Reviewers: campbellbarton, brecht

Subscribers: homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2074
2016-07-04 11:19:13 +03:00
4aaf5baccf Fix input for Texture node (envmap+world_space_shading)
This patch fixes shortcoming of D2046.
The original behavior without world_space_shading flag is that Texture node expects the reflected vector in view space. But with world_space_shading it should be in world space.

In attached file you will see a simple material setup and a node material analogue.

Simple material must have the same behavior regardless world_space_shading flag.

{F318866}

Alexander (Blend4Web Team)

Reviewers: brecht

Reviewed By: brecht

Subscribers: campbellbarton, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2072
2016-07-04 11:08:48 +03:00
fe44eacf78 Environment lighting for the GLSL mode
Environment lighting (aka ambient) is a key component of any renderer.
It's implemented like the Environment lighting of BI render for Approximate Gather mode. It support "Sky Color" and "White" Environment lighting modes.

It would be great if the user could see actual lighting conditions right in the Blender viewport instead of waiting for the renderer to complete the final image, exporting for external renderer or for a game engine.

Before:
{F113921}

After:
{F113922}

Example file: {F319013}

Original author: valentin_b4w

Alexander (Blend4Web Team)

Reviewers: valentin_b4w, campbellbarton, merwin, brecht

Reviewed By: brecht

Subscribers: panzergame, youle, duarteframos, AlexKowel, yurikovelenov, dingto, Evgeny_Rodygin

Projects: #rendering, #opengl_gfx

Differential Revision: https://developer.blender.org/D810
2016-07-04 11:01:32 +03:00
9269574089 Quiet warnings w/ USE_VERIFY define 2016-07-04 14:55:29 +10:00
b27322e71e Curve: utility to evaluate entire curve 2016-07-03 23:28:13 +10:00
b084003e88 Update pacman pkgbuild 2016-07-03 21:14:28 +10:00
8cc123a387 Fix T48783: OSL render errors after recent refactoring. 2016-07-03 13:08:21 +02:00
2c9add965b Fix use of uninitialized variable in Cycles OpenCL image textures. 2016-07-02 21:54:49 +02:00
0d4961cc52 Fix typo in bgl.Buffer report function
A GL_INT buffer was reported as GL_BYTE.
2016-07-02 18:38:05 +02:00
ee90badbd5 Install Deps: Use OSL 1.7.3, latest bugfix release. 2016-07-02 18:07:20 +02:00
aef72125da Correction for MSVC 2016-07-02 20:22:07 +10:00
b1047640ad BMesh: utility function to resize bmesh elements
This can be used to re-allocate bmesh data with/without tool flags.
Needed for Symmetrize since it uses bmesh operators from dyntopo.
2016-07-02 18:18:47 +10:00
9f5621bb4a Cleanup: comment blocks 2016-07-02 10:08:33 +10:00
1077514896 Cleanup: style 2016-07-02 10:00:30 +10:00
5c249fac9a Fix Cycles OpenCL not taking Extend and Clip extension types into account.
(See T48720).
2016-07-01 23:48:31 +02:00
85c9aefe0f "Fix" crash when deleting linked object which has indirect usages.
This is in fact very hairy situation here... Objects are only refcounted by scenes,
any other usage is 'free', which means once all object instanciations are gone Blender
considers it can delete it.

There is a trap here though: indirect usages. Typically, we should never modify linked data
(because it is essencially useless, changes would be ignored and ost on next reload or
even undo/redo). This means indirect usages are not affected by default 'safe' remapping/unlinking.

For unlinking preceeding deletion however, this is not acceptable - we are likely to end with
a zero-user ID (aka deletable one) which is still actually used by other linked data.

Solution choosen here is double:
I) From 'user-space' (i.e. outliner, operators...), we check for cases where deleting datablocks
should not be allowed (indirect data or indirectly used data), and abort (with report) if needed.
II) From 'lower' level (BKE_library_remap and RNA), we also unlink from linked data,
which makes actual deletion possible and safe.

Note that with previous behavior (2.77 one), linked object would be deleted, including from linked data -
but then, once file is saved and reloaded, indirect usage would link back the deleted object,
without any instanciation in scene, which made it somehow virtual and unreachable...

With new behavior, this is no more possible, but on the other hand it means that in situations of dependency cycles
(two linked objects using each other), linked objects become impossible to delete (from user space).

Not sure what's best here, behavior with those corner cases of library linking is very poorly defined... :(
2016-07-01 18:29:12 +02:00
ad717fe737 Outliner: pass operator's reports to all operation callbacks.
Also define single callback func typedef, cleaner this way!

Note: maybe we want to do that for the other callbacks too (data, etc.), but will be enough for now.
2016-07-01 18:29:12 +02:00
158679c9cc Fix T48666: Segfault on boolean operation when exiting edit mode of instanced operand
This is quite tricky situation which combined:

- Boolean modifier which accesses other object's derived mesh
  (in fact, it's nothing to do with boolean modifier, any other
  modifier which uses other's DM will have same bug).

- Dependency cycles in the scene which is rather russian-roulette
  from the cycle solver point of view.

- Multiple instanced objects used as boolean operand.

With all this things combined boolean modifier was accessing operand's derived
mesh which was referencing data from Mesh datablock. The issue is that those
references are becoming invalid after EDBM_mesh_load().

This function already had code to make sure object itself does not end up with
dangling pointers from derived mesh. Make it now so no possible instanced objects
are left with dangling pointers.

And who said it's a good idea to reference something from derived mesh..
2016-07-01 14:25:30 +02:00
50d715f970 UI: take zoom into account w/ curves widget
The Curves widget has buttons to zoom in on the curve. However the
click detection code doesn't take it into account, and at full zoom
in click on curve is detected very far from the actual visible curve.

Change it to compare the position to the actual line segments
in the UI coordinate space, i.e. with curve zoom applied.
2016-07-01 22:13:53 +10:00
b558fa6715 Add wait cursor toggling dyntopo 2016-07-01 21:50:53 +10:00
ff0079b40a UI: move dyntopo button to header
This looks a bit odd, but being able to see if dyntopo is enabled
when the panel is collapsed is handy.
2016-07-01 21:44:31 +10:00
85bdbd7653 Sculpt: skip normal calculation entering dyntopo
When no triangulation runs we can skip re-calculating normals.
2016-07-01 21:14:33 +10:00
dbd38e969f BGE: Display Hardware infos only in standalone.
This patch moves the PrintHardwareInfo() function in standalone only, not in embedded. Why? Because you can need this infos for debugging
purpose in "compiled" blender files but it was boring to have it displayed each time you launched embedded. So you can have this infos when you
click standalone or when you run your executable app from a console.

Reviewers: moguri, kupoman, panzergame.
2016-07-01 11:56:26 +00:00
c08f0ceeb7 Enable dyntopo re-entering sculpt mode 2016-07-01 19:49:13 +10:00
0a026033ae BMesh: make toolflags optional
Saves 8 bytes per vert/edge/face.
Gives overall ~20-25% memory saving for dyntopo sculpting
and modifiers that use BMesh.
2016-07-01 19:29:22 +10:00
4b0aeaf327 Fix T48757: Broken in D1120 normal baking 2016-06-30 12:40:35 +03:00
260da0cd91 Fix T48728, part 2: Vertex colors not shown in texture mode 2016-06-30 14:20:20 +05:00
b01a56ee5c Transform Snap: Optimize edge-snap using BVH tree
changes in BLI_kdopbvh:

- `BLI_bvhtree_find_nearest_to_ray` now takes is_ray_normalized and scale argument.
- `BLI_bvhtree_find_nearest_to_ray_angle` has been added (use for perspective view).

changes in BLI_bvhutils:

- `bvhtree_from_editmesh_edges_ex` was added.

changes in math_geom:

- `dist_squared_ray_to_seg_v3` was added.

other changes:

- `do_ray_start_correction` is no longer necessary to snap to verts.
- the way in which the test of depth was done before is being simulated in callbacks.
2016-06-30 17:52:03 +10:00
9d5661c9e8 CMake: list buildinfo.h as buildinfo.cmake's output
Keep the fake header to ensure we always run.
2016-06-30 08:53:25 +10:00
72792406c9 Correct fix for MSVC 2016-06-30 08:10:49 +10:00
94a80a1fb1 Fix bplayer (c) 2016-06-29 17:57:41 +02:00
903cb13bb8 Cleanup: use const 2016-06-29 23:22:54 +10:00
0971749f4c Cleanup: spelling, indentation 2016-06-29 20:37:54 +10:00
2e41df6847 Fix T48695: Slowdown w/ edit-mesh & shrinkwrap
0b5a0d84 caused regression since edit-mesh BVH wasn't cached,
each shrink-wrap modifier created its own BVH.
2016-06-29 19:43:08 +10:00
68fcc3b1f6 Correction to previous commit: Only skip colors for texture paint
This way we avoid regression of sculpt mode shading.

Hopefully now it's all fine.
2016-06-29 13:31:45 +05:00
9e173afca3 Cleanup: endian tests 2016-06-29 18:14:45 +10:00
2f532c7844 Fix T48728: Vertex colors not shown in texture mode
Regression caused by own changes to make texture paint more efficient
from workflow point of view.

Now the idea is to use vertex color outside of paint mode, so we don't
break any compatibility here.
2016-06-29 13:08:12 +05:00
c7eb5eeaa9 Cleanup: warning 2016-06-29 17:12:48 +10:00
e6d947f037 BMesh Intersect: use flags to keep track of verts
For simple cases bitmasks were OK, but didnt work for vert/edge, vert/edge tests.

Tag verts instead, makes logic easier to follow and gives minor speedup.
2016-06-29 16:09:58 +10:00
29a73106b4 UI: prevent softrange from becoming nan
Quiets assert
2016-06-29 12:09:00 +10:00
20f634cfc2 Fix T48755: Crash UV unwrapping 2016-06-29 11:51:36 +10:00
a21549f822 Usual i18n/UI messages cleanup & fixes. 2016-06-28 21:34:18 +02:00
Martijn Berger
5b325abf60 [msvc2015/OpenEXR] Linker hackery is no longer required in vc2015
Reviewers: juicyfruit

Reviewed By: juicyfruit

Differential Revision: https://developer.blender.org/D1892
2016-06-28 16:02:12 +02:00
23cc453975 Fix T48732: New GGX breaks OpenCL kernel
Make sure we don't perform any implicit address space conversion.

A bit annoying, but less intrusive approaches (like using temp private
variable in .cl kernel) do not work correct here.

Using generic address space will help from code side here, but will
be somewhat slower due to extra things happening as far as i know.
2016-06-28 17:15:35 +05:00
0d7817d1a4 Cleanup: use bool for writefile 2016-06-28 21:00:00 +10:00
55546b4e13 writefile: replace most struct lookups /w constants
Removes many hash lookups per file-save and undo-step.
2016-06-28 20:25:52 +10:00
f181839c57 Cleanup: code-style
Other changes here planned which touch many lines, so run cleanup first.
2016-06-28 20:05:04 +10:00
72fc2b6afe Fix T48753: VSE must restart for international fonts 2016-06-28 16:25:49 +10:00
6ce0ddae96 GHOST/X11: Hotplug support for xinput
Allows to plug/unplug different tablets while Blender is running.

Also fixes crash unplugging tablet while Blender runs (T48750).
2016-06-28 16:08:39 +10:00
e5a1f3142e RNA: resolve assert w/ no languages available 2016-06-28 12:36:21 +10:00
66054caa1b RNA: perform reverse search on operators
In most the last added operator is being handles.
2016-06-28 12:13:43 +10:00
3569ea03d8 Cleanup: Python imports 2016-06-28 12:13:16 +10:00
5806268051 Fix MSVC error, co_return now a reserved word
D2073 by @LazyDodo
2016-06-28 08:35:05 +10:00
f738f66f1b Fix (unreported) wrong ID type check in Text editor's ID remap callback. 2016-06-27 17:42:38 +02:00
14f056144e Bendy Bones Instability Fix - Second Attempt
So the error seems to be in cubic_tangent_factor_circle_v3(),
which was introduced with D2001.

I've tweaked the most obvious culprit here - the epsilon factor.
It used to be 10^-7, but I've reduced it down to 10^-5 now,
and it's looking a lot more stable now :)

---------

BTW, about the derivation of the magic 0.390464 factor I briefly subbed back
as a workaround for this bug, see:
    http://www.whizkidtech.redprince.net/bezier/circle/
2016-06-28 02:52:20 +12:00
9466d1579d Bendy Bones: Temporary workaround for instability caused by D2001 when using custom handle bones
It's probably some numeric precision issue, but until we figure out exactly what's
going wrong here, let's just revert back to the hardcoded value that was used here
successfully for years without issues.
2016-06-28 02:20:54 +12:00
e2c7ee7733 Fix T48740: User could remap indirect libdata usages from outliner.
Remapping indirect usage of IDs is forbidden from user space, this is calling for
nice nightmare with libraries handling (and undo crash, among other things).

Not sure why I was 'laxist' about indirect usage cases detection like that,
for now just consider any ID used by another linked datablock as indirect usage case!

Also, added some error/warning reports to Outliner's remap code.
2016-06-27 15:46:43 +02:00
34024c7cd8 FCurve Auto Colours: "XYZ to RGB" works for Quaternions too now
The "W" channel will get a yellowish colour (i.e. a blend between the X/R and
Y/G axis colours), while the XYZ will behave as they do for other transforms.
2016-06-28 00:27:51 +12:00
f4e492ad71 Partial fix for T48734
The create drivers operator should not use the "Transform Channel" variable type
when driving one transform with another on the same object/bone. Otherwise, you
end up with a situation which technically results in a bit of a pseudo-dependency
cycle.
2016-06-28 00:27:50 +12:00
b6483a25f2 Code Cleanup: Use bools not shorts 2016-06-28 00:27:50 +12:00
de6064eab1 Ctrl-Shift-C: Made it easier to add constraints between bones in different armatures
The Ctrl-Shift-C operator to add constraints between a pair of selected items,
for example, between two objects, or between two bones (in the same armature).

This commit makes it possible to use this operator to add a constraint where the
target is a bone from another object - e.g. to make a deform bone follow the control
bone in another armature, or to make an object use a bone as a tracking target.

Usage:
1) Ensure you are in Pose Mode, then select the bone to use as the target
2) Shift-Select the other object and/or the bone that's going to get the constraint
3) Ctrl-Shift-C
2016-06-28 00:27:49 +12:00
ab921321e1 Fix (unreported) potential buffer overflow with BLO_library_path_explode() usage.
Also added warning to func doc, let's try to avoid this in future (for until we
pass string length systematically...).
2016-06-27 12:38:12 +02:00
5f77266baf Fix T48741: File browser back button doesn't work from inside Blend (library) file.
Problem was in fact slightly wider, File space was nearly not taking into account
library navigation case and its 'virtual' directoris, except in a few places.

Add a wrapper around BLI_is_dir that also check for lib paths, and used it in
ED_file_change_dir(), such that we now always check path is a
valid directory - in the filebrowser context, not filesytem context. ;)
2016-06-27 12:26:14 +02:00
4a641e3cbc Cycles: Fix corner case of human readable number returning empty string 2016-06-27 13:49:25 +05:00
f1253f5d2b Fix T48717: Modal operators called from Py omit reports from the UI 2016-06-27 17:09:52 +10:00
6021cc4007 Rename script stub
Was clear from name this is to run external scripts.
2016-06-27 16:04:59 +10:00
5181f085eb Fix T48733: World background fails in 3d-view
Missing from fix for T48555.
Unfortunately duplicates code.
2016-06-27 15:36:28 +10:00
936c176a71 Fix T48743: Broken menu key accelerators
Regression caused by fc96110b
2016-06-27 14:15:48 +10:00
538a70c9b6 Cleanup: unnecessary NULL check 2016-06-27 13:21:14 +10:00
c7a6ff0981 Docs: arg names 2016-06-27 13:21:14 +10:00
6e193c42cb Docs: minor edits to writefile comments 2016-06-27 12:39:28 +10:00
2a69b09b62 Fix T48732 v2: New GGX breaks OpenCL kernel
As far as I can see, the second issue there was that the functions receive a pointer to a member variable of the
ShaderData, which is stored in global memory. However, this means that the pointer points to global memory as well,
therefore OpenCL requires the ccl_addr_space "keyword" in front of the pointer.
With this commit, the OpenCL kernels build on Linux with the Intel CPU OpenCL runtime - however, they already did
without the change and I don't have an AMD card, so I can't really test whether the AMD runtime is happy as well now.
2016-06-26 00:51:16 +02:00
aff81c6393 Cleanup: Get rid of remaining 'BKE_<id>_unlink()' functions, no more used anyway. 2016-06-25 18:36:27 +02:00
1b6cf7a99b Cleanup: get rid of BKE_text_unlink(), replace by usage of generic BKE_libblock_... API. 2016-06-25 18:12:23 +02:00
42872656d8 Cleanup: remove RNA's ID.destroy() function.
We already have Main's ID lists' `remove()` function, better not do the same thing
in two different places!
2016-06-25 17:10:33 +02:00
d4e435836d Cleanup/refactor RNA IDs' remove functions.
Those (one per ID type!) were uselessly duplicated, and badly inconsistent
(some types were actually unlinking before deletion, others were only working if already unlinked!).

Now we use same func and same API for all types, by default deletion is performed only if ID is no more used,
set `do_unlink` parameter to True to always delete ID even if still in use.
Only exception now is with Scene, since we always want to keep at least one!

Note that this will change default behavior of some types (since unlinking is never done anymore by default).
2016-06-25 17:10:33 +02:00
bfcf8c8e03 CMake: exclude gitignore & arcconfig for addons
These files were included in releases
2016-06-25 21:57:54 +10:00
9c96585f3c Cleanup: remove bad-level call 2016-06-25 21:19:54 +10:00
0a99072f0d GPU: move select index code out of WM
This avoids bad-level calls.
2016-06-25 21:13:33 +10:00
28dbd572a4 Exclude obsolete static pythonlibs from install 2016-06-25 12:40:19 +02:00
99088f8b55 Fix T48732, OpenCL compile failure after Multiscatter GGX commit.
Use OpenCL "all" builtin type for conversion, according to OpenCL 1.1 spec 6.3e.
2016-06-25 11:14:06 +02:00
05a60aaa07 Fix T48723: Curve bevel creates invalid geometry 2016-06-25 13:57:35 +10:00
8f0a44a5d5 Cleanup: use BLI_bitmap for bevel-split 2016-06-25 11:24:25 +10:00
c376ff26be Fix T48725: UI message typo. 2016-06-24 11:00:19 +02:00
a10117562f BMesh: avoid redundant calculations comparing angles 2016-06-24 19:01:35 +10:00
73a9c56607 Fix T48716: Knife cut creates inverted normals
In the case of having 3+ boundary edges, we need to find the best.
2016-06-24 18:58:42 +10:00
823ab66eca Avoid memory leaks on exit during argument parsing
Exiting Blender during argument parsing would leak memory
(tests, documentation generation, utilities).

While harmless, it hides real leaks which should be resolved.
2016-06-24 10:05:23 +10:00
25866aa149 BKE_blender: Add own atexit functions
Runs before guarded-alloc leaks print.
2016-06-24 10:05:18 +10:00
4fc1510dd8 Cleanup: use return argument prefix 2016-06-24 10:05:09 +10:00
23c276832b Cycles: Add multi-scattering, energy-conserving GGX as an option to the Glossy, Anisotropic and Glass BSDFs
This commit adds a new distribution to the Glossy, Anisotropic and Glass BSDFs that implements the
multiple-scattering microfacet model described in the paper "Multiple-Scattering Microfacet BSDFs with the Smith Model".

Essentially, the improvement is that unlike classical GGX, which only models single scattering and assumes
the contribution of multiple bounces to be zero, this new model performs a random walk on the microsurface until
the ray leaves it again, which ensures perfect energy conservation.

In practise, this means that the "darkening problem" - GGX materials becoming darker with increasing
roughness - is solved in a physically correct and efficient way.

The downside of this model is that it has no (known) analytic expression for evalation. However, it can be
evaluated stochastically, and although the correct PDF isn't known either, the properties of MIS and the
balance heuristic guarantee an unbiased result at the cost of slightly higher noise.

Reviewers: dingto, #cycles, brecht

Reviewed By: dingto, #cycles, brecht

Subscribers: bliblubli, ace_dragon, gregzaal, brecht, harvester, dingto, marcog, swerner, jtheninja, Blendify, nutel

Differential Revision: https://developer.blender.org/D2002
2016-06-23 22:57:26 +02:00
2af4c80be6 GPencil: Eraser respects "Selection Mask" when in EditMode 2016-06-24 03:33:31 +12:00
9839aba84f Fix minor typo - Was m[3][4] instead of m[4][4] for a 4x4 matrix 2016-06-24 03:18:38 +12:00
4fd78bb06f ChildOf Constraint: Hide the Loc/Rot/Scale toggles
The RNA properties are still there (in case you really need them), except now
they will not be shown in the UI anymore, as this constraint really didn't
work well/at all when any of those was disabled. Most people shouldn't really
need to worry about this change.

If anyone wants a matrix-math challenge, they're welcome to try getting those
working for real, so that we can show these toggles again.
2016-06-24 03:18:37 +12:00
9466829ead DopeSheet Mask Mode: Circle/Lasso support
Adapted from the code for Grease Pencil (just like the whole mode was)
2016-06-24 03:18:36 +12:00
833e69ff7e DopeSheet: GPencil-Mode supports Circle and Lasso Select
To get this working the least effort, I've had to expose the helper functions
used by the lasso and circle select keyframe-test callbacks (which are generic)
and expose them for use by the GP keyframe editing code too. Hopefully in time
we clean this all up and just write the code once to operate on "keyframes"
2016-06-24 03:18:36 +12:00
7e53f9fb1a Dopesheet: Lasso and Circle Select tools work for selecting keyframes
This only works in the Action and Dopesheet modes (which operate on FCurve keyframes).
Support for Grease Pencil and Mask Keyframes though is still pending.
2016-06-24 03:18:35 +12:00
58acc184c4 Code Cleanup - Circle/Lasso select in the Graph Editor 2016-06-24 03:18:34 +12:00
b6a898b3db GPencil UI: Streamline toolbar options a bit
As suggested by mendiobox:

* Don't show "enable editing" in the 3D view. You can already do this by switching
  into stroke editing mode here, so no need for the duplication. (In other editors
  though, this can't be done yet, so we don't do it)

* Make the "Convert" button into a dropdown so that you don't need to deal with a
  a separate popup menu

* In the 3D view, don't show the selection + transform operators that can be easily
  found in the menus too (as well as having commonly used shortcuts)
2016-06-24 03:18:33 +12:00
ec7603d6f1 GPencil: Added a new version of the "delete active frame" operator which deletes on all editable layers
This new operator will delete any GP frame it finds on the current frame, regardless
of whether it's on the active layer or not. It will only remove the frames if the
layer is editable, but otherwise, it will just go for it.

The existing operator is great for use in the panel (where it only applies to the active
frame), but it was not so good for all the other places where tools can be invoked
(e.g. D-X, or Delete) as you're typically thinking about the whole scene more holisticaly
than just caring about a particular layer.
2016-06-24 03:18:33 +12:00
37560e77e8 Fix T48689: Transform proportional size was not seriously clamped.
Now use same, reasonable min/max values, to avoid getting inf or zero values when
using shortcuts during transform operation...
2016-06-23 16:45:06 +02:00
d9a01a1d04 Fix T48707: Edit-mesh intersect crash
In rare cases intersect would attempt to add edges with the same vertex twice
from edge-vert / edge-edge intersections.

Solve by checking for duplicates when creating vertex-array for these types of intersections
(always under 3x comparisons, so not much overhead).
2016-06-23 22:20:40 +10:00
57744df38f Correct recent change to edge-net
Need account for cases where vertex connects a single edge.
2016-06-23 22:20:40 +10:00
097611a92a Fix T48710: 'velocity' particle settings were incorrectly using 'speed' in their tooltips.
Not the same thing, velocity is a vector conveying both speed *and* direction...
2016-06-23 13:09:32 +02:00
219a8d046a Use hard min/max for view clipping
In rare cases its useful to have far clip below 1.
2016-06-23 18:47:55 +10:00
a8898d3105 Correct assert 2016-06-23 12:26:26 +10:00
fad0c336e4 RNA: Expose hook inverse matrix
Needed so scripts don't need to use operators to adjust hook modifiers.
2016-06-23 11:52:44 +10:00
475b7f5a2c BLI_array_utils: add BLI_array_rfindindex
Array search from back to front.
2016-06-23 11:36:49 +10:00
9bce807d0b Cycles: Fix the Convert Node type registration
The function that assigns names to socket types missed an entry, therefore all entries after it were mapped to the wrong name.
Long-term, it might be a better solution to use a map to avoid issues like these, but for now this fix works.
2016-06-23 03:15:57 +02:00
29448bd99b Fix T48658: Cycles render & render preview corrupts particles
Replaces `G.is_rendering` with `use_render_params` argument.

This is needed for Cycles, which attempts to restore render-preview settings from particles,
after it gets its own particle data, but fails to restore because
`G.is_rendering` was being checked in psys_cache_paths (and other places).
2016-06-23 07:54:35 +10:00
7547c6a250 ID-Remap, step two: add some user-level tools.
This commit adds operators and Outliner menu entries to reload or relocate a library,
and to delete or replace a datablock.

RNA ID API is also extended to allow ID deletion and remapping from python.

Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 18:05:55 +02:00
fb1f7fad78 Cleanup: use proper RNA struct type for ListBase type
(otherwise all code using RNA has to link DNA_listbase.h, not clean at all!).
2016-06-22 18:04:04 +02:00
897e97f078 ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.

Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).

One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).

This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).

This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.

A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)

Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:53:50 +02:00
73cfbb0ab9 Cycles: Fix crash with Environment Texture and OSL
In the OSL node compilation code for the Environment Texture, is_linear was used as a socket.
However, there was no socket for it, which caused Blender to crash.
Adding a socket doesn't really make sense since it's an internal value and not a parameter
of the node, so it now just uses the variable directly.
2016-06-22 16:12:40 +02:00
b204bdad47 EditMesh: Avoid creating deform-vert layer every redraw
Getting a new edit-derived-bmesh was always creating a deform-vert array, even when it wasn't needed.
Since this was called on redraw, in many cases it was doing it unnecessarily.

Now pass in a custom-data mask and only fill in deform-verts when needed.

Gives noticeable drawing speedup (~10-30% here).
2016-06-22 21:31:00 +10:00
493c6b622f Cleanup: style 2016-06-22 14:02:51 +10:00
435fa9a015 Cleanup: remove unused Image space curves
Caused leaks reading old files, was read/written but not freed,
remove since its unused.
2016-06-22 09:50:53 +10:00
e0f314d750 readfile: use BLI_endian_switch
Replace inline endian switching
2016-06-22 09:38:23 +10:00
68040359d1 Remove module reloading for preview operators
This can be kept on file level but best keep out of operator functions.
2016-06-22 08:47:40 +10:00
63006c88a1 writefile: use const for old address
Also remove temp preview overwriting.
2016-06-22 08:44:26 +10:00
6fbe6eb033 Fix T48703: Name inconsistency w/ area maximize/fullscreen
Name operator based on default behavior.
2016-06-22 07:47:30 +10:00
a5b474e352 Docs: use doxy formatting for readfile 2016-06-22 07:47:30 +10:00
1fd773ed14 T48694: fix bge.texture.Texture.refresh() documentation
first parameter is mandatory and must be a bool indicating if the image
source should be refreshed after updating the texture.
2016-06-21 23:23:05 +02:00
8ae74ece9a Fix null-pointer free
Own error in recent decimeter commit
2016-06-22 05:34:04 +10:00
e783fddc01 Fix T48700: Crash when window creation fails
Check if Python is initialized before calling BPY_python_end.
2016-06-22 04:17:02 +10:00
028ba31903 Fix T48698: Rays from SSS act as diffuse for normal objects but have an undefined type for lamp objects
The problem here was that there are five path types internally (diffuse, glossy, transmission, subsurface and volume scatter), but subsurface isn't exposed to the user.
This caused some weird behaviour - if all four types are disabled on the lamp, Cycles doesn't even try sampling it, but if any type was active, the lamp would illuminate
the cube since none of the options set subsurface to zero.
In the future, it might be reasonable to add subsurface visibility as an option - but for now the weird and inconsistent behaviour can be fixed simply by setting both
diffuse and subsurface to zero if the user disables diffuse visibility.
2016-06-21 20:09:48 +02:00
db4a46bc3c Cleanup: hide debug print behind proper debug defines instead of using comments... 2016-06-21 16:19:08 +02:00
e34ade4eb3 Fix T48412: Blender 2.77a crashes on Undo in some specific multi-level linked libraries cases.
Good old dead-brain stupid error when iterating over a linked list from which you remove some items...
2016-06-21 16:12:33 +02:00
8dec4a0e79 Fix for string buffer overflow in DepsNode identifiers.
Layer flags can go up to 2^n-1 for n layers, requiring *at least* 9 chars + 1 terminator for 20 layers.
2016-06-21 12:51:18 +02:00
1abf7dd835 Fix T48697: Brush curve-stroke snaps strangely
Support Snapping screen-space 2d curves, (was applying world-space coords in screen-space).
Also show snap settings in header.
2016-06-21 16:19:45 +10:00
7cbd1285a5 Fix T48196: Crash enabling modal operator in exec
Not good practice, but better not crash.
2016-06-21 15:02:10 +10:00
994dd5c7c1 Cleanup: rename curve align-x flags 2016-06-21 12:45:25 +10:00
Dalai Felinto
cb5a77253a Text Object: Vertical Alignment
A new option for Font/Text objects vertical alignment:

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

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

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

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

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

Reviewers: campbellbarton

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

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

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

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

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

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

Part of my GSoC 2016.
2016-06-19 17:31:16 +02:00
3372 changed files with 946247 additions and 152435 deletions

5
.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
@@ -33,3 +32,7 @@ Desktop.ini
/doc/python_api/sphinx-in-tmp/
/doc/python_api/sphinx-in/
/doc/python_api/sphinx-out/
/doc/python_api/rst/bmesh.ops.rst
# in-source lib downloads
/build_files/build_environment/downloads

8
.gitmodules vendored
View File

@@ -2,11 +2,19 @@
path = release/scripts/addons
url = ../blender-addons.git
ignore = all
branch = master
[submodule "release/scripts/addons_contrib"]
path = release/scripts/addons_contrib
url = ../blender-addons-contrib.git
ignore = all
branch = master
[submodule "release/datafiles/locale"]
path = release/datafiles/locale
url = ../blender-translations.git
ignore = all
branch = master
[submodule "source/tools"]
path = source/tools
url = ../blender-dev-tools.git
ignore = all
branch = master

File diff suppressed because it is too large Load Diff

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,16 @@ 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)
ifneq ($(OS_NCASE),darwin)
# Add processor type to directory name
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(shell uname -p)
endif
# Allow to use alternative binary (pypy3, etc)
ifndef PYTHON
PYTHON:=python3
@@ -86,13 +96,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 +108,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 +117,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 +131,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 +150,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 +189,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 ""
@@ -182,14 +208,20 @@ help: .FORCE
@echo " * package_archive - build an archive package"
@echo ""
@echo "Testing Targets (not associated with building blender)"
@echo " * test - run ctest, currently tests import/export, operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8 which are tagged to use the stricter formatting"
@echo " * test - run ctest, currently tests import/export,"
@echo " operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker"
@echo " which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8"
@echo " which are tagged to use the stricter formatting"
@echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed"
@echo " * test_style_c - checks C/C++ conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_c - checks C/C++ conforms with blenders style guide:"
@echo " http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_c_qtc - same as test_style but outputs QtCreator tasks format"
@echo " * test_style_osl - checks OpenShadingLanguage conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_osl - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo ""
@echo "Static Source Code Checking (not associated with building blender)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
@@ -392,10 +424,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
@@ -405,7 +443,8 @@ update: .FORCE
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: .FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
@@ -414,7 +453,8 @@ doc_doxy: .FORCE
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna: .FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup \
--python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: .FORCE

View File

@@ -0,0 +1,131 @@
# ***** 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/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,80 @@
# ***** 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,67 @@
# ***** 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,49 @@
# ***** 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,114 @@
# ***** 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()
set(BOOST_PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/boost/src/external_boost < ${PATCH_DIR}/boost.diff)
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 .)
set(BOOST_PATCH_COMMAND 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)
set(BOOST_PATCH_COMMAND echo .)
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 ""
PATCH_COMMAND ${BOOST_PATCH_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,54 @@
# ***** 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,136 @@
# ***** 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()
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()

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()

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,276 @@
# ***** 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 &&
# 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()
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()
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()

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,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(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()
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,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 *****
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
-DALSOFT_BACKEND_SNDIO=Off
)
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,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(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,73 @@
# ***** 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,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(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,152 @@
# ***** 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
-DUSE_WEBP=${WITH_WEBP}
-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,64 @@
# ***** 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
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_openjpeg_msvc after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/lib ${HARVEST_TARGET}/openjpeg/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/include ${HARVEST_TARGET}/openjpeg/include
DEPENDEES install
)
endif()
endif()
set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT})
if(MSVC)
set_target_properties(external_openjpeg PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,78 @@
# ***** 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_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-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,80 @@
# ***** 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,211 @@
# ***** 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()
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,98 @@
# ***** 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,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(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,46 @@
# ***** 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,140 @@
# ***** 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()

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(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,48 @@
# ***** 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,62 @@
# ***** 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(UNIX)
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,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(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
-DTBB_BUILD_TBBMALLOC=Off
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
)
if(TBB_VERSION MATCHES 2018)
set(TBB_VS_VERSION vs2013)
elseif(TBB_VERSION MATCHES 2017)
set(TBB_VS_VERSION vs2012)
else()
set(TBB_VS_VERSION vs2010)
endif()
# 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/${TBB_VS_VERSION}/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,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 *****
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,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(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,257 @@
# ***** 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://releases.llvm.org/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.gz)
set(LLVM_HASH a20669f75967440de949ac3b1bad439c)
set(CLANG_URI http://releases.llvm.org/${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)
if(UNIX AND NOT APPLE)
# Needed to be compatible with GCC 7, other platforms can upgrade later
set(TBB_VERSION 2017_U7)
set(TBB_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 364f2a4b80e978f38a69cbf7c466b898)
else()
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)
endif()
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,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 *****
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

@@ -25,17 +25,18 @@
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,\
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
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,\
force-ffmpeg,force-opencollada,\
force-ffmpeg,force-opencollada,force-alembic,\
build-all,build-python,build-numpy,build-boost,\
build-ocio,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\
build-ffmpeg,build-opencollada,\
build-ffmpeg,build-opencollada,build-alembic,\
skip-python,skip-numpy,skip-boost,\
skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
skip-ffmpeg,skip-opencollada \
skip-ffmpeg,skip-opencollada,skip-alembic \
-- "$@" \
)
@@ -103,6 +104,11 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--no-confirm
Disable any interaction with user (suitable for automated run).
--use-cxx11
Build all libraries in cpp11 'mode' (will be mandatory soon in blender2.8 branch).
NOTE: If your compiler is gcc-6.0 or above, you probably *want* to enable this option (since it's default
standard starting from this version).
--with-all
By default, a number of optional and not-so-often needed libraries are not installed.
This option will try to install them, at the cost of potential conflicts (depending on
@@ -112,6 +118,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.
@@ -167,6 +176,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--build-openvdb
Force the build of OpenVDB.
--build-alembic
Force the build of Alembic.
--build-opencollada
Force the build of OpenCOLLADA.
@@ -216,6 +228,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--force-openvdb
Force the rebuild of OpenVDB.
--force-alembic
Force the rebuild of Alembic.
--force-opencollada
Force the rebuild of OpenCOLLADA.
@@ -258,6 +273,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--skip-openvdb
Unconditionally skip OpenVDB installation/building.
--skip-alembic
Unconditionally skip Alembic installation/building.
--skip-opencollada
Unconditionally skip OpenCOLLADA installation/building.
@@ -272,14 +290,15 @@ SUDO="sudo"
NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=false
PYTHON_VERSION="3.5.1"
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
@@ -306,8 +325,8 @@ OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false
_with_built_openexr=false
OIIO_VERSION="1.6.9"
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
@@ -321,14 +340,14 @@ LLVM_FORCE_REBUILD=false
LLVM_SKIP=false
# OSL needs to be compiled for now!
OSL_VERSION="1.7.1"
OSL_VERSION="1.7.5"
OSL_VERSION_MIN=$OSL_VERSION
OSL_FORCE_BUILD=false
OSL_FORCE_REBUILD=false
OSL_SKIP=false
# OpenSubdiv needs to be compiled for now
OSD_VERSION="3.0.2"
OSD_VERSION="3.1.1"
OSD_VERSION_MIN=$OSD_VERSION
OSD_FORCE_BUILD=false
OSD_FORCE_REBUILD=false
@@ -343,13 +362,19 @@ OPENVDB_FORCE_BUILD=false
OPENVDB_FORCE_REBUILD=false
OPENVDB_SKIP=false
# Version??
OPENCOLLADA_VERSION="1.3"
# Alembic needs to be compiled for now
ALEMBIC_VERSION="1.7.1"
ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
OPENCOLLADA_VERSION="1.6.51"
OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
FFMPEG_VERSION="2.8.4"
FFMPEG_VERSION="3.2.1"
FFMPEG_VERSION_MIN="2.8.4"
FFMPEG_FORCE_BUILD=false
FFMPEG_FORCE_REBUILD=false
@@ -476,12 +501,18 @@ while true; do
--no-confirm)
NO_CONFIRM=true; shift; continue
;;
--use-cxx11)
USE_CXX11=true; shift; continue
;;
--with-all)
WITH_ALL=true; shift; continue
;;
--with-opencollada)
WITH_OPENCOLLADA=true; shift; continue
;;
--with-jack)
WITH_JACK=true; shift; continue;
;;
--ver-ocio)
OCIO_VERSION="$2"
OCIO_VERSION_MIN=$OCIO_VERSION
@@ -525,6 +556,7 @@ while true; do
OPENVDB_FORCE_BUILD=true
OPENCOLLADA_FORCE_BUILD=true
FFMPEG_FORCE_BUILD=true
ALEMBIC_FORCE_BUILD=true
shift; continue
;;
--build-python)
@@ -567,6 +599,9 @@ while true; do
--build-ffmpeg)
FFMPEG_FORCE_BUILD=true; shift; continue
;;
--build-alembic)
ALEMBIC_FORCE_BUILD=true; shift; continue
;;
--force-all)
PYTHON_FORCE_REBUILD=true
NUMPY_FORCE_REBUILD=true
@@ -580,6 +615,7 @@ while true; do
OPENVDB_FORCE_REBUILD=true
OPENCOLLADA_FORCE_REBUILD=true
FFMPEG_FORCE_REBUILD=true
ALEMBIC_FORCE_REBUILD=true
shift; continue
;;
--force-python)
@@ -620,6 +656,9 @@ while true; do
--force-ffmpeg)
FFMPEG_FORCE_REBUILD=true; shift; continue
;;
--force-alembic)
ALEMBIC_FORCE_REBUILD=true; shift; continue
;;
--skip-python)
PYTHON_SKIP=true; shift; continue
;;
@@ -656,6 +695,9 @@ while true; do
--skip-ffmpeg)
FFMPEG_SKIP=true; shift; continue
;;
--skip-alembic)
ALEMBIC_SKIP=true; shift; continue
;;
--)
# no more arguments to parse
break
@@ -674,18 +716,39 @@ 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****"
PRINT "If you are experiencing issues building Blender, _*TRY A FRESH, CLEAN BUILD FIRST*_!"
PRINT "The same goes for install_deps itself, if you encounter issues, please first erase everything in $SRC and $INST"
PRINT "(provided obviously you did not add anything yourself in those dirs!), and run install_deps.sh again!"
PRINT "Often, changes in the libs built by this script, or in your distro package, cannot be handled simply, so..."
PRINT ""
PRINT "You may also try to use the '--build-foo' options to bypass your distribution's packages"
PRINT "for some troublesome/buggy libraries..."
PRINT ""
PRINT ""
PRINT "Ran with:"
PRINT " install_deps.sh $COMMANDLINE"
PRINT ""
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"
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" )
@@ -698,8 +761,8 @@ OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION
OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" )
OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
LLVM_SOURCE=( "http://releases.llvm.org/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
LLVM_CLANG_SOURCE=( "http://releases.llvm.org/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
OSL_USE_REPO=false
OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
@@ -712,7 +775,7 @@ OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
OSL_SOURCE_REPO_UID="7d40ff5fe8e47b030042afb92d0e955f5aa96f48"
OSL_SOURCE_REPO_BRANCH="blender-fixes"
OSD_USE_REPO=true
OSD_USE_REPO=false
# Script foo to make the version string compliant with the archive name:
# ${Varname//SearchForThisChar/ReplaceWithThisChar}
OSD_SOURCE=( "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${OSD_VERSION//./_}.tar.gz" )
@@ -727,13 +790,32 @@ OPENVDB_SOURCE=( "https://github.com/dreamworksanimation/openvdb/archive/v${OPEN
#~ OPENVDB_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee"
#~ OPENVDB_SOURCE_REPO_BRANCH="dev"
ALEMBIC_USE_REPO=false
ALEMBIC_SOURCE=( "https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz" )
# ALEMBIC_SOURCE_REPO=( "https://github.com/alembic/alembic.git" )
# ALEMBIC_SOURCE_REPO_UID="e6c90d4faa32c4550adeaaf3f556dad4b73a92bb"
# 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" )
CXXFLAGS_BACK=$CXXFLAGS
if [ "$USE_CXX11" = true ]; then
WARNING "You are trying to use c++11, this *should* go smoothely 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.
* 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
remain fuzzy and incompatibilities may happen..."
PRINT ""
PRINT ""
CXXFLAGS="$CXXFLAGS -std=c++11"
export CXXFLAGS
fi
#### Show Dependencies ####
@@ -746,7 +828,7 @@ Those libraries should be available as packages in all recent distributions (opt
* libjpeg, libpng, libtiff, [libopenjpeg], [libopenal].
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
* libsdl1.2, libglew, libglewmx.\""
* libsdl1.2, libglew, [libglewmx].\""
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
@@ -767,7 +849,8 @@ You may also want to build them yourself (optional ones are [between brackets]):
* [OpenShadingLanguage $OSL_VERSION_MIN] (from $OSL_SOURCE_REPO, branch $OSL_SOURCE_REPO_BRANCH, commit $OSL_SOURCE_REPO_UID).
* [OpenSubDiv $OSD_VERSION_MIN] (from $OSD_SOURCE_REPO, branch $OSD_SOURCE_REPO_BRANCH, commit $OSD_SOURCE_REPO_UID).
* [OpenVDB $OPENVDB_VERSION_MIN] (from $OPENVDB_SOURCE), [Blosc $OPENVDB_BLOSC_VERSION] (from $OPENVDB_BLOSC_SOURCE).
* [OpenCollada] (from $OPENCOLLADA_SOURCE, branch $OPENCOLLADA_REPO_BRANCH, commit $OPENCOLLADA_REPO_UID).\""
* [OpenCollada] (from $OPENCOLLADA_SOURCE, branch $OPENCOLLADA_REPO_BRANCH, commit $OPENCOLLADA_REPO_UID).
* [Alembic $ALEMBIC_VERSION] (from $ALEMBIC_SOURCE).\""
if [ "$DO_SHOW_DEPS" = true ]; then
PRINT ""
@@ -919,7 +1002,7 @@ prepare_opt() {
# Check whether the current package needs to be recompiled, based on a dummy file containing a magic number in its name...
magic_compile_check() {
if [ -f $INST/.$1-magiccheck-$2 ]; then
if [ -f $INST/.$1-magiccheck-$2-$USE_CXX11 ]; then
return 0
else
return 1
@@ -928,7 +1011,7 @@ magic_compile_check() {
magic_compile_set() {
rm -f $INST/.$1-magiccheck-*
touch $INST/.$1-magiccheck-$2
touch $INST/.$1-magiccheck-$2-$USE_CXX11
}
# Note: should clean nicely in $INST, but not in $SRC, when we switch to a new version of a lib...
@@ -1077,7 +1160,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...
@@ -1118,7 +1201,7 @@ compile_Boost() {
fi
# To be changed each time we make edits that would modify the compiled result!
boost_magic=10
boost_magic=11
_init_boost
@@ -1179,7 +1262,11 @@ compile_Boost() {
#### Build OCIO ####
_init_ocio() {
_src=$SRC/OpenColorIO-$OCIO_VERSION
_git=false
if [ "$OCIO_USE_REPO" = true ]; then
_git=true
else
_git=false
fi
_inst=$INST/ocio-$OCIO_VERSION
_inst_shortcut=$INST/ocio
}
@@ -1196,7 +1283,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!
@@ -1213,14 +1300,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
@@ -1426,7 +1526,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"
@@ -1504,7 +1603,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!
@@ -1559,7 +1658,6 @@ compile_OIIO() {
cmake_d="$cmake_d -D LINKSTATIC=OFF"
cmake_d="$cmake_d -D USE_SIMD=sse2"
cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
cmake_d="$cmake_d -D OPENEXR_VERSION=$OPENEXR_VERSION"
if [ "$_with_built_openexr" = true ]; then
@@ -1568,6 +1666,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"
@@ -1575,6 +1676,7 @@ compile_OIIO() {
cmake_d="$cmake_d -D BUILD_TESTING=OFF"
cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
cmake_d="$cmake_d -D TXT2MAN="
#cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
#cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
@@ -1588,6 +1690,10 @@ compile_OIIO() {
# fi
cmake_d="$cmake_d -D USE_OCIO=OFF"
if [ "$USE_CXX11" = true ]; then
cmake_d="$cmake_d -D OIIO_BUILD_CPP11=ON"
fi
if file /bin/cp | grep -q '32-bit'; then
cflags="-fPIC -m32 -march=i686"
else
@@ -1675,7 +1781,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
@@ -1742,7 +1848,7 @@ compile_OSL() {
fi
# To be changed each time we make edits that would modify the compiled result!
osl_magic=20
osl_magic=21
_init_osl
# Clean install if needed!
@@ -1781,7 +1887,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!
@@ -1799,6 +1905,9 @@ compile_OSL() {
cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
cmake_d="$cmake_d -D USE_SIMD=sse2"
if [ "$USE_CXX11" = true ]; then
cmake_d="$cmake_d -D OSL_BUILD_CPP11=1"
fi
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
@@ -1873,7 +1982,7 @@ compile_OSD() {
fi
# To be changed each time we make edits that would modify the compiled result!
osd_magic=1
osd_magic=2
_init_osd
# Clean install if needed!
@@ -2138,6 +2247,105 @@ compile_OPENVDB() {
run_ldconfig "openvdb"
}
#### Build Alembic ####
_init_alembic() {
_src=$SRC/alembic-$ALEMBIC_VERSION
_git=false
_inst=$INST/alembic-$ALEMBIC_VERSION
_inst_shortcut=$INST/alembic
}
clean_ALEMBIC() {
_init_alembic
_clean
}
compile_ALEMBIC() {
if [ "$NO_BUILD" = true ]; then
WARNING "--no-build enabled, Alembic will not be compiled!"
return
fi
# To be changed each time we make edits that would modify the compiled result!
alembic_magic=2
_init_alembic
# Clean install if needed!
magic_compile_check alembic-$ALEMBIC_VERSION $alembic_magic
if [ $? -eq 1 -o "$ALEMBIC_FORCE_REBUILD" = true ]; then
clean_ALEMBIC
fi
if [ ! -d $_inst ]; then
INFO "Building Alembic-$ALEMBIC_VERSION"
prepare_opt
if [ ! -d $_src -o true ]; then
mkdir -p $SRC
download ALEMBIC_SOURCE[@] "$_src.tar.gz"
INFO "Unpacking Alembic-$ALEMBIC_VERSION"
tar -C $SRC -xf $_src.tar.gz
fi
cd $_src
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
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"
fi
if [ "$_with_built_openexr" = true ]; then
cmake_d="$cmake_d -D ILMBASE_ROOT=$INST/openexr"
cmake_d="$cmake_d -D USE_ARNOLD=OFF"
cmake_d="$cmake_d -D USE_BINARIES=OFF"
cmake_d="$cmake_d -D USE_EXAMPLES=OFF"
cmake_d="$cmake_d -D USE_HDF5=OFF"
cmake_d="$cmake_d -D USE_MAYA=OFF"
cmake_d="$cmake_d -D USE_PRMAN=OFF"
cmake_d="$cmake_d -D USE_PYALEMBIC=OFF"
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"
INFO "ILMBASE_ROOT=$INST/openexr"
fi
cmake $cmake_d ./
make -j$THREADS install
make clean
if [ -d $_inst ]; then
_create_inst_shortcut
else
ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
exit 1
fi
magic_compile_set alembic-$ALEMBIC_VERSION $alembic_magic
cd $CWD
INFO "Done compiling Alembic-$ALEMBIC_VERSION!"
else
INFO "Own Alembic-$ALEMBIC_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-alembic option."
fi
run_ldconfig "alembic"
}
#### Build OpenCOLLADA ####
_init_opencollada() {
_src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION
@@ -2305,7 +2513,7 @@ compile_FFmpeg() {
--enable-avfilter --disable-vdpau \
--disable-bzlib --disable-libgsm --disable-libspeex \
--enable-pthreads --enable-zlib --enable-stripping --enable-runtime-cpudetect \
--disable-vaapi --disable-libfaac --disable-nonfree --enable-gpl \
--disable-vaapi --disable-nonfree --enable-gpl \
--disable-postproc --disable-librtmp --disable-libopencore-amrnb \
--disable-libopencore-amrwb --disable-libdc1394 --disable-version3 --disable-outdev=sdl \
--disable-libxcb \
@@ -2423,7 +2631,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"
@@ -2431,15 +2638,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 \
libopenal-dev libglew-dev libglewmx-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_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"
@@ -2452,7 +2668,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"
@@ -2601,7 +2817,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
@@ -2746,6 +2962,17 @@ install_DEB() {
fi
fi
PRINT ""
if [ "$ALEMBIC_SKIP" = true ]; then
WARNING "Skipping Alembic installation, as requested..."
elif [ "$ALEMBIC_FORCE_BUILD" = true ]; then
INFO "Forced Alembic building, as requested..."
compile_ALEMBIC
else
# No package currently, only HDF5!
compile_ALEMBIC
fi
if [ "$WITH_OPENCOLLADA" = true ]; then
_do_compile_collada=false
@@ -2978,7 +3205,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
@@ -3283,6 +3510,17 @@ install_RPM() {
compile_OPENVDB
fi
PRINT ""
if [ "$ALEMBIC_SKIP" = true ]; then
WARNING "Skipping Alembic installation, as requested..."
elif [ "$ALEMBIC_FORCE_BUILD" = true ]; then
INFO "Forced Alembic building, as requested..."
compile_ALEMBIC
else
# No package currently!
compile_ALEMBIC
fi
if [ "$WITH_OPENCOLLADA" = true ]; then
PRINT ""
@@ -3441,7 +3679,11 @@ 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 ""
@@ -3693,6 +3935,16 @@ install_ARCH() {
fi
fi
PRINT ""
if [ "$ALEMBIC_SKIP" = true ]; then
WARNING "Skipping Alembic installation, as requested..."
elif [ "$ALEMBIC_FORCE_BUILD" = true ]; then
INFO "Forced Alembic building, as requested..."
compile_ALEMBIC
else
compile_ALEMBIC
fi
if [ "$WITH_OPENCOLLADA" = true ]; then
PRINT ""
@@ -3835,9 +4087,6 @@ install_OTHER() {
fi
if [ "$_do_compile_llvm" = true ]; then
install_packages_DEB libffi-dev
# LLVM can't find the debian ffi header dir
_FFI_INCLUDE_DIR=`dpkg -L libffi-dev | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
PRINT ""
compile_LLVM
have_llvm=true
@@ -3856,7 +4105,6 @@ install_OTHER() {
if [ "$_do_compile_osl" = true ]; then
if [ "$have_llvm" = true ]; then
install_packages_DEB flex bison libtbb-dev
PRINT ""
compile_OSL
else
@@ -3875,7 +4123,6 @@ install_OTHER() {
fi
if [ "$_do_compile_osd" = true ]; then
install_packages_DEB flex bison libtbb-dev
PRINT ""
compile_OSD
fi
@@ -3892,10 +4139,6 @@ install_OTHER() {
fi
if [ "$_do_compile_collada" = true ]; then
install_packages_DEB libpcre3-dev
# Find path to libxml shared lib...
_XML2_LIB=`dpkg -L libxml2-dev | grep -e ".*/libxml2.so"`
# No package
PRINT ""
compile_OpenCOLLADA
fi
@@ -3980,16 +4223,6 @@ print_info_ffmpeglink() {
}
print_info() {
PRINT ""
PRINT ""
WARNING "****WARNING****"
PRINT "If you are experiencing issues building Blender, _*TRY A FRESH, CLEAN BUILD FIRST*_!"
PRINT "The same goes for install_deps itself, if you encounter issues, please first erase everything in $SRC and $INST"
PRINT "(provided obviously you did not add anything yourself in those dirs!), and run install_deps.sh again!"
PRINT "Often, changes in the libs built by this script, or in your distro package, cannot be handled simply, so..."
PRINT ""
PRINT "You may also try to use the '--build-foo' options to bypass your distribution's packages"
PRINT "for some troublesome/buggy libraries..."
PRINT ""
PRINT ""
PRINT "Ran with:"
@@ -4000,7 +4233,13 @@ print_info() {
_buildargs="-U *SNDFILE* -U *PYTHON* -U *BOOST* -U *Boost*"
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG*"
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC*"
if [ "$USE_CXX11" = true ]; then
_1="-D WITH_CXX11=ON"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
_1="-D WITH_CODEC_SNDFILE=ON"
PRINT " $_1"
@@ -4057,7 +4296,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
@@ -4106,6 +4345,25 @@ 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"
_buildargs="$_buildargs $_1"
if [ -d $INST/alembic ]; then
_1="-D ALEMBIC_ROOT_DIR=$INST/alembic"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$NO_SYSTEM_GLEW" = true ]; then
_1="-D WITH_SYSTEM_GLEW=OFF"
PRINT " $_1"
@@ -4154,3 +4412,6 @@ PRINT ""
# Switch back to user language.
LANG=LANG_BACK
export LANG
CXXFLAGS=$CXXFLAGS_BACK
export CXXFLAGS

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,15 @@
--- a/boost/config/compiler/visualc.hpp 2015-12-08 11:55:19 -0700
+++ b/boost/config/compiler/visualc.hpp 2018-03-17 10:29:52 -0600
@@ -287,12 +287,3 @@
# define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
#endif
-//
-// last known and checked version is 19.00.23026 (VC++ 2015 RTM):
-#if (_MSC_VER > 1900)
-# if defined(BOOST_ASSERT_CONFIG)
-# error "Unknown compiler version - please run the configure tests and report the results"
-# else
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
-# endif
-#endif

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,72 @@
# - 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/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,72 @@
# - 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/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,264 @@
# 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,72 @@
# - 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/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,246 @@
# 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,72 @@
# - 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/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,204 @@
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()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-flifetime-dse=1" SUPPORTS_FLIFETIME)
if (SUPPORTS_FLIFETIME)
add_definitions(-flifetime-dse=1)
endif()
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