1
1

Compare commits

...

2589 Commits

Author SHA1 Message Date
Dalai Felinto
041e2d3e28 Base list refcount with Bastien Montagne 2016-11-24 18:07:19 +01:00
Dalai Felinto
be976500fe Fix reading collection objects and small refactors here and there 2016-11-24 16:26:52 +01:00
Dalai Felinto
c5e47be6d7 collections.objects.link() 2016-11-24 15:50:59 +01:00
Dalai Felinto
ae87a5c803 Use BLI_genericNodeN 2016-11-24 11:38:18 +01:00
Dalai Felinto
f60ad41893 Layers doversion: use 1, 2, 3, ... for new collections 2016-11-23 19:10:42 +01:00
Dalai Felinto
72edec3e23 RNA: layer.collections[2].objects
This does not include objects from nested collections.
Missing bits: objects.link, objects.unlink
2016-11-23 19:09:29 +01:00
Dalai Felinto
75d6c0cae6 Fix mem leak for recursive collections and get layer.bases and objects
to work

(also some base util functions, and a refactor to unify the functions
for nested and non nested collections)
2016-11-23 18:26:06 +01:00
Dalai Felinto
b3de810bf2 Cleanup: silence unused prop warning 2016-11-23 14:49:13 +01:00
Dalai Felinto
d9dbd58035 Finish nested collections rna (recursions ftw) 2016-11-23 14:08:12 +01:00
Dalai Felinto
f5499f8092 Fix nested collection write/read 2016-11-23 12:27:30 +01:00
Dalai Felinto
b9a6616b47 Fix crash when dupli scene 2016-11-23 11:42:10 +01:00
Dalai Felinto
e583d8e21b Layer collection nesting (DNA/RNA) 2016-11-22 17:29:31 +01:00
Dalai Felinto
69950081de Layer collection initial RNA
new/remove/active
2016-11-22 17:29:31 +01:00
Dalai Felinto
e15ef1dbe1 BKE_scene_ layer/collection API touch ups 2016-11-22 17:27:22 +01:00
Julian Eisel
9e282590d1 Fix compiling with Cycles enabled
Brings back some code that was removed in 17beb57356 to avoid naming conflicts. Now did some renaming to avoid these.
2016-11-22 16:48:24 +01:00
Julian Eisel
00b895389b Merge branch 'blender2.8' into layers 2016-11-22 14:52:47 +01:00
Julian Eisel
a796a84a43 Use const for color array arguments 2016-11-22 14:51:34 +01:00
Julian Eisel
60ce602380 Fix missing conversion of uchar color to float
Decided to just pass float [4] args, so no type conversion is needed at all.
2016-11-22 14:40:57 +01:00
Julian Eisel
7abf9c05c5 Use enum instead of preprocessor defines 2016-11-22 14:23:52 +01:00
Julian Eisel
e2bae71afe Add/use DNA_DEPRECATED_LAYERS
Using DNA_DEPRECATED resulted in thousands of warnings, so rather not use this. These warnings can still be handy though to check for usage of deprecated struct members as we go, so this quick way to toggle them could be handy. Note that this should eventually be replaced by DNA_DEPRECATED once stuff is actually deprecated.
2016-11-22 14:13:27 +01:00
Dalai Felinto
17beb57356 Initial RNA for scene layers
Next will be the collections, and then the other missing props of rna_def_scene_layer

Note: it would be nice to have a way to tag rna properties asa
deprecated. For example, scene.engine can still be valid (and mapped to
scene.layers.active.engine), but it would be nice to indicate the addon
writers of the new API.
2016-11-22 13:03:01 +01:00
Dalai Felinto
d05f693959 Fixup for versioning: name initial layer ... "Layer" 2016-11-22 12:32:21 +01:00
Dalai Felinto
3592c959e7 Layers - initial commit
This is mostly DNA + doversion and some util functions.
I need to look at the layer-manager branch to see how
Julian Eisel (Severin) managed to handle nested lists
(required for collections).

Also, since I think doversioning may get more complex as the project
evolves, I started the vesioning_280.c file.

And the changes in readfile.c were so that I could include into the
versioning_280.c file only the DNA_* that were really needed.

(if someone feels like doing a cleanup, I'm sure the other
versioning_*.c files could use the same treatment)
2016-11-21 20:10:19 +01:00
559bd75766 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/space_view3d/drawobject.c
2016-11-19 16:28:39 +01:00
Martijn Berger
5cbc7b6ed2 bgl do not bind parts of OpenGL that are not exposed in core profiles 2016-11-19 15:07:01 +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
Martijn Berger
53267d2579 convert icon_draw_texture to gawain imm mode replacements 2016-11-18 16:04:25 +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
e0bea34c51 fix problem from D2360
I was too eager to get patch in after a last-minute change. My bad!
2016-11-18 00:40:40 -05:00
43ed3079e2 Moved UI_view2d_grid_draw() to immediate functions
Part of T49043

Reviewers: krash, merwin

Reviewed By: krash, merwin

Differential Revision: https://developer.blender.org/D2360
2016-11-17 22:49:22 -05:00
2de882e8cb OpenGL: textview port to immediate mode -> T49043
Updated the GL calls to the new immediate mode.
I left some glcolor calls which I'm not sure wether thats right?
Part of T49043

warm regards,
Sebastian Witt

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2305
2016-11-17 22:05:49 -05:00
fe73b8c29c use new enum types in glutil & imm_util 2016-11-17 16:10:53 -05:00
d915e89ec8 delete deprecated fdrawXORcirc function
Only one place used it, and that place was dead code already.
2016-11-17 15:03:55 -05:00
feccadd81b mark certain glutil functions as deprecated
These will be removed before we ship 2.8
2016-11-17 14:44:15 -05: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
86f435d6c8 Gawain: small note for future Vulkan work 2016-11-16 18:25:36 -05:00
Martijn Berger
b757e8298a Convert console_draw.c to Gawain
Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2276
2016-11-16 22:56:39 +01:00
b1f700dad3 Gawain: use PRIM_ and INDEX_ enums instead of GLenum
For a few reasons:
- separate enum sets for separate concepts
- debug with symbolic names instead of 0x4e72
- prepare for a Vulkan future
2016-11-16 16:03:15 -05: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
36ac979ee0 Gawain: use COMP_ instead of GL_ internally
Because GLenum could be ANYTHING. We use our own enum type for components.
2016-11-16 15:18:06 -05:00
7aa82e7ed2 Gawain: re-enable strict error checking in release builds
Makes it easier for new volunteers to catch errors early.
2016-11-16 12:14:55 -05:00
472e2c5acf Blender 2.8: Added immVertex2s() and immAttrib2s()
Just as mentioned in title. Need new functions for calls found in `transform.c`

T49043

Reviewers: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2358
2016-11-16 11:53:41 -05:00
Dalai Felinto
2bcb1b208a Merge remote-tracking branch 'origin/master' into blender2.8 2016-11-16 17:04:21 +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
930f999f6e Part of T49043: Convert drawsimdebug.c to use the new Gawain API.
This conversion is pretty straightforward.

The code for debug drawing is not great, but it does the job.
Rewriting it is for another day, if it becomes more widely used.
2016-11-16 12:18:12 +01:00
15b2a64d0a Add stdlib.h include to fix missing 'abort' prototype. 2016-11-16 11:31:35 +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
3b06c42616 Blender2.8 convert UI_view2d_constant_grid_draw to new immediate mode
Convert UI_view2d_constant_grid_draw to new immediate mode.

Part of T49043.

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2298
2016-11-15 18:59:24 -05:00
edddd2c6f5 Use new immediate mode for ED_region_grid_draw
Convert ED_region_grid_draw to new immediate mode.

Part of T49043

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2289
2016-11-15 18:37:03 -05: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
2653758adc blender 2.8: OpenGL immediate mode: anim_draw
Reviewers: merwin

Reviewed By: merwin

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2353
2016-11-15 12:19:47 -05:00
b78ddd43a5 start using COMP_* instead of GL_* in viewport
Gawain can accept either enum, but its own COMP_ values are recommended.
2016-11-15 11:49:00 -05: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
093b6c9e6e blender 2.8: OpenGL immediate mode: action_draw
Updated action_draw to use imm mode.

Reviewers: merwin

Subscribers: LazyDodo

Differential Revision: https://developer.blender.org/D2351
2016-11-14 23:02:57 -05: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
665aa6a2a0 blender 2.8: Opengl: UI_draw_roundbox
all is in the title too..

Reviewers: merwin

Reviewed By: merwin

Subscribers: Blendify, Severin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2337
2016-11-14 20:27:54 -05: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
8859aa3828 OpenGL: use packed normals for fancy wireframes
Consumes much less memory (1/3 for both normals = 32 bytes less per edge). Same visual result.

We can pack normals for other draw modes to get similar savings.

Part of T49165
2016-11-13 20:27:50 -06:00
ffc26fc5a8 Gawain: add support for 10_10_10 vertex format
Most useful for packed normals, which take 1/3 the space of float32 normals.

2-bit alpha|w component is ignored for now.

Batch API can use these now, will add support to immediate mode API if desired.

Enabling on Windows first. Will enable on all platforms after we switch Blender to core profile.
2016-11-13 20:18:51 -06: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
1dbe26f76c OpenGL: simplify debug, use only newer features
Drop SciTech support & workarounds for WinCE and OpenGL ES.

AMD_debug_output is still in the code but disabled. Once I verify the newer extensions are available on all the GPU + OS combos we support we can delete this disabled code.
2016-11-12 17:18:13 -06: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
eb880f280d Gawain: strict error checking in debug builds
Not release builds. Fix 66d7f01ecc to match what I meant to do.
2016-11-11 23:53:58 -06:00
8fd510f4b8 Gawain: new enum type for vertex attrib components
Motivations:
1) GLenum is too broad; tightly-defined enum just for this is safer.
2) enable a Vulkan future

New code should use these instead of GL_FLOAT etc. When all existing code has been updated to use new enum, we can drop compatibility with GLenum values.

Early work towards 10_10_10 format, more to come soon.
2016-11-11 19:39:56 -06: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
Julian Eisel
82ba89b042 Fix T49961: Blender 2.8 Crashes on saving an image
Caused by 4811b2d356 which caused the event handler hack that is used to fire up the file browser from other operators to fail. Basically the context from before the file browser is opened gets stored and used later for executing the actual file read/write operation (in this case, saving image). This context storage is cleared when exiting an editor since 4811b2d356, which is technically correct, but causes usage of NULLed context data in this case, because the file browser is exited before the file read/write operation is executed.

For now I solved this by moving the fileselect handler to list of normal handlers, instead of modal ones. 4811b2d356 only touches list of modal handlers so we avoid the crash. Ideally we'd completely refactor how the file browser opening works to get rid of these event handler hacks.

Note that I wouldn't be suprised if this causes other regressions, but I couldn't find one so worth a try.
2016-11-10 20:34:35 +01: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
Dalai Felinto
69655a1103 Merge remote-tracking branch 'origin/master' into blender2.8 2016-11-09 14:36:59 +01:00
49a3eaa3dc BMesh: face-flip, no need for temporary edge-array
Reverse loops in-place.
2016-11-10 00:08:26 +11:00
a0ae6d7116 OpenGL: manage built-in shaders better
As our library of built-in shaders grows, it's important to create, access, and discard them efficiently.

Lookup via GPU_shader_get_builtin is now constant time instead of linear (# of built-in shaders). This is called very often with our new immediate mode.

Creation and discard are unified.

Adding a new shader requires fewer steps.

365 lines shorter  :D
2016-11-08 22:53:59 -06: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
2b726b054e blender 2.8: OpenGL immediate mode: node_draw_preview_background
all is in the title.

Reviewers: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2336
2016-11-08 11:12:29 -05:00
682bcb2995 Atomics: Add 32 bit version of fetch and AND/OR 2016-11-08 17:12:04 +01:00
12bce04b2f Blender 2.8: OpenGL: new immediate mode for paint_image.c
This one is for the straight line (white with width 2.0 over a black with width 4.0) drawn when you use the gradient tool.

To test: Image editor, create / open an image, choose image paint mode and on the tool shelf: choose the Fill brush and enable "Use Gradient" for it. Then click and drag on the image.

From what I checked, calls to glLineWidth are not being removed yet, so I kept them.

Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2312
2016-11-08 11:08:16 -05:00
f90b480f95 OpenGL: wm_operators.c uses new immediate mode
D2311 by @ianwill

This is the radial control that appears when we change the size of a brush in sculpt and vertex and texture painting modes, by pressing "f".

Also includes a new built-in shader that can be useful in other places.

Part of T49043
2016-11-08 10:55:23 -05:00
4e80bd2d6d Blender 2.8: OpenGL: new immediate mode API for screendump.c
It's the screencast cursor, tested here, compared to original, seems to be working fine.

Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2306
2016-11-08 10:10:55 -05: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
66d7f01ecc Gawain: less error checking in release builds
Gawain does very strict runtime checking to help us catch coding errors. Final release should disable most of these checks, so I'm disabling now for all non-debug builds.

When writing Blender code that uses Gawain, always make debug builds and test there! "make lite debug" is my favorite.
2016-11-08 05:28:40 +01:00
de101fe9a8 OpenGL: mesh edit mode uses edge overlays
Legacy GL uses GL_LINES, modern GL uses the good stuff.

Edit mode still has a long way to go...
2016-11-08 05:22:17 +01:00
0b83680d85 OpenGL: support for edge overlays
Has some obvious opportunities for improvement. This is my second attempt. First attempt used MLoopTri and sort of worked...
2016-11-08 05:06:09 +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
016aca7427 OpenGL: fade other objects during edit mode
Right now this only affects other objects in wireframe. The idea is to do something similar for other draw modes, and keep focus on the edit object.

As seen at #bcon16
2016-11-07 20:32:27 +01:00
a3277ae384 OpenGL: simple mesh edit mode for new viewport
Very very simple. Needs a lot of work to reach "legacy viewport" capabilities.
2016-11-07 20:24:03 +01:00
5abf1a4e9d OpenGL: enable fancy wireframes
Most of this was already in place, just enabling & adding comments.

One fix was needed to make batch uniforms stick between multiple draws.

Added comments to selection outline; no functional changes there.
2016-11-07 20:07:31 +01:00
1cd754ad31 OpenGL: simple batch of all mesh triangles
Can be used for drawing basic surfaces, hit testing, depth pre-pass, ...
2016-11-07 20:07:31 +01:00
c1ba58c44d Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/addon/properties.py
2016-11-07 15:46:27 +01: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
93dbd81796 Gawain: manage batch API's current shader program + uniform funcs
Typical pattern:
Batch_set_program
Batch_Uniform(s)
Batch_draw
2016-11-05 21:03:26 +01: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
5b26c36008 OpenGL: edge overlay shaders
As seen at #bcon16. These were produced quickly and probably need further work.

SIMPLE variant draws triangle mesh edges. Based on this research:
http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/4884/pdf/imm4884.pdf
http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf

Non-SIMPLE variant can adjust thickness per edge. This can be used to draw only some edges, or accentuate some edges. Given the right inputs this is a general n-gon perimeter shader.

Part of T49165
2016-11-05 19:26:13 +01:00
a85f68e9c7 OpenGL: further wireframe shaders
As seen at #bcon16

Geometry shader version is automatically used on modern GL runtimes. Legacy version is used on pre-3.2 systems (Mac, Mesa compat profile). They have the same inputs and visual result.

TODO: specialized versions that are less flexible -- draw ALL edges or draw JUST silhouette edges.

Part of T49165
2016-11-05 18:56:57 +01: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
Dalai Felinto
c25c3bb6cb Fix UI for smoke cache
(this was probably broken since we got rid of point cache in 2.8)
2016-11-02 11:09:27 +01:00
Dalai Felinto
a41bbd3053 Merge remote-tracking branch 'origin/master' into blender2.8 2016-11-02 10:59:52 +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
fb6f42dc4f OpenGL: draw NLA strip curves with new imm mode
Part of T49043.
2016-10-31 17:42:11 +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
1556a28108 OpenGL: draw filebrowser dropshadow with new imm mode
Part of T49043.
2016-10-28 20:46:10 +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
Dalai Felinto
a25d3d7de2 Viewport: Set outline color for mesh based on active/select state
(also, fix warning regarding const float being written)

You only see the color if you use the "modern" viewport option
(otherwise I believe Blender is drawing the old on top of the new outline).

That said, in the "modern" viewport we have unfreed mem. To be
investigated separately.
2016-10-26 13:57:22 +00: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
2783d5df61 OpenGL: follow up on mesh wire TODOs
- depth test on (affects scene depth for now)
- color variations
- object outline  does not need GL_BLEND with latest shader
2016-10-26 04:18:19 -04:00
a394f4e545 OpenGL: edge shader discards fragments of unused edges
Discarded edges should not update depth buffer or blend with color buffer.

Geometry shader version will make this obsolete.
2016-10-26 03:57:14 -04: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
222ba0247f fix edge shader input 2016-10-25 19:38:22 -04:00
456d145d07 OpenGL: new mesh draw routines for new viewport
Totally WIP.

Started with copies of legacy routines, modified to use the new shaders & batch cache. Not all features are implemented; this is why we keep legacy viewport around during development!
2016-10-25 19:34:17 -04: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
Dalai Felinto
821fa24876 Viewport: fix depth not being cleared in ortho mode 2016-10-25 11:18:56 +00:00
Dalai Felinto
b4f849b9c6 Merge remote-tracking branch 'origin/master' into blender2.8 2016-10-25 11:18:41 +00:00
392551bd95 OpenGL: mesh batch cache (WIP)
Gawain batches are built on demand while drawing, then kept in this per-DerivedMesh cache.

A mesh's batches try to share vertex buffers as much as possible.

Not sure if this file is the best home for this code, but functions in this file are the only users of the cache. So maybe.

Big part of T49165
2016-10-25 05:31:25 -04:00
d8d42e1702 make View3D depth debug code optional
Quick hack to optionally disable depth buffer debugging at compile time.

Will this be useful for users or just during development?
2016-10-25 04:46:07 -04:00
bc566e9393 OpenGL: 3D View background & depth buffer details
Surveying buffer usage & clears for new viewport. Not yet perfect, but closer. Committing from Mac so I can test this on Windows.

Using new matrix API (T49450) for gradient background.
2016-10-25 04:39:55 -04: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
94e14a2c43 OpenGL: new built-in shaders for mesh edges 2016-10-25 03:19:10 -04:00
c5072941c3 OpenGL: clean up glActiveTexture usage
Removed some of my earlier glActiveTexture calls. After reviewing the
code I now trust that GL_TEXTURE0 is active by default. Fewer GL calls,
same results.

Fixed some misuse of glActiveTexture & glUniformi, mostly my fault.
Caught by --debug-gpu on Windows. Don't know why this appeared to be
working previously!

Plus some easy cleanup nearby.
2016-10-25 01:02:41 -04:00
Dalai Felinto
4d11b2fb91 Viewport: original gradient background
Last but not least, fix the original 3d view background based on
@merwin's comment.
2016-10-24 19:40:37 +00:00
Dalai Felinto
1458f0136d Viewport: move the background to the "modern" viewport
This also leaves room for the gradient background Mike Erwin wants to
implement.
2016-10-24 19:05:49 +00:00
Dalai Felinto
744718f635 immediate mode: background
There is a problem here, which is that we can't use immediate mode here
until we rely on `GPU_material_bind`.

(cc: @merwin)
2016-10-24 17:26:27 +00: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
Dalai Felinto
a3b69c8131 Viewport: fix depth filled before solid plates 2016-10-24 12:58:23 +00: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
6388d0c4a0 OpenGL: triple buffer tweaks
Works great on Mac now. Will test on Windows & Linux (Mesa) tomorrow. Related to T49505

Main fix is glActiveTexture and immUniform1i.

TEXTURE_2D vs TEXTURE_RECTANGLE is now a compile-time option. Both are available starting in GL 3.1 so there's no need for a run-time check.

Removed glClears that I don't think are necessary.

Prevent TEXTURE_2D from creating extra mipmap levels. We only need level 0.

Some minor cleanup: booleans and variable declarations.
2016-10-24 05:06:45 -04: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
1abdb0c2ee OpenGL: add NormalMatrix & inverse to new API
Part of T49450
2016-10-23 23:37:53 -04:00
2cb45c9938 a place to cache draw data in DerivedMesh
DerivedMesh owns this cache and cleans up as part of DM cleanup. DM has no idea what is stored in this cache. Loose coupling FTW
2016-10-23 23:22:16 -04:00
e53ab2b9ec Gawain: fixups & progress for batch API 2016-10-23 23:16:54 -04:00
Julian Eisel
dabbe6eb22 Fix memory leak when using depth-only shader 2016-10-24 00:03:55 +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
Julian Eisel
46257e01a7 Fix compiling with blenderplayer (once again...) 2016-10-22 00:30:28 +02:00
Dalai Felinto
5ff586610a Viewport: use depth shader to debug the depth
At the moment this already shows that the depth is the same after the solid plates and in the very end of drawing, while they should be different. Later on we can adapt this to show different buffers we want to debug.

I am using near=0.1, far=2.0 for my tests. I decided not to make a doversion for near/far because this is for debugging only
2016-10-21 20:51:12 +00:00
Dalai Felinto
deb77c0e74 Viewport: create a shader to show depth images linearized 2016-10-21 20:51:10 +00:00
Dalai Felinto
4c3624a7a0 Viewport: add missing alpha for stereo 2016-10-21 20:51:05 +00:00
Dalai Felinto
af20ca51a1 Viewport: Bring camera, speaker, rigid body shape and bounding box 2016-10-21 20:50:36 +00:00
cdcddddd96 OpenGL: disable GL_CULL_FACE state only when needed
The active camera has a solid "up" triangle instead of the usual outline. We want to see both sides of this triangle. Disable face culling only when drawing the active camera, not for every camera.
2016-10-21 16:25:17 -04: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
Dalai Felinto
01872d7f5d Fix build for gameengine 2016-10-21 12:50:04 +00:00
Dalai Felinto
dd23e52817 Merge remote-tracking branch 'origin/master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_defaults.c
2016-10-21 12:22:50 +00: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
224d70c978 OpenGL: draw lamp objects with new imm mode
Previous commit in blender2.8 branch had some... unintended
consequences. This one should be better.

Part of T49043. Also uses new matrix API (T49450)
2016-10-20 16:55:40 -04:00
4ea6917468 OpenGL: box & circle outline functions that work with 3D position (z=0)
New immediate mode API is strict about attribute formats. These new functions make existing code easier to port.

Supports T49043
2016-10-20 14:33:32 -04:00
c6abbb40ad Gawain: closer integration of immediate mode & matrix APIs
- any shader program can use matrix state (not only built-in shaders)
- you can mix matrix & begin/end calls, and the bound shader will use the latest matrix state

Part of T49450 & T49043
2016-10-20 14:29:59 -04:00
a92d20a0a4 OpenGL: dirty bit for GPU matrix API
Have matrices changed since the most recent bind?

Part of T49450
2016-10-20 14:18:34 -04: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
Dalai Felinto
225edf4e66 immediate mode: outliner background
I tried using immRecti instead, but it didn't work. The current approach
should be more efficient anyways (since GL_TRIANGLE_FAN wouldn't work
here).
2016-10-20 01:44:49 +00:00
Dalai Felinto
33d99bdfe6 immediate mode: ed_util.c
note: I switched one of the glVertex2iv into glVertex2fv to use the same attrib_id
2016-10-19 23:59:22 +00: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
9941bc3041 OpenGL: draw empties with new imm mode
Part of T49043
2016-10-19 04:01:15 -04:00
625f1a1c30 OpenGL: draw cameras using new matrix API
Also removed some extra push/pops.
Ref T49450
2016-10-18 20:57:36 -04:00
05117d71a3 OpenGL: draw cameras with new immediate mode
Mostly the same as before. Except:
- avoid drawing same lines multiple times
- helper functions take "bool filled" argument instead of GLenum
- drawcamera_volume draws its own near & far planes
2016-10-18 20:27:24 -04:00
54a0ff3ab5 Gawain: yet another way to set uniform color 2016-10-18 20:22:22 -04:00
e9268abf4a fix narrow text entry fields
widget_draw_text was calculating wrong display length when field is too narrow to show entire input string. Gawain assert caught this 11 function calls away!

Thanks to @ianwill for reporting.
2016-10-18 17:34:29 -04:00
117af2356a skip drawing of gpencil strokes with overall thickness <= zero
Fixes an assert in drawing code.

Might need further work to support variable-thickness strokes (from pressure-sensitive stylus). This all is due for geometry shader overhaul anyway.
2016-10-18 13:12:40 -04:00
46a069822a draw gpencil dots smooth
Some strokes are just single dots. Draw these smooth / antialiased.
2016-10-18 13:07:35 -04:00
827ad4125c OpenGL: new built-in shader for smooth round 3D points 2016-10-18 13:03:30 -04: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
70ff63e63f OpenGL: tweak image shaders & code that uses them
- rename image shaders to describe exactly what they do
- rename inputs to match other built-in shaders
- set & use active texture unit
- no need to enable/disable textures with GLSL
- pull vertex format setup out of loops
2016-10-18 00:08:34 -04:00
0c6939f5f5 minor cleanup & deprecation 2016-10-17 23:48:12 -04:00
8327795f8d OpenGL: draw image empties with new API
This extensive rewrite caches the image texture in VRAM. Can handle images up to OpenGL limits (8K or 16K).

Part of T49043 & T49450
2016-10-17 23:28:51 -04:00
Dalai Felinto
cccd3eb5a8 Fixup for doversion (rB8d573aa0 and rBa7e74791) 2016-10-17 19:45:34 +00:00
Dalai Felinto
6a0292cc19 Fix for gpu_shader_2D_texture_2D_frag.glsl
Report and patch by Willian Padovani Germano (ianwill)
2016-10-17 19:24:08 +00:00
Julian Eisel
4811b2d356 Proper fix for crash when joining areas that doesn't break manipulators
Turns out CTX_wm_region returns mostly NULL in wm_manipulatormaps_handled_modal_update. Now propertly unsetting area/region data of handlers when deleting area/region.
2016-10-17 19:28:09 +02: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
e7fddc0772 OpenGL: disable checks for NPOT texture support
Non-power-of-two textures are always allowed. Keeping the disabled checks in the code in case we support OpenGL ES in the future. Even then it should be a compile-time check, not at run-time.
2016-10-17 02:36:51 -04:00
42677fa937 Gawain: tweak tracking of unassigned attributes (no API change)
Hoping for a small performance win.
2016-10-16 23:50:18 -04:00
ca369e6f0c OpenGL: draw object centers nicer
Shaders + new immediate mode = very nice dots.

Part of T49043
2016-10-16 18:49:48 -04:00
61ca73ea10 OpenGL: new built-in shader for smooth round 3D points w/ outline 2016-10-16 18:43:24 -04:00
36d2365ac3 OpenGL: new immUniformThemeColorShadeAlpha function
Plus some naming cleanup.

Supports T49043
2016-10-16 17:48:35 -04:00
9cdf4afb76 Gawain: new immUniform4fv function 2016-10-16 17:48:35 -04:00
f7414b7412 fix IS_VIEWPORT_LEGACY macro 2016-10-16 17:48:35 -04:00
Julian Eisel
d1a35b7a08 Fix outliner items sometimes not opening
Own mistake in 9a9a663f40. Guessed there is a case where we have to rebuild the tree but everything seemed fine... It didn't work in display modes like "Data-Blocks".
2016-10-16 22:23:50 +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
Julian Eisel
fa39ec9e46 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 20:47:44 +02:00
Julian Eisel
196654ad08 Fix crash when joining areas (caused by manipulators)
Manipulator code tried to access the removed region from handler->op_region. Use context region now.
2016-10-16 19:31:57 +02:00
Julian Eisel
69713aa2da Cleanup: Quiet warnings, use RAD2DEG macro 2016-10-16 17:28:12 +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
b557ceb2c1 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/editors/space_outliner/outliner_edit.c
	source/blender/editors/space_outliner/outliner_intern.h
	source/blender/editors/space_outliner/outliner_select.c
2016-10-16 15:33:00 +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
Julian Eisel
9a9a663f40 Outliner: Rework element selection behavior
* LMB now replaces selection instead of adding to it. Shift+LMB adds to selection (or removes if already selected). This is usual selection behavior Blender.
* Outliner selection isn't completely separate from object/sequencer-strip/render-layer/... selection anymore, when selecting an outliner item we now always try to select (and activate) the object it belongs to. Previously you had to click the name or icon of an item to select the object (or whatever) and on empty space within the row to set outliner selection.
* Collapsed items may show click-able icons for their children (nothing new). Clicking on such an icon will also select the hidden item it represents now, you'll notice after opening the parent. This valid from a technical POV, I'm not sure if this is wanted from user POV though. Changing would be easy, feedback welcome!
* Code cleanup.

Part of T37430.
2016-10-16 14:29:38 +02:00
Julian Eisel
f929045c2c Outliner: Avoid rebuilding tree when mouse-hover highlight changes 2016-10-16 14:10:30 +02:00
3999910b19 OpenGL: add GLSL #version 330, drop 140 and 150
GL 3.3 is the new minimum. Compatibility profile for now, core profile eventually. During development, GL 3.0 (on Mesa) and 2.1 (on Mac) will still work.

Part of T49012
2016-10-16 03:18:17 -04:00
1deab69e0a BLF/OpenGL: more text drawing optimization
Make color values compact. Set color once per primitive. Use new immSkipAttrib to avoid useless color copies.

All of this should make text drawing less CPU hungry.
2016-10-16 02:08:16 -04:00
741965615d Gawain: new immSkipAttrib function
Now you can explicitly skip a vertex attribute -- you don't give it a value and it won't get a copy of the previous vert's value. Useful for flat interpolated per-primitive values.

This is an advanced feature. Expect garbage in the empty spaces, and copies of garbage if you rely on the attrib copy behavior after skipping.
2016-10-16 01:58:26 -04:00
a4fe823416 BLF/OpenGL: accurate vertex count for drawing
We still need to BeginAtMost instead of simple Begin, since some glyphs could be clipped & not drawn.
2016-10-15 20:04:25 -04:00
a8dc3f4596 BLF: make blurry text an optional (disabled) feature
While trying to simplify text drawing, noticed no Blender code uses the blur feature. Hopefully scripts don't use it!
2016-10-15 19:40:41 -04:00
878938f203 OpenGL: remove some unused legacy matrix calls
Part of T49450
2016-10-15 19:08:19 -04:00
3996fbc564 OpenGL: bump Windows to GL 3.3 compat profile
Part of T49012
2016-10-15 14:41:29 -04:00
cf5750a85e Gawain: improve immediate mode performance
This was already fast on Apple, but @Severin and @dfelinto noticed slowdowns in user prefs, which is text heavy.

The problem was immBeginAtMost not being smart about VBO write flushing. immBeginAtMost can use all of its allocated range or only a subrange. The previous code was forcing back-to-back draw calls and buffer writes to serialize. This commit lets OpenGL know that our VBO writes never overlap, so there's no need to wait.

Should be much faster now!
2016-10-15 14:41:29 -04:00
Julian Eisel
5e428b3b3f Fix unitialized variable use
Own mistake in ae8e845470.
Patch by @efi0ng, thanks!
2016-10-15 18:59:31 +02:00
fcff984338 Merge branch 'master' into blender2.8 2016-10-15 10:05:03 +02:00
9632ca0a13 OpenGL: draw node sockets more efficiently
1 or 2 draw calls per node instead of 1 per socket (inputs + outputs).
Rearranged draw order so we set uniforms less frequently.
Some style & dead code cleanup.

Part of T49043
2016-10-15 02:49:00 -04:00
2df27995f9 OpenGL: new built-in point shader, clean up other shader names
Smooth round point with outline (uniform color) and fill (varying color).

Updated shader naming scheme: a shader that doesn't deal with color does not have to say "no color". Vertex shaders do not have to say "uniform color" since their frag counterpart actually has the uniform. Each name should describe what that shader *does*, not what it *doesn't do*.
2016-10-15 02:30:59 -04:00
48db35468f blender 2.8: OpenGL: node_circle_draw use now immediate mode
I use your new point shader to draw the node's soket

Reviewers: Severin, merwin

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2286
2016-10-15 00:14:28 -04:00
29b47924dd OpenGL: bump Linux to GL 3.3 compat profile
fall back to 3.0 if needed (during development)

Part of T49012
2016-10-14 23:42:45 -04:00
4f4c7808e4 fix pointer type warning
thanks, gcc
2016-10-14 22:40:55 -04:00
Julian Eisel
325b21c1d5 Outliner: Fix missing indentation for search-match highlight
Own mistake in ae8e845470.
2016-10-15 02:08:38 +02:00
4736f19000 BLF: early exit when drawing empty strings
Avoids all kinds of setup & preparations to draw nothing.
2016-10-14 20:00:31 -04:00
3f0c0ed87d BLF: fix crash on text input fields
Some strings have known length, others are NULL terminated (len = INT_MAX in this case).

Now font drawing knows to treat INT_MAX special.
2016-10-14 20:00:31 -04:00
Julian Eisel
9904d73d9a Outliner: Draw highlights over entire row
Previously, highlights (mouse hover, selection, search-match) didn't affect background of restriction icons, now the entire line gets highlighted.
2016-10-15 01:38:44 +02:00
Julian Eisel
ae8e845470 Outliner: Element mouse hover feedback
Some little UI polish to get familiar with outliner code (but also because it's a useful feature). Committing to blender2.8 branch but can also port to master (2.7) if wanted.

This basically causes the mouse hovered element to be highlighted. Contrast of the highlight should be fine, even with a non-default theme. Also did some minor cleanup.
2016-10-15 01:03:25 +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
Dalai Felinto
ee54a6f130 viewport: draw non-mesh objects for a starter
This starts to decouple non-mesh objects and the legacy draw pipeline.
It shows how we can mix e.g., Cycles and lamps and empties.
2016-10-14 19:00:59 +00:00
Dalai Felinto
608e2402ef viewport: move border drawing code to new file 2016-10-14 19:00:45 +00:00
Dalai Felinto
4a10eb38a3 immediate mode: convert render border code and move to new drawing
routine
2016-10-14 19:00:32 +00:00
Dalai Felinto
e1e97bbb98 Immediate mode: use new util functions, and border draw functions
Part of T49043

Reviewers: merwin
2016-10-14 18:58:58 +00:00
Dalai Felinto
11653f85ff Immediate mode: new util functions (imm_cpack and imm_draw_line_box) 2016-10-14 18:57:38 +00:00
34dc660a76 OpenGL: draw text with fewer draw calls
Was one draw call per glyph,  now one per line.

Still room for improvement here.
2016-10-14 14:41:36 -04:00
dd350c0b37 GPencil: Avoid assert error if the immEnd is called with only one point for lines
This function will be replace by geometry shader, but we need this fix until the shader will be ready. The problem is similar to T49614.
2016-10-14 19:24:27 +02:00
05c727bb00 Prevent crash after OpenGL rendering animation to images. 2016-10-14 18:46:28 +02:00
6855ba4034 Fix T49614: Grease Pencil GPF error if stroke thickness change too much between stroke points
The problem was the function tried to draw a line with one point only. This fix will be replaced by new geometry shaders, but we need while this change is not ready.
2016-10-14 18:35:01 +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
f23db59e48 GPencil: Display stroke filling while drawing
Before this change, the stroke was filled only after complete the stroke drawing. For artist is better to get a feedback of the area he is filling while drawing, so this commit draws the filling area while drawing.

The triangulation of the stroke is recalculated every time the function is called because using a cache is not useful because the points information is changing all the time while the stroke is being drawing.
2016-10-14 12:06:30 +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
Dalai Felinto
58f0af965c viewport: fix rv3d->viewport mem free issue 2016-10-14 05:17:55 +00: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
Dalai Felinto
3cecf39069 immediate mode: starting using new immUniformThemeColorBlendShade and more conversion 2016-10-13 20:08:52 +00:00
Dalai Felinto
05cf74622f more theme color functions: UI_GetThemeColorBlendShade4fv, immUniformThemeColorBlendShade 2016-10-13 20:08:51 +00:00
945f8e3f93 Gawain: vertex format now uses fixed allocations (CPU perf++)
API stays exactly the same.

Attribute names can still be of variable length, as long as the average length does not exceed AVG_VERTEX_ATTRIB_NAME_LEN. Since this includes unused attributes (length = 0) the current avg of 5 might even be too high.
2016-10-13 15:15:40 -04:00
Dalai Felinto
dfa5b32c8c Merge remote-tracking branch 'origin/master' into blender2.8 2016-10-13 16:42:54 +00: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
Dalai Felinto
ecbedce81e viewport: barebones to handle viewport compositing in gpu_viewport.c 2016-10-13 16:26:29 +00:00
14d0549295 Gawain: fix build when TRUST_NO_ONE is disabled 2016-10-13 12:24:01 -04: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
Julian Eisel
916e631fc9 Fix compiling with Blenderplayer 2016-10-13 17:17:17 +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
Dalai Felinto
3579350481 immediate mode: small cleanup on timeline
(no need to unbind/rebind the same program)
2016-10-13 14:18:47 +00: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
6f220c1c55 inform immediate mode when switching OpenGL context
Longstanding to-do is now to-done.

Heinous bug reported by @dfelinto pushed me to fix this.
2016-10-13 00:38:29 -04:00
71656ac222 Gawain: fix immediate mode for multiple GL contexts
New functions activate & deactivate immediate mode. Call these when switching context and the internal VAO will be handled properly. VAOs are one of the few things *not* shared between OpenGL contexts.
2016-10-13 00:38:29 -04:00
Dalai Felinto
d5b75256e0 Fix for crash on dopesheet drawing with immediate mode (rB7a552612c) 2016-10-13 04:23:58 +00:00
Dalai Felinto
c565f7b5fd viewport: bring the manipulators 2016-10-13 02:50:42 +00:00
Dalai Felinto
165bdfb672 Fix timeline break after recent immediate mode change (rBf6e7e46f) 2016-10-13 02:19:04 +00:00
Dalai Felinto
b5c539f9fa gawain: assert for immBeginAtMost(..., 0) 2016-10-13 02:16:55 +00:00
Dalai Felinto
84ed9d9829 Draw depth even when in wire mode (for OB_RENDER)
Note: this is not working at the moment, but the logic is sound.
Since we will still change the drawing code a lot I think the commit is valid.
2016-10-13 00:36:58 +00:00
Dalai Felinto
69b1b95356 immediate mode: use new ThemeColor functions 2016-10-13 00:36:56 +00:00
Dalai Felinto
e79f302f16 gawain/immediate mode: new util functions for color uniforms 2016-10-13 00:36:52 +00:00
Dalai Felinto
8d573aa0ec wrong alpha set for timeline theme (fixup for rBf329ebe3) 2016-10-13 00:28:07 +00:00
Dalai Felinto
f6e7e46fac Immediate mode: timeline (keyframes and range)
Part of T49043
2016-10-12 22:36:54 +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
683656681c BLF/OpenGL: use new matrix API when drawing text
First test of matrix API. This will eventually use the 2D part of this API, but the 3D part is ready now.

Part of T49450
2016-10-11 21:21:02 -04:00
06d4aca879 OpenGL: matrix fixes & compatibility
Was multiplying matrices backward, so concatenation was broken. Fixed!

Also a way to mix legacy matrix stacks with the new library. Just during the transition! Anything within SUPPORT_LEGACY_MATRIX will go away after we switch to core profile.

Part of T49450
2016-10-11 21:16:26 -04:00
dc95c31372 Fix T49502: file browser on OS X not highlighting external drives. 2016-10-12 00:07:52 +02:00
c330f37135 quiet GPU matrix debug printing
Will be needed soon but turn it off by default.
Part of T49450
2016-10-11 14:44:12 -04:00
53d82c3e8d BLF/OpenGL: draw text with new immediate mode
Part of T49043
2016-10-11 14:36:16 -04: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
2fe7e70e92 install_deps: make c++11 building mandatory on blender2.8 branch. 2016-10-11 12:19:04 +02:00
0c43567a5a Merge branch 'master' into blender2.8 2016-10-11 12:09:59 +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
587a16352a Gawain: add immRect utility functions (replaces legacy glRect)
Caller is responsible for setting up vertex format, binding a shader program, and setting the color *before* calling immRect.
2016-10-10 12:31:38 -04: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
6371f8ff8a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/space_view3d/view3d_draw.c
2016-10-10 12:41:32 +02:00
ecbad54df9 blender 2.8; OpenGL. ui_panel_category_draw_tab with immediate API
Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2281
2016-10-10 01:41:31 -04: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
22f59b81d7 OpenGL: remove GLSL support query (it's always supported) 2016-10-10 01:13:03 -04:00
78abbdf264 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.
2016-10-10 01:11:03 -04:00
5fc9bed8b3 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:08:49 -04:00
7a60f889d3 OpenGL: plug new matrix system into shaders (WIP)
Built-in shaders now use uniforms instead of legacy built-in matrices. So far I only hooked this up for new immediate mode.

We use the same matrix naming convention as OpenGL, but without the gl_ prefix, e.g. gl_ModelView becomes ModelView.

Right now it can skip the new matrix stack and use the legacy built-in matrices app-side. This will help us transition gradually from glMatrix functions to gpuMatrix functions.

Still some work to do in gpuBindMatrices. See TODO comments in gpu_matrix.c for specifics.
2016-10-09 23:03:35 -04:00
e636529e33 OpenGL: Draw dividers in space_file with the new immediate mode
Thanks to @merwin for the review

Part of T49043
2016-10-09 18:20:52 +02:00
99db1b8d95 fix shaders for picky GLSL compilers
@zeauro reported this issue:
texture2DRect needs the ARB_texture_rectangle extension.
But isn't that an OpenGL 2.1 feature and should be part of GLSL 1.2+?

This should fix it, and future shaders should do something similar.
2016-10-09 10:53:03 -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
a2471d2b37 Gawain: validate inputs to add_attrib
Should help prevent errors when building vertex formats.
2016-10-08 16:58:06 -04: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
187d8f473a OpenGL: fix smooth point fringe
Smooth edge was fading to transparent black instead of transparent color. My bad.
2016-10-08 03:34:05 -04:00
7a552612c3 OpenGL: draw f-curve points and handles with new imm mode
Got rid of GLU and some matrix manipulation. Everything is shader driven now, drawn with point sprites.

Still plenty to do in this file...

Part of T49042 and T49043
2016-10-08 03:27:02 -04:00
25e4dc45e5 OpenGL: shaders for smooth round points
Solid color with an optional outline.

size (diameter) and outlineWidth are in pixels.
2016-10-08 03:11:53 -04:00
b071ac315c Gawain: allow immBeginAtMost, immEnd with no vertices
The whole point of BeginAtMost is to avoid counting before drawing. Sometimes the uncounted count is zero, and that's ok!
2016-10-07 23:50:52 -04:00
2a76da9ec2 draw region emboss with new immediate mode
Simple convert of drawing emboss lines to new immediate mode.

Part of T49043

Reviewers: merwin

Reviewed By: merwin

Subscribers: dfelinto

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2271
2016-10-07 23:46:52 -04:00
a398cdedfa Gawain: code cleanup & inline docs
Made function categories more clear & added more notes about how to use this API.

immEndVertex is no longer part of the public API.

Minor cleanup & organizing of recent additions.
2016-10-07 18:51:42 -04:00
b613d25354 Blender 2.8: OpenGL: replace old GL with the new immediate API in UI_draw_roundbox_gl_mode
I change UI_draw_roundbox_gl_mode to use immediate API.
The rest of the change is the call to the function.
I also make some change in UI_ThemeColor4(int colorid) for eg to make convenience to use.
I would really like to know if it's the good way to do, if yes I will make all the change in the node_daw.c after, else say me what's wrong and how to deal with color else.

Reviewers: merwin, dfelinto, Severin

Reviewed By: merwin

Subscribers: fablefox, Severin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2274
2016-10-07 15:03:21 -04: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
5c23b863f8 fix grid floor drawing assert
@dfelinto reported crash when setting grid subdivisions too low.

Code was setting color twice and Gawain was catching this. Fix is to only set regular grid color when we have regular grid lines to draw.  Then emphasized grid lines are free to set their own color further down.
2016-10-07 13:00:23 -04: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
Julian Eisel
6e358a1d06 Custom Manipulators Core Backend
This commit lands the core backend of the Custom Manipulators project onto the blender2.8 branch. It is a generic backend for managinig interactive on-screen controls that can be integrated into any 2D or 3D edito. It's also already integrated into the window-manager and editor code where needed.

NOTE: The changes here should not be visible for users at all. It's really just a back-end patch. Neither does this include any RNA or Python integration.

Of course, there's still lots of work ahead for custom manipulators, but this is a big milestone. WIP code that actually uses this backend can be found in the 'custom-manipulators' branch (previously called 'wiggly-widgets').

The work here isn't completely my own, all the initial work was done by @Antony Riakiotakis (psy-fi) and - although it has changed a lot since them - it's still the same in essence. He definitely deserves a big credit! Some changes in this patch were also done by @Campbell Barton (campbellbarton). Thank you guys!

Merge accepted by @brecht and @merwin.
Patch: https://developer.blender.org/D2232
Code documentation: https://wiki.blender.org/index.php/Dev:2.8/Source/Custom_Manipulator
Main task: https://developer.blender.org/T47343
More info: https://code.blender.org/2015/09/the-custom-manipulator-project-widget-project/
2016-10-07 16:59:55 +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
Julian Eisel
53d1dbbe5c Merge branch 'master' into blender2.8 2016-10-07 15:14:49 +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
4639664b3c Merge branch 'master' into blender2.8 2016-10-07 11:50:17 +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
107b585a41 OpenGL/gpencil: delete unused utility functions
Part of T49043  -- done with this file!
2016-10-07 03:17:23 -04:00
9d40c3dc32 OpenGL: draw gpencil fill with new imm mode
Part of T49043
2016-10-07 03:04:34 -04:00
1865bcd3cf OpenGL: draw 2D gpencil strokes with new imm mode
Part of T49043
2016-10-07 00:56:28 -04:00
1f6d704008 OpenGL: draw 3D gpencil strokes with new imm mode
Part of T49043
2016-10-07 00:06:20 -04:00
0fbe35c674 OpenGL: fix shader input typo 2016-10-07 00:00:12 -04:00
70a16298ea gpencil: disable / remove some legacy drawing
Want to avoid updating code we no longer use anyway.

Comments for areas to investigate or deadlines for deletion.

also some minor bool cleanup

Part of T49165
2016-10-06 22:05:28 -04:00
Julian Eisel
fc77787f6f Avoid possible compatibility issues with tmp viewport flags
We can't prevent users from using this branch, so I'd say it's reasonable to be a bit careful about what we store to files. In this concrete case we were storing a bit-flag for temporary use (only during early viewport transition) in a bit-field that's saved in files. Doing so would mean we either can't reuse this bit later or we risk breaking files (admittedly, likely in a pretty minor way). Moved the bit-flag to a new bit-field which can be removed later.
2016-10-07 03:56:32 +02:00
Dalai Felinto
49beb714c5 Viewport: support for external render engines (e.g., Cycles) with depth
(it is still a rough approach, but you can already see Cycles with Floor (when using board render or full render)
2016-10-07 01:47:30 +00:00
Dalai Felinto
4539c2b173 Viewport: floor cleanup 2016-10-07 01:47:30 +00:00
Dalai Felinto
82d069c232 Viewport: draw floor routine should not use GL_ALWAYS for depth
(talked with merwin about that, and he agrees on it, we are not supposed to write to the scene depth buffer
but we should read its depth)
2016-10-07 01:47:30 +00:00
Julian Eisel
490a938c8b Move panel for new viewport up
Makes it easier to enable it and avoids jumping of the panel when activating/deactivating it (because some panels disappear then). Also changed how panel title is drawn to make it behave like other panels.
2016-10-07 03:22:48 +02:00
Julian Eisel
1997b0f03c Use theme color for clearing viewport background
We'll obviously do more fancy stuff here later, but we don't have to look at pure blackness either ;)
2016-10-07 03:11:08 +02:00
1b4b4dfd0c OpenGL/GPencil: draw stroke-in-progress with new imm mode
We should revisit this later and use geometry shader to draw one continuous tapered stroke.

Part of T49043
2016-10-06 20:51:31 -04:00
fe654a93c7 Gawain: allow strips of 1 line, fans of 1 triangle
My initial tests were stricter than necessary, and blocked some valid uses. Fixed!
2016-10-06 20:51:31 -04:00
e01b1eac84 cleanup: C99, const, blank lines 2016-10-06 20:51:30 -04:00
Julian Eisel
553b4faac8 Merge branch 'master' into blender2.8 2016-10-07 00:22:21 +02:00
ffc46668c4 OpenGL: modernize gp_draw_strokes_edit
Single draw call per stroke!

Part of T49043
2016-10-06 17:41:23 -04: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
Dalai Felinto
ea89b4a918 Viewport: bring grid over to the new viewport
We will keep the old system working as long as we can. At the moment even the visibility flags we are getting from the old system. That will continue like this until we have decided on the new UI
2016-10-06 20:35:41 +00:00
Dalai Felinto
6b88f3118f Viewport: Starting to port over the principles of the draw flux into placeholder functions
A lot of the work still have to done on space_view3d.c for initialize the data and buffers properly, but it is a start
2016-10-06 20:35:40 +00:00
198e3a35c8 OpenGL: another built-in shader for 2D points
GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR
2016-10-06 16:32:02 -04: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
86e439e311 OpenGL: convert gp_draw_stroke_point to new immediate mode
and constify some static utility functions

Note: 2D shader will ignore position's z value, but making pos a vec3 lets us unify code in this function.
2016-10-06 14:40:47 -04:00
edcce96d97 OpenGL: more built-in GPU_SHADERs for points
No new GLSL shaders were needed! Just combined existing vertex & fragment shaders in new ways.
2016-10-06 14:20:33 -04:00
360cb87007 OpenGL: modernize more volumetric gpencil drawing
Main goal is to get rid of GLU.

Part of T49042, touches on T49043 and T49450
2016-10-06 12:45:04 -04:00
e86bd78745 Gawain: more ways to set uniform color 2016-10-06 09:37:04 -04:00
5a0f397eaa Fix T49523: very slow normal map tangent computation for rendering in 2.78. 2016-10-06 03:12:04 +02:00
1731e94d0c draw gpencil erase cursor with new imm mode
Part of T49043 and T49450.
2016-10-05 14:05:55 -04:00
e874f3cdc5 draw gpencil sculpt cursor with new imm mode
Part of T49043 and T49450.
2016-10-05 13:45:28 -04:00
c462500618 Gawain: more ways to set uniform color 2016-10-05 13:12:18 -04:00
3caa830c11 Fix T49501: Animations imported via alembic render with wrong or no motion blur 2016-10-05 12:37:09 +02:00
Dalai Felinto
5e8c4ae75b Barebones for viewport code apart from 2.7x drawing code
A new option (set in the properties region) allows the user to pick the
"new viewport" for the rendering  (in the UI: Modern Viewport).

For now we have a semi-blank file (view3d_draw.c) that can starts to take
over the drawing pipeline.

I can't guarantee we will be able to keep both drawing systems working
through the entire 2.8 development, but it should do for now.

also, we can use branches for some of the viewport development, but it's
better to keep things in 2.8 whenever we can, so people can test it.
2016-10-04 22:02:05 +00: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
3a4c1db14b fix Linux build
My mistake. Breakage reported by @mont29
2016-10-04 01:31:24 -04:00
79b8242fd1 Gawain: fix bug in immUniformColor4ubv
Reported by @kgeogeo
2016-10-04 01:24:33 -04:00
Dalai Felinto
ae44e24fed Merge remote-tracking branch 'origin/master' into blender2.8 2016-10-03 20:54:22 +00: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
55aadccbde Merge branch 'master' into blender2.8 2016-10-03 20:48:00 +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
72473a61b0 Fix compile errors with Alembic. 2016-10-02 20:52:25 +02:00
c50ccc8476 Merge branch 'master' into blender2.8 2016-10-02 18:53:01 +02: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
ba30b852f3 OpenGL: draw volumetric gpencil with point sprites
Transition away from GLU and legacy matrix stack. Using point sprites eliminated the need for most of the matrix math!

Depends on decent support of large aliased points. NVIDIA is good at this, must test limits on AMD & Intel systems.

Still needs proper scaling based on view zoom.

Part of T49042, touches on T49043 and T49450.
2016-10-01 18:11:58 -04:00
b8e3d81f31 OpenGL: fix point sprites
Apparently GL_POINT_SPRITE is important to GL 3.2+ compatibility profile, not just to GL 2.1 as thought.

We'll remove this during the core profile transition.
2016-10-01 17:34:41 -04:00
875d63ccb5 OpenGL: one more point shader
Added a built-in shader for points that vary both size and color.
2016-10-01 17:32:29 -04: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
5753a1462f OpenGL: new built-in shaders for drawing points
Both of these draw round points with jaggy edges, but treat color & size differently.
2016-09-30 20:44:22 -04: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
d1b21d1278 OpenGL: add support for programmable point size
And enable point sprites always. Fragment shaders can use gl_PointCoord now.
2016-09-30 19:51:04 -04:00
82648a8f91 OpenGL: make platform requirements explicit
At context startup, make sure our assumptions about the OpenGL version are true. Should match since we set up the contexts... but this is what asserts are for, to check "should"s!

Part of T49012
2016-09-30 19:10:30 -04: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
Julian Eisel
42ed1f0e3c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/writefile.c
2016-09-30 01:18:41 +02:00
47bba7e15f OpenGL: draw nurbs control verts with new imm mode
patch P397 by @lichtwert + minor const by @merwin

Notes from drawvertsN function:
this used to be called twice (once for selected/active, once for unselected -- guess: to avoid state switches[color]?)
this used to be called in a loop, too (subcurves), moved the loop here to avoid multiple init stuff

Part of T49043
2016-09-29 15:23:13 -04:00
Julian Eisel
35bd833e02 Cleanup: Style 2016-09-29 21:15:27 +02:00
bbf32980b0 OpenGL: draw speaker with new immediate mode
patch P388 by @lichtwerk, I tweaked a few things.

Since speaker theme color is opaque we leave blend mode alone.

Part of T49043
2016-09-29 14:47:38 -04: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
Dalai Felinto
9bac74c27b Complement fixup for 4a1feaa555 (texture shaders)
We now multiply the alpha by the image alpha (as per severin
suggestion).
That still doesn't solve the main question of user preference drawing
black.
2016-09-28 19:11:11 +00:00
Dalai Felinto
4c7ff8fb1e Fix animation transition in region overlay not working since 4a1feaa5
We still have stills with the User Preference window, though.
2016-09-28 18:48:51 +00: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
83d5a919e2 modernize basic shader a tiny bit
"varying" is redundant here, all GS inputs & outputs vary.

Any code that uses this will be GLSL 1.3 or newer.
2016-09-27 21:25:38 +02:00
0ca2118851 safety checks in GPU shader library
If shader compilation fails, or for some other reason the shader is NULL or 0, we need to know.
2016-09-27 21:25:38 +02:00
ad32b774cb fix basic shader syntax when drawing lines
Fixed on GL 3.2+, Mac still lays an egg due to the geometry shader.
2016-09-27 21:05:48 +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
Julian Eisel
88aa42a6f7 Fix most toolbar panels not visible
Was likely in here since initial blender2.8 branch commit (particle removal).
2016-09-27 03:38:24 +02:00
Dalai Felinto
fc485302cc immediate mode: using texture shader for stereo drawing
(for side-by-side and top-bottom stereo modes)
2016-09-26 15:38:24 +00:00
8cff9c20ff Merge branch 'master' into blender2.8
WARNING! Full build is broken, alembic has not been merged in correctly and has some references to particle stuff.
Don't have time to tackle this now (and probably would be better if someone knowing what he's doing does it anyway).

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	source/blender/blenkernel/intern/library_remap.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/editors/physics/particle_object.c
	source/blender/editors/physics/physics_intern.h
	source/blender/editors/physics/physics_ops.c
	source/blender/editors/space_outliner/outliner_intern.h
	source/blender/editors/space_view3d/drawvolume.c
	source/blender/makesrna/intern/rna_smoke.c
2016-09-26 17:19:03 +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
628ef78e8a overhaul gpuMatrix API
Complete (for our needs) 2D & 3D transformation API. Should be easy to port legacy OpenGL matrix stack-based code to this. Still needs testing.

Ported ortho, frustum, lookAt functions from Viewport FX (rB194998766c65). Kept plenty of Viewport FX code from previous commit.

Stack API and 2D routines ported from Gawain. This version uses BLI_math library so everything is licensed under GPL instead of the usual MPL.

Part of T49450
2016-09-25 19:29:45 +02:00
a731c75442 port math function from Viewport FX
mul_v4_m4v3(r, M, v) means r = M * vec4(v, 1.0)
Based on rB194998766c65
2016-09-25 19:01:18 +02:00
9bea012b8c specialize mat3 multiply routines
Same as 5c6baf1ee9 but for 3x3 matrices.
2016-09-25 18:48:11 +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
5c6baf1ee9 specialize mat4 multiply routines
mul_m4_m4m4(R, A, B) gives us R = AB in general. Existing code assumed the worst, that A and B both alias the output R. For safety it makes internal copies of A and B before calculating & writing R.

This is the least common case. Usually all 3 matrices differ. Often we see M = AM or M = MB, but never M = MM.

With this revision mul_m4_m4m4 is called in exactly the same way but copies inputs only when needed. If you know the inputs are independent of the output use the "uniq" variant to skip the saftety checks.
2016-09-25 14:27:48 +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
addc666999 constify BLI_math_matrix inputs
GPU_matrix needs this very soon, and it's good practice in general.

also sprinkled in some TODOs for later
2016-09-24 16:21:38 +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
36bbdf142c OpenGL: fix new shader for Mac
Follow-up to rB4a1feaa5558ed60388fd3be41db74fbc54f2ab08
2016-09-23 18:16:45 +02:00
7fc2e333bb small merge fix
Follow-up to rB1dfb89d22930
2016-09-23 18:12:24 +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
Julian Eisel
1dfb89d229 Merge branch 'master' into blender2.8
Conflicts:
	intern/ghost/intern/GHOST_ContextCGL.mm
	intern/ghost/intern/GHOST_WindowCocoa.mm
	source/blender/makesrna/intern/rna_main.c
2016-09-23 01:40:19 +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
Dalai Felinto
4a1feaa555 immediate mode: Triple Buffer and two new shaders for TEXTURE_2D and TEXTURE_RECT
Use the same vertex shader for both fragment shaders
2016-09-22 13:40:33 +00: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
1d469f3780 OpenGL: remove double precision matrix functions
Proper fp64 is a GL 4.x feature. Pretending to support it in our API is just clutter.
2016-09-22 12:19:24 +02:00
0e7c3dfe75 OpenGL: matrix code from viewport-fx
Bringing over whole files from rB194998766c65
2016-09-22 12:11:40 +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
825150605e GPU_basic_shader uses GLSL by default
switch back to old mode at runtime:
blender --enable-legacy-basic-shader
2016-09-21 20:24:02 +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
9047717b3f Gawain: support triangle strips & fans in immediate mode
fixes crash in Vertex Paint (color picker)
2016-09-21 15:47:08 +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
0f759da370 Gawain: batch drawing works
Forgot to tell OpenGL which shader program the batch is using. Now it works!
2016-09-20 18:03:59 +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
Dalai Felinto
284398e517 immediate mode refactor: walk navigation cross 2016-09-20 14:50:24 +00:00
Dalai Felinto
04bc828fb6 gawain update: immAttribute for 2i 2016-09-20 14:50:20 +00:00
Dalai Felinto
6ebf5c18c3 immediate mode refactor: fly navigation square 2016-09-20 14:47:14 +00:00
d3365c5c72 OpenGL: fix GPU_SHADER_TEXT on non-Mac
Developed on Mac and committed quickly.. oops
2016-09-20 16:13:01 +02:00
Julian Eisel
42ad5952ff Quiet warning with -Wformat-signedness
Is actually a redundant cast since Blender uses -funsigned-char, however I think it's fine to be explicit about it in new code so cast is required to make compiler happy. Am not a fan of -funsigned-char anyway...
2016-09-20 14:23:15 +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
34bd89a9f6 OpenGL: draw_view_axis with new immediate mode
Changed drawing to use smooth lines, and to fade away when axis points toward / away from screen. (transform manipulators do this already)

Also fixed a nearby (but unrelated) missing immUnbindProgram.

Part of T49043
2016-09-17 15:52:32 +02:00
e21853abb9 OpenGL: streamline font rendering
Ignore texture matrix in the shader, stop messing with texture matrix in BLF code.

Use linear screen-space interpolation instead of perspective.

Avoid redundant call to glMatrixMode.
2016-09-17 13:54:30 +02:00
1b1275f0db add GPU_SHADER_TEXT for font rendering
With USE_GLSL enabled, GPU_basic_shader(TEXTURE|COLOR) always rendered black. New shader uses a solid color + alpha channel of texture (which in our case is a font glyph). See fragment shader for details.

I prefer this approah -- multiple shaders that each do one thing well (and are easy to read/write/understand), instead of one shader that can do many things given the right options.
2016-09-17 13:33:48 +02:00
c3034afa58 OpenGL: simplify basic_shader_bind
No need to enable/disable texturing with GLSL, just use textures in the fragment shader.
2016-09-17 13:33:48 +02: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
834cb93f40 Blender 2.8: Fix some strict aspects on Linux 2016-09-16 17:18:19 +02:00
d96b8e168f Merge branch 'master' into blender2.8 2016-09-16 17:09:28 +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
76c99f361f Gawain improvements
Fixed compile error in debug build (thanks mont29)

Renamed some functions for consistency.

New features:

Create a Batch with immediate mode! Just use immBeginBatch instead of immBegin. You can keep the result and draw it as many times as you like. This partially replaces the need for display lists.

Copy a VertexFormat, and create a VertexBuffer using an existing format.

Resize a VertexBuffer to a different number of vertices. (can only resize BEFORE using it to draw)
2016-09-15 21:45:10 +02:00
5eddb80513 Extend Gawain to use Blender's built-in shaders
Was already done for immediate mode, but rearranged code to make a clean separation. Cleaned up #includes for code that uses this feature.

Added same for batched rendering.
2016-09-15 18:41:28 +02:00
39f7a81176 Gawain: batch rendering API
Follow-up to rBddb1d5648dbd

API is nearly complete but untested.

1) create batch with vertex buffer & optional index buffer
2) choose shader program
3) draw!
2016-09-15 16:51:10 +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
0d54d32dd6 Gawain: simplify attrib binding API
This API is used internally by the immediate and batch drawing systems.
2016-09-15 12:57:07 +02:00
2fb5a959e9 Gawain: delete bind_attrib_locations
This function modifies the GL program object, which reduces our ability to share a shader among meshes with different vertex formats. Recommended approach is to use get_attrib_locations.
2016-09-15 12:24:06 +02: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
110d68ca1d Gawain: flesh out VertexBuffer
create, specify, fill with data
2016-09-14 16:29:01 +02:00
df7be04ca6 fix Mac build with Xcode 8
Small issues in GHOST
- use NSApplicationDelegate protocol for our app delegate
- make sure NSApp is initialized before using
2016-09-14 16:29: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
54b00657ca Gawain: fix Windows compile error
MSVC was NOT happy about uint64_t, now it is.
2016-09-13 03:21:16 -04:00
1b5b899228 OpenGL: add built-in GPU_SHADER_3D_DEPTH_ONLY
We’re discussing several techniques that require a depth pre-pass.
2016-09-13 02:51:38 -04:00
ddb1d5648d Gawain: geometry batches (unfinished)
Vertex Buffer to store vertex attribute data.
Element List (AKA Index Buffer) to select which vertices to use.
Batch combines these into an object that can be built once then drawn
many times.

Porting over from the C++ version… Most of this C code is compiled but
unused. Some of it is not even compiled. Committing now in case I’m
lost at sea.
2016-09-13 02:41:43 -04:00
56c798ee62 API doc update script: Fix generated zipfile name, was broken in 'release' case... 2016-09-13 08:39:01 +02:00
b6bd299359 Gawain: reorganize source code
Put Gawain source code in a subfolder to make the boundary between the
library and the rest of Blender clear.

Changed Gawain’s license from Apache to Mozilla Public License. Has
more essence of copyleft — closer to GPL but not as restrictive.

Split immediate.c into several files so parts can be reused (adding
more files soon…)
2016-09-13 02:18:33 -04: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
18d49a8283 Gawain: add immBeginAtMost
immBegin requires us to know how many vertices will be drawn. Most times this is fine, but sometimes it can be tricky. Do we make the effort to count everything in one pass, then draw it in a second?

immBeginAtMost makes this simple. Example: I'll draw at most 100 vertices. Supply only 6 verts and it draws only 6.

Any unused space is reclaimed and given to the next immBegin.
2016-09-06 16:56:08 -04:00
d0e7c7a032 Add XK_ISO_Left_Tab to ghost's known X11 keydefines... 2016-09-06 22:32:17 +02:00
031c5bad87 Gawain: fix GL_POINTS in immediate mode
Was using GL_NONE to mean "no primitive" but GL_NONE and GL_POINTS are both defined as 0x0000.

Introducing PRIM_NONE = 0xF which does not clash with any primitive types.
2016-09-06 15:45:10 -04: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
3c29aad787 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_particles.cpp
	source/blender/blenkernel/intern/particle.c
	source/blender/gpu/intern/gpu_shader.c
2016-09-04 16:41:06 +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
498583844f OpenGL: use new uniform color functions
Color picker code motivated these convenience functions. looks much better now.
2016-08-27 14:14:01 -04:00
9d3813e602 Gawain: convenience functions for uniform color
Application code can pass ubytes, Gawain converts to float vec4 expected by shader.

For now the conversion is simple linear. We can add sRGB support later if needed.
2016-08-27 14:10:37 -04: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
42bbfe7f0a OpenGL: draw grid floor & axes with new immediate mode
Significant rewrite with some improvements.

Maintain visual hierarchy of the grid:
- emphasized lines draw atop normal lines
- axes draw atop all lines (same as before)

Draw axes only once, not twice.

Return early if nothing to draw.

Single draw call for the default case (grid floor with X and Y axes).

Z axis needs a second draw call because it uses 3D coordinates.

Part of T49043
2016-08-26 01:12:44 -04: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
060bf1bd28 OpenGL: draw empties without GLU
Also reduced number of matrix ops by generating final positions directly.

Also removed a display list (deprecated in modern GL).

Tried to reuse sinval & cosval tables but those values are skewed (last value repeats first value, middle values are squished to compensate). Went with sinf & cosf instead.

Part of T49042
2016-08-25 13:45:39 -04: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
da36b447c7 OpenGL: de-GLU the transform manipulator
Part of T49042

Also reduced the number of matrix ops.

TODO: replace glBegin/glVertex with new immediate mode
2016-08-24 23:47:45 -04: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
1fc1fd8372 OpenGL: draw area resize handle with new immediate mode
The little grabby handle in the corner of an area. Now uses 1 draw call
instead of 6.

Also one version of the (+) icon to show a hidden region. Why do we
have multiple versions of this?

Fixed a harmless signed/unsigned error.

Fixed a GL state error that prematurely disabled blending.

Added imm_draw_filled_circle function, which can be used for drawing
other widgets.

Work toward T49042 and T49043
2016-08-22 23:39:42 -04: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
069569f820 Merge branch 'master' into blender2.8
In addition to pack of conflicts listed below, also had to comment out particle part of new Alembic code... :/

Conflicts:
	intern/ghost/intern/GHOST_WindowWin32.cpp
	source/blender/blenkernel/BKE_effect.h
	source/blender/blenkernel/BKE_pointcache.h
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/effect.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/blenkernel/intern/pointcache.c
	source/blender/blenkernel/intern/rigidbody.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/blenkernel/intern/softbody.c
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/gpu/intern/gpu_debug.c
	source/blender/makesdna/DNA_object_types.h
	source/blender/makesrna/intern/rna_particle.c
2016-08-21 13:18:26 +02:00
be2bc7e0f6 OpenGL: draw color picker wheel with new immediate mode
Includes new imm_draw_lined_circle function that can be used for other
widgets.

Part of T49043
2016-08-20 15:40:08 -04:00
eb717ee979 Gawain: more immediate mode functions
Scanned Blender code for commonly used glVertex, glColor functions.
Implemented immVertex, immAttrib versions of these to ease transition
away from legacy OpenGL.
2016-08-20 15:09:32 -04:00
1e6b3ef1a1 cleanup: unused OpenGL utility code
Keeping unused gla2D code because it might be useful, or inspire
something useful, for Blender 2.8 development.

Also removed an old Mac driver bug workaround. Disabled this before the
2.77 release and nobody has complained.
2016-08-20 13:57:17 -04: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
7e02d335c0 OpenGL: don't poll for errors, rely on KHR_debug
Errors are caught & reported by our GL debug callback. This gives us way more useful information than sporadic calls to glGetError.

I removed almost all use of glGetError, including our own GPU_ASSERT_NO_GL_ERRORS and GPU_CHECK_ERRORS_AROUND macros.

Still used in rna_Image_gl_load because it passes unvalidated input to OpenGL functions.

Still used in gpu_state_print_fl_ex as an exception handling hack -- will rewrite this soon.

The optimism embodied by this commit will not prevent OpenGL errors. We need to analyze what would cause GL to fail at certain points and proactively intercept these failures. Or guarantee they can't happen.
2016-08-19 00:52:52 -04: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
d8f036efd6 OpenGL: draw NDOF guide with new immediate mode
This is the rotation pivot guide for 3D mouse input.

Work toward T49043
2016-08-16 21:54:50 -04:00
6b34eed217 Gawain: add v functions to immediate mode
Legacy OpenGL has a matching Vertex3fv for every Vertex3f, and so on. Add something similar to Gawain, just for a few common functions. Might add more as the need arises.
2016-08-16 21:45:17 -04:00
b92d76000d fix #includes for GPU debug
Can now build release and debug.

Close to final version in master (which took several commits).
2016-08-16 17:14:42 -04: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
b8f27b2514 OpenGL: shaders for simple 3D drawing
These are intended for very simple drawing. No lighting etc.

Shares some fragment code with the 2D shaders.

Similar to their 2D counterparts, but are not combined because of
future plans for separate 2D & 3D matrix stacks.
2016-08-16 14:58:53 -04: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
8619e09107 OpenGL: tweak legacy 2D shader
EXT_gpu_shader4 lets us say “noperspective” in GLSL #version 120 just
like in later GLSL.

Mac shader now matches modern GLSL available on other platforms.
2016-08-15 21:44:44 -04: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
23d7ae1843 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:00:59 -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
f1ad3483af get latest OpenGL version on Windows + AMD
When we ask for GL 3.2 compatibility profile:
AMD (Radeon HD 6970) gives us exactly this version
NVIDIA (Quadro K600) gives at least this version
Still need to check Intel behavior

We want *at least* the version requested, plus more recent features if
available.

Both GPUs tested & mentioned above are capable of GL 4.5. With this
commit they both give 4.5 to Blender.
2016-08-14 01:27:00 -04:00
91f04b82a5 early out for ortho grid drawing
Helps most when real-world units are used.

Previous code started at the smallest visible unit (e.g. Inches) then
followed to Feet, Yards, Chains, Furlongs, Miles. Always to the largest
unit of the set, even though most would be way off screen.

New code knows whether it skipped any grid lines for the next unit to
fill in, can stop once all lines are on screen.
2016-08-13 22:33:49 -04:00
90c4ad7387 Mac fixes for new ortho grid drawing
Previous commit works on Windows, found some issues after trying on Mac.

- benign warnings about && within ||
- replaced nearbyint() with round() to avoid floating point environment
surprises
- remquo function appears to be broken on Mac (!) results were way way
off. Replaced with simple division.
- minor tweaks to debug output
2016-08-13 22:13:24 -04:00
db5ad6a79e draw ortho grid with new immediate mode
Work toward T49043, with a side of client vertex arrays.

Not a straightforward port from glVertex to immVertex since Gawain needs
to know how many vertices we'll be drawing *before* we start drawing.

Fixed these not-so-great aspects of grid drawing:
- coarse grids would draw atop some lines from the finer grids
- visible axes would draw atop lines from coarse grid
- axes were drawn even if they weren't in view
- terrible misuse of vertex arrays
- each line issued its own draw call

New code draws each line exactly once. The entire grid is one draw call.

Bonus: I had to / got to learn how the units system works!
2016-08-13 18:14:45 -04:00
e36af2c257 Gawain: increase size of immediate mode buffer
New value of 4MB should handle our needs without taking up too many GPU
resources.

Old value of 1KB was for observing what happens when the buffer fills up
and we need to flush and start a new one.
2016-08-13 16:31:44 -04: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
dfbc51f764 cleanup: ortho grid drawing
Getting this ready for Gawain treatment.

Removed setlinestyle(0) -- solid lines are the default,  hope this isn't
really needed.

Eliminated redundant math.

Arithmetic is still double precision, passed to OpenGL as single
precision. Even though it said GL_DOUBLE before, values were converted
to GL_FLOAT internally.

Use C99-isms for declaring variables close to where they're used.

Minor whitespace tweaks.
2016-08-12 17:20:21 -04: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
4565f3d0c8 use new immediate mode for UI_draw_box_shadow
This serves as a good example of the Gawain API. (I’ve thought of a
better way to draw drop shadows, but that can wait!)

Part of T49043.

This is what I had in mind for D1753.
2016-08-11 01:06:17 -04:00
7664d947b3 Gawain: allow partial vertex specification
If you don’t specify a vertex’s color, it will use the color of the
previous vertex. Similar for all other attributes.

This matches the legacy behavior of glColor, glNormal, etc. *except* in
Gawain the first vertex of each immBegin must be fully specified. There
is no “current” color in the new system.
2016-08-11 00:11:48 -04:00
4aadf7331e Gawain: tweak immediate mode API
Should be simpler to use now.

Made vertex format structure private. New immVertexFormat() function
clears and returns the format. Devs can start with add_attrib(format...)
and not have to clear it first.

immBindProgram automatically packs the vertex format if needed.

Updated 3D cursor drawing to use new API.
2016-08-10 18:01:04 -04:00
f537d96286 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2016-08-10 16:09:08 -04:00
adbbcefe57 Gawain: fewer glEnable/DisableVertexAttribArray calls
Track previously enabled attrib locations so we can call OpenGL only
when needed.

Same result, fewer GL calls.
2016-08-10 16:08:32 -04: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
8fd4a8ab5d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/particle.c
2016-08-10 15:06:40 +02:00
774beb7c3c GPencil: Rename color name property to keep consistency in naming 2016-08-10 12:21:18 +02:00
e7a32365cf Gawain: map vertex format to shader inputs
glBindAttribLocation does not take effect until the program is
re-linked. In other words I was doing it wrong!

New code gets attrib locations from program, then remembers the attrib
-> location mapping for subsequent draw calls.

The program and VertexFormat are not modified (makes threading and reuse
easier).
2016-08-10 04:45:23 -04:00
5320a0ad9b Gawain: fix compiler warnings
properly typed function parameters
pointer casting & arithmetic
ptrdiff_t formatting
2016-08-10 02:38:51 -04:00
e4e1b0c7d3 OpenGL: invalidate buffers the modern way
There are older ways to give OpenGL hints about buffer invalidation, but
glInvalidateBufferData does exactly what we want. Use this function when
OpenGL 4.3 is available (Windows and proprietary Linux drivers).

Part of Gawain immediate mode.
2016-08-09 17:17:34 -04: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
f3d65ad23c OpenGL: debug context on Windows
Enable based on --debug-gpu at the command line. Linux already works
this way.
2016-08-09 03:29:49 -04:00
b7f3fb0ef9 Gawain: fix Windows build error
MSVC is more strict than  gcc or clang about pointer arithmetic. Also
fixed pointer cast warnings.
2016-08-09 02:27:54 -04:00
a77e77599d 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-09 01:29:58 -04: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
9893153799 OpenGL: fix FBO error messages
Old code had a mix of framebuffer error codes from OpenGL ES, EXT_framebuffer_object, and desktop GL. We use desktop GL (or ARB_framebuffer_object which acts just like GL 3.x) so I made it compatible with that.

Changed messages to the actual GL_FRAMEBUFFER_XXX symbols. These are less friendly and more accurate. Can easily look up what an error means, unfiltered by what a Blender dev thinks it means.

Kept ES error codes around in case we support that one day. Just flip the #if or use a compile-time option.
2016-08-08 18:02:40 -04:00
903e9ce0c9 Make previous alembic fix only apply to MSVC 2016-08-08 14:17:43 -06:00
39259fc8ab draw 3D cursor with new immediate mode
Replace legacy OpenGL with Gawain. Use shaders instead of fixed
function pipeline.

This simple UI element is shown at startup so is easy to verify things
are working. It also serves as a good example for people converting
other parts of the code.

Part of T49043
2016-08-08 15:45:18 -04: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
c73e4e99a5 OpenGL: simple 2D shader with flat color
Flat color means each primitive will use color from the provoking
vertex.
2016-08-08 04:56:02 -04:00
5c815a6d78 Cycles: Remove set but unused variable 2016-08-08 10:50:23 +02:00
4214b3c44a OpenGL: simplify 3D cursor drawing
Use simple alternating colored lines instead of stippled overdraw.

Reimplement circ function to not use deprecated GLU (T49042). It also
leaves matrix stack untouched.

Remove unused circf function.
2016-08-08 03:17:24 -04:00
6c65e5a00c GPU: bind builtin shader for immediate mode
immBindBuiltinProgram extends Gawain’s immBindProgram to use Blender’s
library of built-in shader programs.

It uses imm prefix instead of GPU_ so people won’t be tempted to call
GPU_unbind_program() afterward.

From my understanding, Apache code is not allowed to call GPL code, so
this function needs to be in the GPU lib.
2016-08-07 22:11:45 -04:00
8e99eec026 Gawain: immediate mode set uniforms for active program
Start simple with vec4 uniforms. Add more later.
2016-08-07 21:30:02 -04: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
11ffbfb36a Gawain: bind a shader for immediate mode
How to use:
1) set up vertex format
2) bind a shader
3) draw with immBegin … immEnd
4) unbind shader

TODO: expand this a little, so we can send uniform values to the bound
shader.
2016-08-07 01:35:42 -04:00
6fea42d677 Gawain: initialize & destroy immediate mode
TODO: make this work better with multiple OpenGL contexts
2016-08-07 01:30:45 -04:00
f27516839f fix simple 2D built-in shaders
Forgot the projection matrix.
2016-08-07 01:26:29 -04:00
0ea8430549 Gawain: legacy Mac VBO workarounds
glMapBufferRange is a wonderful function that doesn’t exist on GL < 3.0.

Use the APPLE_flush_buffer_range extension on Mac. It offers several of
glMapBufferRange’s benefits.

Use older “black arts” method to orphan VBOs when we are done with
them. In modern OpenGL this behavior is more obvious.

Add APPLE_flush_buffer_range to Mac requirements. Every GPU is
supported. T49012
2016-08-07 01:05:49 -04:00
e7f9614f07 Gawain: legacy OpenGL compatibility
Apple invented VAOs and exposes them via an extension in legacy GL.
Other platforms use at least GL 3.0 which has VAOs built in.

QUADS were removed from core profile but are useful for immediate-mode
drawing. We’ll have to implement our own QUAD drawing before switching
to core profile.
2016-08-07 01:05:49 -04:00
6b21d22c60 Gawain: fix VAO and VBO binds
Immediate mode no longer leaves its internals bound after use. Part of
transition from a simple prototype app to non-simple Blender, which has
lots of other parts using OpenGL.
2016-08-07 01:05:49 -04:00
a55c5dbcc4 Gawain: flesh out immediate mode
More ways to send values via immAttrib:
2D float vectors
3 & 4 component ubytes (for colors mostly)

New immVertex functions that act more like familiar glVertex. We’ll
find a balance between making this API convenient and keeping it small.
2f and 3f are enough for now.
2016-08-07 01:05:49 -04:00
3eae585791 Merge branch 'master' into blender2.8 2016-08-06 12:57:21 +02:00
566dd4e8a5 Cleanup: add missing ID types to BKE_library_idtype_can_use_idtype(). 2016-08-06 12:56:15 +02:00
9843921288 Merge branch 'master' into blender2.8
Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	release/scripts/startup/bl_ui/properties_physics_cloth.py
	release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
	release/scripts/startup/bl_ui/properties_physics_softbody.py
	source/blender/blenkernel/BKE_library.h
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/library_query.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/blenkernel/intern/scene.c
	source/blender/blenkernel/intern/softbody.c
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/space_file/filesel.c
	source/blender/editors/space_outliner/outliner_intern.h
	source/blender/makesdna/DNA_ID.h
	source/blender/makesdna/DNA_object_force.h
	source/blender/makesdna/DNA_particle_types.h
	source/blender/makesrna/intern/rna_particle.c
	source/blender/makesrna/intern/rna_sculpt_paint.c
	source/blender/makesrna/intern/rna_smoke.c
	source/blender/makesrna/intern/rna_space.c
2016-08-06 12:45:03 +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
4571fdde0e OpenGL: transition to ARB FBOs, remove runtime checks
ARB_framebuffer_object replaces several related EXT extensions. The ARB
version pulls GL 3 FBO features into GL 2.1, useful for Mac platform.
Its functions and enums have no ARB suffix so transition to modern GL
will be seamless!

Extension is checked at startup, so is guaranteed to be true at runtime.

Part of T49012
2016-08-04 21:11:45 -04:00
58697444bb OpenGL: remove runtime check for EXT_gpu_shader4
It’s checked at startup, so is guaranteed to be true at runtime.

Part of T49012
2016-08-04 20:27:24 -04:00
32757d488f OpenGL: require EXT_gpu_shader4 & ARB_framebuffer_object on Mac
Mac’s OpenGL version is furthest away from our target of GL 3.2. This
commit brings Mac closer to other platforms, so that our shaders and
other code don’t diverge too much during development.

According to Apple’s OpenGL matrix these useful extensions are
available on all GPUs that will be able to run Blender 2.8.

Only checked in debug builds; we might need something more forceful.

Part of T49012
2016-08-04 20:25:47 -04: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
396dd82428 OpenGL: add simple shaders for 2D drawing
The first two of several new simple built-in shaders (will test these
before adding more). These are intended for the new immediate mode API,
but you can use them just like any built-in GPUShader.

Due to limitations on different platforms, shaders need to work with
GLSL versions 120, 130 and 150. Final Blender 2.8 will be pure #version
150.
2016-08-04 15:59:38 -04:00
797f1896fa OpenGL: immediate mode work-alike
Introducing an immediate mode drawing API that works with modern GL 3.2
core profile. I wrote and tested this using a core context on Mac.

This is part of the Gawain library which is Apache 2 licensed. Be very
careful not to pull other Blender code into these files.

Modifications for the Blender integration:
- prefix filenames to match rest of Blender’s GPU libs
- include GPU_glew.h instead of <OpenGL/gl3.h>
- disable thread-local vars until we figure out how best to do this
2016-08-04 15:36:20 -04: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
42d816a3d9 Blender 2.8 requires Mac OS 10.7 or later
MacOS 10.7 “Lion” was the first to implement OpenGL 3.2, which will be
required to run Blender 2.8.

Minimum OS version was unspecified before.
2016-08-04 03:13:20 -04:00
3d9cc4d3f1 support automatic GPU switching on Mac
First attempt. On my laptop (Intel + nVidia) Blender still switches to
nVidia at launch time.
2016-08-04 03:08:13 -04:00
b3cb7e2652 OpenGL: on Mac use legacy 2.1 or core 3.2
This implements Mac part of T49012.

Removed options for EGL, ES2, compatibility profile. None of these
exist on Mac platform.

Create a GL 3.2 core context when requested at build time. Old code
just pretended to support core profile.
2016-08-04 02:36:46 -04: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
0d1f0116fe OpenGL: Blender 2.8 on X11 requires GL 3.0
Implements the Linux part of T49012.

Simplify the options for context creation. No options for legacy GL or EGL or ES2. Select 3.2 CORE or COMPATIBILITY profile at build time.

If that fails, use a GL 3.0 context. This keeps Mesa supported while we work on full 3.2 core elsewhere in the code.
2016-08-03 17:58:24 -04: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
eccf5a6f81 OpenGL: Blender 2.8 on Windows requires GL 3.2
This greatly simplifies the options for context creation. No options for
legacy GL or EGL or ES2. Select CORE or COMPATIBILITY profile at build
time.

OpenGL 3.2 core profile will be our final target on all platforms. Until
all our code is ready we can use 3.2 compatibility profile or "legacy"
GL 2.1 on platforms that don't support compatibility profile.
2016-08-03 14:46:29 -04: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
251349c3c2 Merge branch 'master' into blender2.8 2016-07-28 12:00:58 +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
b1532493c2 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/particle.c
2016-07-25 15:07:17 +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
9186b9ae48 Merge branch 'master' into blender2.8 2016-07-18 19:25:44 +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
cfbd605567 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/addon/ui.py
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenkernel/intern/particle_distribute.c
	source/blender/blenkernel/intern/texture.c
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_relations.c
	source/blender/editors/physics/particle_edit.c
	source/blender/editors/physics/particle_object.c
	source/blender/editors/transform/transform_snap_object.c
2016-07-12 00:07:44 +02: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
71a57a37b2 Merge branch 'master' into blender2.8 2016-06-29 17:58:39 +02:00
94a80a1fb1 Fix bplayer (c) 2016-06-29 17:57:41 +02:00
f45fbf4b83 Merge branch 'master' into blender2.8 2016-06-29 17:45:16 +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
b90b02a480 Merge branch 'master' into blender2.8 2016-06-28 21:21:11 +10:00
5ae6a3b6b6 Merge branch 'master' into blender2.8 2016-06-28 21:10:11 +10: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
0f927d6eca Fix stupid merge error. 2016-06-27 16:07:38 +02:00
cbce7fef16 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/pointcache.c
	source/blender/makesrna/intern/rna_main_api.c
	source/blender/makesrna/intern/rna_particle.c
2016-06-27 15:59:01 +02: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
c2dc77983d Merge branch 'master' into blender2.8
No changes, just resolve conflicts.
2016-06-23 08:04:19 +10: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
3b0a5dd158 Merge branch 'master' into blender2.8 2016-06-23 07:52:58 +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
97ee7f8609 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/physics/particle_edit.c
2016-06-22 13:12:44 +02: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
48c58bd913 Merge branch 'master' into blender2.8 2016-06-21 12:14:49 +10: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
7da189b4e8 Fix broken combine XYZ node after recent refactoring. 2016-06-18 22:37:18 +02:00
2465bd90d5 Cleanup: style, whitespace, doxy filepaths 2016-06-19 06:33:29 +10:00
d67c07ea49 Fix T48671: Cycles crash with OSL nodes and bump after recent refactoring. 2016-06-18 12:32:40 +02:00
7ac126e728 Fix T46492: GGX distribution produces black pixels
The issue was caused by some numerical instability.
2016-06-17 16:30:29 +02:00
bcde045b32 Fix T48667: Bisect-fill crash
BMO iterator would loop over removed faces.

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

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

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

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

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

region_2d_to_origin_3d would misbehave (and consequently region_2d_to_location_3d).

Sample addon to test it:
```
import bpy

from bpy_extras.view3d_utils import (
    region_2d_to_location_3d,
    )

from mathutils import (
    Vector,
    )

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

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

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

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

        return {'RUNNING_MODAL'}

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

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

        self.ob.location.xy = xy

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

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

if __name__ == "__main__":
    register()
```
2016-06-14 18:03:07 -03:00
09da51e603 Text Editor: auto-complete removed entire word on undo 2016-06-15 04:28:13 +10:00
81f435202a VSE: minor drawing glitch with meta's
Meta contents could obscure meta selection outline, draw after.
2016-06-15 04:08:03 +10:00
28398f654d Correct update issue caused by recent commit
VSE effects within a meta-strip could fail to update on cancel.
2016-06-15 04:08:03 +10:00
eaf894db6d Fix VSE updating effects within metas
Missing update caused internal lengths to be wrong.
2016-06-15 02:44:34 +10:00
a3a7e46318 Cleanup: Remove outdated comment, visibility layers in kernel have been removed. 2016-06-14 16:46:44 +02:00
9182e07c0e FileSpace cleanup: make ED_path_extension_type public.
Maybe we should move it to BLI, but not sure how, and where (and its defines
are SpaceFile's ones, meh :| ).
2016-06-14 16:30:16 +02:00
c7e7c1b241 Write .blend file: refactor & fixes re ID block itself.
Factorized writing of ID block's data (so far, only IDProps) into own helper func.
This also fixes missing IDProp (aka custom data) saving from GreasePencil and Library
datablocks (and add comment about why we do not save WM IDProps).

Finaly, it ensures all ID-related data are written immediately after the ID itself
(was not the case for all data types previously, some were writting their own data
before IDProps). This is not a fix (.blend file format does not enforce any order
on sub-data of datablocks, they only have to be after datablock struct itself in file),
but makes things more consistent.
2016-06-14 15:03:49 +02:00
424f41ad1c Fix T48649: VSE meta-strip overlap shuffles recursively 2016-06-14 21:57:55 +10:00
180aad5e0b Correct sequencer transform check
Check to avoid operating on same strip multiple times wasn't working.

Harmless but better make it functional.
2016-06-14 21:57:55 +10:00
a47937454c fix T48602: Changed The Collada validator to treat faces with < 3 verts as Warning and let the Mesh Validator take care of the cleanup 2016-06-14 13:09:10 +02:00
6d111a233c Fix T48613: Bump mapping in cycles is not shown on the viewport when the material use node groups 2016-06-14 11:31:00 +02:00
51cb4ea2cf Fix T48154: Decimate topology changes with scale
This can't be avoided completely, however the threshold used can be much lower.
2016-06-14 17:12:29 +10:00
049f715d1c Usual UI/i18n message fixes. 2016-06-14 00:16:39 +02:00
Phil Gosch
9c600435fa Made incremental snapping intervalls smaller for UV editor
Before the intervall was set to 0.125 which effectively resulted in 8 positions across the UV space (per axis).
I halved that value, holding shift enables an even finer movement.

This change was ported over from my soc-2016-uv_tools branch after talking with howardt, ideasman42 and hackerman-
2016-06-13 18:35:32 +02:00
abb9d0b0ad Curve Fitting: add high-quality flag
When this flag is set - even when the curve error is under the threshold,
keep attempting a better fit.

Enable this for freehand drawing, since it gives nicer results and isn't noticeably slower.
2016-06-14 02:27:32 +10:00
b0985b393c Fix T48595: UI glitch with driver menu re-opening
Holding Ctrl-D would keep opening driver menus.
2016-06-14 01:52:35 +10:00
520691e591 Bevel segments also changeable with mouse (S toggle).
Also, can use numeric input to set segments and profile when
in those respective value-adjusting modes (as per S or P toggle).
Finally, fixed problem with previous bevel commit: when changing
value-adjusting mode, would like to start off resumed value adjustment
where it was before.
2016-06-13 09:14:13 -04:00
08baf3ea79 Keymap: include 'Dopesheet Generic' 2016-06-13 23:03:00 +10:00
5be4d0b328 Fix misleading indentation in ImBuf 2016-06-13 14:46:04 +02:00
f87611622d Fix typo in variable name as well. 2016-06-13 14:08:06 +02:00
f2c5ea2516 Fix own error w/ undefined behavior
This happened to work for me but caused issues on OSX.
2016-06-13 21:57:22 +10:00
2566652ae6 Cycles: fixed a typo that would crash shaders that use the "Is Diffuse Ray" output of the LightPath node 2016-06-13 13:33:56 +02:00
5864269b2c Merge branch 'master' into blender2.8 2016-06-13 19:26:56 +10:00
617c4d6adb Fix glShadeModel being left flat in edit-mode draw 2016-06-13 19:21:46 +10:00
8d8c5a542c Cycles: Fix unhandled enumerator in OSL switch
Unsigned int is not supported by OSL as far as i concerned, so should not
really matter here. However, might be wrong and perhaps more proper idea
would be so set it as regular int?
2016-06-13 10:15:39 +02:00
1883dbd8c3 Fix T48616: Auto-merge selects extra edges
Auto-merge caused all edges between selected vertices to be selected.
This only makes sense in vertex-select-mode.

Correct edge-flag merging code, which now merges flags from multiple edges.
2016-06-13 18:07:59 +10:00
cefbe8fe54 Fix build error with GCC 6.1. 2016-06-12 21:29:19 +02:00
24d53f79b2 Fix Cycles debug build assert on some platforms, tighten checks to avoid this in the future. 2016-06-12 17:35:15 +02:00
055001111e Fix T48604: Crash on undo due to bad drawing code.
Short story: draw_lamp would add itself to delayed transp drawing list from 'xray' drawing step.
This was broken, since delayed transp drawing list is always handled **before** delayed xray one.

After undo it lead to segfault crash, v3d->afterdraw_transp still having reference to old freed scene's base.

Also added asserts that those afterdraw list are empty at end of drawing step, should help
avoiding that kind of issue in future.
2016-06-12 17:06:50 +02:00
2033f47e55 Curve Fitting: offset based fallback to calculate cubics
Add a new fallback method that uses offset distance from the curve to the line between both points,
for freehand drawing it typically only fives minor improvements (1-3% fewer points),
for curve dissolve the improvements are more noticeable.
2016-06-12 22:25:43 +10:00
66b12ef4ab BLI_math: cleanup arg names
project functions arg naming made it hard to tell which vector was projected onto.
2016-06-12 15:39:04 +10:00
65df2fd997 bmesh py api: expose BM_face_calc_tangent_*
D1988 by @wisaac, with own edits and improvements.

This improves on existing tangent calculation functions too.

- BM_face_calc_tangent_auto: Chooses method based on number of sides, used by manipulator (not exposed to Python).
- BM_face_calc_tangent_edge: from longest edge.
- BM_face_calc_tangent_edge_pair: from longest edge-pair (most useful with quads).
- BM_face_calc_tangent_edge_diagonal: edge farthest from any vertex.
- BM_face_calc_tangent_vert_diagonal: vert farthest from any vertex.

Also optimize BM_vert_tri_calc_tangent_edge* functions to avoid sqrt.
2016-06-12 15:12:34 +10:00
421ec97276 Docs: Support out-of-source reference-API builds
This was originally supported, however relative links to examples & templates made it fail.
Now files in the source tree are copied to the build-dir, with ".." replaced with "__"
to avoid having to mirror Blender's source-layout in the Sphinx build-dir.

Also skip uploading the built docs when an SSH user-name isn't passed to sphinx_doc_gen.sh
instead of aborting (so people w/o SSH access to our servers can use the shell-script).
2016-06-12 11:31:28 +10:00
2b15a588a1 Cleanup: API docs (whitespace/line length) 2016-06-12 10:05:35 +10:00
1cd3676d4d Cleanup, remove unneeded variable. 2016-06-12 00:01:57 +02:00
324bed3843 Fix compiler warning for unused variables. 2016-06-11 23:58:12 +02:00
ebdd2e0b6d Cycles: make shader node enums consistently lower case, update OSL shaders accordingly. 2016-06-11 23:50:11 +02:00
b8112a8960 Fix OS X build after Decklink changes, it is not supported yet so don't enable it. 2016-06-11 23:50:06 +02:00
eea89417f4 BGE: DeckLink card support for video capture and streaming.
You can capture and stream video in the BGE using the DeckLink video
   cards from Black Magic Design. You need a card and Desktop Video software
   version 10.4 or above to use these features in the BGE.
   Many thanks to Nuno Estanquiero who tested the patch extensively
   on a variety of Decklink products, it wouldn't have been possible without
   his help.
   You can find a brief summary of the decklink features here: https://wiki.blender.org/index.php/Dev:Source/GameEngine/Decklink
   The full API details and samples are in the Python API documentation.

bge.texture.VideoDeckLink(format, capture=0):

   Use this object to capture a video stream. the format argument describes
   the video and pixel formats and the capture argument the card number.
   This object can be used as a source for bge.texture.Texture so that the frame
   is sent to the GPU, or by itself using the new refresh method to get the video
   frame in a buffer.
   The frames are usually not in RGB but in YUV format (8bit or 10bit); they
   require a shader to extract the RGB components in the GPU. Details and sample
   shaders in the documentation.
   3D video capture is supported: the frames are double height with left and right
   eyes in top-bottom order. The 'eye' uniform (see setUniformEyef) can be used to
   sample the 3D frame when the BGE is also in stereo mode. This allows to composite
   a 3D video stream with a 3D scene and render it in stereo.
   In Windows, and if you have a nVidia Quadro GPU, you can benefit of an additional
   performance boost by using 'GPUDirect': a method to send a video frame to the GPU
   without going through the OGL driver. The 'pinned memory' OGL extension is also
   supported (only on high-end AMD GPU) with the same effect.

bge.texture.DeckLink(cardIdx=0, format=""):

   Use this object to send video frame to a DeckLink card. Only the immediate mode
   is supported, the scheduled mode is not implemented.
   This object is similar to bge.texture.Texture: you need to attach a image source
   and call refresh() to compute and send the frame to the card.
   This object is best suited for video keying: a video stream (not captured) flows
   through the card and the frame you send to the card are displayed above it (the
   card does the compositing automatically based on the alpha channel).
   At the time of this commit, 3D video keying is supported in the BGE but not in the
   DeckLink card due to a color space issue.
2016-06-11 22:26:05 +02:00
c0bf881ebf BL_Shader.setUniformEyef(name)
defines a uniform that reflects the eye being rendered in stereo mode:
    0.0 for the left eye, 0.5 for the right eye.
    In non stereo mode, the value of the uniform is fixed to 0.0.
    The typical use of this uniform is in stereo mode to sample stereo textures
    containing the left and right eye images in a top-bottom order.

    python:
      shader = obj.meshes[0].materials[mat].getShader()
      shader.setUniformEyef("eye")

    shader:
      uniform float eye;
      uniform sampler2D tex;
      void main(void)
      {
         vec4 color;
         float ty, tx;
         tx = gl_TexCoord[0].x;
         ty = eye+gl_TexCoord[0].y*0.5;
         // ty will be between 0 and 0.5 for the left eye render
         // and 0.5 and 1.0 for the right eye render.
         color = texture(tex, vec2(tx, ty));
         ...
      }
2016-06-11 22:24:18 +02:00
fa9bb2ffe9 Atomic ops: Fix atomic_add_uint32 and atomic_sub_uint32 in Windows
The assembler version in Windows used to return the previous value
    of the variable while all the other versions return the new value.
    This is now fixed for consistency.
    Note: this bug had no effect on blender because no part of the code
    use the return value of these functions, but the future BGE DeckLink
    module makes use of it to implement reference counter.
2016-06-11 22:15:25 +02:00
40f1c4f343 BGE: Various render improvements.
bge.logic.setRender(flag) to enable/disable render.
    The render pass is enabled by default but it can be disabled with
    bge.logic.setRender(False).
    Once disabled, the render pass is skipped and a new logic frame starts
    immediately. Note that VSync no longer limits the fps when render is off
    but the 'Use Frame Rate' option in the Render Properties still does.
    To run as many frames as possible, untick the option
    This function is useful when you don't need the default render, e.g.
    when doing offscreen render to an alternate device than the monitor.
    Note that without VSync, you must limit the frame rate by other means.

fbo = bge.render.offScreenCreate(width,height,[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER])
    Use this method to create an offscreen buffer of given size, with given MSAA
    samples and targetting either a render buffer (bge.render.RAS_OFS_RENDER_BUFFER)
    or a texture (bge.render.RAS_OFS_RENDER_TEXTURE). Use the former if you want to
    retrieve the frame buffer on the host and the latter if you want to pass the render
    to another context (texture are proper OGL object, render buffers aren't)
    The object created by this function can only be used as a parameter of the
    bge.texture.ImageRender() constructor to send the the render to the FBO rather
    than to the frame buffer. This is best suited when you want to create a render
    of specific size, or if you need an image with an alpha channel.

bge.texture.<imagetype>.refresh(buffer=None, format="RGBA", ts=-1.0)
    Without arg, the refresh method of the image objects is pretty much a no-op, it
    simply invalidates the image so that on next texture refresh, the image will
    be recalculated.
    It is now possible to pass an optional buffer object to transfer the image (and
    recalculate it if it was invalid) to an external object. The object must implement
    the 'buffer protocol'. The image will be transfered as "RGBA" or "BGRA" pixels
    depending on format argument (only those 2 formats are supported) and ts is an
    optional timestamp in the image depends on it (e.g. VideoFFmpeg playing a video file).
    With this function you don't need anymore to link the image object to a Texture
    object to use: the image object is self-sufficient.

bge.texture.ImageRender(scene, camera, fbo=None)
    Render to buffer is possible by passing a FBO object (see offScreenCreate).

bge.texture.ImageRender.render()
    Allows asynchronous render: call this method to render the scene but without
    extracting the pixels yet. The function returns as soon as the render commands
    have been send to the GPU. The render will proceed asynchronously in the GPU
    while the host can perform other tasks.
    To complete the render, you can either call refresh() directly of refresh the texture
    to which this object is the source. Asynchronous render is useful to achieve optimal
    performance: call render() on frame N and refresh() on frame N+1 to give as much as
    time as possible to the GPU to render the frame while the game engine can perform other tasks.

Support negative scale on camera.
    Camera scale was previously ignored in the BGE.
    It is now injected in the modelview matrix as a vertical or horizontal flip
    of the scene (respectively if scaleY<0 and scaleX<0).
    Note that the actual value of the scale is not used, only the sign.
    This allows to flip the image produced by ImageRender() without any performance
    degradation: the flip is integrated in the render itself.

Optimized image transfer from ImageRender to buffer.
    Previously, images that were transferred to the host were always going through
    buffers in VideoTexture. It is now possible to transfer ImageRender
    images to external buffer without intermediate copy (i.e. directly from OGL to buffer)
    if the attributes of the ImageRender objects are set as follow:
       flip=False, alpha=True, scale=False, depth=False, zbuff=False.
       (if you need to flip the image, use camera negative scale)
2016-06-11 22:05:20 +02:00
5b061ddf1e Fix Gradient Texture and OSL after refactor. 2016-06-11 21:40:00 +02:00
0b415700f4 Attempted fix for T48625: tablet button configured to right click not working on OS X. 2016-06-11 20:32:24 +02:00
42aec3b355 Cycles: nodify shader nodes
Differential Revision: https://developer.blender.org/D2038
2016-06-11 20:32:24 +02:00
4df6474f01 Fix T48617: VSE: Do not draw backdrop in Seq + Preview mode, only makes sense when no preview is available... 2016-06-11 17:28:32 +02:00
dccf5afbef BLI_rand: add BLI_rng_get_char_n
Use to fill an array of bytes to random values.
2016-06-12 00:41:02 +10:00
4ec1c76afc Fix T48634: Interpolation and distribution of Children Particles breaks.
Own stupid off-by-one regression in rB019ce363b01bba0afe1 and later...
2016-06-11 14:37:47 +02:00
07925b6316 UI Font: Fix bad kerning of Thai font.
Thai font is a complex script that assumes full featured unicode layout engine,
while Blender only knows about basic kerning (offset of a char based on the previous one).

So this commit edits Thai part of our i18n font to fix the very bad spacing of thai chars
we had in Blender so far.

Work done by Hồ Châu, many thanks!
2016-06-11 10:47:53 +02:00
a99c03a0ad VSE: select by group: add option to select by group on same channel only. 2016-06-10 18:40:31 +02:00
25f3c0a395 Install_deps: add '--no-build' option to prevent compiling anything. 2016-06-10 18:09:34 +02:00
54343b821d GPU: use basic-shader for line-stipple 2016-06-10 07:50:49 +10:00
af077706fb Remove redundant GL attribute push/pop
Stipple isnt left on during object drawing
2016-06-10 07:50:49 +10:00
b07508a362 Fix GPU logical error changing stipple 2016-06-10 07:50:49 +10:00
a5788a9c47 Cleanup: brace-placement 2016-06-10 07:50:45 +10:00
8529b2f925 BGE: alpha on frame buffer and precedence of MSAA over swap.
A new option '-a' can be passed to the blenderplayer. It forces the
framebuffer to have an alpha channel.
This can be used in VideoTexture to return a image with alpha channel
with ImageViewport (provided alpha is set to True on the ImageViewport
object and that the background color alpha channel is 0, which is the
default).
Without the -a option, the frame buffer has no alpha channel and
ImageViewport always returns an opaque image, no matter what.
In Linux, the player window will be rendered transparently over
the desktop.
In Windows, the player window is still rendered opaque because
transparency of the window is only possible using the 'compositing'
functions of Windows. The code is there but not enabled  (look for
WIN32_COMPOSITING) because 1) it doesn't work so well 2) it requires
a DLL that is only available on Vista and up.

give precedence to AA over Swap copy:

Certain GPU (intel) will not allow MSAA together with swap copy.
Previously, swap copy had priority over MSAA: fewer AA samples would be
chosen if it was the condition to get swap copy. This patch reverse the
logic: swap copy will be abandonned if another swap method (undefined or
exchange) will provide the number of AA samples requested. If no AA
samples is requested, swap copy still has the priority of course.
2016-06-09 22:15:13 +02:00
5da02ab9e2 GPU: only call glShadeModel when needed 2016-06-10 06:11:14 +10:00
efd547f3da GPU: avoid multiple bind calls in GPU_draw_pbvh_buffers
Also add utility functions: GPU_basic_shader_bind_enable/disable
so we don't have to get the previous state every time and manipulate it
2016-06-10 06:09:11 +10:00
46e1d85e61 Reduce conflicts be keeping same indent-level as master 2016-06-10 05:51:34 +10:00
c96d4ec644 Merge branch 'master' into blender2.8 2016-06-10 05:46:29 +10:00
6798809c7e Flat shading for basic shader
The purpose of the patch is to replace deprecated  glShadeModel.

To decrease glShadeModel calls I've set GL_SMOOTH by default

Reviewers: merwin, brecht

Reviewed By: brecht

Subscribers: blueprintrandom, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D1958
2016-06-10 05:38:17 +10:00
a151806698 Merge branch 'master' into blender2.8 2016-06-10 05:17:33 +10:00
10d57f991b Merge branch 'master' into blender2.8 2016-06-10 05:15:06 +10:00
d733826708 Fix T48614: Blender from buildbot crash when Separate selection in this particular scene.
Regression from recent rB2c5dc66d5effd4072f438afb, if last item of last chunk of a mempool was valid,
it would not be returned by mempool iterator step, which would always return NULL in that case.
2016-06-09 17:53:51 +02:00
20f0e2f342 Compilation error fix after recent cleanup
Please do not do cleanups in minimal configuration, doing that has been
proven to only cause issues without solving anything meaningful ;)
2016-06-09 09:53:35 +02:00
88ac2d390b Cleanup: GPU arg wrapping 2016-06-09 05:44:25 +10:00
5065343074 Cleanup: GPU headers 2016-06-09 05:38:43 +10:00
d01499a45c GPU: avoid disabling basic-shader for lasso
Replace glDrawPixels w/ glaDrawPixelsTex
2016-06-09 05:17:43 +10:00
69bf7a44aa Fix armature stick draw, unpack-alignment was set but never restored
Drawing a single stick bone set the alignment to 1, applying this setting to the rest of Blender.
2016-06-09 05:17:43 +10:00
b41cfb590c glutil: add glaGetOneInt helper 2016-06-09 05:17:43 +10:00
b32fd196a0 Depsgraph: Avoid redundant connection from IK solver to chain
Could give barely measurable speedup on a complex rigs.
2016-06-08 17:33:04 +02:00
c683c3805e Depsgraph: Remove unused code
Became obsolete after recent changes.
2016-06-08 17:33:04 +02:00
bdd855ac1a Depsgraph: Optimize flush update when there's few objects and fewzillions of bones
Avoid annoying checks form inside operations loop, gives few percent speedup in
files like army_of_blenrigs.
2016-06-08 17:33:04 +02:00
b9de44f458 GPU: fix texface image w/ basic-shader 2016-06-09 00:44:20 +10:00
Julian Eisel
fc96110bb5 Make uiLists placed in popups usable
It's still not completely working - there are still some glitches - but far better than before.
To make buttons of the uiList work, you have to add a 'check' callback to the operator that invokes the menu. Only if it returns True, the uiList gets refreshed. To avoid this we have to make the region refresh tagging in the entire button handling a bit smarter.

Changes I had to do:
* Call uiList handling from menu/popup handling if needed.
* Make uiList handling use special popup refresh tag if placed in menu.
* Allow popups invoked from py operator to tag for refresh by using operator 'check' callback.
* Tag popup for refresh when resizing uiList.

Mostly fixes T48612.
2016-06-08 16:05:23 +02:00
37fc4b575f Fix FPE exception happening when converting linear<->srgb using SIMD 2016-06-08 16:00:34 +02:00
6ca6d3c4fd Cleanup: typo 2016-06-08 22:31:35 +10:00
e02679f71e Cleanup: typos 2016-06-08 22:25:23 +10:00
5e063ce6c9 Fix edit-mesh draw not disabling stipple
Caused problem w/ basic-shader
2016-06-08 21:37:34 +10:00
6307e823ca Cycles: Fix crash after recent zero scale instance optimization 2016-06-08 12:25:35 +02:00
438bdccff3 Buildobt: Update master config 2016-06-08 12:17:18 +02:00
b7a0340414 Buildbot: Give 2015 builds different name 2016-06-08 12:01:26 +02:00
4845736e41 3D Text: Use BLI_array_store for undo storage 2016-06-08 19:26:49 +10:00
94057b15d1 3D Text: Store separate arrays for undo data
Don't store maximum length of text per undo step,
or attempt to pack all data in a single array.

Was storing 32766 characters per undo step, irrespective of actual text length.
2016-06-08 19:21:18 +10:00
c6864c408b 3D Text: move undo into its own file 2016-06-08 19:12:23 +10:00
0a029e3dd1 BLI_array_store: move helper functions into their own API 2016-06-08 19:12:23 +10:00
e623d6b223 Fix cloth stability when in perfect rest shape.
The way cloth is coded, structural springs are only effective when stretched, while bending springs act only when shrunk. However, when cloth is exactly in its rest shape, neither have any effect, and effectively don't exist for the implicit solver.

This creates a stability problem in the initial frames of the simulation, especially considering that gravity seems to act so precisely that it doesn't disturb the strict equality of lengths, so in parts of the cloth this springless state can continue for quite a while.

Here is an example of things going haywire because of this and some suspicious logic in collision code acting together: {F314558}

Changing the condition so that structural springs are active even at exactly rest length fixes this test case. The use of >= is also supported by the original paper that the cloth implementation in blender is based on.

Reviewers: lukastoenne

Reviewed By: lukastoenne

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D2028
2016-06-08 10:32:11 +02:00
1345865dcd Buildbot: Trickery for MSVC2015 and NVCC 2016-06-08 10:31:04 +02:00
fc60689a25 Correct assert 2016-06-08 16:31:40 +10:00
eaa19177e7 GPU: fix/workaround basic shader font-color
All text was displaying black.

BLF uses alpha-only textures which aren't supported by the basic-shader,
Workaround this by using texture swizzle so the RGB components of the texture are set to 1.
2016-06-08 15:20:57 +10:00
654019fa01 Cycles: Fix two numerical issues in the volume code
This hopefully fixes T48383 by avoiding two numerical problems that I found in the volume code.

Reviewers: sergey, dingto, brecht

Reviewed By: sergey, dingto, brecht

Maniphest Tasks: T48383

Differential Revision: https://developer.blender.org/D2051
2016-06-08 03:17:19 +02:00
Julian Eisel
a506f4c74e Cleanup: Add comment on behavior of tweak events
It's not obvious that they use the mouse coordinate of the initial key-press event (behavior since rBf1f33ba7be2d), so added comment.

Also corrected other comments.
2016-06-07 23:13:27 +02:00
38f07a81b3 Fix T48600: VSE strip 'side selection' fails in 'Both' case.
Looks like a line was forgotten in the 'BOTH' case in code...
2016-06-07 22:37:31 +02:00
9081adf097 Cleanup - size_t is unsigned, so always >= 0! 2016-06-07 21:53:17 +02:00
5bd9e83289 GPU: Fix triple buffer w/ basic glsl shader
Needed to add GL_TEXTURE_RECTANGLE support to basic-shader.
2016-06-08 05:40:21 +10:00
91c146c42e Cuda 7.5 cannot be made to work with a supported cl.exe version in the same way as cuda 6.0 does allow, disabling cuda kernels on buildbot for now 2016-06-07 20:58:53 +02:00
d16635e497 Cuda 7.5 cannot be made to work with a supported cl.exe version in the same way as cuda 6.0 does allow, disabling cuda kernels on buildbot for now 2016-06-07 20:56:44 +02:00
f3d33a1a0f GPU: Fix for glDrawPixels drawing w/ glsl shader
The basic shader needs to be temporarily disabled in this case.
Add macros for temp store/restoring the state.
2016-06-08 04:13:21 +10:00
cf8a0d08b0 GPU: make using the glsl basic-shader a flag
This allows for it to be more easily tested.
2016-06-08 04:13:16 +10:00
bf54dcc3c9 Fix T48589: Compositor Backdrop crashes Blender 2016-06-07 16:44:15 +02:00
b595a692c8 Cycles: Limit degenerated triangle check got CUDA only
OpenCL seems to work fine here, and for some reason that comparison was
giving compilation error on OpenCL here.

Better to compile OpenCL kernel than to be fully robust to weird corner
cases.
2016-06-07 15:48:56 +02:00
b6954c8da1 Cycles: Fix regression introduced in c96a4c8
A few places still needed to be updated to use the new Mesh::num_triangles()
method; wrong number from triangles.size() was causing crashes.
2016-06-07 07:38:09 -04:00
f08018f928 Fix (unreported) EditNormal modifier: broken 'flip poly' feature.
Newly computed custom normals were forgotten during poly flipping, leading
to wrong custom normals being assigned to wrong loop...

Dead simple, but was tough to track down this one!
2016-06-07 13:07:01 +02:00
0036ffb3e6 Cleanup: warning 2016-06-07 19:23:43 +10:00
4b99958ca1 Remove particle expander
Having this caused buffer-overrun on startup
2016-06-07 18:27:31 +10:00
1e5735ab99 World space switch for BI nodes.
At the moment light shading in Blender is produced in viewspace. Apparently, that's why
shader nodes work with normals in camera space. But it is not convenient for artists.
The more convenient approach is implemented in Cycles where normals are represented in world space.
Blend4Web Team designed the engine keeping in mind shader parameters readability,
so normals are interpreted in world space as well. And now our users have to use some tweaks, like
empty node group with the name "Replace", which is replacing one input by another on the engine side
(replacing working configuration in Blender Viewport by the configuration that has the same behavior in the engine).

This patch adds the ability to switch to world space for normals and lamp vector in BI and Viewport.
This patch is very important to us and we crave to see this patch in Blender 2.7 because
it will significantly simplify Blend4Web material creation workflow.

{F315547}

{F315548}

Reviewers: campbellbarton, brecht

Reviewed By: brecht

Subscribers: homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2046
2016-06-07 10:21:55 +02:00
5750549f6a Cleanup: warnings 2016-06-07 18:16:03 +10:00
ed6f86a510 Merge branch 'master' into blender2.8 2016-06-07 18:06:46 +10:00
24d29f2e50 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/particle.c
	source/blender/editors/transform/transform_snap_object.c
2016-06-07 09:59:26 +02:00
0da13ad1eb World space switch for BI nodes.
At the moment light shading in Blender is produced in viewspace. Apparently, that's why
shader nodes work with normals in camera space. But it is not convenient for artists.
The more convenient approach is implemented in Cycles where normals are represented in world space.
Blend4Web Team designed the engine keeping in mind shader parameters readability,
so normals are interpreted in world space as well. And now our users have to use some tweaks, like
empty node group with the name "Replace", which is replacing one input by another on the engine side
(replacing working configuration in Blender Viewport by the configuration that has the same behavior in the engine).

This patch adds the ability to switch to world space for normals and lamp vector in BI and Viewport.
This patch is very important to us and we crave to see this patch in Blender 2.7 because
it will significantly simplify Blend4Web material creation workflow.

{F315547}

{F315548}

Reviewers: campbellbarton, brecht

Reviewed By: brecht

Subscribers: homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2046
2016-06-07 10:42:29 +03:00
441a440cbb readfile: optimization for undo
Was using O(n^2) lookup on ID's with undo.

This caused undo to hang with 1000's of data-blocks
(especially with heavy scenes & outliner-space, which doesn't even need to be visible to cause a slow-down).

Internally this uses a ghash per id-type, which is lazy-initialized.
Each key uses the name and library since there may be name collisions between libraries.

Developer Notes:

- Adds small `BKE_main_idmap_*` API.
- Needed to change linking order for this to build.
2016-06-07 17:27:52 +10:00
3054e33d67 BLO_idcode: Move ID_ID last
This lets us use MAX_LIBARRAY to loop over id-codes in Main.
2016-06-07 16:42:11 +10:00
2d9d17c031 readfile: avoid library lookups for every id on undo
Instead index libraries, makes minor speedup when using many libraries.
2016-06-07 14:13:22 +10:00
f12c55d2b8 Correct exit-code check 2016-06-07 14:02:32 +10:00
7a5a02509b Cycles: Use faster ray-quad-intersection test
The original quad intersection test works by just testing against the two triangles that define the quad.
However, in this case it's actually faster to use the same test that's also used for portals: Determining
the distance to the plane in which the quad lies, calculating the hitpoint and checking whether it's in the
quad by projecting onto the sides.

Reviewers: brecht, sergey, dingto

Reviewed By: dingto

Differential Revision: https://developer.blender.org/D2045
2016-06-06 23:38:50 +02:00
ac7feaed3d EditNormal modifier: add some 'maximum angle' limit.
Allows to avoid generating flipped faces when using extreme normal modifications.

Related to T48576.
2016-06-06 21:42:47 +02:00
c8e9e6dda0 Added P key toggle to allow mouse movement to control bevel profile (modal).
The Shift key can be held while adjusting profile to make finer changes
to the profile (just as it already does when adjusting offset).
2016-06-06 13:15:13 -04:00
78f7d0b714 Cleanup: remove unused Library.idblock 2016-06-07 00:34:54 +10:00
420bd15262 Cleanup: warning 2016-06-07 00:34:16 +10:00
14f9a5aa1d Fix T48571: Cycles/GPU - A lot of fireflies on SSS+Volume
Was some accumulated precision error happening.
2016-06-06 15:56:22 +02:00
122c59fba4 Fix T48582: Rigidbody simulation issue with new depsgraph
Being granular means we need to re-build depsgraph a bit more often..

The issue was caused by rigidbody requiring some special nodes to
handle physics which were not created with just tagging object for
update.
2016-06-06 14:38:12 +02:00
c276480b0f Fix compilation error on 32 bit Windows 2016-06-06 14:01:49 +02:00
fd7068ee28 Fix T48550: Imperfections when Bake displacement map to plane if camera is not in front
The issue was caused by non-watertight nature of intersection, which is now addressed.

Hopefully it doesn't cause any regression caused by uninitialized precalculated storage.
2016-06-06 13:55:04 +02:00
b277ba5c0d Cycles: Fix compilation error on OSX 2016-06-06 13:52:57 +02:00
47d0d9cca4 Depsgraph: Russian electric tape bodge to have multiple proxies work
Makes behavior of proxy_from backlink working similar to the old dependency graph.

it's nasty, but needed here in the studio to get proxies fixes ASAP.
2016-06-06 12:09:04 +02:00
24049c8196 readfile: add assert to check libmap isn't sorted 2016-06-06 19:12:13 +10:00
5d45ffc755 readfile: minor optimization, no need to count flags
in this case we only need to check if any id's need to be read.
2016-06-06 19:05:21 +10:00
894d24fb16 Cleanup: use const for old member in OldNew struct 2016-06-06 18:04:13 +10:00
a97bcc2985 Cleanup: rename flag -> tag
ID's have a flag member too, best avoid confusion here.
2016-06-06 18:04:13 +10:00
6046c03f5c Cycles: Ignore zero size instances in BVH
In certain types of animation it's possible to have some objects
scaling to zero. In this case we can save render times by avoid
traversing such instances.

Better to do ti ahead of a time, so traversal stays simple.

Reviewers: lukasstockner97, dingto, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2048
2016-06-06 09:23:53 +02:00
b62faa54de Cycles: Add support of processor groups
Currently for windows only, this is an initial commit towards native
support of NUMA.

Current commit makes it so Cycles will use all logical processors on
Windows running on system with more than 64 threads.

Reviewers: juicyfruit, dingto, lukasstockner97, maiself, brecht

Subscribers: LazyDodo

Differential Revision: https://developer.blender.org/D2049
2016-06-06 09:14:37 +02:00
9d090ed1cd RNA: disable animating object dimensions 2016-06-06 12:57:17 +10:00
7f57c99be8 Fix T48579: RNA shadows new custom properties 2016-06-06 12:23:01 +10:00
04bcaf07dc Fix T48580: path / branched path UI grayed out with OpenCL device that is not used. 2016-06-04 23:21:44 +02:00
234801c8dc Fix T48587, constant fold should only be done for Mix Type. 2016-06-04 21:39:07 +02:00
1d8637ec69 buildbot work around cuda / msvc compatibility issues attempt 2/ passing a string from python to cmake to nvcc is harder then it looks 2016-06-04 17:41:11 +02:00
ebbfd92859 buildbot work around cuda / msvc compatibility issues 2016-06-04 12:37:46 +02:00
50f432b1e0 CMake, minor changes to make Visual studio 2015 use a compatible numpy and
the standard cmake CUDA/NVCC arguments flag allowing 2015 build to use
msvc 2013 for cuda
2016-06-04 11:42:48 +02:00
17fbce9549 Cleanup: avoid temp string edit 2016-06-04 10:55:14 +10:00
38410e6e25 changed use_connect from bool to a 3 state value (-1,0,1) 2016-06-03 18:31:51 +02:00
b000a01725 fix T48389 (wip) added warning for loops that define holes (polygons with holes not supported) 2016-06-03 18:31:49 +02:00
fac9f1c840 Workaround MSVC error 2016-06-04 01:00:40 +10:00
c6cc599311 Fix T48234: Glitch w/ action constraints sharing an action
FCurve evaluation depended on FCurve.curval, which isn't threadsafe.
Now only use this value for debug display,
and pass the value instead of storing in the FCurve for all but debug-display.
2016-06-04 00:57:44 +10:00
398180439b Fix Playercompile 2016-06-03 12:05:01 +02:00
b406b7be00 Cycles: Mark which CUDA device is used for display
It is really handy to know which one is display when having two cards of
same type in the machine.
2016-06-03 11:52:08 +02:00
f71feb34a3 Make playback invoked form animation editors more usable
This covers the following workflow. Animator will disable Update All 3D views
in order to get quick playback in a particular 3D editor. However, it also
handy to see playback in all editors and image editors to see comparison of
animation and reference footage.

So the idea here is to refresh reasonable editors when playback is invoked
from animation editors.

Commit to make Hjalti happy.
2016-06-03 11:46:57 +02:00
f54a98a1c5 Cycles: Simplify check for degenerated faces on GPU
Still not sure how to properly solve the issue, needs some trickery to get
actual optimized values from intersection function (using printf() avoids
some optimization and makes stuff render correct).

For the time being let's just simplify check.
2016-06-03 10:36:04 +02:00
e370806b38 Cleanup & simplify snapping functions
- the name of the enumerator `SNAP_NOT_OBEDIT` was changed to `SNAP_NOT_ACTIVE`.
- the parameter `snap_to_flag` was moved to outside `SnapObjectParams`.
- the member `use_object_edit` was renamed to `use_object_edit_cage`.
- added the arg `params` in `ED_transform_snap_object_project_ray`.
- simplifications in the loop of the function `snapObjectsRay`.
2016-06-03 16:56:16 +10:00
e9363483ca Fix possible uninitialized variable in snapping
Introduced in 0b5a0d84, thanks to Brecht for spotting.
2016-06-03 16:26:27 +10:00
8c154d67b2 Fix T48111: Auto-run fails w/ empty paths
Enabling auto-run, then excluding a path but leaving it set to a blank value would ignore all paths.
2016-06-03 15:28:32 +10:00
528539ef59 Fix T48575: Particle crash using 'Parting' setting 2016-06-03 15:13:20 +10:00
cd768a8df1 Add upstream information to wcwidth library 2016-06-03 02:43:24 +10:00
a055523899 Theme: 2.4x, correct graph region color 2016-06-03 01:59:53 +10:00
c5b2f12b36 Fix T48456: 2x pixel size clamps min brush size
Using double pixel size prevented 1px brushes

D2044 by @jeske
2016-06-03 01:11:12 +10:00
68d1348ca2 Fix T47637: Multiple multires objects in Sculpt mode make blender crash.
That was a nice and funny hunt, albeit rather time consumming!

To summarize, so far code was using a static global gpu_buffer for pbvh vbo drawing
of 'grid' types (multires mostly?).

There were two issues here:
1) Global gpu buffer was assigned to GPU_PBVH_Buffers->index_buf, but then nearly no
check was done when freeing that buffer, to ensure we were not freeing the global one
(not totally sure this one was actually causing any issue, but was bad and unsafe anyway).
Was solved by adding a flag to GPU_PBVH_Buffers to indicate when we are using some
'common' buffer here, which freeing is handled separately.

2) Main issue: if several multires objects in sculpt mode with different grid size
were present simultaneously, the global gpu buffer had to be resized for each object draw
(i.e., freed and re-allocated), but then the pbvh nodes from other objects storing freed reference
to that global buffer had no way to know that it had been freed, which was causing the segfault & crash.
Was solved by getting rid of that global buffer, and instead allocating one 'grid_commmon_gpu_buffer' per pbvh.

Told ya baby, globals are *PURE EVIL*!
2016-06-02 16:14:21 +02:00
ac8246cd89 Fix for GLSL uniform being update from inside glBegin/glEnd
This seems to be illegal and not productive anyway. Do it ahead of
a time now, which solves shading issues in edit mode and prevents
assert from happening.
2016-06-02 14:01:07 +02:00
Julian Eisel
664e854af7 Fix leak using UI_BTYPE_TEXT button w/o a callback
Moving ownership of the string to the button's 'rename_orig'
leaked when the button didn't have a uiAfterFunc.
2016-06-02 20:31:48 +10:00
64663b1f73 Cleanup: warnings in previous commit 2016-06-02 19:48:45 +10:00
cc7b817099 Minor edits to last commit
Failed with chunk merging disabled
2016-06-02 18:42:09 +10:00
0ce98b1ffb BLI_array_store: Move writing many chunks into a function
Minor optimization, avoid some checks each iteration.
2016-06-02 18:13:13 +10:00
7980c7c10f BLI_array_store: store max size in BArrayInfo 2016-06-02 18:05:11 +10:00
0bd8d6d194 Add extra validation checks to array-store 2016-06-02 16:41:41 +10:00
d931e958a1 Minor changes to help text
D2040 by @Blendify, also move 'Experimental Features' above more general help text.
2016-06-02 15:29:53 +10:00
1e9b222322 ShapeKey was missing lattice-flag
missed from 7a8bd2eae
2016-06-02 15:12:29 +10:00
c4b23a57a9 Fix T48566: Render-border minor offset issue 2016-06-02 12:53:04 +10:00
24712b1c0b Usual UI/i18n message cleanup (get rid of last remaining 'addon' too). 2016-06-01 20:38:30 +02:00
57d5ddc251 Revert "BLI_ghash: Fix initial over-allocation of mempool chunks."
Useless change in fact, sorry for the noise.

This reverts commit b08473680e.
2016-06-01 17:38:50 +02:00
6befc76265 Fix T48466: Multiple passes starting with 'Diffuse' in EXR file breaks its loading in Blender.
Issue here is that for Blender, any pass which name starts with 'Diffuse' is considered
a diffuse pass - and it does not really support several passes of the same type in renderresult.

So for now, passtype_from_name() is now checking whether a pass of same type already exists
in render layers, and return 0 (uknown passtype) in this case.
2016-06-01 17:31:42 +02:00
2c5dc66d5e Optimize mempool iteration
Around ~10% improvement in own tests.
2016-06-02 00:07:18 +10:00
b1704d18a1 Fix T48415: Segfault on opening .blend in which a 'surface' force object was saved in Edit mode.
In that case, surface modifier won't run (until surface object goes back to Object mode),
and its bvhtree remains NULL.
2016-06-01 15:29:19 +02:00
8cf8679b53 Revert "Correct invalid pointer-pair compare check"
This reverts commit d5e0e681ce.

Tsk, these functions return false on a match.
2016-06-01 23:08:40 +10:00
543c64ef74 Fix bug where corner boundary was straight when it should curve.
Some adjustments to how bevel edge 'profiles' are adjusted in some
cases. For the bug fix, wanted to handle cases of middle of three
coplanar beveled cases to make profile curve rather than linear
interpolate.
Also undid an earlier decision to make profile plane be perpendicular
to beveled edge i the non-coplanar case.
2016-06-01 08:51:08 -04:00
11af9e9a5b Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	intern/cycles/blender/blender_particles.cpp
	source/blender/depsgraph/intern/builder/deg_builder_relations.h
	source/blender/depsgraph/intern/depsgraph_build.cc
2016-06-01 14:34:11 +02:00
b08473680e BLI_ghash: Fix initial over-allocation of mempool chunks.
Code intended to create only one pool by default here, but code in `mempool_maxchunks()` would make it two.
2016-06-01 12:58:59 +02:00
9ed4233d9d Fix wrong vertex colors in edit mode 2016-06-01 11:53:28 +02:00
d0de2733d5 BI: fix counting of tangents, that was reset during recursion of init_render_nodetree 2016-06-01 12:28:48 +03:00
0e8570b415 GLSL: Attempt to fix errors in setting UV attributes 2016-06-01 10:26:18 +02:00
334d823b2b Depsgraph: Fix missing updates when modifying armature 2016-06-01 10:10:39 +02:00
1c292c9730 Fix/Workaround T48560: Color picker V fail w/ user defined RNA
Set the maximum soft-max to 1.0 when its left at FLT_MAX.
Since this causes problems using the slider.
2016-06-01 16:11:47 +10:00
Dalai Felinto
d85271572b Increase range of Font object textboxs
The current values were arbitrary. I'm keeping them as ui_range, but
internally there is no reason we can't use larger values.
2016-05-31 19:11:16 -03:00
aedeca7d1c BLI_mempool: Use an 'odd' FREEWORD for big/little endian
This also changes freeword to an intptr_t to ensure
not only the first 4 bits of a pointer are tested on 64bit systems.
2016-06-01 02:54:47 +10:00
d2bb0e660b Fix T46207: Slow OpenCL GPU bake and blown out baking Cycles render 2016-05-31 17:48:42 +02:00
Dalai Felinto
ad1c3bef8b Small API typo found while reading the API 2016-05-31 12:39:58 -03:00
a430c688ee Cleanup: unused defines 2016-06-01 00:26:14 +10:00
3df30c1a6e Cleanup: parenthesize defines 2016-06-01 00:19:01 +10:00
a0e91ef040 Fix T48554: Absolute grid snap fails w/ cursor pivot
Use center of selection when using absolute grid snapping and cursor pivot.
2016-06-01 00:01:17 +10:00
d5220d23f9 Cycles: Fixes for recent refactor
- add_vertex() can be called from split_vertex() which does not guarantee
  to have properly pre-allocate arrays.

- Need to check whether Cycles is compiled with OSL in XML reader.
2016-05-31 15:32:31 +02:00
230cf2e46d Buildbot: Attempt to fix buildbot after recent change 2016-05-31 15:28:32 +02:00
9e77a03f63 Buildbot: Use proper list management function
Spotted by Campbell, thanks!
2016-05-31 15:20:14 +02:00
f1f7f6d4b1 Buildbot: Pass proper generator for MSVC 2015 builder 2016-05-31 14:42:18 +02:00
e9c8917e10 Properly handle vertex color color space for Cycles GLSL
A bit tricky, need to pass additional information about what the attribute
is and how to deal with it.

BI path stays unchanged, just to make things simplier for now.

Fixes T48555: Cycles GLSL- Incorrect Vertex Color results from Attribute node
2016-05-31 14:41:51 +02:00
19cfc84328 CMake/ Visual Studio 14 2015, Use one library name for openal for both 2013 and 2015 2016-05-31 14:16:29 +02:00
9725661c60 Cycles GLSL: Make it work with software opengl mode 2016-05-31 12:31:16 +02:00
4388b29e98 Cycles: Add human readable sizes to debug output
Some of these values can get quite large and are hard to read, adding this
makes it easy to read them at a glance.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2039
2016-05-31 06:13:54 -04:00
a2aa44370b Fix T48556: Missing transparent shadows on AMD OpenCL
We had transparent shadows disabled for some time because they were causing
drivers to crash. Can't reproduce that issue anymore with current drivers,
so will enable them and see how it goes.
2016-05-31 11:48:07 +02:00
ea8a7397e4 Fix T48553: Cycles GLSL Box projection produces strong artifacts 2016-05-31 09:50:24 +02:00
4f730b4708 Fix T48552: Ctrl-D to add drivers shows disabled menu items 2016-05-31 16:30:44 +10:00
5186143d2c Theme: 2.4x disabled menu text wasn't greyed out 2016-05-31 14:55:55 +10:00
3ed5da0479 Fix T48547: Shrinkwrap fails w/ auxiliary target
Error in 0b5a0d84
2016-05-31 14:37:06 +10:00
0d4a7d50c6 Fix broken Cycles curve motion radius after recent refactor, and fix warnings. 2016-05-31 00:21:33 +02:00
1482826075 Add 'multi small' testcase to performance Ghash tests.
This new test simply inserts and lookup a lot of time on very small ghashes
(most are < 17 items).
2016-05-30 20:04:43 +02:00
7e120f3a74 Shrinkwrap: OMP->BLI_task.
Gives little to no speedup (a few percents at best).
2016-05-30 17:30:55 +02:00
06969fdf1b Depsgraph: Small optimization to update flushing
Gives about 5% speedup in scene with lots of nodes (army_of_clones.blend)
2016-05-30 16:56:05 +02:00
1e7e183787 Fix T48527: Maya keymap fails w/ knife snap 2016-05-30 22:45:46 +10:00
c9799b68f1 Depsgraph: Fix compilation with new depsgraph disabled 2016-05-30 14:44:56 +02:00
f0ee7f9544 CMake: Workaround to get Libmv compiled with latest Gcc 2016-05-30 14:37:33 +02:00
ce13a7b609 Fix: Add a hard upper limit for fontsize of Text Strip's text
Although there is a "UI limit", it's necessary to have the hard limit on the
property too. I noticed this bug first hand just now, when, after accidentally
setting the size to 8188 (due to a combination of typos and sluggish UI refresh)
my machine locked up completely when trying to jump to that frame. It got so bad
that I had to do a hard reset to fix it - so, it's possible that even 1000 or 2000
as used now are actually way too large still.
2016-05-30 23:45:58 +12:00
da975c59c2 GLSL: Fix voronoi texture giving different results form rendered 2016-05-30 13:07:11 +02:00
673fabbb64 Depsgraph: Fix wrong layers flush form children to parent
It was possible to have issues in cases when several child dependencies
goes to IDs with different layers. In this case order of flushing was not
really well defined, which could lead to cases when indirect dependency
via invisible object wouldn't work.

Need some sort of barrier to prevent scheduling of parent nodes for until
all children are done, but that's becoming quite nasty thing to implement.

Added a temp field to component for now. maybe it's not so crazy actually
and we might use it for evaluation as well, so we wouldn't flush updates
to components which does not affect visible stuff.
2016-05-30 12:35:03 +02:00
Ralf Hölzemer
4aaf7b0c7a Support all Cycles image texture projections in the GLSL viewport
This patch enables Tube, Sphere and Box projections in GLSL for the image texture node.

Reviewers: sergey

Projects: #nodes, #opengl_gfx

Differential Revision: https://developer.blender.org/D2036
2016-05-30 10:29:46 +02:00
0f86a545e7 GLSL: Fix magic colors being off 2016-05-30 10:22:18 +02:00
163e46bbea GLSL: Brick texture uses bit operations, which seems to be a failure on some Intel cards 2016-05-30 10:22:18 +02:00
665cb1b291 Change the hash-table to be 3x total items to hash 2016-05-30 18:00:03 +10:00
bd6a64ced7 Remove accidental static var 2016-05-30 17:27:06 +10:00
91bfdacde2 Editmesh undo memory optimization
Previously a whole mesh was stored between undo steps,
This commit uses BLI_array_store to de-duplicate memory use between undo steps.

Memory saving depends entirely on kinds of edits performed,
in own tests 5x-15x less memory use is common.

Compacting the memory does give some overhead however its done in a background thread
so its not blocking in most cases.

New behavior and threading can be ifdef'd out to check for regressions.

See D2026 for details.
2016-05-30 16:27:15 +10:00
8a7d1f3b3c BLI_array_store tests
Ensure the data is valid once expanded,
and that de-duplication is working as expected.
2016-05-30 16:27:12 +10:00
53b60eed45 Add BLI_array_store copy-on-write API
This supported in-memory de-duplication,
useful to avoid in-efficient memory use when storing multiple, similar arrays.
2016-05-30 16:18:24 +10:00
11b0874db0 Code refactor: store ShaderNode enums as enum rather than ustring. 2016-05-29 20:30:16 +02:00
a70a435f28 Code refactor: centralize OSL node creation in shader manager. 2016-05-29 20:30:16 +02:00
af073e149b Code refactor: pass ShaderInput to constant_fold, so it supports arbitrary types. 2016-05-29 20:30:16 +02:00
9bd2820aaf Code refactor: add separate RGB to BW node and rename some sockets. 2016-05-29 20:30:16 +02:00
eac7ed8d04 Code refactor: minor node and node type utility functions and changes. 2016-05-29 20:30:16 +02:00
7cd18dda7d Fix debug mode assert in subd code after recent refactoring. 2016-05-29 20:30:16 +02:00
e1003c2ead BKE's DerivedMesh: get rid of last OMP usage.
Not replacing with some BLI_task_stuff here, tests show this is pointless
(in absolute best case - i.e. single huge mesh in scene - parallelizing here switches
from 0.8ms to 0.5ms for that piece of code - with something like 750ms per frame update...).
2016-05-29 20:14:42 +02:00
3ed2b11a4d Fix T48507: Symmetrize doesn't work properly on Bendy Bones 2016-05-29 19:37:40 +12:00
df76d60267 Fix: Flip logic order for autokeying checking to cope with files where the flags have been set incorrectly
Sometimes the autokeying flags don't get set correctly (i.e. the "mode" flags
used for 'Add + Replace' vs 'Replace Only' aren't set), meaning that the old logic
would always fall through to the "replace only" case. When this happens, the resulting
behaviour can be quite strange and hard to debug. This fix prevents problems like
this from continuing to be an issue...
2016-05-29 19:08:45 +12:00
cd4d80fac6 added missing include 2016-05-29 01:38:14 +02:00
af185e1154 fixed some incompatible definitions (to make this work also on linux) 2016-05-29 01:30:20 +02:00
5366900ace Added support for non numeric bone layer labels (could happen when importing from other tools)
Differential Revision: https://developer.blender.org/D2037
2016-05-29 00:37:46 +02:00
8b2c67c3c3 collada exporter: fixed wrong check for bone roll value 2016-05-28 20:52:32 +02:00
362bd116d9 Fix T48529: NLA : viewport not updated after Track muted/unmuted.
Not sure why, but ANIM_animdata_update() totally ignored NLAStrip type of bAnimListElem.

For now only added support for ANIM_UPDATE_DEPS type of update, don't know whether
others are needed in this case or not... time will say.
2016-05-28 19:52:31 +02:00
8e26111020 Collada: Adding support for bone roll and bone layers
Differential Revision: https://developer.blender.org/D2034
2016-05-28 19:22:06 +02:00
001ba5bdf5 Code refactor: nodify object and mesh, but not used for XML yet.
Differential Revision: https://developer.blender.org/D2016
2016-05-28 18:40:09 +02:00
c96a4c8a2a Code refactor: modify mesh storage to use arrays rather than vectors, separate some arrays.
Differential Revision: https://developer.blender.org/D2016
2016-05-28 18:31:00 +02:00
b94bfe4cd8 Code refactor: make ShaderNode match Node a bit more, reusing types and enums.
Differential Revision: https://developer.blender.org/D2016
2016-05-28 15:49:15 +02:00
a9f7bbc9f8 PyRNA: Fix repr used /w arrays
RNA arrays now display their index, with support for multi-dimensional arrays.
2016-05-28 22:30:25 +10:00
98ad473324 Code refactor: nodify Cycles camera and fix some mistakes in XML node read.
Differential Revision: https://developer.blender.org/D2016
2016-05-28 14:07:19 +02:00
9d5aead88f Fix T48534: color picker hex #RRGGBB input allows typing one character too many.
Fix suggested by Daniel Rivera.
2016-05-28 12:38:21 +02:00
4ae507180e Fix T48498: stereo camera interocular distance should not have a hard max limit. 2016-05-28 12:22:34 +02:00
62f85add48 Fix T48526: Cycles viewport render incorrectly influenced by pixel aspect ratio.
This reverts 72592cfb, needs more refactoring to do that cleanup.
2016-05-28 11:57:27 +02:00
Ralf Hölzemer
739bf147a9 Fix T48533: camera node view vector wrong for Cycles GLSL.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2033
2016-05-28 11:38:10 +02:00
94e18c59f8 Add missing include 2016-05-28 10:25:46 +10:00
dc07a5561f Cleanup: Further tweaks for consistency and simplifications.
Now I can start adding half float without adding even bigger mess to all these functions. ;)
2016-05-27 23:35:29 +02:00
2f457b7649 Cleanup: Simplify and de-duplicate assignements in the ImageManager constructor. 2016-05-27 23:12:13 +02:00
2ee063868d Cleanup: Shorten texture variables, tex and image was kinda redundant.
Also make prefix consistent, so it starts with either TEX_NUM or TEX_START, followed by texture type and architecture.
2016-05-27 22:58:33 +02:00
bd678f179b ndof: detect SpaceMouse Enterprise
New device! Lots of buttons!
2016-05-27 15:34:40 -04:00
9449126d7a Depsgraph: Accidentally removed one line too much 2016-05-27 18:30:01 +02:00
55b24bef55 Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:

- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where

So in this commit the following changes are done:

- STL is prohibited, it's not really predictable on various compilers,
  with our BLI algorithms we can predict things much better.

  There are still few usages of std::vector, but that we'll be
  solving later once we've got similar thing in BLI.

- Simplify foreach loops, avoid using const_iterator all over the place.

- New directory layout, which is hopefully easier to follow.

- Some files were split, some of them will be split soon.

  The idea of this is to split huge functions into own files with
  good documentation and everything.

- Removed stuff which was planned for use in the future but was never
  finished, tested or anything.

  Let's wipe it out for now, and bring back once we really start using
  it, so it'll be more clear if it solves our needs.

- All the internal routines were moved to DEG namespace to separate
  them better from rest of blender.

  Some places now annoyingly using DEG::foo, but that we can olve by
  moving some utility functions inside of the namespace.

While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).

Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
3d86a5bc72 more correct Normal Map node behavior for tangent mapping in Cycles Viewport 2016-05-27 14:45:13 +03:00
108b36f1ce Add upstream information to libraries 2016-05-27 20:03:27 +10:00
7dae62cde0 Cycles: Simplify code around debug stats in BVH traversing 2016-05-27 10:55:48 +02:00
c3eb7c4e9d Add some more information about extern libraries 2016-05-27 09:27:44 +02:00
1e32951477 OpenGL: use EXT version of FBOs
Blender 2.7x supports OpenGL 2.1 which has FBO only as an extension.

It was working fine, but this is more correct.
2016-05-27 00:19:32 -04:00
ab4aa2e3fb fixed collada api call for blenderplayer 2016-05-26 19:16:18 +02:00
1346482d23 moved is_leaf_bone() to collada utils for reuse in exporter and importer 2016-05-26 18:22:36 +02:00
29aa13cfa2 fix: Import of meshes with holes is now reported as WARNING (unsupported)
improved: add support for bone tail export/import using Blender Collada profile

Differential Revision: https://developer.blender.org/D2031
2016-05-26 17:53:25 +02:00
6a7ce064ad fix: Import of meshes with holes is now reported as WARNING (unsupported) 2016-05-26 17:41:41 +02:00
f87842a73a Image viewer scopes update: OMP->BLI_task.
Gives over 50% faster scope update (from 4.5ms to 2.2ms here with SD shot)!
Probably mostly due to more clever usage of thread-local data (which avoids any lock,
when OMP code had a rather stupid critical section for minmax)...
2016-05-26 14:33:26 +02:00
d5e0e681ce Correct invalid pointer-pair compare check 2016-05-26 22:20:12 +10:00
7424ded9c7 Cleanup: glsl style 2016-05-26 18:53:09 +10:00
fe766d9c7a BMesh: don't alloc zero sized select elem array 2016-05-26 15:56:12 +10:00
f2ba13964d Fix T48514: Cycles toon glossy BSDF not respecting reflective caustics option. 2016-05-25 21:13:24 +02:00
b49185df99 Cycles CUDA: reduce branched path stack memory by sharing indirect ShaderData.
Saves about 15% for the branched path kernel.
2016-05-25 21:13:24 +02:00
7928030eff Fix T47257: bevel crash when there are internal faces.
Bevel had assumed that when rebuilding a face that touches
a vertex with beveled edges, the edges of the face at that vertex
would be adjacent in internal order. That is not necessarily true
if there are edges with more than two faces attached.
We could just prohibit beveling any edges that touch a vertex
where this happens (we already don't bevel non-manifold edges)
but the use case in the model of T47257 seems reasonable.
Also had to fix the edge-ordering code, and the face reconstruction
code to take care of cases where the face normal may not be as expected.
2016-05-25 08:48:46 -04:00
cb2b776332 dd upstream information to libraries 2016-05-25 22:27:53 +10:00
cec629ae42 Depsgraph: Simplify some loops using foreach() 2016-05-25 13:52:02 +02:00
f83f7bb988 Add warning to Mesh.from_pydata 2016-05-25 21:35:45 +10:00
dcd2136f95 Depsgraph: Solve wrong datamask calculated by depsgraph
This is a weak concept, but nice t support it for now, so we can enable
new depsgraph by default earlier.
2016-05-25 13:00:30 +02:00
84c7f427f2 Cycles: Yet another fix for textures limit 2016-05-25 12:49:02 +02:00
15911eebda Move editmesh undo into its own file 2016-05-25 19:12:43 +10:00
18b418e8e0 Cycles: Fix wrong cuda textures limits 2016-05-24 17:02:19 +02:00
dc5a6a0aed Cycles: Fix wrong render results when using multiple OpenCL devices 2016-05-24 16:57:57 +02:00
faec430914 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/physics/particle_edit.c
	source/blender/editors/transform/transform_snap_object.c
	source/blender/editors/util/undo.c
	source/blender/makesrna/intern/rna_object_force.c
2016-05-24 16:48:10 +02:00
5494ea1d08 Fix own mistake in D1120: wrong indexing of UV maps during tangent calculation 2016-05-24 17:43:57 +03:00
42b26206c6 Fix T48508: Cycles Regression / Crash 2016-05-24 14:53:34 +02:00
2e190abf70 Fix T48496: Viewer function in NodeWrangler addon don't work in Material Shading mode 2016-05-24 14:39:28 +02:00
800de8bffd Cleanup: indentation 2016-05-24 20:34:53 +10:00
e1dd83b399 Fix T48486: Not enough precision in Volume Sampling Step Size input
Volumes might be small, makes sense to use more precision here.
2016-05-24 12:17:06 +02:00
a7c3ec4feb GHOST cleanup (null check before delete, and 0 -> NULL for pointers).
Based on patch from Lawrence D'Oliveiro (ldo) in T48499.
2016-05-24 11:49:30 +02:00
0b588f0905 Forgot this in previous commit 2016-05-24 11:48:19 +02:00
8f04a228f7 Add upstream information to libraries 2016-05-24 11:46:53 +02:00
93b3f1c856 Sequencer's histogram view: OMP -> BLI_task.
New code using loop/finalize model is about 45% faster (from 4.4ms tp 2.4ms per frame,
overall playback of single shot in sequencer in this preview mode goes from 40 to 45fps).
2016-05-24 09:34:55 +02:00
886349fd98 ndof: build system cleanup
Only Linux needs a lib linked in (libspnav).

ghostndof3dconnexion refers to an obsolete Mac driver shim.
2016-05-24 01:57:17 -04:00
84e0839537 ndof: enable Linux support by default, unless libs missing 2016-05-24 00:35:17 -04:00
999d5a6785 Cycles CUDA: reduce stack memory by reusing ShaderData.
57% less for path and 48% less for branched path.
2016-05-23 22:29:24 +02:00
af4a04eae0 Fix T48487: Physics cache names allow (back)slashes, which breaks its handling.
For now, just validate new pointcache names as if they were filnames.

Ideal solution would be rather to validate names in `ptcache_filename()`, but it would
likely break some existing caches - and we'd also have to ensure we still have
uniqueness of name after it has been cleaned up, wich would not be trivial at this stage.

So let's go for simple solution for now, especially since this part of code is to be
fully rewritten in 2.8...
2016-05-23 17:45:44 +02:00
Ralf Hölzemer
a6b218af2e Enable correct GLSL output for cycles normalmap node
See T48453 for details and test scenes

Reviewers: a.romanov, sergey

Reviewed By: a.romanov, sergey

Projects: #opengl_gfx, #nodes

Differential Revision: https://developer.blender.org/D2011
2016-05-23 16:25:44 +03:00
66dceb2bed Add TODO about vertex color linearization to GLSL code
It's not really clear at this moment how we can detect cases
when attribute needs linearization. For now added a comment
so we don't forget about this, hopefully.
2016-05-23 14:43:03 +02:00
12f86a4e48 Fix wrong scale of vertex color values when doing border render of Cycles viewport 2016-05-23 14:40:04 +02:00
6d84a4ecfd Fix wrong vertex color in BI GLSL mode
The issue was caused by recent normalization added to the GLSL attributes.
2016-05-23 14:29:08 +02:00
2aa4b6045a Cycles: Fix wrong closure counter in feature adaptive kernel
Some closures were missing from calculation, leading to an array
under-allocation, presumable causing memory corruption issues with
emission shaders on OpenCL and was causing issues with Volume 3D
textures with CUDA.

The issue was identified by Thomas Dinges, the patch is different
from the original D2006. See the brief discussion there. Current
approach is similar (or the same) as Brecht suggested.
2016-05-23 14:09:27 +02:00
6894bb0555 Fix T48334: Cycles standalone xml import of uv coordinates
In Cycle standalone, the xml import of uv's is done in a way that
a vertex could only have one unique uv coordinate. In practice it
is most of the time not the case.

Patch by Laurent Boiron, thanks!
2016-05-23 13:38:15 +02:00
Stefan Werner
7a35a0f419 Fixed a rare case of NaN in Cycles
This fixes a rare case where NaNs could exist inside Cycles.

When certain invalid meshes were passed in, Cycles would try too normalize
a zero length normal during its setup stage. While it does check against
division by zero, it still returns a zero length normal and passes it on to
the path tracing kernel. The kernel then operates under the assumption that
normals are valid, and in the case of such a zero length normal, would
eventually create NaNs that propagate through and result in black pixels.

Reviewers: #cycles

Subscribers: brecht, sergey

Projects: #cycles

Differential Revision: https://developer.blender.org/D2008
2016-05-23 13:34:14 +02:00
cdcb0826ee B-Bones improve handle calculation
This changes the bezier handles b-bones to fit to a circle more closely.
2016-05-23 21:35:54 +10:00
a17cba339c BLI_math: Add function to calculate circular cubic curve tangents 2016-05-23 21:35:54 +10:00
abe98de63c Cycles: Fix missing feature reported by the Volume node 2016-05-23 12:58:25 +02:00
065c052cfb Cycles: Fix missing volumes support for feature-adaptive viewport render 2016-05-23 12:36:31 +02:00
cbbb021596 Fix for all OpenGL lights affecting Cycles viewport, regardless of their Enabled state
Was a regression since e1b8a5d.

Probably not very optimal fix, but better than a regression anyway.
2016-05-23 12:10:53 +02:00
de8494b54e Cleanup: glsl indentation, line length 2016-05-23 19:56:50 +10:00
caec6f3d41 Code cleanup, stick closer to a blender code style in GLSL shader 2016-05-23 10:31:36 +02:00
a830280688 Support Vertex Color in GLSL viewport for Cycles
The title says it all actually.

Added special custom data type, because we don't know in advance
whether we're referencing UV or Color layer. Also made it so vertex
attributes are normalized.

TODO: Border render in viewport ignores the normalization of the
attribute array for some reason, will be looked into still.

Reviewers: mont29, brecht, campbellbarton

Reviewed By: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D2022
2016-05-23 10:23:43 +02:00
a2669b0cbf Cleanup: Deduplicate image loading functions using templates. 2016-05-22 23:24:26 +02:00
84a9d171da Cleanup: Use short condition style. 2016-05-22 22:47:37 +02:00
27e4ce0cf6 Fix Cycles warning in release builds. 2016-05-22 19:42:45 +02:00
f7c28a66e2 Fix Cycles compile errors with GCC due to double promotion as errors. 2016-05-22 19:17:22 +02:00
2f978656ab Support Musgrave texture for Cycles GLSL viewport
Only for non-OSX viewport!
2016-05-22 19:10:15 +02:00
22ff9c5568 Fix T48497: Stupid typo in recent own BLI_task forloop work that broke non-parallelized case. 2016-05-22 18:35:44 +02:00
ca03eddfcc Cleanup: remove Cycles layer bits checking in the kernel.
At some point the idea was that we could have an optimization where we could
render multiple render layers without re-exporting the scene, by just updating
the layer bits. We are not doing this now and in practice with the available
render layer control like exclude layers it's not always possible anyway.

This makes it easier to support an arbitrary number of layers in the future
(hopefully this summer), and frees up some useful bits in the kernel.

Reviewed By: sergey, dingto

Differential Revision: https://developer.blender.org/D2020
2016-05-22 17:36:38 +02:00
9b9921b765 Code refactor: nodify Cycles shader and lights.
Differential Revision: https://developer.blender.org/D2016
2016-05-22 17:29:25 +02:00
e7d13b8a1d Code refactor: nodify Cycles background and film.
Differential Revision: https://developer.blender.org/D2016
2016-05-22 17:29:25 +02:00
0062d9f58c Code refactor: nodify Cycles integrator.
Differential Revision: https://developer.blender.org/D2016
2016-05-22 17:29:25 +02:00
226dc75e77 Code refactor: add generic Cycles XML node read and write functions.
Differential Revision: https://developer.blender.org/D2016
2016-05-22 17:29:25 +02:00
ec51175f1f Code refactor: add generic Cycles node infrastructure.
Differential Revision: https://developer.blender.org/D2016
2016-05-22 17:29:24 +02:00
841d008b98 Fix missing Ignore option for GLSL bump 2016-05-22 16:47:06 +02:00
309f26014b Use previous shading mode for border render in viewport
This way we can have border rendered part in the viewport and have
everything else material/texture shaded.
2016-05-22 16:23:26 +02:00
0cc514ec84 Make Shift-Z in viewprot a toggle between current shading mode and rendered one
This way it is now possible to toggle between material and rendered shading
while previously rendered viewport will always go back to solid shading.
2016-05-22 15:44:18 +02:00
120492ace9 Cycles: Support bump mapping in GLSL viewport
This commit implements Bump node in GLSL, making it possible to
see previews of bump mapping in viewport without need to render.
Nothing really fancy going on here, just uses internal dFdx/dFdy
functions to get derivatives of the surface and map itself.
Quite basic but seems to behave correct-ish.

This commit also makes Displacement material output to affect
viewport shading by re-linking unconnected Normal input to a
node which was used for displacement output (via Bump node).

Intention of all this is to make it really easy to do bump map
painting with Cycles as an active render engine.

Reviewers: campbellbarton, mont29, brecht, psy-fi

Reviewed By: brecht

Subscribers: Blendify, eyecandy

Differential Revision: https://developer.blender.org/D2014
2016-05-22 15:12:14 +02:00
6115267a84 CMake: Solve compilation error with pre-compiled libraries and new GCC-6
Since version 6 G++ switched to C++11 by default, which breaks some logic
around WITH_CXX11 checks in out CMake files, leading to compilation errors.
This is easy to solve by explicitly enabling older C++ standard when C++11
was not explicitly enabled by CMake options.

However, G++-6 will also use new ABI by default even if older standard was
specified in the compiler options. This is being addressed by a special
define flag.

This tricks made it possible to use new G++-6 without need to recompile
any of pre-compiled libraries.

However, this might break compilation with existing system libraries, which
might already be using new ABI. We can't address this automatically, so
now we simply default WITH_C11 and WITH_CXX11 options to whatever defaults
of the current compiler are. This means, for G++-6 we'll set WITH_CXX11 to
truth. This should make linking with system libraries working just fine,
but to make pre-compiled libraries we still might need to disable CXX11.

This should work fine work for a new environments with G++-6 and install_deps
script run from scratch there, because C++ standard will be the same for
both Blender dependencies and Blender itself.
2016-05-22 13:48:52 +02:00
e21af38f69 Fix T48476: 'Recalculate Bone to Cursor' fails 2016-05-22 17:47:39 +10:00
24a3a9e8a3 Cleanup: remove unused doxy config 2016-05-22 17:15:08 +10:00
9bf09200d2 ndof: simplify Mac build
We don’t require the 3Dconnexion driver framework at build time.

No special link flags or include paths needed.
2016-05-21 18:29:55 -04:00
Sebastian Ullrich
6bd248cd65 Python API: add material to uniforms from gpu.export_shader.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1457
2016-05-21 16:46:42 +02:00
4bbc0731a0 Forgot to remove omp header include... 2016-05-21 16:12:30 +02:00
951db20862 Dynamicpaint: fix (unreported) missing progress bar in early baking stage.
Nothing was shown in UI during pre-bake step, while it can take several minutes
to complete with heavy geometry.
2016-05-21 16:09:35 +02:00
c1b7acda4c DynamicPaint: massive refactor, replace all OpenMP usage by BLI_task and other optimizations.
This commit makes Dynamicpaint modifier evaluation (during playback) a few percents quicker.
However, it makes dynapaint's 'image sequence' baking about 33% quicker (from 119 to 77 seconds
in own heavy test), partly due to switch to BLI_task itself (about 20%), and partly due to
optimizations (remaining ~13%).

As usual, did a lot of tests here to ensure nothing is broken, but a lot more users' testing would definitively
be welcome too! ;)

Note that some quite meaningless omp forloops have been removed (parallelizing thousands of vec copy does
make it two or three times quicker, but the few hundreds of microseconds gained do not make any difference
in a hundreds millisecond process).

Also, this code could still use a lot more cleanup (naming etc.), the way it (tries to) handle malloc faults
is also totally flacky and makes the code horribly verbose and convoluted in some places - without actually
catching all possible faults (memarena could make it more easy to handle here), etc.
2016-05-21 16:01:09 +02:00
3a73d31c56 BKE Mesh mapping: add 'vert to looptri' mapping generator. 2016-05-21 15:20:06 +02:00
92a3ac4dd2 GPencil: Add hotkeys for the "Delete Active Frame" operator
Usage:
* D+X     - Works anytime, anywhere
* Shift-X - Works in EditMode only
* Via Delete Menu - EditMode only

Often doing video tutorials or perhaps during dailies/shot review you want to
quickly get rid of a quick scribble you made for making a point, without having
to undo (i.e. maybe you edited some objects in between) and/or without having
to use the eraser (i.e. it'd take too long to cover the entire area).
2016-05-21 18:34:06 +12:00
b730238e6d GP Sculpt: Make the cursor more visible on light backgrounds
On light coloured backgrounds (especially on white), it was impossible to see
where the cursor was. This commit adds a second ring (black) to the cursor so
that on light backgrounds, even if the light ring isn't visible the black one
will be.
2016-05-21 18:34:05 +12:00
2203444f3f Hopefully fix OMP/MSVC crap... 2016-05-21 00:54:37 +02:00
a055395487 Dynapaint: Serious cleanup and optimization of dynamicPaint_createUVSurface (mostly).
Gives 3-4% speedup in pre-bake step (from 112 to 108 seconds with own heavy test file).

Note that here we have a huge potential performance boost if we replace the flat
`Bounds2D *faceBB` array of UV tris bounding boxes by a real 2D AABB tree (right now,
we can loop over all UV triangles times the number of pixels of the surface times 5...).
2016-05-20 23:18:15 +02:00
f5a4beffdd Fix GLSL shader failing to compile on OSX
Bit operations are not supported on legacy profile of OSX.
2016-05-20 22:54:27 +02:00
79d69bb9e3 Makefile: Use hidden FORCE target 2016-05-21 05:48:10 +10:00
ecf534e4c5 Support Cycles wave texture in GLSL viewport. 2016-05-20 21:21:57 +02:00
d5b843ba9d Support Cycles noise texture in GLSL viewport 2016-05-20 18:58:56 +02:00
bff095184a Cleanup: Don't use f suffix for values in GLSL
Was giving an issues in the past, will avoid it for now.
2016-05-20 18:14:04 +02:00
c6ea288bcf Support voronoi texture in GLSL shading
It gives some slight differences on the plane corners, but can't
really figure out source of the issue here yet.

It's still better than fully white texture for the previews anyway.

At this point we should perhaps ifdef chunks of the code in order
to have faster GLSL compilation and probably even faster compiled
code. Will look into this shortly.
2016-05-20 18:05:29 +02:00
ca8419ed6e Support Cycles magic texture in GLSL viewport 2016-05-20 16:58:56 +02:00
a5a05fc291 Cycles: Fix long compile time with MSVC.
Compile time per kernel increased alot after recent image commits, re-shuffle some code to fix this.

Patch by "LazyDodo".

Differential Revision: https://developer.blender.org/D2012
2016-05-20 16:50:29 +02:00
7ab55d8947 Support gradient Cycles texture in GLSL viewport 2016-05-20 16:39:45 +02:00
b79214bbc5 Support Cycles brick texture in GLSL viewport 2016-05-20 16:13:44 +02:00
0405bbeae2 Support Cycles's checker texture in GLSL shading 2016-05-20 15:18:40 +02:00
9d19533117 Fix T48472: issue in array refactor, causing performance regression in BVH build. 2016-05-20 10:58:11 +02:00
6e416b6bdf Fix T48470: Bendy Bones: Custom Handle References not being cleared when bone deleted
In addition to the original bug report, I've gone through cleaning up a range of
related bugs which only became clear when hunting around the code...

* Custom Handle References weren't getting cleared when the bones they used got
  deleted.  But, neither was the custom bone shape location/transform reference.

* Various places where posebone settings are copied around were also missing code
  to handle the new Bendy Bone properties.

  (WHY DO WE HAVE SO MANY VARIATIONS OF COPYING POSE DATA!?!?)

* If duplicating a Bendy Bone with custom references, and the custom references
  are also selected/duplicated, the new Bendy Bones will use the corresponding
  duplicated bones
2016-05-20 19:09:27 +12:00
75a31c3670 Add Peak Memory as render stamp option
This commit adds Peak Memory to the stamp options, the value is the same one that is already shown in the image viewer.

Requested by @nutel.

Reviewers: campbellbarton

Subscribers: campbellbarton, nutel

Differential Revision: https://developer.blender.org/D1989
2016-05-19 22:57:38 +02:00
ad14c471eb Cycles: Add XML parsing of MappingNodes to Cycles Standalone
Reviewers: dingto, sergey

Differential Revision: https://developer.blender.org/D2009
2016-05-19 21:28:57 +02:00
01e86b2c7d Cleanup: warnings 2016-05-20 05:14:17 +10:00
38f65c500c Fix T48204: Generic Tablet on Linux - Erratic strokes with pressure sensitivity enabled.
Once and for all - I hope!

So, for the records: Xinput1 events' valuators have a first_axis and axis_count defining the 'range'
of valid axes for that event - but valid data in the valuator's array **always** start at zero
(which means that, if event reports first axis as being axis 2, axis 2's value is in axis_data[0]).
2016-05-19 20:30:48 +02:00
dedc995018 Cycles / CUDA: Don't use bundled kernel if Adaptive is enforced by the user. 2016-05-19 16:32:57 +02:00
c5893db5cc Cleanup: misleading indentation 2016-05-19 23:37:23 +10:00
a4a968fd99 Dynapaint: parallelize drip effect.
Was not so far, because this effect is not modifying its 'own' PaintPoint, which means
it's not threadsafe. Since a global lock (mutex or spinlock) would not be much efficient
(we need to lock a given point pretty much all the computaion cycle), and since locking
a same PaintPOint from different threads at the same time is *very* unlikely,
solution here is to use an 'array of locks', one for each PaintPoint (same thing as BLI_bitmap,
using atomic ops to set/clear bits).

Here in own test (complex dynapaint over a huge sphere combining all dynapaint types), it gives
20% speedup of the whole dynapaint simulation!

Note: maybe we'd want to move that kind of bitlock into BLI lib some day - not totally sure how,
so let's keep it local for now...
2016-05-19 14:44:37 +02:00
4b810127ba Dynapaint: fix use of normal normalization in dynamicPaint_generateBakeData().
Vertex's normal is always normalized - and its conversion from short to float should not change that!
On the other hand, linear interpolation of three normals **does not give a normalized vector**
(unless all three inputs are exactly the same).

Also, minor optimization, avoid recomputing that interpolated normal twice for each PaintUVPoint.
2016-05-19 14:44:37 +02:00
c9f1ed1e4c Cycles: Add support for bindless textures.
This adds support for CUDA Texture objects (also known as Bindless textures) for Kepler GPUs (Geforce 6xx and above).
This is used for all 2D/3D textures, data still uses arrays as before.

User benefits:
* No more limits of image textures on Kepler.
 We had 5 float4 and 145 byte4 slots there before, now we have 1024 float4 and 1024 byte4.
 This can be extended further if we need to (just change the define).

* Single channel textures slots (byte and float) are now supported on Kepler as well (1024 slots for each type).

ToDo / Issues:
* 3D textures don't work yet, at least don't show up during render. I have no idea whats wrong yet.
* Dynamically allocate bindless_mapping array?

I hope Fermi still works fine, but that should be tested on a Fermi card before pushing to master.

Part of my GSoC 2016.

Reviewers: sergey, #cycles, brecht

Subscribers: swerner, jtheninja, brecht, sergey

Differential Revision: https://developer.blender.org/D1999
2016-05-19 13:14:37 +02:00
03f846ea12 Ignore vertex color when doing texture paint
It was totally useless to multiply diffuse color with the vertex color
when doing texture painting. It was masking actual texture and only was
forcing artists to create an empty vertex color layer to work this around.
2016-05-19 11:11:21 +02:00
89df6720be CMake: use signed char for recastnavigation
External libraries may need char to be signed.
2016-05-19 07:36:32 +10:00
20678138f7 Cleanup: CMake indentation
Also remove outdated comment
2016-05-19 07:12:14 +10:00
6988061bf1 Cuda wrangler: Fix very nasty bug with multiple scalar type qualifiers 2016-05-18 18:01:37 +02:00
3289f174ee Fix missing modifiers for mesh objects
All modifiers for all non-lattice objects were disabled after recent commit.
2016-05-18 17:36:52 +02:00
e34e5ce332 Theme Color Sets - Dynamically generated icons
The theme color set selector (for Bone Groups) will now show previews of
what each color set looks like. It does so using a 3-color band icon.
2016-05-19 03:25:38 +12:00
f74c7fcca2 Fix T47727: Weird bake results with non integer color values 2016-05-18 15:11:05 +02:00
7a8bd2eaea Fix T47737: Lattice crashes w/ smooth modifier
Add flag for modifiers that support lattice
2016-05-18 22:46:29 +10:00
cade8e25c6 Revert string splitting
Caused error on OSX
2016-05-18 22:05:53 +10:00
1283c66146 Revert part of 4adffde02c to get Windows (MSVC2013) compiling again 2016-05-18 23:42:53 +12:00
41a6829021 Depsgraph: Fix rest pose still using bone constraints 2016-05-18 11:38:52 +02:00
792e147e2c Cycles: Fix compilation error of CUDA kernels after recent volume commit
Apparently the code path with malloc() was enabled for CUDA.
2016-05-18 11:15:28 +02:00
cbe7f9dd03 Cycles: Pole merging for spherical stereo
The idea of pole merge is to fade interocular distance after a certain
altitude to zero when altitude goes closer to a pole. This should prevent
annoyances looking up in the sky or down to the bottom.

Works for both panorama and perspective cameras when Spherical Stereo
is enabled.

Reviewers: dfelinto, brecht

Reviewed By: brecht

Subscribers: sebastian_k

Differential Revision: https://developer.blender.org/D1998
2016-05-18 10:56:57 +02:00
7b356a8565 Cycles: Reduce amount of malloc() calls from the kernel
This commit makes it so malloc() is only happening once per volume and
once per transparent shadow query (per thread), improving scalability of
the code to multiple CPU cores.

Hard to measure this with a low-bottom i7 here currently, but from quick
tests seems volume sampling gave about 3-5% speedup.

The idea is to store allocated memory in kernel globals, which are per
thread on CPU already.

Reviewers: dingto, juicyfruit, lukasstockner97, maiself, brecht

Reviewed By: brecht

Subscribers: Blendify, nutel

Differential Revision: https://developer.blender.org/D1996
2016-05-18 10:14:24 +02:00
2433a537fa Cycles: Explicitly mark arguments as unused 2016-05-18 09:12:47 +02:00
e3218ded41 Fix T48395: Grease Pencil, pressing Ekey to sculpt don't work for left click configurations
When using Left Click select, it wasn't possible to sculpt using E+LMB.

I've changed the order of things in the keymap so that the select operator won't
end up catching and blocking all these events.
2016-05-18 17:23:16 +12:00
1139e51be6 Fix: "Whole Character" Keying Set should not include Location on bones with "connected" joint 2016-05-18 16:29:18 +12:00
4adffde02c Cleanup: cmake, indentation, line length 2016-05-18 11:58:08 +10:00
6f29dbd045 Fix issue in with multiple importance sampling in recent code refactor. 2016-05-18 01:51:30 +02:00
9dc5367c89 Cleanup code style inconsistency in last commits. 2016-05-17 23:41:45 +02:00
2630207ada Fix GCC/Linux build error after finite/isfinite changes. 2016-05-17 23:40:25 +02:00
21fddf7d1c C99/C++11: replace deprecated finite() by isfinite(). 2016-05-17 21:39:16 +02:00
2b73402547 Fix C++11 build issues on OS X, remove references to outdated libs. 2016-05-17 21:39:16 +02:00
0e8cd14dfe Code refactor: use shader pointers rather than shader indexes. 2016-05-17 21:39:16 +02:00
08670d3b81 Code refactor: use dynamic shader node array lengths now that OSL supports them. 2016-05-17 21:39:16 +02:00
93e4ae84ad Code refactor: add some array utility methods, fix leak in assignment operator. 2016-05-17 21:39:16 +02:00
df8097ea2a Bendy Bones: Small ui tweak
Change the order of the bending controls ("Curve XY Offsets") so the user can activate both InX and OutX by holding down the left mouse button. This way, it's easy to bend symmetrically on X or Y.
2016-05-17 18:08:04 +02:00
6cf7cc3393 Fix T48434: Missing meta support in new depsgraph 2016-05-17 17:52:23 +02:00
49aeee5a3d Bendy Bones: Advanced B-Bones for Easier + Simple Rigging
This commit/patch/branch brings a bunch of powerful new options for B-Bones and
for working with B-Bones, making it easier for animators to create their own
rigs, using fewer bones (which also means hopefully lighter + faster rigs ;)
This functionality was first demoed by Daniel at BConf15

Some highlights from this patch include:
* You can now directly control the shape of B-Bones using a series of properties
  instead of being restricted to trying to indirectly control them through the
  neighbouring bones.  See the "Bendy Bones" panel...

* B-Bones can be shaped in EditMode to define a "curved rest pose" for the bone.
  This is useful for things like eyebrows and mouths/eyelids

* You can now make B-Bones use custom bones as their reference bone handles,
  instead of only using the parent/child bones. To do so, enable the
  "Use Custom Reference Handles" toggle. If none are specified, then the BBone will
  only use the Bendy Bone properties.

* Constraints Head/Tail option can now slide along the B-Bone shape, instead of
  just linearly interpolating between the endpoints of the bone.

For more details, see:
* http://aligorith.blogspot.co.nz/2016/05/bendy-bones-dev-update.html
* http://aligorith.blogspot.co.nz/2016/05/an-in-depth-look-at-how-b-bones-work.html



-- Credits --
Original Idea: Daniel M Lara (pepeland)
Original Patch/Research: Jose Molina
Additional Development + Polish: Joshua Leung (aligorith)
Testing/Feedback: Daniel M Lara (pepeland), Juan Pablo Bouza (jpbouza)
2016-05-18 03:19:06 +12:00
29a17d54da Fix CUDA MEMCPY condition, it should only copy 3D, 2D or 1D.
Found by Brecht, thanks!
2016-05-17 00:37:34 +02:00
99d861169f Cycles / Requested Features: Volume was missing in logging print. 2016-05-17 00:36:22 +02:00
b90cc984f7 Usual i18n/UI messgaes fixes... 2016-05-16 21:46:55 +02:00
886ff72301 Remove strict header, gives issues with gcc5x 2016-05-17 05:26:09 +10:00
0096bae8c4 Cleanup: use const args 2016-05-17 03:07:40 +10:00
42f8232046 CustomData: Support for >2gig layers 2016-05-17 03:02:55 +10:00
2b02e03973 Cleanup: simplify checks calculating tangents 2016-05-17 02:18:11 +10:00
688858d3a8 BLI_task: Add new 'BLI_task_parallel_range_finalize()'.
Together with the extended loop callback and userdata_chunk, this allows to perform
cumulative tasks (like aggregation) in a lockfree way using local userdata_chunk to store temp data,
and once all workers have finished, to merge those userdata_chunks in the finalize callback
(from calling thread, so no need to lock here either).

Note that this changes how userdata_chunk is handled (now fully from 'main' thread,
which means a given worker thread will always get the same userdata_chunk, without
being re-initialized anymore to init value at start of each iter chunk).
2016-05-16 17:15:18 +02:00
5a7429c363 BLI_task: Add back lost 'push_from_thread' change to BLI_task_parallel_range() & co. 2016-05-16 17:00:15 +02:00
19955bd152 Fix T48447: Inactive menu items don't grey-out icons 2016-05-17 00:17:26 +10:00
575d7a9666 BLI_task: make foreach loop index hleper lockfree, take II.
New code is actually much, much better than first version, using 'fetch_and_add' atomic op
here allows us to get rid of the loop etc.

The broken CAS issue remains on windows, to be investigated...
2016-05-16 15:57:19 +02:00
75a96f8325 Atomic ops: add 'fetch_and_add_uint32' op.
Needed for next commit.
2016-05-16 15:56:39 +02:00
460d944493 Cleanup rna_Brush_direction_itemf()
Some variants of gcc compilation were reporting 'control reaching end of non-void function' error
in this switch/case maze. Either use break everywhere or not at all (which is simpler, since we
only always return anyway...).
2016-05-16 15:54:18 +02:00
22d53e558d Cycles: Cleanup after recent refactor
Wrong indentation, wrong spacing.
2016-05-16 10:55:50 +02:00
f85745b17b Flat shading for basic shader
The purpose of the patch is to replace deprecated  glShadeModel.

To decrease glShadeModel calls I've set GL_SMOOTH by default

Reviewers: merwin, brecht

Reviewed By: brecht

Subscribers: blueprintrandom, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D1958
2016-05-16 11:13:21 +03:00
f70b548630 Revert "Docs: smoke typo corrections"
This reverts commit b13bc48932.

Wasn't only typo fixes, broke compiling
2016-05-16 09:28:49 +10:00
b13bc48932 Docs: smoke typo corrections
patch by @Blendify
2016-05-16 07:52:56 +10:00
a1a640f614 Curve Fitting: correct circular tangent length calculation
Method for scaling is still not perfect but quite close.
2016-05-16 07:45:50 +10:00
bb7da630ba Fix T48422: Revert "BLI_task: nano-optimizations to BLI_task_parallel_range feature."
There are some serious issues under windows, causing deadlocks somehow (not reproducible under linux so far).

Until further investigation over why this happens, better to revert to previous
spin-locked behavior.

This reverts commits a83bc4f597 and 98123ae916.
2016-05-15 21:14:40 +02:00
23bdcfe560 BGE: Fix KX_LightObject python API documentation.
Replace "..attribute::" by ".. attribute::".
2016-05-15 14:56:40 +00:00
20714889bf Fix T48425: Armature Symmetrize is flipping Custom Shape parameter.
In case not all bones are selected, not all possible mirrors are set in editbone->temp.ebone,
so we need to search them...
2016-05-15 12:35:01 +02:00
a83bc4f597 Fix an error in new lockfree parallel_range_next_iter_get() helper.
Reading the shared state->iter value after storing it in the 'reference' var could in theory
lead to a race condition setting state->iter value above state->stop, which would be 'deadly'.

This **may** be the cause of T48422, though I was not able to reproduce that issue so far.
2016-05-14 18:06:05 +02:00
b9996a3cc3 Fix Cube generated UV's rotated incorrectly 2016-05-14 23:01:59 +10:00
b1e2f8be23 Fix T48426: Use same length for all header message strings.
Some languages like Chinese or Japanese take three or four bytes per char...

Also fixed some missing translation markers for UI header messages.
2016-05-14 10:00:52 +02:00
ede742917a Correct BM_iter_mesh_bitmap_from_filter return 2016-05-14 04:49:42 +10:00
eeca6372d0 Correct asserts 2016-05-14 04:05:18 +10:00
24e887cd93 Fix script_paths(check_all=True) missing script paths
BLENDER_SYSTEM_SCRIPTS wasn't included in bpy.utils.script_paths()
2016-05-14 03:27:35 +10:00
89c6b58ef5 Fix compilation with strict compiler flags
Some const qualifier was discarding.
2016-05-13 17:37:39 +02:00
8b92d728ae Fix T48421: AO pass broken, only works when AO in cycles is enabled 2016-05-13 17:33:40 +02:00
141c0f8ad1 Cleanup: rna naming, indentation 2016-05-14 01:33:27 +10:00
a91a49ba8e Fix T48416: Impossible to copy a linked object from a file to another one mantaining the linked library.
When writing temp blenbuffer file, libraries of linked datablocks where not tagged correctly, which
means they were not put in the temp Main used to write the buffer, resulting in implicit localization
of linked data.
2016-05-13 14:12:10 +02:00
5e0ec49570 Fix T48416: Impossible to append from another file without localizing also all indirectly linked data.
Previous to 2.77, this used to be default behavior, was changed in rB591f4549c958b.

However, in most append cases, you do want a full localization of your data, so this new behavior
is kept by default, but there is now an option in append operator to only localize the 'first level'
of data (i.e. datablocks from linked library itself, and not those from other 'sub-libraries').
2016-05-13 14:12:10 +02:00
6276726bc4 Fix T47652: Texture shading mode fails to update material colors 2016-05-13 22:16:14 +10:00
029ccca0fe Armature meshdeform evaluation: parallelize computation of bbones deform matrices.
On big and complex rigs like blendrig or koro, it can give up to ~10% more FPS in best cases.
Hard to tackle all cases in tests though, so please report any unexpected slowdown
in armature animation playback!
2016-05-13 12:06:15 +02:00
868cfc5a4a BLI_task: add support for listbase parallelized for loops.
Code by @sergey, with small edits and doc by @mont29.
2016-05-13 12:06:15 +02:00
990fab73ea Cleanup: fix inconsitency in dynamicPaint_outputLayerExists()
Dyna WPaint indeed only uses first output layer, but better be consistent in those cases...
2016-05-13 12:06:15 +02:00
d4b8aa476b Dynapaint: cleanup of BKE code.
Line lengths, monolined 'if' statements, int -> bool, etc.

Also, replaced some internal cooked stuff by BLI helpers (most notably, the
'is inside UV triangle' code in `dynamicPaint_createUVSurface()`), and some
other minor optimizations.
2016-05-13 12:06:15 +02:00
ba6519f0a7 BLI_math: add 'equals_m4m4' (and 'm3' variant) helpers. 2016-05-13 12:06:15 +02:00
0903ee6ce2 Cycles: Scale debug pass with number of samples
This way it's easier to compare different renders together without
worrying about scale too much.
2016-05-13 11:22:18 +02:00
958d613f66 Image editor: Show actual value of single-channel buffer in sample info
Previously if image only had single channel only z buffer value was displaying.
This isn't handy for cases when you've got single channel buffer which is not
a z buffer.

Also fixed possible read past the array.
2016-05-13 11:22:18 +02:00
b72aef92c4 install_deps: Avoid conflicts on Arch-based systems when gcc-multilib is installed
install_deps can fail due to conflict between gcc (referenced by base-devel) and
gcc-multilib if the latter is installed. This avoids the conflict by filtering
the contents of base-devel when needed.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D1944
2016-05-12 18:17:14 -04:00
3c85e1ca1a Cycles: Add support for single channel byte textures.
This way, we also save 3/4th of memory for single channel byte textures (e.g. Bump Maps).

Note: In order for this to work, the texture *must* have 1 channel only.
In Gimp you can e.g. do that via the menu: Image -> Mode -> Grayscale
2016-05-12 14:51:42 +02:00
cde10e774c Fix array bounds compile warning. 2016-05-12 14:20:12 +02:00
86b509229f Fix T48413: editmesh intersect tool crash
Its important to add tri-edge intersections from both sides.
2016-05-12 21:00:08 +10:00
8d3f367c01 Correct debug prints 2016-05-12 20:59:48 +10:00
ea41207c3b Fix depsgraph tagging during the relations build pass.
Followup commit to 18e5e2fa1a. Needs the same
treatment in the second pass when ID tags are reset again.
2016-05-12 09:55:48 +02:00
80b1adf8c2 BMesh: avoid calling delete operator w/ face dissolve
In nearly all cases this isn't needed.
2016-05-12 16:47:30 +10:00
031715f743 Fix missing piece in recent rBce65fae8f32c (support for '+' key).
Thanks to Daniel Rivera (Dr2d4) for the headup!
2016-05-12 08:15:59 +02:00
689e45284b Recent bmesh face-join caused regression (T48407) 2016-05-12 16:11:42 +10:00
8de3303a03 Cleanup: Fix typo. 2016-05-12 02:11:36 +02:00
c5ddbf181e Armature outline drawing used single width line
Only set line width in pose-mode
2016-05-12 07:14:44 +10:00
d3ed8233ff BMesh: use active face fallback w/ select-path
From user perspective, last selected face is the same as the active face,
use this as a fallback.
2016-05-12 07:11:19 +10:00
16ce1b78b0 Cleanup: Remove outdated comment and add new one about slot IDs. 2016-05-11 22:25:48 +02:00
4a4f043bc4 Cycles: Add support for single channel float textures on CPU.
Until now, single channel textures were packed into a float4, wasting 3 floats per pixel. Memory usage of such textures is now reduced by 3/4.
Voxel Attributes such as density, flame and heat benefit from this, but also Bumpmaps with one channel.
This commit also includes some cleanup and code deduplication for image loading.

Example Smoke render from Cosmos Laundromat: http://www.pasteall.org/pic/show.php?id=102972
Memory here went down from ~600MB to ~300MB.

Reviewers: #cycles, brecht

Differential Revision: https://developer.blender.org/D1981
2016-05-11 21:58:34 +02:00
544b76ac9c BMesh: ignore non-manifold face connections
Was showing an error message,
now dissolve the faces that and delimit at non-manifold boundaries.
2016-05-12 06:00:05 +10:00
a46d930d8b BMesh: add BMW_ISLAND_MANIFOLD
An island walker that only walks over manifold edges.
2016-05-12 05:59:59 +10:00
f6948083e9 BMesh Island Walker: use direct loop access 2016-05-12 05:30:20 +10:00
135064c45e BMesh: remove exception from face-join function
Callers need to check for NULL, if we need to know exact cause it could be a return arg.
2016-05-12 04:42:45 +10:00
1b003511be BMesh: boundary walker, skip non-manifold loops
Instead of setting an exception, treat non-manifold edges as boundaries.
2016-05-12 04:39:01 +10:00
674bf2fe58 BMesh: add check for manifold loop 2016-05-12 04:37:36 +10:00
5d93836a61 Cleanup: only use r_ prefix for return args 2016-05-12 04:36:16 +10:00
fbbac6807a Cleanup: unused win32 headers 2016-05-12 04:35:40 +10:00
8dea74bb4f error in last commit 2016-05-12 01:43:56 +10:00
725a088ef9 Correct check for tree being in BVH cache 2016-05-12 01:40:50 +10:00
79d01de6b0 Remove pointer typedef from BVHCache
Used ** arguments unnecessarily,
also replace BLI_linklist_apply with while loop.
2016-05-12 01:40:46 +10:00
63432f1424 Fix crash snapping to mesh with no geometry 2016-05-12 01:00:43 +10:00
92774ff792 Cycles: Use explicit qualifier for single-argument constructors
Almost in all cases we want such constructors to be explicit, there are
exceptions but only in few places.
2016-05-11 16:51:14 +02:00
d57f416e47 Fix incorrect FLT_MIN use 2016-05-11 21:36:42 +10:00
67d2de8828 Transform Volume rewrite/refactor
Take advantage of the efficiency provided by the snap_context.

Also fixes errors:
- volume snap fails based on view angle (T48394).
- multiple instances of dupli-objects break volume calculation.
2016-05-11 20:20:25 +10:00
4a135ad2b7 BMesh: correct fix for face-join removing attached faces 2016-05-11 20:12:52 +10:00
de72dcadbb Fix for inline documentation of FOREACH_NODETREE.
Was missing id macro variable.
2016-05-11 10:53:11 +02:00
18e5e2fa1a Fix for node tree ID tagging in new depsgraph.
Nested node trees are not handled in BKE_main_id_tag_all.
2016-05-11 10:53:11 +02:00
b4b269f38e Depsgraph: Add some missing relations
Those cases requires not only geometry component, but also a transform one
to be ready before evaluation can start.
2016-05-11 09:24:16 +02:00
35531657e5 BLI_kdopbvh: Use distance for BLI_bvhtree_ray_cast_all
Pass distance argument so its possible to limit the range we get all hits from.

Other changes:

- Use boundbox test before calling callback, avoids redundant calls.
- Remove meaningless return value.
- Add doc string, explaining purpose of this function.
2016-05-11 15:01:27 +10:00
a18f4d2bc6 CMake: optional date/time overrides for reproducible builds 2016-05-11 02:47:38 +10:00
c1e4aaa289 Fix T48387: Mirror weights keeps groups assigned
Swapping the weights kept zero weight verts assigned.
2016-05-11 02:47:38 +10:00
e525a06800 BMesh: only remove loose geometry when joining faces
Joining faces could remove faces that happened to share an edge that would normally be removed.
2016-05-11 02:47:38 +10:00
98123ae916 BLI_task: nano-optimizations to BLI_task_parallel_range feature.
This commit makes use of new taskpool feature (instead of allocating own tasks),
and removes the spinlock used to generate chunks (using atomic ops instead).

In best cases (dynamic scheduled loop with light processing func callback), we
get a few percents of speedup, in most cases there is no sensible enhancement.
2016-05-10 17:57:53 +02:00
fdd999042b Depsgraph: A bit of experiment with skipping where_is_bone if channels is taged as done
This is what old dependency graph was doing and apparently this avoids some updates,
however it's not really clear why those nodes are considering done. Maybe just because
of the way how relations are working. But needs a closer investigation.
2016-05-10 17:30:19 +02:00
e343e4a5ba Avoid per-constraint-target call of strlen
It's enough to do one single comparison to see if the string is empty or not.
2016-05-10 17:15:16 +02:00
2786b0bc9d Optimize action constraint by avoid memory allocation 2016-05-10 16:45:27 +02:00
e1a254d8de Attempt to fix blenplayer after recent changes 2016-05-10 16:14:24 +02:00
335274192e Revert "Task scheduler: Avoid mutex lock in number manipulation functions"
Appears mutex was guarateeing number of tasks is not modified at moments
when it's not expected. Removing those mutexes resulted in some hard-to-catch
locks where worker thread were waiting for work by all the tasks were already
done.

This reverts commit a1d8fe052c.
2016-05-10 15:43:03 +02:00
f501dfb085 Depsgraph: Use some more threading when tagging and finalizing evaluation
Also don't reset values there which were re-set on the next evaluation anyway.
2016-05-10 15:42:44 +02:00
a1d8fe052c Task scheduler: Avoid mutex lock in number manipulation functions
It seems using atomic operations here we can avoid having mute without
breaking anything.

Thanks Bastien for double-checking the changes!
2016-05-10 14:59:19 +02:00
9239257806 Fix T48393: Blender player doesn't start on files saved with with cyrillic letters in path 2016-05-10 14:31:00 +02:00
fcc2175710 Fix own mistake in rBd617de965ea20e5d5 from late December 2015.
Brain melt here, intention was to reduce number of tasks in case we have not much chunks of data to loop over,
not to increase it!

Note that this only affected dynamic scheduling.
2016-05-10 13:10:21 +02:00
898d040b0c Depsgraph: For big graphs update pending parents in threads
Gives additional speedup from ~88 to ~91 fps with a test rig.
2016-05-10 13:02:54 +02:00
288bbee5b1 Depsgraph: Comment evaluation priority out for now
It uses some additional compute power and the evaluation priority is
not even used.

This brings fps 88.2 with blenrig_for_debugging.blend on this desktop.
2016-05-10 12:05:09 +02:00
ce2c15deaf Depsgraph: Avoid multipel editors update per same ID
Simple thing, and apparently fps goes up to 80 with the demo file from jpbouza.

Not sure why at this point fps is so much higher than the old dependency graph
here now. And it's definitely something what others should verify as well.
2016-05-10 11:25:57 +02:00
12a20b78d3 Depsgraph: Don't leave active thread if there's only one children node
This reduces stress on the task scheduler and avoids some unwanted overhead
caused by all the threading business in the cases when there's only one
children node. We try to immediately switch to it's evaluation now, keeping
active thread up and running.

This bumps FPS from 58 to 64 on the blenrig test file from jpbouza.
2016-05-10 10:39:38 +02:00
7efa34d078 Task scheduler: Add thread-aware task push routines
This commit implements new function BLI_task_pool_push_from_thread()
who's main goal is to have less parasitic load on the CPU bu avoiding
memory allocations as much as possible, making taks pushing cheaper.

This function expects thread ID, which must be 0 for the thread from
which pool is created from (and from which wait_work() is called) and
for other threads it mush be the ID which was sent to the thread working
function.

This reduces allocations quite a bit in the new dependency graph,
hopefully gaining some visible speedup on a fewzillion core machines
(on my own machine can only see benefit in profiler, which shows
significant reduce of time wasted in the memory allocation).
2016-05-10 10:01:24 +02:00
401e710807 Correct armature-sketch snap context use
Use scene snap mode.
Also allow passing NULL ray-depth which falls back to BVH_RAYCAST_DIST_MAX.
2016-05-10 16:47:57 +10:00
ce65fae8f3 Fix T48369: Missing suport for main '+' key.
Many keyboard layouts (italian, spanish, german...) have direct access to '+' key on main
keyboard area (not the numpad one), ans x11 has own define for this key, so use it instead
of generating an unkown key event.

Note that we most likely have much more missing 'specific' keycodes for non-US keyboard layout,
but think since we already had a 'minus' keyevent, supporting 'plus' one is totally consistent.
And we had a spare space in our defined values just for it even!

This keyevent is only supported/generated by x11 and cocoa Ghost backends for now,
neither SDL nor win32 seem to have matching key events...
2016-05-10 08:29:03 +02:00
76481eaeff Cycles: Add support for float4 textures on OpenCL.
Title says it all, this adds OpenCL float4 texture support.

There is a bug in the code still, I get a "Out of ressources error" on nvidia hardware here, not sure whats wrong yet.
Will investigate further, but maybe someone else has an idea. :)

Reviewers: #cycles, brecht

Subscribers: brecht, candreacchio

Differential Revision: https://developer.blender.org/D1983
2016-05-10 02:53:50 +02:00
dc82c2cd48 View selected support for grease-pencil 2016-05-10 04:37:00 +10:00
119230b565 Cleanup: header, style 2016-05-10 03:03:34 +10:00
d8cf14fa67 Fix T48388: Undo history sculpt mode not visible 2016-05-10 02:42:14 +10:00
9513bdcaea Buildbot: Attempt to make sure install folder is always clean for Win and OSX 2016-05-09 17:34:02 +02:00
ba3ae9ea27 Cleanup and refactor our atomic library.
This commit:
* Removes most of all dirty internal details from public atomi_ops.h file, and move them into /intern private subdir.
* Removes unused 'architectures' (__apple__ and jemalloc).
* Split each implementation into its own file.
* Makes use of C99's limits.h system header to determine pointer and int size, instead of using fix hardcoded list of architectures.
* Introduces new 'faked' atomics ops for floats.

Note that we may add a lot more real and 'faked' atomic operations over integers and floats
(multiplication, division, bitshift, bitwise booleans, etc.), as needs arise.

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1982
2016-05-09 17:03:08 +02:00
299a25cb35 Fix weight-mirror reporting invalid failed mirror verts
Use vertex tagging instead of clearing mirror index.
2016-05-10 00:57:00 +10:00
f616caa315 CMake: Fix compilation error when toolkit gives empty result
Should we also check whether toolkit exist perhaps?
2016-05-09 16:05:02 +02:00
df07303fbb Depsgraph: Avoid unneeded relations update when canceling transform
This was originally done for T46320 in order to re-store depsgraph state
after all the constraint modifications.

However, it relations were updated if there's any IK chain the the pose,
which is a bit too annoying.
2016-05-09 16:04:26 +02:00
5ae4487351 Missed last commit 2016-05-09 23:51:42 +10:00
6172bdbde8 Remove redundant error checks in grease-pencil tessellation 2016-05-09 23:47:57 +10:00
8b13555b24 Docs: comment polyfill2d functions 2016-05-09 23:47:57 +10:00
9ac35be63a Task scheduler: Don't calloc in performance-critical areas
Majority of the fields are being overwritten anyway, so calloc it
kinda waste of CPU ticks.
2016-05-09 14:54:24 +02:00
86a57b04bf Depsgraph: Store node input/output links in a vector rather than in set
Set is much slower to iterate through (due to cache misses and such) and
the only advantage of using set is faster removal of link. However, we are
iterating links much much more often than removing them, and even when we
are removing links we don't really need to remove link from nodes which it
connects -- we don't support partial depsgraph updates, so removing links
from nodes on destruction is a waste of time.

If we ever want to support partial updates we can have dedicated function
to remove link from nodes it connects.

This gives a surprising increase of fps from 42 to 56 with test file from
Mr. J.P.Bouza (blenrig_for_debugging.blend). Surprising because old DEG is
actually slower here (52 fps). Didn't see any regressions (and don't see
why they will happen), so let's ask our riggers and animators to perform
further speed tests ;)
2016-05-09 12:42:53 +02:00
5dbeea95d0 Depsgraph: Avoid having per-node lock when scheduling children
Use atomic operations instead, should in theory improve timing of
scheduling. However, probably not so visible yet because actual
task scheduling still have some locks and memory allocations.

Baby steps, what would i say.
2016-05-09 11:58:36 +02:00
dc5e02c42c Atomics: Add atomic_fetch_and_or_uint8() function
Hopefully it compiles on all platforms still..
2016-05-09 11:45:43 +02:00
a27772cd66 Fix makesdna not checking alignment for a non-native platform
This was causing alignment issues which were only visible on a platform
of particular bitness, so it was easy to break stuff for 32bit when
working on 64bit platform and vice versa.
2016-05-09 09:54:51 +02:00
3ce3163379 Fixes for GPencil Copy and Paste
* Fix "Attempt to free NULL pointer" when copying strokes for the first time

* Fix poll callback on "paste" operator, so that it is possible to paste
  strokes when there are no editable strokes visible.
2016-05-09 19:42:34 +12:00
d6555d936c Cleanup: Avoid duplicative defines for CPU textures, use the ones from util_texture.h
Also includes some further byte -> byte4 renaming, missed that in last commit.
2016-05-09 09:16:41 +02:00
e0e7d94f79 Fix error introduced by removing faces before executing bridge
Commit 86abddc9, caused an error when the face-region included boundary edges.
Since removing the faces first, caused the edges along the boundaries to be removed.

Add support for deleting faces and internal edges, that keeps boundaries.
2016-05-09 16:21:00 +10:00
69be8d7cbd Fix error in recent snap refactor
Crash in edge snapping
2016-05-09 15:46:34 +10:00
73fab5bb3f Fix crash introduced w/ snap refactor
Create snapping context when in the 3d view,
transforming pose bones and grease-pencil crashed.
2016-05-09 15:46:34 +10:00
dc4c3ce592 GPencil: Added operators to select first and last points of strokes
These are useful for removing overshoots at the end of closed strokes (for fills)
2016-05-09 17:23:36 +12:00
0578d3ef3e Graph Editor: Ctrl-Click keyframing now deselects all existing keyframes by default
Now, when creating new keyframes in the graph editor by ctrl-clicking, only
the newly created keyframes will be selected. This is a little workflow tweak
to make it faster to work, as you no longer have to deselect all, and then
re-select the newly added keys in order to manipulate them.

The old behaviour (not modifying the selection status of the old keys) has been
kept, but is now available via Shift-Ctrl-Click.

Feature request from @Shhlife
2016-05-09 17:23:35 +12:00
9a1e11260c Cleanup: More byte -> byte4 renaming for consistency. 2016-05-09 02:22:01 +02:00
5fe1bea2da Info Header / URLs: Fix community link + https'ification. 2016-05-08 23:38:41 +02:00
98e2135a2d Fix T48380: fix for recent image manager code cleanup. 2016-05-08 21:41:25 +02:00
a815e10211 Code cleanup: use special type instead of node names. 2016-05-08 20:21:04 +02:00
dfe9aa25c3 Code cleanup: tweaks to image manager code found while looking into previous bug. 2016-05-08 20:20:53 +02:00
e362b04c43 Fix T48377: Cycles crash removing float image texture node during viewport render. 2016-05-08 19:48:22 +02:00
5fde5616e0 Fix T48372: missing OS X trackpad scroll support for increasing loop cut / bevel segments. 2016-05-08 19:06:48 +02:00
2d8db0de79 Docs: explain some details of RNA enums 2016-05-09 02:37:34 +10:00
cbaa25eb88 Cycles: Fix two small memory leaks and deduplicate table freeing
This commit makes remove_table skip the freeing if the offset is
already set to invalid - or, if it wasn't, set it to invalid after freeing.

That's what the current code was already doing in the Manager classes,
this change allows them to just call remove without the additional code.

Also, two potential memory leaks where new tables were always allocated
without freeing the old ones are fixed.

Reviewers: sergey, dingto, brecht

Differential Revision: https://developer.blender.org/D1974
2016-05-08 17:44:03 +02:00
6100c2d262 Cleanup: warnings 2016-05-09 01:16:58 +10:00
e2b79a0a24 GPencil Onion Skinning: Setting before/after to -1 will turn off onionskinning in that direction
This is an experimental option that I found would have been useful to have,
when making my earlier anim test. The only contentious point is whether it's
better to use a separate boolean flag (perhaps bound to the labels) instead
of overloading this setting (and describing the usage in the tooltip).
2016-05-09 03:03:40 +12:00
d6fd6d18d7 Fix: Toggling "lock layer" for GPencil layers in the dopesheet didn't update the layers UI 2016-05-09 02:49:32 +12:00
c4a5c26a59 Fix: Lasso select for Grease Pencil doesn't work in the Nodes Editor
In the nodes editor, Ctrl-LMB-drag is taken by "Cut", and it seems impossible
for any other keymap to override that. Instead, the default lasso select hotkey
there is Ctrl-Alt-LMB-drag instead.

To get Grease Pencil lasso select (in GP Editmode) to work in the Nodes Editor too,
this commit adds the Ctrl-Alt-LMB-drag binding here too. However, to make things easier,
this extra binding will be part of the Grease Pencil keymap everywhere. There doesn't
seem to be any conflicts with having this in place - until we find them, this should
be ok to have.
2016-05-09 02:44:21 +12:00
491ad6664e Tweak to GPencil layers UI layout
I'm still not happy with this layout as it is now, but it seems a bit less unbalanced
than what I'd been trying before. So, let's leave this as-is for now.
2016-05-09 02:04:28 +12:00
3f934b06a6 Tweaks for a tooltip I missed during earlier review for D1886 2016-05-09 02:00:23 +12:00
d4ed5c398e A "better" (?) fix for msvc silliness - used in one other place in all of Blender 2016-05-09 01:46:18 +12:00
e43ee5563b Fix compiling on MSVC - M_PI undefined 2016-05-09 01:31:13 +12:00
81c302bbff Action Editor: Initial support for a Properties Region
This commit adds some of the initial support for a properties region in the
Action Editor. There are currently no panels to display, as there is still
a lot of work required to port over the required internal architecture to
support the panels seen in the Graph Editor.
2016-05-09 00:53:52 +12:00
9dbe7bbe9a D1886: GPencil - Add smooth iterations parameter to get better quality
After some test, a new iteration parameter has been added in order to
apply repetitive smoothing to the stroke. By default 1 iteration is applied,
but can used any number between 1 and 3.

The repetition uses different levels of intensity from 100% of the defined smooth
factor for the first loop, 50% for the second and 25% for the third. We use in each
loop a smaller value in order to avoid deform too much the stroke.
2016-05-09 00:53:51 +12:00
dc78e47b77 Fix for D1705: Update to fix the bug with extra triangles that produces glitches in some situations 2016-05-09 00:53:51 +12:00
011786a3f8 GPencil Fills: Small reshuffle of UI buttons
Now, stroke-related things (thickness, volumetric, points) and fill-related things
(HQ fill) are in the relevant columns, instead of having some in each column.
2016-05-09 00:53:50 +12:00
b88535ed28 Code Cleanup: Just a bit more tidying up comments/whitespace/etc.
There is still some instability in how the triangulations are happening,
where the triangle count of the resulting triangulation fluctuates resulting
in weird artifacts sometimes.

To reproduce, try drawing some U-shapes, and keep reloading the file.
2016-05-09 00:53:49 +12:00
af8a54bd8d Fix for potential bug with new GP Fill
While trying to track down why I still keep getting some random "extra" triangles
showing up when reloading files with fills, I noticed that there's an index mismatch
here that may cause problems in some rare cases:

There are "gps->totpoints" items in tmp_triangles, but there should only be
"gps->tot_triangles" triangles in the gps->triangles array. If for whatever reason
some of the triangles in tmp_triangles are invalid, this could have meant that
while a tmp_triangles candidate was skipped, a corresponding slot for a valid
triangle also got skipped.
2016-05-09 00:53:49 +12:00
f5ddcfeb03 Code Cleanups: A bunch of tweaks to tidy up things from the GPencil Fill patch 2016-05-09 00:53:48 +12:00
1d5c71bca7 D1705: Fix Grease Pencil Fill for Concave Shapes
Improve filling for concave shapes using a triangulation of the stroke.
The triangulation information is saved in an internal cache and only is
recalculated if the stroke changes.

The triangulation is not saved in .blend file.

Reviewers: aligorith

Maniphest Tasks: T47102

Differential Revision: https://developer.blender.org/D1705
2016-05-09 00:53:47 +12:00
0411cfea9d Fix T48373: Crash when using dynamic paint with brush material.
`dynamicPaint_doMaterialTex` was called from inside an omp parallel section with brush->dm
itself, and not the local dm copy. Generating looptri data is not thread safe at all...
2016-05-08 11:39:45 +02:00
1955754934 Cycles: Cleanup: Swap order of the RNG-state-initializing for-loops
Swap the for-loops in the RenderBuffer reset code to follow the convention
of looping over y in the outer loop.
The improved cache performance won't really be noticable here, but it's nicer
if it follows the usual style.
2016-05-08 01:22:28 +02:00
e5b4e6b0a3 Clamp dot-product to avoid precision error
Would only happen in degenerate cases.
2016-05-08 00:04:05 +10:00
1c46ecd86b Cleanup: Remove unneded (void) line, we don't have ifdefs here anymore. 2016-05-07 15:55:28 +02:00
a3b42d638b Cleanup: whicespace 2016-05-07 23:58:04 +10:00
b132f3ac7b Correct render-border line width 2016-05-07 23:53:35 +10:00
6d402610c1 Correct error in wrapped array-span-iteration 2016-05-07 23:48:53 +10:00
f5930759a6 Fix T48368: Cycles mix RGB constant folding bug after recent refactor. 2016-05-07 14:21:15 +02:00
68e856da03 Curve Fitting: better fallback when least-square solution fails
Take curvature into account when calculating handle length.

Gives significantly better results for curve dissolve and 10-20% more efficient freehand drawing.
2016-05-07 21:48:00 +10:00
d2296cd5ec Fix error copying cubic data 2016-05-07 21:38:48 +10:00
65dd1d7d08 Fix T48362: Spin tool broken after recent commit.
Typo in rBrBa48d74079, spin tool was now using the wrong view axis.
2016-05-07 11:58:33 +02:00
Martijn Berger
0a277f7428 Fix cycles-xml with OSL support after changes inroduced in 1422f0dd16 2016-05-07 10:50:21 +02:00
4422b3f919 Some fixes for CUDA runtime compile:
* When Baking wasn't used we got an error.
* On top of Volume Nodes (NODES_FEATURE_VOLUME), we now also check if we need volume sampling code,
so we can disable that as well and save some further compilation time.
2016-05-06 23:13:33 +02:00
734d1aec3f Cycles: Make CUDA adaptive feature compile a Debug flag.
If the CUDA Toolkit is installed and the user is on Linux,
adaptive, feature based CUDA runtime compile is now possible to enable via:

* Environment flag CYCLES_CUDA_ADAPTIVE_COMPILE or
* Debug menu (Debug value 256) in the Cycles UI.
2016-05-06 23:13:33 +02:00
bd335f13fe Fix T47657: Using template_list() with invoke_props_dialog()
popups have no wm_region in context, using wm_menu here.

Not working perfect, but at least it prevents crash.
2016-05-06 21:56:54 +02:00
8c2cec937b Fix T48262: Crash when trying to render a scene without camera. 2016-05-06 21:41:56 +02:00
e074554f8f Image Editor: Add border zoom
Use Shift-B, UV border-select-pinned is now Ctrl-B.

Patch from @rav66
2016-05-07 04:32:08 +10:00
ddbc351dd3 Fix recent issue in recent BVH snap/cache
The derivedMesh could free a tree stored by the cache.
Now check the cached tree is valid.
2016-05-07 02:59:19 +10:00
9c6f33c405 Correct in-range assert (zero is valid) 2016-05-07 02:16:21 +10:00
9f96976e59 DerivedMesh: don't allocate a new material array each draw 2016-05-07 02:16:21 +10:00
bd309603c5 Clip invisible parts of image when drawing in 2D textures and GLSL Modes
This commit avoids draw of invisible parts of image in image editor,
making it faster to re-draw the image.

Especially handy when painting on a high-res image when zoomed-in.
2016-05-06 16:54:07 +02:00
dd52bf8fb9 Cleanup: Move full SVM statistics to VLOG(2) verbosity level. 2016-05-06 14:39:41 +02:00
3807bcb3a8 Cleanup: Rename texture slots to float4 and byte, to distinguish from future float (single channel) and half_float slots.
Should be no functional changes, tested CPU and CUDA.
2016-05-06 14:37:35 +02:00
36d8a70b00 Code refactor: Change Cycles ImageManager arrays.
This commit simplifies the code for the image arrays. Instead of having 2 arrays for float and byte textures,
we now use an array here. This simplifies the code (avoids code duplication), and makes it possible to easily extend it
with float1 and half-float types in the future.

Only tested with CPU yet, plus some cleanup / code de-duplication is still possible here.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: jesterking, sergey

Differential Revision: https://developer.blender.org/D1969
2016-05-06 13:20:09 +02:00
8aa3bac7af Tweak precision for interocular distance and convergence plane
Previous number of digits after point was not really useful, especially
for the interocular distance where it's quite common to go sub-cm precision.
2016-05-06 12:32:23 +02:00
ef0c02cb4d Speedup of regular 2D painting
Yet another commit which makes painting aware of multi-threaded systems.
2016-05-06 11:49:09 +02:00
204f55c189 Cloth: Fix shrinking to properly respond to animated min/max and weight.
Enable dynamic restlen recomputation based on sew flag and update the
shrink factor math within it to call the new utility function.
2016-05-06 11:40:20 +03:00
2a9ddc808d Cloth: Change ClothVertex::xrest to actually store the rest position.
Originally the value was only needed when building the springs,
so a pointer to the input data was somewhat ok. However, recalculating
spring length dynamically requires keeping the actual value around.
2016-05-06 11:40:19 +03:00
Luca Rood
fcfbe27826 Part of D1903: Dynamic base mesh for cloth simulation
A function that recalculates cloth spring lengths.
2016-05-06 11:40:19 +03:00
8e1ab9b137 Cloth: Ignore zero-restlen sewing springs in average length computation.
The average length is used to adjust self-collision and stiffness
to match mesh density, and in either case considering the always zero
restlen sewing springs doesn't actually make much sense.

The struct_springs variable is also used for other things like total
spring count, so a new one needed for the true struct springs.
2016-05-06 11:40:19 +03:00
b481e886e5 Cloth: Use Geometrical Mean for averaging cloth shrink factor.
This comes out of considering a one-dimensional transition in weight
on a rectangular cloth grid. At the transition face loop, one side
of each rectangular face would be scaled by k1, and the opposite one
by k2, thus turning the rectangle into a trapezoid. Averaging would
be used to choose the scale factor for the remaining two sides.

If Geometrical Mean, i.e. sqrt(k1*k2) is used, it so happens that the
diagonals of the trapezoid also end up scaled by sqrt(k1*k2) compared
to the original rectangle. This means that the same scale factor is
correct for both structural and shear springs, which is not the case
with simple average.
2016-05-06 11:40:19 +03:00
8d22a8afa0 Cloth: Fix the shrink feature to be controlled by the sewing spring flag.
Previously it was all over the place: without a vertex group it was
always enabled, and with it it depended on the Self Collision option
due to a likely editing mistake. Now it should be in sync with what
disables the fields in the UI.

The verts->shrink_factor field is changed to just cache the vertex
weight, with the shrink_min/shrink_max interpolation done later.
This is because cloth_apply_vgroup only runs if there are vertex
groups, and thus the factor may not update after property changes.

In addition, bending springs are now also affected by the shrink
factor to avoid visible distortion in object shape at high shrink.
2016-05-06 11:40:19 +03:00
ae3f68109d Cloth: Invalidate cache when sewing springs are toggled on or off. 2016-05-06 11:40:19 +03:00
7ecc159f37 Force Fields: Fix Texture with both Use Coordinates and 2D enabled.
From description, Use Coordinates evaluates the texture using
target coordinates in the local space of the force field object.
2D is supposed to ignore the Z coordinate. Thus one would assume
that if both are enabled, the force field effect would move with
the force field object, and Z would be 0.

However, instead first the 2D option projects points onto a plane
passing through the global zero and orthogonal to the local Z,
and only then the resulting point is transformed into local space.
Z is not locked at 0, so procedural textures like Spherical Blend
don't work as expected.

To fix this, apply local transform first, and then just clear Z if 2D.
2016-05-06 11:40:18 +03:00
8cc4f3f52a Implement threaded partial display buffer update
This speeds up update of display buffer when affected area is big enough.

Mainly helpful for cases when doing long fast strokes when painting.
2016-05-06 10:04:29 +02:00
bc1a7d9283 Cleanup: warnings
Values set but not used
2016-05-06 16:49:25 +10:00
304501193b Fix T48356: Bridge tool creates self-intersecting loop
When loops are planar to eachother, initialize their winding based on surrounding geometry.
2016-05-06 10:22:02 +10:00
86abddc96a Fix error bridging edge loops flipping
Calculating the winding failed when faces exist on both sides of the edge.
2016-05-06 08:53:51 +10:00
37ad451b8e Cycles: Comment out unused function arguments 2016-05-05 23:47:22 +02:00
9b89071c9c Multi-thread generated image creation
Gives about 2x speedup on laptop when creating new hires generated image,
regardless of it's type (color, color grid, uv grid).
2016-05-05 23:47:22 +02:00
3064270e13 Correct snap checks for edges & faces
Snap targets can't contain vertices which are being transformed
2016-05-06 07:44:07 +10:00
5e72ea4397 Don't overwrite existing snap context
Re-activating transform would overwrite previous context, leaking memory.
2016-05-06 06:47:21 +10:00
d12378da11 Cleanup: style 2016-05-06 06:34:25 +10:00
ee5eb2a26a Missed last commit 2016-05-06 06:28:36 +10:00
55c4889864 bvhutils: remove bitmap counting
All callers pass in valid number
2016-05-06 06:14:36 +10:00
c5a26bef5d Cleanup: rename getepsilon -> get_epsilon 2016-05-06 06:14:36 +10:00
cc650c3d07 Add asserts to check bvhutils args are correct
Would have prevented previous error going unnoticed.
2016-05-06 06:14:36 +10:00
7efdee7517 Fix crash adding byte color grid images 2016-05-05 22:05:09 +02:00
7b7e7ac4c1 Code cleanup: simplify SVM stack assignment. 2016-05-05 21:43:46 +02:00
0f943337bc Code cleanup: remove some unused functions. 2016-05-05 21:43:46 +02:00
dd8bfa0929 Code refactor: reduce special node types, use generic constant folding. 2016-05-05 21:43:46 +02:00
2cfadecf97 Fix Cycles emission node being unnecessarily tagged as spatially varying. 2016-05-05 21:43:46 +02:00
9a20ff2b52 Fix OS X build error after SSE changes, BLI_math_base.h conflicts with EXR headers. 2016-05-05 21:43:46 +02:00
4aaafcbc45 Fix for fix, sorry for the noise 2016-05-06 05:46:07 +10:00
2812a8f7eb Missed last commit 2016-05-06 05:42:33 +10:00
7122b05ac3 Correct own mistake int recent transform API edits
Need to return number of enabled elements.
2016-05-06 05:40:07 +10:00
46ccc54faf Fix error not using the cached BVH tree 2016-05-06 05:17:34 +10:00
0b5a0d8412 Transform/Snap: EditMesh/BKE_bvhutils API improvements
Separate the creation of trees from EditMesh from the creation of trees from DerivedMesh.
This was meant to simplify the API, but didn't work out so well.

`bvhtree_from_mesh_*` actually is working as `bvhtree_from_derivedmesh_*`.
This is inconsistent with the trees created from EditMesh. Since for create them does not use the DerivedMesh.

In such cases the dm is being used only to cache the tree in the struct DerivedMesh. What is immediately released once
bvhtree is being used in functions that change(tag) the DM cleaning the cache.

- Use a filter function so users of SnapObjectContext can define how edit-mesh elements are handled.
- Remove em_evil.
- bvhtree of EditMesh is now really cached in the snap functions.
- Code becomes organized and easier to maintain.

This is an important patch for future improvements in snapping functions.
2016-05-06 05:01:51 +10:00
88b72925d0 Optimize linear<->sRGB conversion for SSE2 processors
Using SSE2 intrinsics when available for this kind of conversions.

It's not totally accurate, but accurate enough for the purposes where
we're using direct colorspace conversion by-passing OCIO.

Partially based on code from Cycles, partially based on other online
articles:

  https://stackoverflow.com/questions/6475373/optimizations-for-pow-with-const-non-integer-exponent

Makes projection painting on hi-res float textures smoother.

This commit also enables global SSE2 in Blender. It shouldn't
bring any regressions in supported hardware (we require SSE2 since
2.64 now), but should keep an eye on because compilers might have
some bugs with that (unlikely, but possible).
2016-05-05 19:46:06 +02:00
bb6fbc64ae Docs: scanfill.c purpose 2016-05-06 00:45:38 +10:00
c8e9832be3 Fix T48320: Freestyle renders wrong edges of objects which in the other RenderLayer.
FSAA sample files in EXR format are no longer always updated (after some
changes between 2.73 and 2.74 releases), and the reported bug was caused
by old samples from a previous frame that were being merged by mistake.

The present revision addresses the documented issue by entirely skipping
the rendering of auto-generated scenes when there are no Freestyle strokes
to render, which suppresses sample merging of the render layers that were
not rendered.
2016-05-05 23:15:52 +09:00
6f83710af9 Optimize projection painting with big brushes
Multi-threaded partial buffer update, gives about 2x speedup with
big brushes.

Thanks Campbell for testing and benchmarking!
2016-05-05 14:45:00 +02:00
c81d9fda46 Optimize threaded scanline processor
Avoid memory allocation for task data.
2016-05-05 14:18:11 +02:00
c795d31a1f Simplify scanline threaded processor used by GPU_verify_image
Just avoid some unneeded initialization functions when the threaded
processor is simple enough to only depend on current chunk start
scanline and number of scanlines.
2016-05-05 13:16:56 +02:00
f5dcb137f1 Fix project paint using uninitialized edit-region
First stroke always had the minimum rectangle set to 0,0 which could cause a largre region of pixels to be
unnecessarily updated.
2016-05-05 20:57:54 +10:00
9b8bf57361 Curve Fitting: avoid clamping fallback handles. 2016-05-05 20:31:13 +10:00
d0818dbae1 Optimize Blank and Color Grid generated images
Avoid unnecessary pixels linearization gives nice speedup.
2016-05-05 12:04:42 +02:00
dd73d9c54e Correct error in recent smoothview edits 2016-05-05 19:58:45 +10:00
043486e2bc Fix typo in previous commit
Thanks Julian Eisel (Severin) for the heads up!
2016-05-05 11:33:13 +02:00
9aff51661c Optimization for initial display of high res textures in viewport
Multi-thread all the color space conversion operations.

Gives speedup from 0.8 to 0.1 seconds on a model with 4k etxture on it.
2016-05-05 11:28:50 +02:00
8c3c669c2d Image Paint: fix for calls to GPU_free_image while painting
The width and height of of the region to update are often zero,
skip calling GPU_paint_update_image in this case.
2016-05-05 18:52:11 +10:00
08be000637 Fix T48210: Editing all selected buttons fails to auto-key 2016-05-05 02:37:46 +10:00
10bbce30a9 UI: avoid getting the active button when its already known 2016-05-05 02:22:23 +10:00
6601680e8d View3D: apply smoothview before modal view operations 2016-05-05 02:01:18 +10:00
bd1378b56b Cleanup: rename ED_view3d_smooth_view_finish (to force_finish) 2016-05-05 01:51:25 +10:00
e30f0427a5 Fix error in BM_face_exists_overlap_subset
Was re-using loop index, thanks to @bzztploink for spotting!
2016-05-05 01:35:09 +10:00
875df1e2b9 Cycles: Fix hair minimal size doesn't work on GPU and SSE2 only CPUs 2016-05-04 17:14:43 +02:00
ddd6be1834 Compositor: negative color support for ASC-CDL offset
Since the color wheel can't handle negative colors usefully, use a basis value for the initial RGB.
2016-05-05 00:06:55 +10:00
980f3c3693 Fix T48346: Transparent shadows do not work for instanced objects 2016-05-04 14:46:30 +02:00
6f2797b50b Curve Draw: option to apply absolute offset
Offset used curve radius, which isn't useful drawing without any bevel radius.
2016-05-04 15:45:55 +10:00
568514c875 Fix T48340: Smooth view cancels previous view action
Previously users needed to wait for view orbit to finished,
so quickly pressing keys would gave different result.
2016-05-04 03:38:20 +10:00
Julian Eisel
9d3d9ac0b9 Fix 3D View panel header color wrong after theme reset
Caused by wrong alpha value in rB34b30f847429ac (used 0.01, should've been 0.1). Also made sure all editors initialize same default theme values for panels and cleaned up code a bit.
Works fine with old userpref.blend files.
2016-05-03 18:31:37 +02:00
645047708d Fix broken build without IME and/or I18N (caused by rBcb6307162b4c12). 2016-05-03 16:56:52 +02:00
9151095dbe Fix T48328: Outliner: Armature EditMode: crash when selecting bone of a shared amrature in another object's bone list.
Basically, issue is that outliner stores editbones for an edited armature, which are only valid during EditMode.

When more than one object use the same armature, selecting ebones from same armature but under non-edited object
would first select that object (and hence switch out of editmode), and then try to select editbone while editdata
no more exist.

Solution for now is to not change active object in this case - it's not totally ideal (not consistent),
but other solutions (like switching edited object without leaving editmode, or rebuilding (part of)
outliner tree in-between) are horribly hackish and most likely prone to epic failure anyway.
2016-05-03 15:11:42 +02:00
cb6307162b Cache whether current translation language supports IME or not
Solves the weak point mentionedi n previous commit.
2016-05-03 12:38:21 +02:00
b34f177a39 Fix T47841: Shift-space doesn't type space in type-in fields on Windows
Shift-space was reserved for IME support, however IME will only
be enabled on certain languages. We can avoid any IME-related
exceptions form other languages without too much trouble.

There's one weak point around ui_ime_is_lang_supported() tho,
which is it might be doing string comparison a bit too much
often now, this we can avoid by handling those checks from BLT.
2016-05-03 12:20:40 +02:00
bff15770a9 Fix T47424: Blender Internal material node 'mapping' not showing results of animation
Not very efficient solution -- it'll update mapping node on init ntree exec and will
not work for viewport GLSL shading perhaps, but it's as good as it could be within
current dependency graph.

The issue here is that manual edit of values will cause cached matrix re-evaluation.
but using animation does not use rna update callbacks hence no matrix update was
happening.
2016-05-03 11:44:17 +02:00
3dcc05c591 Cleanup: no need to cast for pointer comparison 2016-05-03 18:20:33 +10:00
c2f28864d6 Fix T48169: 1 pixel offset painting 2D textures
Painting at negative locations was using int-rounding.
2016-05-03 17:49:18 +10:00
ead2496e67 Cleanup: use offset macro 2016-05-03 16:40:14 +10:00
1fb17fcf23 UI: limit listview arrow/wheel bindings
Allow Ctrl-Up for eg to be used when in a list view.
2016-05-03 16:17:14 +10:00
e2a6fb1f0b UI: don't show tips when navigating ui-list 2016-05-03 14:59:45 +10:00
9953eeb012 Cleanup: use const for units API
Also make return args explicit.
2016-05-03 13:52:07 +10:00
48d3a8b54b Math Lib: inline project_plane_v3_v3v3 2016-05-03 13:48:00 +10:00
a58a8ebea7 Missed setting handles in curve dissolve 2016-05-03 00:06:12 +10:00
122496dda1 Correct header (can't use uint here) 2016-05-02 21:08:02 +10:00
f28c626574 Fix bl_load_py_modules test
- scripts that execute directly need to include their basedir in the sys.path
- modules which are in a directory without an __init__.py weren't importing.
2016-05-02 21:06:15 +10:00
b4a721af69 Merge branch 'temp_remove_pointcache' into blender2.8 2016-05-02 11:00:34 +02:00
5aa19be912 Merge branch 'temp_remove_particles' into blender2.8 2016-05-02 11:00:26 +02:00
143f6c4bb2 Curve: new dissolve tool
removes vertices, re-fitting the surrounding handles.
2016-05-02 18:50:12 +10:00
ec9cb57b01 Curve Fitting: expose function for fitting a single curve 2016-05-02 18:50:04 +10:00
915e9eeff1 BLI_array_utils: helper for stepping over contiguous ranges 2016-05-02 18:49:22 +10:00
c1ca667d4a Fix compilation error on Armel architecture
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_n are not defined on this architecture
for some reason, however those functions are available.

Adding a workaround for newly used __sync_fetch_and_and() function.
2016-05-02 09:55:08 +02:00
4e4ff72d13 Fix T48325: Data transfer modifier vertex group selector doesn't work with freestyle data.
Freestyle edge/face marks are (afaik) our only actual customdata bitflags... Original work
kinda assumed we had no such things. :P
2016-05-01 15:36:09 +02:00
1422f0dd16 Fix Cycles external OSL shader not working with relative file paths. 2016-05-01 01:44:52 +02:00
abf6f9f6cf Fix T48118: Vertex Groups not masking particle hair emission correctly
Own regression from rB019ce363b01bba0af, not totally sure why removing the heading
zero value in element_sum broke binary search distribution in random branch, but...

New code makes thing sooo much simpler, by simply getting rid of all zero-weight
items in element_sum (at the cost of adding a temporary extra index mapping array),
that way neither random nor 'even ordered' distribution code has to wory anymore
about skipping zero-weighted items!
2016-04-30 16:56:19 +02:00
b1f6cd5a6a Slight adjustment to curve fitting tangents
Don't let the point spacing give bias to a side.
2016-04-30 16:27:43 +10:00
6ab22064c2 Fix for typo comparing double events
Also remove doubles when filling the final array.
2016-04-30 16:21:06 +10:00
ac163447f8 Cleanup: warnings. spelling 2016-04-30 04:10:34 +10:00
461604c0d5 Fix (unreported) bad 'NULL freeing' with placeholder images.
Looks like code expects some initialized Image data after all, so do it
for placeholders as well (using default generated UV grid).
2016-04-29 18:05:49 +02:00
57eb8539fc Fix crash (segfault) in node editor.
In some cases, we can have nodegroups without attached nodetree, this case is checked
in top `node_group_has_output()` entry point, but not in recursive `node_group_has_output_dfs()`.

Issue appeared after rB42824f4403db3a35, presumably because check on node flag itself
was skipping that case, which is no more possible when using ID tags.

Reported by sebastian_k over IRC, thanks.
2016-04-29 17:37:00 +02:00
467e12514e Fix broken Collada from rBrB6d0cae56e84306ed. 2016-04-29 16:56:20 +02:00
2ba7b3ea1a install_deps: add support for OpenVDB.
Note that recent DEB-based distro have packages for this, even simpler!

Differential Revision: https://developer.blender.org/D1933
2016-04-29 16:45:09 +02:00
de0b480629 install_deps: add check for glew version, too old ones are not compatible with OSD.
In case too old system glew is detected, use the one shipped with blender.

Part of D1933.
2016-04-29 16:43:28 +02:00
3ccc61c03a install_deps: bunch of cleanups, tweaks and micro-fixes.
This commit mostly:
* removes some (very) old messages or hacks (like those for ubuntu 10.4...).
* Moves lib-specific dependencies installations to upper level
  (simpler to manage, and those are small enough packages).
* Uses new dnf package manager for fedora (sigh, we now have tree different commands for fed/suse/rehl).
* fixes or enhances some options for commandline tools.
* Force anew building of oiio package, due to insane dependencies of this one in recent distro.

Part of D1933.
2016-04-29 16:35:37 +02:00
6d0cae56e8 Fix T48290: Hook fails after deleting geometry
Now CD_SHAPEKEY_INDEX customdata is stored in edit-mode when hooks and vertex parents are used.

This also fixes a bug where undo would loose key-index data.

Move to structs for BM_mesh_bm_to/from_me to avoid passing many argument, which mostly aren't used.
2016-04-29 23:39:50 +10:00
b5ce2bbef7 BMesh: when multiple vertices have the same key-index, use the first
Simple error case where many vertices share an original index,
now use the first match instead of the last.
2016-04-29 21:52:09 +10:00
3e32f8e601 Fix T48298: Cycles World environment Texture node, movie doesn't update frame 2016-04-29 10:54:40 +02:00
9e1a9fa5bb Remove redundant selection flush call 2016-04-29 17:29:23 +10:00
d3344ca7b1 Minor optimization to bmesh shape key conversion
Avoid linked linked loop and custom-data lookups per vertex,
use a table of shape-keys with array offsets instead.
2016-04-29 15:02:04 +10:00
636195e402 Fix T48301: Cycles incorrect render with CMJ and viewport samples 0.
Max samples 2147483647 was causing integer overflow.
2016-04-28 23:57:20 +02:00
1962 changed files with 247734 additions and 67151 deletions

6
.gitignore vendored
View File

@@ -33,3 +33,9 @@ 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
/doc/python_api/rst/in_menu.png
/doc/python_api/rst/menu_id.png
/doc/python_api/rst/op_prop.png
/doc/python_api/rst/run_script.png
/doc/python_api/rst/spacebar.png

4
.gitmodules vendored
View File

@@ -10,3 +10,7 @@
path = release/datafiles/locale
url = ../blender-translations.git
ignore = all
[submodule "source/tools"]
path = source/tools
url = ../blender-dev-tools.git
ignore = all

File diff suppressed because it is too large Load Diff

View File

@@ -120,7 +120,7 @@ endif
# -----------------------------------------------------------------------------
# Build Blender
all: FORCE
all: .FORCE
@echo
@echo Configuring Blender in \"$(BUILD_DIR)\" ...
@@ -149,13 +149,13 @@ bpy: all
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
config: FORCE
config: .FORCE
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Help for build targets
help: FORCE
help: .FORCE
@echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
@echo " * debug - build a debug binary"
@@ -182,14 +182,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++)"
@@ -228,13 +234,13 @@ help: FORCE
# -----------------------------------------------------------------------------
# Packages
#
package_debian: FORCE
package_debian: .FORCE
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman: FORCE
package_pacman: .FORCE
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg
package_archive: FORCE
package_archive: .FORCE
make -C "$(BUILD_DIR)" -s package_archive
@echo archive in "$(BUILD_DIR)/release"
@@ -242,24 +248,24 @@ package_archive: FORCE
# -----------------------------------------------------------------------------
# Tests
#
test: FORCE
test: .FORCE
cd $(BUILD_DIR) ; ctest . --output-on-failure
# run pep8 check check on scripts we distribute.
test_pep8: FORCE
test_pep8: .FORCE
$(PYTHON) tests/python/pep8.py > test_pep8.log 2>&1
@echo "written: test_pep8.log"
# run some checks on our cmakefiles.
test_cmake: FORCE
test_cmake: .FORCE
$(PYTHON) build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
@echo "written: test_cmake_consistency.log"
# run deprecation tests, see if we have anything to remove.
test_deprecated: FORCE
test_deprecated: .FORCE
$(PYTHON) tests/check_deprecated.py
test_style_c: FORCE
test_style_c: .FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
@@ -267,7 +273,7 @@ test_style_c: FORCE
"$(BLENDER_DIR)/source/creator" \
--no-length-check
test_style_c_qtc: FORCE
test_style_c_qtc: .FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
@@ -280,7 +286,7 @@ test_style_c_qtc: FORCE
@echo "written: test_style.tasks"
test_style_osl: FORCE
test_style_osl: .FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
@@ -288,7 +294,7 @@ test_style_osl: FORCE
"$(BLENDER_DIR)/release/scripts/templates_osl"
test_style_osl_qtc: FORCE
test_style_osl_qtc: .FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
@@ -303,13 +309,13 @@ test_style_osl_qtc: FORCE
# Project Files
#
project_qtcreator: FORCE
project_qtcreator: .FORCE
$(PYTHON) build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_netbeans: FORCE
project_netbeans: .FORCE
$(PYTHON) build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
project_eclipse: FORCE
project_eclipse: .FORCE
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
@@ -317,40 +323,40 @@ project_eclipse: FORCE
# Static Checking
#
check_cppcheck: FORCE
check_cppcheck: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt"
check_clang_array: FORCE
check_clang_array: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint: FORCE
check_splint: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse: FORCE
check_sparse: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch: FORCE
check_smatch: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_spelling_py: FORCE
check_spelling_py: .FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/release/scripts"
check_spelling_c: FORCE
check_spelling_c: .FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
@@ -359,7 +365,7 @@ check_spelling_c: FORCE
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
check_spelling_c_qtc: FORCE
check_spelling_c_qtc: .FORCE
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
@@ -370,13 +376,13 @@ check_spelling_c_qtc: FORCE
> \
"$(BLENDER_DIR)/check_spelling_c.tasks"
check_spelling_osl: FORCE
check_spelling_osl: .FORCE
cd "$(BUILD_DIR)" ;\
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions: FORCE
check_descriptions: .FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python \
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
@@ -384,14 +390,14 @@ check_descriptions: FORCE
# Utilities
#
tgz: FORCE
tgz: .FORCE
./build_files/utils/build_tgz.sh
icons: FORCE
icons: .FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
update: FORCE
update: .FORCE
if [ -d "../lib" ]; then \
svn update ../lib/* ; \
fi
@@ -404,23 +410,25 @@ 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
doc_py: .FORCE
"$(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'"
doc_doxy: FORCE
doc_doxy: .FORCE
cd doc/doxygen; doxygen Doxyfile
@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
doc_dna: .FORCE
"$(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
doc_man: .FORCE
$(PYTHON) doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
help_features: FORCE
help_features: .FORCE
@$(PYTHON) -c \
"import re; \
print('\n'.join([ \
@@ -431,9 +439,9 @@ help_features: FORCE
if w.startswith('WITH_')]))" | uniq
clean: FORCE
clean: .FORCE
$(MAKE) -C "$(BUILD_DIR)" clean
.PHONY: all
FORCE:
.FORCE:

File diff suppressed because it is too large Load Diff

View File

@@ -94,6 +94,7 @@ all_repositories = {
r'git://git.blender.org/blender-translations.git': 'blender-translations',
r'git://git.blender.org/blender-addons.git': 'blender-addons',
r'git://git.blender.org/blender-addons-contrib.git': 'blender-addons-contrib',
r'git://git.blender.org/blender-dev-tools.git': 'blender-dev-tools',
r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
}
@@ -128,6 +129,7 @@ def schedule_force_build(name):
forcesched.CodebaseParameter(hide=True, codebase="blender-translations"),
forcesched.CodebaseParameter(hide=True, codebase="blender-addons"),
forcesched.CodebaseParameter(hide=True, codebase="blender-addons-contrib"),
forcesched.CodebaseParameter(hide=True, codebase="blender-dev-tools"),
forcesched.CodebaseParameter(hide=True, codebase="lib svn")],
properties=[]))
@@ -143,6 +145,7 @@ def schedule_build(name, hour, minute=0):
"blender-translations": {"repository": "", "branch": "master"},
"blender-addons": {"repository": "", "branch": "master"},
"blender-addons-contrib": {"repository": "", "branch": "master"},
"blender-dev-tools": {"repository": "", "branch": "master"},
"lib svn": {"repository": "", "branch": "trunk"}},
branch=current_branch,
builderNames=[name],
@@ -264,7 +267,8 @@ def generic_builder(id, libdir='', branch='', rsync=False):
for submodule in ('blender-translations',
'blender-addons',
'blender-addons-contrib'):
'blender-addons-contrib',
'blender-dev-tools'):
f.addStep(git_submodule_step(submodule))
f.addStep(git_step(branch))
@@ -285,7 +289,7 @@ def generic_builder(id, libdir='', branch='', rsync=False):
maxsize=150 * 1024 * 1024,
workdir='install'))
f.addStep(MasterShellCommand(name='unpack',
command=['python', unpack_script, filename],
command=['python2.7', unpack_script, filename],
description='unpacking',
descriptionDone='unpacked'))
return f
@@ -299,7 +303,8 @@ add_builder(c, 'linux_glibc219_i686_cmake', '', generic_builder, hour=3)
add_builder(c, 'linux_glibc219_x86_64_cmake', '', generic_builder, hour=4)
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=3)
add_builder(c, 'win64_cmake_vc2013', 'win64_vc12', generic_builder, hour=4)
add_builder(c, 'win64_cmake_vc2015', 'win64_vc14', generic_builder, hour=5)
add_builder(c, 'win32_cmake_vc2015', 'windows_vc14', generic_builder, hour=5)
add_builder(c, 'win64_cmake_vc2015', 'win64_vc14', generic_builder, hour=6)
# STATUS TARGETS
#

View File

@@ -56,7 +56,6 @@ if 'cmake' in builder:
chroot_name = None # If not None command will be delegated to that chroot
cuda_chroot_name = None # If not None cuda compilationcommand will be delegated to that chroot
build_cubins = True # Whether to build Cycles CUDA kernels
remove_install_dir = False # Remove installation folder before building
bits = 64
# Config file to be used (relative to blender's sources root)
@@ -70,19 +69,31 @@ if 'cmake' in builder:
cuda_cmake_options = []
if builder.startswith('mac'):
install_dir = None
# Set up OSX architecture
if builder.endswith('x86_64_10_6_cmake'):
cmake_extra_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/bin/nvcc')
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda8-hack/bin/nvcc')
cmake_extra_options.append('-DWITH_CODEC_QUICKTIME=OFF')
cmake_extra_options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6')
build_cubins = False
elif builder.startswith('win'):
install_dir = None
if builder.startswith('win64'):
cmake_options.append(['-G', '"Visual Studio 12 2013 Win64"'])
elif builder.startswith('win32'):
bits = 32
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
if builder.endswith('_vc2015'):
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 14 2015'])
cmake_extra_options.append('-DCUDA_NVCC_FLAGS=--cl-version;2013;' +
'--compiler-bindir;C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin')
else:
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 12 2013 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 12 2013'])
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/bin/nvcc.exe')
elif builder.startswith('linux'):
tokens = builder.split("_")
@@ -91,7 +102,6 @@ if 'cmake' in builder:
deb_name = "jessie"
elif glibc == 'glibc211':
deb_name = "squeeze"
remove_install_dir = True
cmake_config_file = "build_files/buildbot/config/blender_linux.cmake"
cmake_player_config_file = "build_files/buildbot/config/blender_linux_player.cmake"
if builder.endswith('x86_64_cmake'):
@@ -103,10 +113,13 @@ if 'cmake' in builder:
cuda_chroot_name = 'buildbot_' + deb_name + '_x86_64'
targets = ['player', 'blender', 'cuda']
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-8.0/bin/nvcc')
cmake_options.append("-C" + os.path.join(blender_dir, cmake_config_file))
# Prepare CMake options needed to configure cuda binaries compilation.
cuda_cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=%s" % ('ON' if build_cubins else 'OFF'))
cuda_cmake_options.append("-DCYCLES_CUDA_BINARIES_ARCH=sm_20;sm_21;sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61")
if build_cubins or 'cuda' in targets:
if bits == 32:
cuda_cmake_options.append("-DCUDA_64_BIT_DEVICE_CODE=OFF")
@@ -117,8 +130,7 @@ if 'cmake' in builder:
if 'cuda' not in targets:
cmake_options += cuda_cmake_options
if install_dir:
cmake_options.append("-DCMAKE_INSTALL_PREFIX=%s" % (install_dir))
cmake_options.append("-DCMAKE_INSTALL_PREFIX=%s" % (install_dir))
cmake_options += cmake_extra_options
@@ -133,10 +145,8 @@ if 'cmake' in builder:
cuda_chroot_prefix = chroot_prefix[:]
# Make sure no garbage remained from the previous run
# (only do it if builder requested this)
if remove_install_dir:
if os.path.isdir(install_dir):
shutil.rmtree(install_dir)
if os.path.isdir(install_dir):
shutil.rmtree(install_dir)
for target in targets:
print("Building target %s" % (target))
@@ -173,10 +183,8 @@ if 'cmake' in builder:
print('Condifuration FAILED!')
sys.exit(retcode)
if 'win32' in builder:
command = ['msbuild', 'INSTALL.vcxproj', '/Property:PlatformToolset=v120_xp', '/p:Configuration=Release']
elif 'win64' in builder:
command = ['msbuild', 'INSTALL.vcxproj', '/p:Configuration=Release']
if 'win32' in builder or 'win64' in builder:
command = ['cmake', '--build', '.', '--target', target_name, '--config', 'Release']
else:
command = target_chroot_prefix + ['make', '-s', '-j2', target_name]

View File

@@ -108,6 +108,8 @@ if builder.find('cmake') != -1:
platform += 'i386'
elif builder.endswith('ppc_10_6_cmake'):
platform += 'ppc'
if builder.endswith('vc2015'):
platform += "-vc14"
builderified_name = 'blender-{}-{}-{}'.format(blender_full_version, git_hash, platform)
if branch != '':
builderified_name = branch + "-" + builderified_name

View File

@@ -0,0 +1,70 @@
# - Find Alembic library
# Find the native Alembic includes and libraries
# This module defines
# ALEMBIC_INCLUDE_DIRS, where to find Alembic headers, Set when
# ALEMBIC_INCLUDE_DIR is found.
# ALEMBIC_LIBRARIES, libraries to link against to use Alembic.
# ALEMBIC_ROOT_DIR, The base directory to search for Alembic.
# This can also be an environment variable.
# ALEMBIC_FOUND, If false, do not try to use Alembic.
#
#=============================================================================
# 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 ALEMBIC_ROOT_DIR was defined in the environment, use it.
IF(NOT ALEMBIC_ROOT_DIR AND NOT $ENV{ALEMBIC_ROOT_DIR} STREQUAL "")
SET(ALEMBIC_ROOT_DIR $ENV{ALEMBIC_ROOT_DIR})
ENDIF()
SET(_alembic_SEARCH_DIRS
${ALEMBIC_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/alembic
)
FIND_PATH(ALEMBIC_INCLUDE_DIR
NAMES
Alembic/Abc/All.h
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(ALEMBIC_LIBRARY
NAMES
Alembic
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib lib/static
)
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALEMBIC DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)
IF(ALEMBIC_FOUND)
SET(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARY})
SET(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
ENDIF(ALEMBIC_FOUND)
MARK_AS_ADVANCED(
ALEMBIC_INCLUDE_DIR
ALEMBIC_LIBRARY
)
UNSET(_alembic_SEARCH_DIRS)

View File

@@ -0,0 +1,69 @@
# - Find HDF5 library
# Find the native HDF5 includes and libraries
# This module defines
# HDF5_INCLUDE_DIRS, where to find hdf5.h, Set when HDF5_INCLUDE_DIR is found.
# HDF5_LIBRARIES, libraries to link against to use HDF5.
# HDF5_ROOT_DIR, The base directory to search for HDF5.
# This can also be an environment variable.
# HDF5_FOUND, If false, do not try to use HDF5.
#
#=============================================================================
# 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 HDF5_ROOT_DIR was defined in the environment, use it.
IF(NOT HDF5_ROOT_DIR AND NOT $ENV{HDF5_ROOT_DIR} STREQUAL "")
SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR})
ENDIF()
SET(_hdf5_SEARCH_DIRS
${HDF5_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/hdf5
)
FIND_LIBRARY(HDF5_LIBRARY
NAMES
hdf5
HINTS
${_hdf5_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_PATH(HDF5_INCLUDE_DIR
NAMES
hdf5.h
HINTS
${_hdf5_SEARCH_DIRS}
PATH_SUFFIXES
include
)
# handle the QUIETLY and REQUIRED arguments and set HDF5_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG HDF5_LIBRARY HDF5_INCLUDE_DIR)
IF(HDF5_FOUND)
SET(HDF5_LIBRARIES ${HDF5_LIBRARY})
SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
ENDIF(HDF5_FOUND)
MARK_AS_ADVANCED(
HDF5_INCLUDE_DIR
HDF5_LIBRARY
)
UNSET(_hdf5_SEARCH_DIRS)

View File

@@ -1,15 +1,15 @@
# - Find Jack library
# Find the native Jack includes and library
# - Find JACK library
# Find the native JACK includes and library
# This module defines
# JACK_INCLUDE_DIRS, where to find jack.h, Set when
# JACK_INCLUDE_DIR is found.
# JACK_LIBRARIES, libraries to link against to use Jack.
# JACK_ROOT_DIR, The base directory to search for Jack.
# JACK_LIBRARIES, libraries to link against to use JACK.
# JACK_ROOT_DIR, The base directory to search for JACK.
# This can also be an environment variable.
# JACK_FOUND, If false, do not try to use Jack.
# JACK_FOUND, If false, do not try to use JACK.
#
# also defined, but not for general use are
# JACK_LIBRARY, where to find the Jack library.
# JACK_LIBRARY, where to find the JACK library.
#=============================================================================
# Copyright 2011 Blender Foundation.

View File

@@ -23,6 +23,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
${CMAKE_SOURCE_DIR}/extern/glog/src
${CMAKE_SOURCE_DIR}/extern/gflags/src
${CMAKE_SOURCE_DIR}/extern/gtest/include
${CMAKE_SOURCE_DIR}/extern/gmock/include
)
unset(_current_include_directories)
@@ -33,6 +34,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
bf_testing_main
bf_intern_guardedalloc
extern_gtest
extern_gmock
# needed for glog
${PTHREADS_LIBRARIES}
extern_glog

View File

@@ -1,5 +1,10 @@
# This is called by cmake as an extermal process from
# This is called by cmake as an external process from
# ./source/creator/CMakeLists.txt to write ./source/creator/buildinfo.h
# Caller must define:
# SOURCE_DIR
# Optional overrides:
# BUILD_DATE
# BUILD_TIME
# Extract working copy information for SOURCE_DIR into MY_XXX variables
# with a default in case anything fails, for example when using git-svn
@@ -22,13 +27,12 @@ if(EXISTS ${SOURCE_DIR}/.git)
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git branch --list master --contains ${MY_WC_HASH}
execute_process(COMMAND git branch --list master blender-v* --contains ${MY_WC_HASH}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_contains_check
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "^[ \t]+" "" _git_contains_check "${_git_contains_check}")
if(_git_contains_check STREQUAL "master")
if(NOT _git_contains_check STREQUAL "")
set(MY_WC_BRANCH "master")
else()
execute_process(COMMAND git show-ref --tags -d
@@ -43,6 +47,22 @@ if(EXISTS ${SOURCE_DIR}/.git)
if(_git_tag_hashes MATCHES "${_git_head_hash}")
set(MY_WC_BRANCH "master")
else()
execute_process(COMMAND git branch --contains ${MY_WC_HASH}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_contains_branches
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "^\\*[ \t]+" "" _git_contains_branches "${_git_contains_branches}")
string(REGEX REPLACE "[\r\n]+" ";" _git_contains_branches "${_git_contains_branches}")
string(REGEX REPLACE ";[ \t]+" ";" _git_contains_branches "${_git_contains_branches}")
foreach(_branch ${_git_contains_branches})
if (NOT "${_branch}" MATCHES "\\(HEAD.*")
set(MY_WC_BRANCH "${_branch}")
break()
endif()
endforeach()
unset(_branch)
unset(_git_contains_branches)
endif()
unset(_git_tag_hashes)
@@ -128,12 +148,19 @@ endif()
# BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
# but BUILD_DATE and BUILD_TIME are platform dependent
if(UNIX)
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(WIN32)
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT BUILD_DATE)
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT BUILD_TIME)
execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
elseif(WIN32)
if(NOT BUILD_DATE)
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT BUILD_TIME)
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
# Write a file with the BUILD_HASH define

View File

@@ -239,8 +239,8 @@ def file_check_arg_sizes(tu):
if 0:
print("---",
" <~> ".join(
[" ".join([t.spelling for t in C.get_tokens()])
for C in node.get_children()]
[" ".join([t.spelling for t in C.get_tokens()])
for C in node.get_children()]
))
# print(node.location)

View File

@@ -29,11 +29,11 @@ if not sys.version.startswith("3"):
sys.exit(1)
from cmake_consistency_check_config import (
IGNORE,
UTF8_CHECK,
SOURCE_DIR,
BUILD_DIR,
)
IGNORE,
UTF8_CHECK,
SOURCE_DIR,
BUILD_DIR,
)
import os

View File

@@ -31,7 +31,7 @@ IGNORE = (
"extern/carve/patches/files/random.h",
"intern/audaspace/SRC/AUD_SRCResampleFactory.h",
"intern/audaspace/SRC/AUD_SRCResampleReader.h",
)
)
UTF8_CHECK = True

View File

@@ -37,19 +37,19 @@ if not project_info.init(sys.argv[-1]):
sys.exit(1)
from project_info import (
SIMPLE_PROJECTFILE,
SOURCE_DIR,
CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
# is_py,
cmake_advanced_info,
cmake_compiler_defines,
cmake_cache_var,
project_name_get,
)
SIMPLE_PROJECTFILE,
SOURCE_DIR,
CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
# is_py,
cmake_advanced_info,
cmake_compiler_defines,
cmake_cache_var,
project_name_get,
)
import os

View File

@@ -43,17 +43,17 @@ def quote_define(define):
def create_qtc_project_main(name):
from project_info import (
SIMPLE_PROJECTFILE,
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
SIMPLE_PROJECTFILE,
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
@@ -69,7 +69,7 @@ def create_qtc_project_main(name):
with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') as f:
f.write("\n".join(sorted(list(set(os.path.dirname(f)
for f in files_rel if is_c_header(f))))))
for f in files_rel if is_c_header(f))))))
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
with open(qtc_prj, 'w') as f:
@@ -87,7 +87,7 @@ def create_qtc_project_main(name):
# for some reason it doesnt give all internal includes
includes = list(set(includes) | set(os.path.dirname(f)
for f in files_rel if is_c_header(f)))
for f in files_rel if is_c_header(f)))
includes.sort()
# be tricky, get the project name from CMake if we can!
@@ -125,13 +125,13 @@ def create_qtc_project_main(name):
def create_qtc_project_python(name):
from project_info import (
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_py,
project_name_get,
)
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_py,
project_name_get,
)
files = list(source_list(SOURCE_DIR, filename_check=is_py))
files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
@@ -161,24 +161,24 @@ def argparse_create():
import argparse
parser = argparse.ArgumentParser(
description="This script generates Qt Creator project files for Blender",
)
description="This script generates Qt Creator project files for Blender",
)
parser.add_argument(
"-n", "--name",
dest="name",
metavar='NAME', type=str,
help="Override default project name (\"Blender\")",
required=False,
)
"-n", "--name",
dest="name",
metavar='NAME', type=str,
help="Override default project name (\"Blender\")",
required=False,
)
parser.add_argument(
"-b", "--build-dir",
dest="build_dir",
metavar='BUILD_DIR', type=str,
help="Specify the build path (or fallback to the $PWD)",
required=False,
)
"-b", "--build-dir",
dest="build_dir",
metavar='BUILD_DIR', type=str,
help="Specify the build path (or fallback to the $PWD)",
required=False,
)
return parser

View File

@@ -32,7 +32,7 @@ USE_QUIET = (os.environ.get("QUIET", None) is not None)
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
]
]
CHECKER_BIN = "python2"
@@ -42,7 +42,7 @@ CHECKER_ARGS = [
"-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
# stupid but needed
"-Dbool=char"
]
]
def main():

View File

@@ -32,7 +32,7 @@ USE_QUIET = (os.environ.get("QUIET", None) is not None)
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
]
]
CHECKER_BIN = "cppcheck"
@@ -43,7 +43,7 @@ CHECKER_ARGS = [
"--max-configs=1", # speeds up execution
# "--check-config", # when includes are missing
"--enable=all", # if you want sixty hundred pedantic suggestions
]
]
if USE_QUIET:
CHECKER_ARGS.append("--quiet")

View File

@@ -25,13 +25,13 @@
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
]
]
CHECKER_BIN = "smatch"
CHECKER_ARGS = [
"--full-path",
"--two-passes",
]
]
import project_source_info
import subprocess

View File

@@ -25,11 +25,11 @@
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
]
]
CHECKER_BIN = "sparse"
CHECKER_ARGS = [
]
]
import project_source_info
import subprocess

View File

@@ -25,7 +25,7 @@
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",
]
]
CHECKER_BIN = "splint"
@@ -61,7 +61,7 @@ CHECKER_ARGS = [
# dummy, witjout this splint complains with:
# /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON
"-D_PC_MAX_CANON=0",
]
]
import project_source_info

View File

@@ -4,6 +4,7 @@
# cmake -C../blender/build_files/cmake/config/blender_full.cmake ../blender
#
set(WITH_ALEMBIC ON CACHE BOOL "" FORCE)
set(WITH_BUILDINFO ON CACHE BOOL "" FORCE)
set(WITH_BULLET ON CACHE BOOL "" FORCE)
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
@@ -11,6 +12,7 @@ set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OPENSUBDIV ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
@@ -54,7 +56,7 @@ set(WITH_PLAYER ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
# platform dependant options
# platform dependent options
if(UNIX AND NOT APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)

View File

@@ -8,6 +8,7 @@
set(WITH_INSTALL_PORTABLE ON CACHE BOOL "" FORCE)
set(WITH_SYSTEM_GLEW ON CACHE BOOL "" FORCE)
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_AVI OFF CACHE BOOL "" FORCE)
@@ -15,6 +16,7 @@ set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
@@ -47,6 +49,7 @@ set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION OFF CACHE BOOL "" FORCE)
set(WITH_SDL OFF CACHE BOOL "" FORCE)

View File

@@ -0,0 +1,79 @@
# Turn everything ON thats expected for an official release builds.
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/blender_release.cmake ../blender
#
set(WITH_ALEMBIC ON CACHE BOOL "" FORCE)
set(WITH_BUILDINFO ON CACHE BOOL "" FORCE)
set(WITH_BULLET ON CACHE BOOL "" FORCE)
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OPENSUBDIV ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_LZMA ON CACHE BOOL "" FORCE)
set(WITH_LZO ON CACHE BOOL "" FORCE)
set(WITH_MOD_BOOLEAN ON CACHE BOOL "" FORCE)
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
set(WITH_MOD_REMESH ON CACHE BOOL "" FORCE)
set(WITH_MOD_SMOKE ON CACHE BOOL "" FORCE)
set(WITH_MOD_OCEANSIM ON CACHE BOOL "" FORCE)
set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
set(WITH_OPENAL ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
set(WITH_OPENMP ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
set(WITH_SDL ON CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_20;sm_21;sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61 CACHE STRING "" FORCE)
# platform dependent options
if(UNIX AND NOT APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
elseif(WIN32)
set(WITH_JACK OFF CACHE BOOL "" FORCE)
if(NOT CMAKE_COMPILER_IS_GNUCC)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
else()
# MinGW exceptions
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
endif()
elseif(APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME ON CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
endif()

View File

@@ -32,3 +32,4 @@ set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)

View File

@@ -74,7 +74,7 @@ def main():
"rebuild_cache",
"depend",
"cmake_check_build_system",
])
])
targets -= set(bad)

View File

@@ -196,8 +196,33 @@ function(blender_source_group
endfunction()
# Support per-target CMake flags
# Read from: CMAKE_C_FLAGS_**** (made upper case) when set.
#
# 'name' should alway match the target name,
# use this macro before add_library or add_executable.
#
# Optionally takes an arg passed to set(), eg PARENT_SCOPE.
macro(add_cc_flags_custom_test
name
)
string(TOUPPER ${name} _name_upper)
if(DEFINED CMAKE_C_FLAGS_${_name_upper})
message(STATUS "Using custom CFLAGS: CMAKE_C_FLAGS_${_name_upper} in \"${CMAKE_CURRENT_SOURCE_DIR}\"")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${_name_upper}}" ${ARGV1})
endif()
if(DEFINED CMAKE_CXX_FLAGS_${_name_upper})
message(STATUS "Using custom CXXFLAGS: CMAKE_CXX_FLAGS_${_name_upper} in \"${CMAKE_CURRENT_SOURCE_DIR}\"")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_name_upper}}" ${ARGV1})
endif()
unset(_name_upper)
endmacro()
# only MSVC uses SOURCE_GROUP
function(blender_add_lib_nolist
function(blender_add_lib__impl
name
sources
includes
@@ -225,6 +250,18 @@ function(blender_add_lib_nolist
endfunction()
function(blender_add_lib_nolist
name
sources
includes
includes_sys
)
add_cc_flags_custom_test(${name} PARENT_SCOPE)
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}")
endfunction()
function(blender_add_lib
name
sources
@@ -232,7 +269,9 @@ function(blender_add_lib
includes_sys
)
blender_add_lib_nolist(${name} "${sources}" "${includes}" "${includes_sys}")
add_cc_flags_custom_test(${name} PARENT_SCOPE)
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}")
set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
endfunction()
@@ -294,6 +333,11 @@ function(SETUP_LIBDIRS)
link_directories(${LLVM_LIBPATH})
endif()
if(WITH_ALEMBIC)
link_directories(${ALEMBIC_LIBPATH})
link_directories(${HDF5_LIBPATH})
endif()
if(WIN32 AND NOT UNIX)
link_directories(${PTHREADS_LIBPATH})
endif()
@@ -315,7 +359,6 @@ function(setup_liblinks
target_link_libraries(
${target}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
${FREETYPE_LIBRARY}
)
@@ -372,7 +415,7 @@ function(setup_liblinks
if(WITH_OPENCOLORIO)
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
endif()
if(WITH_OPENSUBDIV)
if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
if(WIN32 AND NOT UNIX)
file_list_suffix(OPENSUBDIV_LIBRARIES_DEBUG "${OPENSUBDIV_LIBRARIES}" "_d")
target_link_libraries_debug(${target} "${OPENSUBDIV_LIBRARIES_DEBUG}")
@@ -395,6 +438,9 @@ function(setup_liblinks
endif()
endif()
target_link_libraries(${target} ${JPEG_LIBRARIES})
if(WITH_ALEMBIC)
target_link_libraries(${target} ${ALEMBIC_LIBRARIES} ${HDF5_LIBRARIES})
endif()
if(WITH_IMAGE_OPENEXR)
target_link_libraries(${target} ${OPENEXR_LIBRARIES})
endif()
@@ -435,9 +481,6 @@ function(setup_liblinks
if(WITH_MEM_JEMALLOC)
target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
endif()
if(WITH_INPUT_NDOF)
target_link_libraries(${target} ${NDOF_LIBRARIES})
endif()
if(WITH_MOD_CLOTH_ELTOPO)
target_link_libraries(${target} ${LAPACK_LIBRARIES})
endif()
@@ -451,6 +494,9 @@ function(setup_liblinks
if(WITH_OPENMP_STATIC)
target_link_libraries(${target} ${OpenMP_LIBRARIES})
endif()
if(WITH_INPUT_NDOF)
target_link_libraries(${target} ${NDOF_LIBRARIES})
endif()
endif()
# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
@@ -463,11 +509,17 @@ function(setup_liblinks
endif()
endif()
target_link_libraries(
${target}
${ZLIB_LIBRARIES}
)
#system libraries with no dependencies such as platform link libs or opengl should go last
target_link_libraries(${target}
${BLENDER_GL_LIBRARIES})
target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
#target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
target_link_libraries(${target} ${PLATFORM_LINKLIBS})
endfunction()
@@ -487,6 +539,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
if(WITH_CYCLES)
list(APPEND BLENDER_LINK_LIBS
cycles_render
cycles_graph
cycles_bvh
cycles_device
cycles_kernel
@@ -551,11 +604,11 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_modifiers
bf_bmesh
bf_gpu
bf_blenloader
bf_blenkernel
bf_physics
bf_nodes
bf_rna
bf_blenloader
bf_imbuf
bf_blenlib
bf_depsgraph
@@ -567,6 +620,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_imbuf_openimageio
bf_imbuf_dds
bf_collada
bf_alembic
bf_intern_elbeem
bf_intern_memutil
bf_intern_guardedalloc
@@ -600,6 +654,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_intern_dualcon
bf_intern_cycles
cycles_render
cycles_graph
cycles_bvh
cycles_device
cycles_kernel
@@ -659,10 +714,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
endif()
if(WITH_INPUT_NDOF)
list(APPEND BLENDER_SORTED_LIBS bf_intern_ghostndof3dconnexion)
endif()
if(WITH_MOD_BOOLEAN)
list(APPEND BLENDER_SORTED_LIBS extern_carve)
endif()
@@ -687,7 +738,15 @@ function(SETUP_BLENDER_SORTED_LIBS)
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
endif()
if(WITH_OPENSUBDIV)
if(WITH_GAMEENGINE_DECKLINK)
list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
endif()
if(WIN32)
list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
endif()
if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
list(APPEND BLENDER_SORTED_LIBS bf_intern_opensubdiv)
endif()
@@ -803,7 +862,15 @@ macro(TEST_UNORDERED_MAP_SUPPORT)
# UNORDERED_MAP_NAMESPACE, namespace for unordered_map, if found
include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_STD_UNORDERED_MAP_HEADER)
# Workaround for newer GCC (6.x+) where C++11 was enabled by default, which lead us
# to a situation when there is <unordered_map> include but which can't be used uless
# C++11 is enabled.
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
set(HAVE_STD_UNORDERED_MAP_HEADER False)
else()
CHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_STD_UNORDERED_MAP_HEADER)
endif()
if(HAVE_STD_UNORDERED_MAP_HEADER)
# Even so we've found unordered_map header file it doesn't
# mean unordered_map and unordered_set will be declared in
@@ -873,8 +940,16 @@ macro(TEST_SHARED_PTR_SUPPORT)
# otherwise it's assumed to be defined in std namespace.
include(CheckIncludeFileCXX)
include(CheckCXXSourceCompiles)
set(SHARED_PTR_FOUND FALSE)
CHECK_INCLUDE_FILE_CXX(memory HAVE_STD_MEMORY_HEADER)
# Workaround for newer GCC (6.x+) where C++11 was enabled by default, which lead us
# to a situation when there is <unordered_map> include but which can't be used uless
# C++11 is enabled.
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
set(HAVE_STD_MEMORY_HEADER False)
else()
CHECK_INCLUDE_FILE_CXX(memory HAVE_STD_MEMORY_HEADER)
endif()
if(HAVE_STD_MEMORY_HEADER)
# Finding the memory header doesn't mean that shared_ptr is in std
# namespace.
@@ -882,7 +957,6 @@ macro(TEST_SHARED_PTR_SUPPORT)
# In particular, MSVC 2008 has shared_ptr declared in std::tr1. In
# order to support this, we do an extra check to see which namespace
# should be used.
include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("#include <memory>
int main() {
std::shared_ptr<int> int_ptr;
@@ -1050,6 +1124,19 @@ macro(remove_strict_flags_file
endmacro()
# External libs may need 'signed char' to be default.
macro(remove_cc_flag_unsigned_char)
if(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|Intel)$")
remove_cc_flag("-funsigned-char")
elseif(MSVC)
remove_cc_flag("/J")
else()
message(WARNING
"Compiler '${CMAKE_C_COMPILER_ID}' failed to disable 'unsigned char' flag."
"Build files need updating."
)
endif()
endmacro()
function(ADD_CHECK_C_COMPILER_FLAG
_CFLAGS
@@ -1474,3 +1561,44 @@ function(print_all_vars)
message("${_var}=${${_var}}")
endforeach()
endfunction()
macro(openmp_delayload
projectname
)
if(MSVC)
if(WITH_OPENMP)
if(MSVC_VERSION EQUAL 1800)
set(OPENMP_DLL_NAME "vcomp120")
else()
set(OPENMP_DLL_NAME "vcomp140")
endif()
SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_RELEASE "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_DEBUG "/DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_MINSIZEREL "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
endif(WITH_OPENMP)
endif(MSVC)
endmacro()
MACRO(WINDOWS_SIGN_TARGET target)
if (WITH_WINDOWS_CODESIGN)
if (!SIGNTOOL_EXE)
error("Codesigning is enabled, but signtool is not found")
else()
if (WINDOWS_CODESIGN_PFX_PASSWORD)
set(CODESIGNPASSWORD /p ${WINDOWS_CODESIGN_PFX_PASSWORD})
else()
if ($ENV{PFXPASSWORD})
set(CODESIGNPASSWORD /p $ENV{PFXPASSWORD})
else()
message( FATAL_ERROR "WITH_WINDOWS_CODESIGN is on but WINDOWS_CODESIGN_PFX_PASSWORD not set, and environment variable PFXPASSWORD not found, unable to sign code.")
endif()
endif()
add_custom_command(TARGET ${target}
POST_BUILD
COMMAND ${SIGNTOOL_EXE} sign /f ${WINDOWS_CODESIGN_PFX} ${CODESIGNPASSWORD} $<TARGET_FILE:${target}>
VERBATIM
)
endif()
endif()
ENDMACRO()

View File

@@ -38,7 +38,21 @@ unset(MY_WC_HASH)
# Force Package Name
execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE CPACK_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME_LOWER}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${CMAKE_SYSTEM_PROCESSOR})
if (MSVC)
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PACKAGE_ARCH windows64)
else()
set(PACKAGE_ARCH windows32)
endif()
else(MSVC)
set(PACKAGE_ARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
if (CPACK_OVERRIDE_PACKAGENAME)
set(CPACK_PACKAGE_FILE_NAME ${CPACK_OVERRIDE_PACKAGENAME}-${PACKAGE_ARCH})
else()
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME_LOWER}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${PACKAGE_ARCH})
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# RPM packages
@@ -83,6 +97,8 @@ if(WIN32)
endif()
set(CPACK_PACKAGE_EXECUTABLES "blender" "blender")
set(CPACK_CREATE_DESKTOP_LINKS "blender" "blender")
include(CPack)
# Target for build_archive.py script, to automatically pass along

View File

@@ -0,0 +1,465 @@
# ***** 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.
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Apple.
if(NOT DEFINED LIBDIR)
if(WITH_CXX11)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
else()
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
endif()
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif()
if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
endif()
if(WITH_OPENAL)
find_package(OpenAL)
if(OPENAL_FOUND)
set(WITH_OPENAL ON)
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
else()
set(WITH_OPENAL OFF)
endif()
endif()
if(WITH_ALEMBIC)
set(ALEMBIC ${LIBDIR}/alembic)
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
set(ALEMBIC_LIBRARIES Alembic)
endif()
if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
set(OPENSUBDIV ${LIBDIR}/opensubdiv)
set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
find_library(OSD_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
find_library(OSD_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
list(APPEND OPENSUBDIV_LIBRARIES ${OSD_LIB_CPU} ${OSD_LIB_GPU})
endif()
if(WITH_JACK)
find_library(JACK_FRAMEWORK
NAMES jackmp
)
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
if(NOT JACK_FRAMEWORK)
set(WITH_JACK OFF)
endif()
endif()
if(WITH_CODEC_SNDFILE)
set(SNDFILE ${LIBDIR}/sndfile)
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
set(SNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
set(SNDFILE_LIBPATH ${SNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
endif()
if(WITH_PYTHON)
# we use precompiled libraries for py 3.5 and up by default
set(PYTHON_VERSION 3.5)
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
# normally cached but not since we include them with blender
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
else()
# module must be compiled against Python framework
set(_py_framework "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}")
set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}m")
set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}m")
set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
#set(PYTHON_LIBRARY python${PYTHON_VERSION})
#set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
unset(_py_framework)
endif()
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
if(NOT EXISTS "${PYTHON_EXECUTABLE}")
message(FATAL_ERROR "Python executable missing: ${PYTHON_EXECUTABLE}")
endif()
endif()
if(WITH_FFTW3)
set(FFTW3 ${LIBDIR}/fftw3)
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
set(FFTW3_LIBRARIES fftw3)
set(FFTW3_LIBPATH ${FFTW3}/lib)
endif()
set(PNG_LIBRARIES png)
set(JPEG_LIBRARIES jpeg)
set(ZLIB /usr)
set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
set(ZLIB_LIBRARIES z bz2)
set(FREETYPE ${LIBDIR}/freetype)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
set(FREETYPE_LIBRARY freetype)
if(WITH_IMAGE_OPENEXR)
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
if(WITH_CXX11)
set(OPENEXR_POSTFIX -2_2)
else()
set(OPENEXR_POSTFIX)
endif()
set(OPENEXR_LIBRARIES
Iex${OPENEXR_POSTFIX}
Half
IlmImf${OPENEXR_POSTFIX}
Imath${OPENEXR_POSTFIX}
IlmThread${OPENEXR_POSTFIX})
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg)
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
set(FFMPEG_LIBRARIES
avcodec avdevice avformat avutil
mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg
)
if(WITH_CXX11)
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} schroedinger orc vpx)
endif()
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
endif()
if(WITH_OPENJPEG OR WITH_CODEC_FFMPEG)
# use openjpeg from libdir that is linked into ffmpeg
if(WITH_CXX11)
set(OPENJPEG ${LIBDIR}/openjpeg)
set(WITH_SYSTEM_OPENJPEG ON)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjpeg.a)
endif()
endif()
find_library(SYSTEMSTUBS_LIBRARY
NAMES
SystemStubs
PATHS
)
mark_as_advanced(SYSTEMSTUBS_LIBRARY)
if(SYSTEMSTUBS_LIBRARY)
list(APPEND PLATFORM_LINKLIBS SystemStubs)
endif()
set(PLATFORM_CFLAGS "-pipe -funsigned-char")
set(PLATFORM_LINKFLAGS
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio"
)
if(WITH_CODEC_QUICKTIME)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
# libSDL still needs 32bit carbon quicktime
endif()
endif()
if(WITH_CXX11)
list(APPEND PLATFORM_LINKLIBS c++)
else()
list(APPEND PLATFORM_LINKLIBS stdc++)
endif()
if(WITH_JACK)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework jackmp")
endif()
if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
# force cmake to link right framework
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")
endif()
if(WITH_OPENCOLLADA)
set(OPENCOLLADA ${LIBDIR}/opencollada)
set(OPENCOLLADA_INCLUDE_DIRS
${LIBDIR}/opencollada/include/COLLADAStreamWriter
${LIBDIR}/opencollada/include/COLLADABaseUtils
${LIBDIR}/opencollada/include/COLLADAFramework
${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
${LIBDIR}/opencollada/include/GeneratedSaxParser
)
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
set(OPENCOLLADA_LIBRARIES
OpenCOLLADASaxFrameworkLoader
-lOpenCOLLADAFramework
-lOpenCOLLADABaseUtils
-lOpenCOLLADAStreamWriter
-lMathMLSolver
-lGeneratedSaxParser
-lxml2 -lbuffer -lftoa
)
# Use UTF functions from collada if LLVM is not enabled
if(NOT WITH_LLVM)
list(APPEND OPENCOLLADA_LIBRARIES -lUTF)
endif()
# pcre is bundled with openCollada
#set(PCRE ${LIBDIR}/pcre)
#set(PCRE_LIBPATH ${PCRE}/lib)
set(PCRE_LIBRARIES pcre)
#libxml2 is used
#set(EXPAT ${LIBDIR}/expat)
#set(EXPAT_LIBPATH ${EXPAT}/lib)
set(EXPAT_LIB)
endif()
if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBRARY SDL2)
set(SDL_LIBPATH ${SDL}/lib)
if(WITH_CXX11)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
else()
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lazy_framework ForceFeedback")
endif()
endif()
set(PNG "${LIBDIR}/png")
set(PNG_INCLUDE_DIRS "${PNG}/include")
set(PNG_LIBPATH ${PNG}/lib)
set(JPEG "${LIBDIR}/jpeg")
set(JPEG_INCLUDE_DIR "${JPEG}/include")
set(JPEG_LIBPATH ${JPEG}/lib)
if(WITH_IMAGE_TIFF)
set(TIFF ${LIBDIR}/tiff)
set(TIFF_INCLUDE_DIR ${TIFF}/include)
set(TIFF_LIBRARY tiff)
set(TIFF_LIBPATH ${TIFF}/lib)
endif()
if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
if(WITH_CXX11)
set(BOOST_POSTFIX)
else()
set(BOOST_POSTFIX -mt)
endif()
set(BOOST_LIBRARIES
boost_date_time${BOOST_POSTFIX}
boost_filesystem${BOOST_POSTFIX}
boost_regex${BOOST_POSTFIX}
boost_system${BOOST_POSTFIX}
boost_thread${BOOST_POSTFIX}
boost_wave${BOOST_POSTFIX}
)
if(WITH_INTERNATIONAL)
list(APPEND BOOST_LIBRARIES boost_locale${BOOST_POSTFIX})
endif()
if(WITH_CYCLES_NETWORK)
list(APPEND BOOST_LIBRARIES boost_serialization${BOOST_POSTFIX})
endif()
if(WITH_OPENVDB)
list(APPEND BOOST_LIBRARIES boost_iostreams${BOOST_POSTFIX})
endif()
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_DEFINITIONS)
endif()
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale and ffmpeg needs it !
endif()
if(WITH_OPENIMAGEIO)
set(OPENIMAGEIO ${LIBDIR}/openimageio)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
set(OPENIMAGEIO_LIBRARIES
${OPENIMAGEIO}/lib/libOpenImageIO.a
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${TIFF_LIBRARY}
${OPENEXR_LIBRARIES}
${ZLIB_LIBRARIES}
)
set(OPENIMAGEIO_LIBPATH
${OPENIMAGEIO}/lib
${JPEG_LIBPATH}
${PNG_LIBPATH}
${TIFF_LIBPATH}
${OPENEXR_LIBPATH}
${ZLIB_LIBPATH}
)
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
endif()
if(WITH_OPENCOLORIO)
set(OPENCOLORIO ${LIBDIR}/opencolorio)
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
endif()
if(WITH_OPENVDB)
set(OPENVDB ${LIBDIR}/openvdb)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(TBB_INCLUDE_DIRS ${LIBDIR}/tbb/include)
set(TBB_LIBRARIES ${LIBDIR}/tbb/lib/libtbb.a)
set(OPENVDB_LIBRARIES openvdb blosc ${TBB_LIBRARIES})
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
set(OPENVDB_DEFINITIONS)
endif()
if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_VERSION "3.4" CACHE STRING "Version of LLVM to use")
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
else()
set(LLVM_CONFIG llvm-config)
endif()
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
find_library(LLVM_LIBRARY
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
else()
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
endif()
else()
message(FATAL_ERROR "LLVM not found.")
endif()
endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
# WARNING! depends on correct order of OSL libs linking
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
set(OSL_FOUND TRUE)
else()
message(STATUS "OSL not found")
set(WITH_CYCLES_OSL OFF)
endif()
endif()
if(WITH_OPENMP)
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE COMPILER_VENDOR)
string(SUBSTRING "${COMPILER_VENDOR}" 0 5 VENDOR_NAME) # truncate output
if(${VENDOR_NAME} MATCHES "Apple") # Apple does not support OpenMP reliable with gcc and not with clang
set(WITH_OPENMP OFF)
else() # vanilla gcc or clang_omp support OpenMP
message(STATUS "Using special OpenMP enabled compiler !") # letting find_package(OpenMP) module work for gcc
if(CMAKE_C_COMPILER_ID MATCHES "Clang") # clang-omp in darwin libs
set(OPENMP_FOUND ON)
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "C compiler flags for OpenMP parallization" FORCE)
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "C++ compiler flags for OpenMP parallization" FORCE)
include_directories(${LIBDIR}/openmp/include)
link_directories(${LIBDIR}/openmp/lib)
# This is a workaround for our helperbinaries ( datatoc, masgfmt, ... ),
# They are linked also to omp lib, so we need it in builddir for runtime exexcution,
# TODO: remove all unneeded dependencies from these
# for intermediate binaries, in respect to lib ID
execute_process(
COMMAND ditto -arch ${CMAKE_OSX_ARCHITECTURES}
${LIBDIR}/openmp/lib/libiomp5.dylib
${CMAKE_BINARY_DIR}/Resources/lib/libiomp5.dylib)
endif()
endif()
endif()
set(EXETYPE MACOSX_BUNDLE)
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
endif()
else()
set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
endif()
if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
# Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
endif()
# Get rid of eventually clashes, we export some symbols explicite as local
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker ${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map"
)
if(WITH_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -stdlib=libc++")
endif()
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
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>")

View File

@@ -0,0 +1,428 @@
# ***** 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.
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for any *nix system including Linux and Unix.
macro(find_package_wrapper)
if(WITH_STATIC_LIBS)
find_package_static(${ARGV})
else()
find_package(${ARGV})
endif()
endmacro()
find_package_wrapper(JPEG REQUIRED)
find_package_wrapper(PNG REQUIRED)
find_package_wrapper(ZLIB REQUIRED)
find_package_wrapper(Freetype REQUIRED)
if(WITH_LZO AND WITH_SYSTEM_LZO)
find_package_wrapper(LZO)
if(NOT LZO_FOUND)
message(FATAL_ERROR "Failed finding system LZO version!")
endif()
endif()
if(WITH_SYSTEM_EIGEN3)
find_package_wrapper(Eigen3)
if(NOT EIGEN3_FOUND)
message(FATAL_ERROR "Failed finding system Eigen3 version!")
endif()
endif()
# else values are set below for all platforms
if(WITH_PYTHON)
# No way to set py35, remove for now.
# find_package(PythonLibs)
# Use our own instead, since without py is such a rare case,
# require this package
# XXX Linking errors with debian static python :/
# find_package_wrapper(PythonLibsUnix REQUIRED)
find_package(PythonLibsUnix REQUIRED)
endif()
if(WITH_IMAGE_OPENEXR)
find_package_wrapper(OpenEXR) # our own module
if(NOT OPENEXR_FOUND)
set(WITH_IMAGE_OPENEXR OFF)
endif()
endif()
if(WITH_IMAGE_OPENJPEG)
find_package_wrapper(OpenJPEG)
if(NOT OPENJPEG_FOUND)
set(WITH_IMAGE_OPENJPEG OFF)
endif()
endif()
if(WITH_IMAGE_TIFF)
# XXX Linking errors with debian static tiff :/
# find_package_wrapper(TIFF)
find_package(TIFF)
if(NOT TIFF_FOUND)
set(WITH_IMAGE_TIFF OFF)
endif()
endif()
# Audio IO
if(WITH_SYSTEM_AUDASPACE)
find_package_wrapper(Audaspace)
if(NOT AUDASPACE_FOUND OR NOT AUDASPACE_C_FOUND)
message(FATAL_ERROR "Audaspace external library not found!")
endif()
endif()
if(WITH_OPENAL)
find_package_wrapper(OpenAL)
if(NOT OPENAL_FOUND)
set(WITH_OPENAL OFF)
endif()
endif()
if(WITH_SDL)
if(WITH_SDL_DYNLOAD)
set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2")
set(SDL_LIBRARY)
else()
find_package_wrapper(SDL2)
if(SDL2_FOUND)
# Use same names for both versions of SDL until we move to 2.x.
set(SDL_INCLUDE_DIR "${SDL2_INCLUDE_DIR}")
set(SDL_LIBRARY "${SDL2_LIBRARY}")
set(SDL_FOUND "${SDL2_FOUND}")
else()
find_package_wrapper(SDL)
endif()
mark_as_advanced(
SDL_INCLUDE_DIR
SDL_LIBRARY
)
# unset(SDLMAIN_LIBRARY CACHE)
if(NOT SDL_FOUND)
set(WITH_SDL OFF)
endif()
endif()
endif()
if(WITH_JACK)
find_package_wrapper(Jack)
if(NOT JACK_FOUND)
set(WITH_JACK OFF)
endif()
endif()
# Codecs
if(WITH_CODEC_SNDFILE)
find_package_wrapper(SndFile)
if(NOT SNDFILE_FOUND)
set(WITH_CODEC_SNDFILE OFF)
endif()
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
mark_as_advanced(FFMPEG)
# lame, but until we have proper find module for ffmpeg
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
if(EXISTS "${FFMPEG}/include/ffmpeg/")
list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg")
endif()
# end lameness
mark_as_advanced(FFMPEG_LIBRARIES)
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
endif()
if(WITH_FFTW3)
find_package_wrapper(Fftw3)
if(NOT FFTW3_FOUND)
set(WITH_FFTW3 OFF)
endif()
endif()
if(WITH_OPENCOLLADA)
find_package_wrapper(OpenCOLLADA)
if(OPENCOLLADA_FOUND)
find_package_wrapper(XML2)
find_package_wrapper(PCRE)
else()
set(WITH_OPENCOLLADA OFF)
endif()
endif()
if(WITH_MEM_JEMALLOC)
find_package_wrapper(JeMalloc)
if(NOT JEMALLOC_FOUND)
set(WITH_MEM_JEMALLOC OFF)
endif()
endif()
if(WITH_INPUT_NDOF)
find_package_wrapper(Spacenav)
if(SPACENAV_FOUND)
# use generic names within blenders buildsystem.
set(NDOF_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIRS})
set(NDOF_LIBRARIES ${SPACENAV_LIBRARIES})
else()
set(WITH_INPUT_NDOF OFF)
endif()
endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
if(NOT OSL_ROOT)
set(OSL_ROOT ${CYCLES_OSL})
endif()
find_package_wrapper(OpenShadingLanguage)
if(OSL_FOUND)
if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
# otherwise LLVM is missing the osl_allocate_closure_component function
set(OSL_LIBRARIES
${OSL_OSLCOMP_LIBRARY}
-Wl,--whole-archive ${OSL_OSLEXEC_LIBRARY}
-Wl,--no-whole-archive ${OSL_OSLQUERY_LIBRARY}
)
endif()
else()
message(STATUS "OSL not found, disabling it from Cycles")
set(WITH_CYCLES_OSL OFF)
endif()
endif()
if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(TBB)
if(NOT OPENVDB_FOUND OR NOT TBB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "OpenVDB not found, disabling it")
endif()
endif()
if(WITH_ALEMBIC)
find_package_wrapper(Alembic)
if(WITH_ALEMBIC_HDF5)
set(HDF5_ROOT_DIR ${LIBDIR}/hdf5)
find_package_wrapper(HDF5)
endif()
if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
set(WITH_ALEMBIC OFF)
set(WITH_ALEMBIC_HDF5 OFF)
endif()
endif()
if(WITH_BOOST)
# uses in build instructions to override include and library variables
if(NOT BOOST_CUSTOM)
if(WITH_STATIC_LIBS)
set(Boost_USE_STATIC_LIBS ON)
endif()
set(Boost_USE_MULTITHREADED ON)
set(__boost_packages filesystem regex thread date_time)
if(WITH_CYCLES_OSL)
if(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6"))
list(APPEND __boost_packages wave)
else()
endif()
endif()
if(WITH_INTERNATIONAL)
list(APPEND __boost_packages locale)
endif()
if(WITH_CYCLES_NETWORK)
list(APPEND __boost_packages serialization)
endif()
if(WITH_OPENVDB)
list(APPEND __boost_packages iostreams)
endif()
list(APPEND __boost_packages system)
find_package(Boost 1.48 COMPONENTS ${__boost_packages})
if(NOT Boost_FOUND)
# try to find non-multithreaded if -mt not found, this flag
# doesn't matter for us, it has nothing to do with thread
# safety, but keep it to not disturb build setups
set(Boost_USE_MULTITHREADED OFF)
find_package(Boost 1.48 COMPONENTS ${__boost_packages})
endif()
unset(__boost_packages)
if(Boost_USE_STATIC_LIBS AND WITH_BOOST_ICU)
find_package(IcuLinux)
endif()
mark_as_advanced(Boost_DIR) # why doesnt boost do this?
endif()
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS})
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
endif()
if(WITH_OPENIMAGEIO)
find_package_wrapper(OpenImageIO)
if(NOT OPENIMAGEIO_PUGIXML_FOUND AND WITH_CYCLES_STANDALONE)
find_package_wrapper(PugiXML)
else()
set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}")
set(PUGIXML_LIBRARIES "")
endif()
set(OPENIMAGEIO_LIBRARIES
${OPENIMAGEIO_LIBRARIES}
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${ZLIB_LIBRARIES}
${BOOST_LIBRARIES}
)
set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere
set(OPENIMAGEIO_DEFINITIONS "")
if(WITH_IMAGE_TIFF)
list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}")
endif()
if(WITH_IMAGE_OPENEXR)
list(APPEND OPENIMAGEIO_LIBRARIES "${OPENEXR_LIBRARIES}")
endif()
if(NOT OPENIMAGEIO_FOUND)
set(WITH_OPENIMAGEIO OFF)
message(STATUS "OpenImageIO not found, disabling WITH_CYCLES")
endif()
endif()
if(WITH_OPENCOLORIO)
find_package_wrapper(OpenColorIO)
set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES})
set(OPENCOLORIO_LIBPATH) # TODO, remove and reference the absolute path everywhere
set(OPENCOLORIO_DEFINITIONS)
if(NOT OPENCOLORIO_FOUND)
set(WITH_OPENCOLORIO OFF)
message(STATUS "OpenColorIO not found")
endif()
endif()
if(WITH_LLVM)
find_package_wrapper(LLVM)
if(NOT LLVM_FOUND)
set(WITH_LLVM OFF)
message(STATUS "LLVM not found")
endif()
endif()
if(WITH_LLVM OR WITH_SDL_DYNLOAD)
# Fix for conflict with Mesa llvmpipe
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'"
)
endif()
if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
find_package_wrapper(OpenSubdiv)
set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARIES})
set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere
if(NOT OPENSUBDIV_FOUND)
set(WITH_OPENSUBDIV OFF)
set(WITH_CYCLES_OPENSUBDIV OFF)
message(STATUS "OpenSubdiv not found")
endif()
endif()
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm)
find_package(Threads REQUIRED)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
# used by other platforms
set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
if(CMAKE_DL_LIBS)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS})
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(NOT WITH_PYTHON_MODULE)
# binreloc is linux only
set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include)
set(WITH_BINRELOC ON)
endif()
endif()
# lfs on glibc, all compilers should use
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
# GNU Compiler
if(CMAKE_COMPILER_IS_GNUCC)
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
if(WITH_LINKER_GOLD)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
else()
message(STATUS "GNU gold linker isn't available, using the default system linker.")
endif()
unset(LD_VERSION)
endif()
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
# Solaris CC
elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro")
set(PLATFORM_CFLAGS "-pipe -features=extensions -fPIC -D__FUNCTION__=__func__")
# Intel C++ Compiler
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
# think these next two are broken
find_program(XIAR xiar)
if(XIAR)
set(CMAKE_AR "${XIAR}")
endif()
mark_as_advanced(XIAR)
find_program(XILD xild)
if(XILD)
set(CMAKE_LINKER "${XILD}")
endif()
mark_as_advanced(XILD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model precise -prec_div -parallel")
# set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -diag-enable sc3")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel")
endif()

View File

@@ -0,0 +1,87 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Windows.
add_definitions(-DWIN32)
if(MSVC)
include(platform_win32_msvc)
elseif(CMAKE_COMPILER_IS_GNUCC)
include(platform_win32_mingw)
endif()
# Things common to both mingw and MSVC should go here
set(WINTAB_INC ${LIBDIR}/wintab/include)
if(WITH_OPENAL)
set(OPENAL ${LIBDIR}/openal)
set(OPENALDIR ${LIBDIR}/openal)
set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
if(MSVC)
set(OPENAL_LIBRARY openal32)
else()
set(OPENAL_LIBRARY wrap_oal)
endif()
set(OPENAL_LIBPATH ${OPENAL}/lib)
endif()
if(WITH_CODEC_SNDFILE)
set(SNDFILE ${LIBDIR}/sndfile)
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
set(SNDFILE_LIBRARIES libsndfile-1)
set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
endif()
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_EXEC_DEBUG NAMES oslexec_d PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${CYCLES_OSL}/lib)
list(APPEND OSL_LIBRARIES
optimized ${OSL_LIB_COMP}
optimized ${OSL_LIB_EXEC}
optimized ${OSL_LIB_QUERY}
debug ${OSL_LIB_EXEC_DEBUG}
debug ${OSL_LIB_COMP_DEBUG}
debug ${OSL_LIB_QUERY_DEBUG}
)
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
set(OSL_FOUND TRUE)
else()
message(STATUS "OSL not found")
set(WITH_CYCLES_OSL OFF)
endif()
endif()

View File

@@ -0,0 +1,302 @@
# ***** 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.
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Windows when compiling with MinGW.
# keep GCC specific stuff here
include(CheckCSourceCompiles)
# Setup 64bit and 64bit windows systems
CHECK_C_SOURCE_COMPILES("
#ifndef __MINGW64__
#error
#endif
int main(void) { return 0; }
"
WITH_MINGW64
)
if(NOT DEFINED LIBDIR)
if(WITH_MINGW64)
message(STATUS "Compiling for 64 bit with MinGW-w64.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
else()
message(STATUS "Compiling for 32 bit with MinGW-w32.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
if(WITH_RAYOPTIMIZATION)
message(WARNING "MinGW-w32 is known to be unstable with 'WITH_RAYOPTIMIZATION' option enabled.")
endif()
endif()
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif()
if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'")
endif()
list(APPEND PLATFORM_LINKLIBS
-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32
-lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -ldbghelp
)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS -limm32)
endif()
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
if(WITH_MINGW64)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
list(APPEND PLATFORM_LINKLIBS -lpthread)
add_definitions(-DFREE_WINDOWS64 -DMS_WIN64)
endif()
add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
add_definitions(-DFREE_WINDOWS)
set(PNG "${LIBDIR}/png")
set(PNG_INCLUDE_DIRS "${PNG}/include")
set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
if(WITH_MINGW64)
set(JPEG_LIBRARIES jpeg)
else()
set(JPEG_LIBRARIES libjpeg)
endif()
set(PNG_LIBRARIES png)
set(ZLIB ${LIBDIR}/zlib)
set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
set(ZLIB_LIBPATH ${ZLIB}/lib)
set(ZLIB_LIBRARIES z)
set(JPEG "${LIBDIR}/jpeg")
set(JPEG_INCLUDE_DIR "${JPEG}/include")
set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined
# comes with own pthread library
if(NOT WITH_MINGW64)
set(PTHREADS ${LIBDIR}/pthreads)
#set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
set(PTHREADS_LIBPATH ${PTHREADS}/lib)
set(PTHREADS_LIBRARIES pthreadGC2)
endif()
set(FREETYPE ${LIBDIR}/freetype)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
set(FREETYPE_LIBRARY freetype)
if(WITH_FFTW3)
set(FFTW3 ${LIBDIR}/fftw3)
set(FFTW3_LIBRARIES fftw3)
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
set(FFTW3_LIBPATH ${FFTW3}/lib)
endif()
if(WITH_OPENCOLLADA)
set(OPENCOLLADA ${LIBDIR}/opencollada)
set(OPENCOLLADA_INCLUDE_DIRS
${OPENCOLLADA}/include/opencollada/COLLADAStreamWriter
${OPENCOLLADA}/include/opencollada/COLLADABaseUtils
${OPENCOLLADA}/include/opencollada/COLLADAFramework
${OPENCOLLADA}/include/opencollada/COLLADASaxFrameworkLoader
${OPENCOLLADA}/include/opencollada/GeneratedSaxParser
)
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib/opencollada)
set(OPENCOLLADA_LIBRARIES
OpenCOLLADAStreamWriter
OpenCOLLADASaxFrameworkLoader
OpenCOLLADAFramework
OpenCOLLADABaseUtils
GeneratedSaxParser
UTF MathMLSolver buffer ftoa xml
)
set(PCRE_LIBRARIES pcre)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg)
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
if(WITH_MINGW64)
set(FFMPEG_LIBRARIES avcodec.dll avformat.dll avdevice.dll avutil.dll swscale.dll swresample.dll)
else()
set(FFMPEG_LIBRARIES avcodec-55 avformat-55 avdevice-55 avutil-52 swscale-2)
endif()
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
endif()
if(WITH_IMAGE_OPENEXR)
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBRARIES Half IlmImf Imath IlmThread Iex)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
endif()
if(WITH_IMAGE_TIFF)
set(TIFF ${LIBDIR}/tiff)
set(TIFF_LIBRARY tiff)
set(TIFF_INCLUDE_DIR ${TIFF}/include)
set(TIFF_LIBPATH ${TIFF}/lib)
endif()
if(WITH_JACK)
set(JACK ${LIBDIR}/jack)
set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
set(JACK_LIBRARIES jack)
set(JACK_LIBPATH ${JACK}/lib)
# TODO, gives linking errors, force off
set(WITH_JACK OFF)
endif()
if(WITH_PYTHON)
# normally cached but not since we include them with blender
set(PYTHON_VERSION 3.5) # CACHE STRING)
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}") # CACHE PATH)
set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}mw.lib") # CACHE FILEPATH)
unset(_PYTHON_VERSION_NO_DOTS)
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
endif()
if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
if(WITH_MINGW64)
set(BOOST_POSTFIX "mgw47-mt-s-1_49")
set(BOOST_DEBUG_POSTFIX "mgw47-mt-sd-1_49")
else()
set(BOOST_POSTFIX "mgw46-mt-s-1_49")
set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_49")
endif()
set(BOOST_LIBRARIES
optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX}
boost_regex-${BOOST_POSTFIX}
boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
debug boost_date_time-${BOOST_DEBUG_POSTFIX} boost_filesystem-${BOOST_DEBUG_POSTFIX}
boost_regex-${BOOST_DEBUG_POSTFIX}
boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
if(WITH_INTERNATIONAL)
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
optimized boost_locale-${BOOST_POSTFIX}
debug boost_locale-${BOOST_DEBUG_POSTFIX}
)
endif()
if(WITH_CYCLES_OSL)
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
optimized boost_wave-${BOOST_POSTFIX}
debug boost_wave-${BOOST_DEBUG_POSTFIX}
)
endif()
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
endif()
if(WITH_OPENIMAGEIO)
set(OPENIMAGEIO ${LIBDIR}/openimageio)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
set(OPENIMAGEIO_LIBRARIES OpenImageIO)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_DEFINITIONS "")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
endif()
if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_LIBPATH ${LLVM_ROOT_DIR}/lib)
# Explicitly set llvm lib order.
#---- WARNING ON GCC ORDER OF LIBS IS IMPORTANT, DO NOT CHANGE! ---------
set(LLVM_LIBRARY LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMAnalysis LLVMArchive
LLVMAsmParser LLVMAsmPrinter
LLVMBitReader LLVMBitWriter
LLVMDebugInfo LLVMExecutionEngine
LLVMInstCombine LLVMInstrumentation
LLVMInterpreter LLVMJIT
LLVMLinker LLVMMC
LLVMMCDisassembler LLVMMCJIT
LLVMMCParser LLVMObject
LLVMRuntimeDyld
LLVMSupport
LLVMTableGen LLVMTarget
LLVMTransformUtils LLVMVectorize
LLVMX86AsmParser LLVMX86AsmPrinter
LLVMX86CodeGen LLVMX86Desc
LLVMX86Disassembler LLVMX86Info
LLVMX86Utils LLVMipa
LLVMipo LLVMCore)
# imagehelp is needed by LLVM 3.1 on MinGW, check lib\Support\Windows\Signals.inc
list(APPEND PLATFORM_LINKLIBS -limagehlp)
endif()
if(WITH_OPENCOLORIO)
set(OPENCOLORIO ${LIBDIR}/opencolorio)
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
set(OPENCOLORIO_LIBRARIES OpenColorIO)
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
set(OPENCOLORIO_DEFINITIONS)
endif()
if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBRARY SDL)
set(SDL_LIBPATH ${SDL}/lib)
endif()
if(WITH_OPENVDB)
set(OPENVDB ${LIBDIR}/openvdb)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(OPENVDB_LIBRARIES openvdb ${TBB_LIBRARIES})
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
set(OPENVDB_DEFINITIONS)
endif()
if(WITH_ALEMBIC)
# TODO(sergey): For until someone drops by and compiles libraries for
# MinGW we allow users to compile their own Alembic library and use
# that via find_package(),
#
# Once precompiled libraries are there we'll use hardcoded locations.
find_package_wrapper(Alembic)
if(WITH_ALEMBIC_HDF5)
set(HDF5_ROOT_DIR ${LIBDIR}/hdf5)
find_package_wrapper(HDF5)
endif()
if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
set(WITH_ALEMBIC OFF)
set(WITH_ALEMBIC_HDF5 OFF)
endif()
endif()
set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
## DISABLE - causes linking errors
## for re-distribution, so users dont need mingw installed
# set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-libgcc -static-libstdc++")

View File

@@ -0,0 +1,489 @@
# ***** 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.
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Windows when compiling with MSVC.
macro(warn_hardcoded_paths package_name
)
if(WITH_WINDOWS_FIND_MODULES)
message(WARNING "Using HARDCODED ${package_name} locations")
endif(WITH_WINDOWS_FIND_MODULES)
endmacro()
macro(windows_find_package package_name
)
if(WITH_WINDOWS_FIND_MODULES)
find_package( ${package_name})
endif(WITH_WINDOWS_FIND_MODULES)
endmacro()
add_definitions(-DWIN32)
# Minimum MSVC Version
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
if(MSVC_VERSION EQUAL 1800)
set(_min_ver "18.0.31101")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
message(FATAL_ERROR
"Visual Studio 2013 (Update 4, ${_min_ver}) required, "
"found (${CMAKE_CXX_COMPILER_VERSION})")
endif()
endif()
if(MSVC_VERSION EQUAL 1900)
set(_min_ver "19.0.24210")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
message(FATAL_ERROR
"Visual Studio 2015 (Update 3, ${_min_ver}) required, "
"found (${CMAKE_CXX_COMPILER_VERSION})")
endif()
endif()
endif()
unset(_min_ver)
# needed for some MSVC installations
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32
advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp
)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS imm32)
endif()
add_definitions(
-D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
-D_CONSOLE
-D_LIB
)
# MSVC11 needs _ALLOW_KEYWORD_MACROS to build
add_definitions(-D_ALLOW_KEYWORD_MACROS)
# We want to support Vista level ABI
add_definitions(-D_WIN32_WINNT=0x600)
# Make cmake find the msvc redistributables
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
# Ignore meaningless for us linker warnings.
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
# MSVC only, Mingw doesnt need
if(CMAKE_CL_64)
set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}")
else()
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
endif()
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
if(NOT DEFINED LIBDIR)
# Setup 64bit and 64bit windows systems
if(CMAKE_CL_64)
message(STATUS "64 bit compiler detected.")
set(LIBDIR_BASE "win64")
else()
message(STATUS "32 bit compiler detected.")
set(LIBDIR_BASE "windows")
endif()
if(MSVC_VERSION EQUAL 1910)
message(STATUS "Visual Studio 2017 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
elseif(MSVC_VERSION EQUAL 1900)
message(STATUS "Visual Studio 2015 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
else()
message(STATUS "Visual Studio 2013 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc12)
endif()
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif()
if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'")
endif()
# Add each of our libraries to our cmake_prefix_path so find_package() could work
file(GLOB children RELATIVE ${LIBDIR} ${LIBDIR}/*)
foreach(child ${children})
if(IS_DIRECTORY ${LIBDIR}/${child})
list(APPEND CMAKE_PREFIX_PATH ${LIBDIR}/${child})
endif()
endforeach()
set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include)
set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz_st.lib)
set(ZLIB_INCLUDE_DIR ${LIBDIR}/zlib/include)
set(ZLIB_LIBRARY ${LIBDIR}/zlib/lib/libz_st.lib)
set(ZLIB_DIR ${LIBDIR}/zlib)
windows_find_package(zlib) # we want to find before finding things that depend on it like png
windows_find_package(png)
if(NOT PNG_FOUND)
warn_hardcoded_paths(libpng)
set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include)
set(PNG_LIBRARIES libpng)
set(PNG "${LIBDIR}/png")
set(PNG_INCLUDE_DIRS "${PNG}/include")
set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
endif()
set(JPEG_NAMES ${JPEG_NAMES} libjpeg)
windows_find_package(jpeg REQUIRED)
if(NOT JPEG_FOUND)
warn_hardcoded_paths(jpeg)
set(JPEG_INCLUDE_DIR ${LIBDIR}/jpeg/include)
set(JPEG_LIBRARIES ${LIBDIR}/jpeg/lib/libjpeg.lib)
endif()
set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include)
set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib)
set(FREETYPE ${LIBDIR}/freetype)
set(FREETYPE_INCLUDE_DIRS
${LIBDIR}/freetype/include
${LIBDIR}/freetype/include/freetype2
)
set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib)
windows_find_package(freetype REQUIRED)
if(WITH_FFTW3)
set(FFTW3 ${LIBDIR}/fftw3)
set(FFTW3_LIBRARIES libfftw)
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
set(FFTW3_LIBPATH ${FFTW3}/lib)
endif()
if(WITH_OPENCOLLADA)
set(OPENCOLLADA ${LIBDIR}/opencollada)
set(OPENCOLLADA_INCLUDE_DIRS
${OPENCOLLADA}/include/opencollada/COLLADAStreamWriter
${OPENCOLLADA}/include/opencollada/COLLADABaseUtils
${OPENCOLLADA}/include/opencollada/COLLADAFramework
${OPENCOLLADA}/include/opencollada/COLLADASaxFrameworkLoader
${OPENCOLLADA}/include/opencollada/GeneratedSaxParser
)
set(OPENCOLLADA_LIBRARIES
${OPENCOLLADA}/lib/opencollada/OpenCOLLADASaxFrameworkLoader.lib
${OPENCOLLADA}/lib/opencollada/OpenCOLLADAFramework.lib
${OPENCOLLADA}/lib/opencollada/OpenCOLLADABaseUtils.lib
${OPENCOLLADA}/lib/opencollada/OpenCOLLADAStreamWriter.lib
${OPENCOLLADA}/lib/opencollada/MathMLSolver.lib
${OPENCOLLADA}/lib/opencollada/GeneratedSaxParser.lib
${OPENCOLLADA}/lib/opencollada/xml.lib
${OPENCOLLADA}/lib/opencollada/buffer.lib
${OPENCOLLADA}/lib/opencollada/ftoa.lib
)
if(NOT WITH_LLVM)
list(APPEND OPENCOLLADA_LIBRARIES ${OPENCOLLADA}/lib/opencollada/UTF.lib)
endif()
set(PCRE_LIBRARIES
${OPENCOLLADA}/lib/opencollada/pcre.lib
)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG_INCLUDE_DIRS
${LIBDIR}/ffmpeg/include
${LIBDIR}/ffmpeg/include/msvc
)
windows_find_package(FFMPEG)
if(NOT FFMPEG_FOUND)
warn_hardcoded_paths(ffmpeg)
set(FFMPEG_LIBRARY_VERSION 55)
set(FFMPEG_LIBRARY_VERSION_AVU 52)
set(FFMPEG_LIBRARIES
${LIBDIR}/ffmpeg/lib/avcodec-${FFMPEG_LIBRARY_VERSION}.lib
${LIBDIR}/ffmpeg/lib/avformat-${FFMPEG_LIBRARY_VERSION}.lib
${LIBDIR}/ffmpeg/lib/avdevice-${FFMPEG_LIBRARY_VERSION}.lib
${LIBDIR}/ffmpeg/lib/avutil-${FFMPEG_LIBRARY_VERSION_AVU}.lib
${LIBDIR}/ffmpeg/lib/swscale-2.lib
)
endif()
endif()
if(WITH_IMAGE_OPENEXR)
set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr)
set(OPENEXR_VERSION "2.1")
windows_find_package(OPENEXR REQUIRED)
if(NOT OPENEXR_FOUND)
warn_hardcoded_paths(OpenEXR)
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
optimized ${OPENEXR_LIBPATH}/Iex-2_2.lib
optimized ${OPENEXR_LIBPATH}/Half.lib
optimized ${OPENEXR_LIBPATH}/IlmImf-2_2.lib
optimized ${OPENEXR_LIBPATH}/Imath-2_2.lib
optimized ${OPENEXR_LIBPATH}/IlmThread-2_2.lib
debug ${OPENEXR_LIBPATH}/Iex-2_2_d.lib
debug ${OPENEXR_LIBPATH}/Half_d.lib
debug ${OPENEXR_LIBPATH}/IlmImf-2_2_d.lib
debug ${OPENEXR_LIBPATH}/Imath-2_2_d.lib
debug ${OPENEXR_LIBPATH}/IlmThread-2_2_d.lib
)
endif()
endif()
if(WITH_IMAGE_TIFF)
# Try to find tiff first then complain and set static and maybe wrong paths
windows_find_package(TIFF)
if(NOT TIFF_FOUND)
warn_hardcoded_paths(libtiff)
set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
endif()
endif()
if(WITH_JACK)
set(JACK_INCLUDE_DIRS
${LIBDIR}/jack/include/jack
${LIBDIR}/jack/include
)
set(JACK_LIBRARIES optimized ${LIBDIR}/jack/lib/libjack.lib debug ${LIBDIR}/jack/lib/libjack_d.lib)
endif()
if(WITH_PYTHON)
set(PYTHON_VERSION 3.5) # CACHE STRING)
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
# Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.lib)
unset(_PYTHON_VERSION_NO_DOTS)
# Shared includes for both vc2008 and vc2010
set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/include/python${PYTHON_VERSION})
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
endif()
if(WITH_BOOST)
if(WITH_CYCLES_OSL)
set(boost_extra_libs wave)
endif()
if(WITH_INTERNATIONAL)
list(APPEND boost_extra_libs locale)
endif()
if(WITH_OPENVDB)
list(APPEND boost_extra_libs iostreams)
endif()
set(Boost_USE_STATIC_RUNTIME ON) # prefix lib
set(Boost_USE_MULTITHREADED ON) # suffix -mt
set(Boost_USE_STATIC_LIBS ON) # suffix -s
if (WITH_WINDOWS_FIND_MODULES)
find_package(Boost COMPONENTS date_time filesystem thread regex system ${boost_extra_libs})
endif (WITH_WINDOWS_FIND_MODULES)
if(NOT Boost_FOUND)
warn_hardcoded_paths(BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
if(MSVC12)
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_POSTFIX "vc120-mt-s-1_60.lib")
set(BOOST_DEBUG_POSTFIX "vc120-mt-sgd-1_60.lib")
else()
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_POSTFIX "vc140-mt-s-1_60.lib")
set(BOOST_DEBUG_POSTFIX "vc140-mt-sgd-1_60.lib")
endif()
set(BOOST_LIBRARIES
optimized libboost_date_time-${BOOST_POSTFIX}
optimized libboost_filesystem-${BOOST_POSTFIX}
optimized libboost_regex-${BOOST_POSTFIX}
optimized libboost_system-${BOOST_POSTFIX}
optimized libboost_thread-${BOOST_POSTFIX}
debug libboost_date_time-${BOOST_DEBUG_POSTFIX}
debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
debug libboost_regex-${BOOST_DEBUG_POSTFIX}
debug libboost_system-${BOOST_DEBUG_POSTFIX}
debug libboost_thread-${BOOST_DEBUG_POSTFIX}
)
if(WITH_CYCLES_OSL)
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
optimized libboost_wave-${BOOST_POSTFIX}
debug libboost_wave-${BOOST_DEBUG_POSTFIX})
endif()
if(WITH_INTERNATIONAL)
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
optimized libboost_locale-${BOOST_POSTFIX}
debug libboost_locale-${BOOST_DEBUG_POSTFIX})
endif()
else() # we found boost using find_package
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS})
endif()
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
endif()
if(WITH_OPENIMAGEIO)
windows_find_package(OpenImageIO)
set(OPENIMAGEIO ${LIBDIR}/openimageio)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
set(OIIO_OPTIMIZED optimized OpenImageIO optimized OpenImageIO_Util)
set(OIIO_DEBUG debug OpenImageIO_d debug OpenImageIO_Util_d)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
add_definitions(-DOIIO_STATIC_BUILD)
endif()
if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_ROOT_DIR}/lib/*.lib)
if(EXISTS ${LLVM_ROOT_DIR}/debug/lib)
foreach(LLVM_OPTIMIZED_LIB ${LLVM_LIBRARY_OPTIMIZED})
get_filename_component(LIBNAME ${LLVM_OPTIMIZED_LIB} ABSOLUTE)
list(APPEND LLVM_LIBS optimized ${LIBNAME})
endforeach(LLVM_OPTIMIZED_LIB)
file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_ROOT_DIR}/debug/lib/*.lib)
foreach(LLVM_DEBUG_LIB ${LLVM_LIBRARY_DEBUG})
get_filename_component(LIBNAME ${LLVM_DEBUG_LIB} ABSOLUTE)
list(APPEND LLVM_LIBS debug ${LIBNAME})
endforeach(LLVM_DEBUG_LIB)
set(LLVM_LIBRARY ${LLVM_LIBS})
else()
message(WARNING "LLVM debug libs not present on this system. Using release libs for debug builds.")
set(LLVM_LIBRARY ${LLVM_LIBRARY_OPTIMIZED})
endif()
endif()
if(WITH_OPENCOLORIO)
set(OPENCOLORIO ${LIBDIR}/opencolorio)
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
set(OPENCOLORIO_LIBRARIES OpenColorIO)
set(OPENCOLORIO_LIBPATH ${LIBDIR}/opencolorio/lib)
set(OPENCOLORIO_DEFINITIONS)
endif()
if(WITH_OPENVDB)
set(BLOSC_LIBRARIES optimized ${LIBDIR}/blosc/lib/libblosc.lib debug ${LIBDIR}/blosc/lib/libblosc_d.lib)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(OPENVDB ${LIBDIR}/openvdb)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include ${TBB_INCLUDE_DIR})
set(OPENVDB_LIBRARIES optimized openvdb debug openvdb_d ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
endif()
if(WITH_ALEMBIC)
set(ALEMBIC ${LIBDIR}/alembic)
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
set(ALEMBIC_LIBRARIES optimized alembic debug alembic_d)
endif()
if(WITH_MOD_CLOTH_ELTOPO)
set(LAPACK ${LIBDIR}/lapack)
# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
set(LAPACK_LIBPATH ${LAPACK}/lib)
set(LAPACK_LIBRARIES
${LIBDIR}/lapack/lib/libf2c.lib
${LIBDIR}/lapack/lib/clapack_nowrap.lib
${LIBDIR}/lapack/lib/BLAS_nowrap.lib
)
endif()
if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
set(OPENSUBDIV_INCLUDE_DIR ${LIBDIR}/opensubdiv/include)
set(OPENSUBDIV_LIBPATH ${LIBDIR}/opensubdiv/lib)
set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBPATH}/osdCPU.lib ${OPENSUBDIV_LIBPATH}/osdGPU.lib)
find_package(OpenSubdiv)
endif()
if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBPATH ${SDL}/lib)
# MinGW TODO: Update MinGW to SDL2
if(NOT CMAKE_COMPILER_IS_GNUCC)
set(SDL_LIBRARY SDL2)
else()
set(SDL_LIBRARY SDL)
endif()
endif()
# Audio IO
if(WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_INCLUDE_DIRS ${LIBDIR}/audaspace/include/audaspace)
set(AUDASPACE_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace.lib)
set(AUDASPACE_C_INCLUDE_DIRS ${LIBDIR}/audaspace/include/audaspace)
set(AUDASPACE_C_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace-c.lib)
set(AUDASPACE_PY_INCLUDE_DIRS ${LIBDIR}/audaspace/include/audaspace)
set(AUDASPACE_PY_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace-py.lib)
endif()
# used in many places so include globally, like OpenGL
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
#find signtool
SET(ProgramFilesX86_NAME "ProgramFiles(x86)") #env dislikes the ( )
find_program(SIGNTOOL_EXE signtool
HINTS
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/10/bin/x86/"
"$ENV{ProgramFiles}/Windows Kits/10/bin/x86/"
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/8.1/bin/x86/"
"$ENV{ProgramFiles}/Windows Kits/8.1/bin/x86/"
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/8.0/bin/x86/"
"$ENV{ProgramFiles}/Windows Kits/8.0/bin/x86/"
)

View File

@@ -39,7 +39,7 @@ __all__ = (
"is_py",
"cmake_advanced_info",
"cmake_compiler_defines",
"project_name_get"
"project_name_get",
"init",
)
@@ -214,7 +214,12 @@ def cmake_advanced_info():
def cmake_cache_var(var):
cache_file = open(join(CMAKE_DIR, "CMakeCache.txt"), encoding='utf-8')
lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
lines = [
l_strip for l in cache_file
for l_strip in (l.strip(),)
if l_strip
if not l_strip.startswith(("//", "#"))
]
cache_file.close()
for l in lines:

View File

@@ -23,7 +23,7 @@
__all__ = (
"build_info",
"SOURCE_DIR",
)
)
import sys

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# <pep8 compliant>

View File

@@ -2,11 +2,9 @@
# custom blender vars
blender_srcdir=$(dirname $startdir)"/../.."
# value may be formatted: 35042:35051M
blender_revision=$(svnversion $blender_srcdir | cut -d: -f2 | awk '{print $3}')
blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender_version.h | awk '{print $3}')
blender_version=$(expr $blender_version / 100).$(expr $blender_version % 100) # 256 -> 2.56
blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blender_srcdir/source/blender/blenkernel/BKE_blender.h)
blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blender_srcdir/source/blender/blenkernel/BKE_blender_version.h)
# blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
# map the version a -> 1
@@ -27,7 +25,9 @@ arch=('i686' 'x86_64')
url="www.blender.org"
license=('GPL')
groups=()
depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.4' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg')
depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.5'
'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl'
'libsndfile' 'ffmpeg')
makedepends=('cmake' 'git')
optdepends=()
provides=()

View File

@@ -6,10 +6,10 @@
BASE_DIR="$PWD"
blender_srcdir=$(dirname -- $0)/../..
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
if [ "$blender_version_cycle" = "release" ] ; then
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char

View File

@@ -187,7 +187,7 @@ The next table describes the information in the file-header.
</table>
<p>
<a href="http://en.wikipedia.org/wiki/Endianness">Endianness</a> addresses the way values are ordered in a sequence of bytes(see the <a href="#example-endianess">example</a> below):
<a href="https://en.wikipedia.org/wiki/Endianness">Endianness</a> addresses the way values are ordered in a sequence of bytes(see the <a href="#example-endianess">example</a> below):
</p>
<ul>

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = "V2.7x"
PROJECT_NUMBER = "V2.8x"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -699,7 +699,7 @@ LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
@@ -1145,7 +1145,7 @@ HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
@@ -1752,7 +1752,7 @@ LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# ##### BEGIN GPL LICENSE BLOCK #####
#

View File

@@ -1,132 +0,0 @@
class IDGroup:
"""
The IDGroup Type
================
This type supports both iteration and the []
operator to get child ID properties.
You can also add new properties using the [] operator.
For example::
group['a float!'] = 0.0
group['an int!'] = 0
group['a string!'] = "hi!"
group['an array!'] = [0, 0, 1.0, 0]
group['a subgroup!] = {"float": 0.0, "an int": 1.0, "an array": [1, 2],
"another subgroup": {"a": 0.0, "str": "bleh"}}
Note that for arrays, the array type defaults to int unless a float is found
while scanning the template list; if any floats are found, then the whole
array is float. Note that double-precision floating point numbers are used for
python-created float ID properties and arrays (though the internal C api does
support single-precision floats, and the python code will read them).
You can also delete properties with the del operator. For example:
del group['property']
To get the type of a property, use the type() operator, for example::
if type(group['bleh']) == str: pass
To tell if the property is a group or array type, import the Blender.Types module and test
against IDGroupType and IDArrayType, like so::
from Blender.Types import IDGroupType, IDArrayType.
if type(group['bleghr']) == IDGroupType:
(do something)
@ivar name: The name of the property
@type name: string
"""
def pop(item):
"""
Pop an item from the group property.
@type item: string
@param item: The item name.
@rtype: can be dict, list, int, float or string.
@return: The removed property.
"""
def update(updatedict):
"""
Updates items in the dict, similar to normal python
dictionary method .update().
@type updatedict: dict
@param updatedict: A dict of simple types to derive updated/new IDProperties from.
@rtype: None
@return: None
"""
def keys():
"""
Returns a list of the keys in this property group.
@rtype: list of strings.
@return: a list of the keys in this property group.
"""
def values():
"""
Returns a list of the values in this property group.
Note that unless a value is itself a property group or an array, you
cannot change it by changing the values in this list, you must change them
in the parent property group.
For example,
group['some_property'] = new_value
. . .is correct, while,
values = group.values()
values[0] = new_value
. . .is wrong.
@rtype: list of strings.
@return: a list of the values in this property group.
"""
def iteritems():
"""
Implements the python dictionary iteritmes method.
For example::
for k, v in group.iteritems():
print "Property name: " + k
print "Property value: " + str(v)
@rtype: an iterator that spits out items of the form [key, value]
@return: an iterator.
"""
def convert_to_pyobject():
"""
Converts the entire property group to a purely python form.
@rtype: dict
@return: A python dictionary representing the property group
"""
class IDArray:
"""
The IDArray Type
================
@ivar type: returns the type of the array, can be either IDP_Int or IDP_Float
"""
def __getitem__(index):
pass
def __setitem__(index, value):
pass
def __len__():
pass

View File

@@ -0,0 +1,237 @@
"""
Video Capture with DeckLink
+++++++++++++++++++++++++++
Video frames captured with DeckLink cards have pixel formats that are generally not directly
usable by OpenGL, they must be processed by a shader. The three shaders presented here should
cover all common video capture cases.
This file reflects the current video transfer method implemented in the Decklink module:
whenever possible the video images are transferred as float texture because this is more
compatible with GPUs. Of course, only the pixel formats that have a correspondant GL format
can be transferred as float. Look for fg_shaders in this file for an exhaustive list.
Other pixel formats will be transferred as 32 bits integer red-channel texture but this
won't work with certain GPU (Intel GMA); the corresponding shaders are not shown here.
However, it should not be necessary to use any of them as the list below covers all practical
cases of video capture with all types of Decklink product.
In other words, only use one of the pixel format below and you will be fine. Note that depending
on the video stream, only certain pixel formats will be allowed (others will throw an exception).
For example, to capture a PAL video stream, you must use one of the YUV formats.
To find which pixel format is suitable for a particular video stream, use the 'Media Express'
utility that comes with the Decklink software : if you see the video in the 'Log and Capture'
Window, you have selected the right pixel format and you can use the same in Blender.
Notes: * these shaders only decode the RGB channel and set the alpha channel to a fixed
value (look for color.a = ). It's up to you to add postprocessing to the color.
* these shaders are compatible with 2D and 3D video stream
"""
import bge
from bge import logic
from bge import texture as vt
# The default vertex shader, because we need one
#
VertexShader = """
#version 130
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
}
"""
# For use with RGB video stream: the pixel is directly usable
#
FragmentShader_R10l = """
#version 130
uniform sampler2D tex;
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
uniform float stereo;
// eye = 0.0 for the left eye, 0.5 for the right eye
uniform float eye;
void main(void)
{
vec4 color;
float tx, ty;
tx = gl_TexCoord[0].x;
ty = eye+gl_TexCoord[0].y*stereo;
color = texture(tex, vec2(tx,ty));
color.a = 0.7;
gl_FragColor = color;
}
"""
# For use with YUV video stream
#
FragmentShader_2vuy = """
#version 130
uniform sampler2D tex;
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
uniform float stereo;
// eye = 0.0 for the left eye, 0.5 for the right eye
uniform float eye;
void main(void)
{
vec4 color;
float tx, ty, width, Y, Cb, Cr;
int px;
tx = gl_TexCoord[0].x;
ty = eye+gl_TexCoord[0].y*stereo;
width = float(textureSize(tex, 0).x);
color = texture(tex, vec2(tx, ty));
px = int(floor(fract(tx*width)*2.0));
switch (px) {
case 0:
Y = color.g;
break;
case 1:
Y = color.a;
break;
}
Y = (Y - 0.0625) * 1.168949772;
Cb = (color.b - 0.0625) * 1.142857143 - 0.5;
Cr = (color.r - 0.0625) * 1.142857143 - 0.5;
color.r = Y + 1.5748 * Cr;
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
color.b = Y + 1.8556 * Cb;
color.a = 0.7;
gl_FragColor = color;
}
"""
# For use with high resolution YUV
#
FragmentShader_v210 = """
#version 130
uniform sampler2D tex;
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
uniform float stereo;
// eye = 0.0 for the left eye, 0.5 for the right eye
uniform float eye;
void main(void)
{
vec4 color, color1, color2, color3;
int px;
float tx, ty, width, sx, dx, bx, Y, Cb, Cr;
tx = gl_TexCoord[0].x;
ty = eye+gl_TexCoord[0].y*stereo;
width = float(textureSize(tex, 0).x);
// to sample macro pixels (6 pixels in 4 words)
sx = tx*width*0.25+0.01;
// index of display pixel in the macro pixel 0..5
px = int(floor(fract(sx)*6.0));
// increment as we sample the macro pixel
dx = 1.0/width;
// base x coord of macro pixel
bx = (floor(sx)+0.01)*dx*4.0;
color = texture(tex, vec2(bx, ty));
color1 = texture(tex, vec2(bx+dx, ty));
color2 = texture(tex, vec2(bx+dx*2.0, ty));
color3 = texture(tex, vec2(bx+dx*3.0, ty));
switch (px) {
case 0:
case 1:
Cb = color.b;
Cr = color.r;
break;
case 2:
case 3:
Cb = color1.g;
Cr = color2.b;
break;
default:
Cb = color2.r;
Cr = color3.g;
break;
}
switch (px) {
case 0:
Y = color.g;
break;
case 1:
Y = color1.b;
break;
case 2:
Y = color1.r;
break;
case 3:
Y = color2.g;
break;
case 4:
Y = color3.b;
break;
default:
Y = color3.r;
break;
}
Y = (Y - 0.0625) * 1.168949772;
Cb = (Cb - 0.0625) * 1.142857143 - 0.5;
Cr = (Cr - 0.0625) * 1.142857143 - 0.5;
color.r = Y + 1.5748 * Cr;
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
color.b = Y + 1.8556 * Cb;
color.a = 0.7;
gl_FragColor = color;
}
"""
# The exhausitve list of pixel formats that are transferred as float texture
# Only use those for greater efficiency and compatiblity.
#
fg_shaders = {
'2vuy' :FragmentShader_2vuy,
'8BitYUV' :FragmentShader_2vuy,
'v210' :FragmentShader_v210,
'10BitYUV' :FragmentShader_v210,
'8BitBGRA' :FragmentShader_R10l,
'BGRA' :FragmentShader_R10l,
'8BitARGB' :FragmentShader_R10l,
'10BitRGBXLE':FragmentShader_R10l,
'R10l' :FragmentShader_R10l
}
#
# Helper function to attach a pixel shader to the material that receives the video frame.
#
def config_video(obj, format, pixel, is3D=False, mat=0, card=0):
if pixel not in fg_shaders:
raise('Unsuported shader')
shader = obj.meshes[0].materials[mat].getShader()
if shader is not None and not shader.isValid():
shader.setSource(VertexShader, fg_shaders[pixel], True)
shader.setSampler('tex', 0)
shader.setUniformEyef("eye")
shader.setUniform1f("stereo", 0.5 if is3D else 1.0)
tex = vt.Texture(obj, mat)
tex.source = vt.VideoDeckLink(format + "/" + pixel + ("/3D" if is3D else ""), card)
print("frame rate: ", tex.source.framerate)
tex.source.play()
obj["video"] = tex
#
# Attach this function to an object that has a material with texture
# and call it once to initialize the object
#
def init(cont):
# config_video(cont.owner, 'HD720p5994', '8BitBGRA')
# config_video(cont.owner, 'HD720p5994', '8BitYUV')
# config_video(cont.owner, 'pal ', '10BitYUV')
config_video(cont.owner, 'pal ', '8BitYUV')
#
# To be called on every frame
#
def play(cont):
obj = cont.owner
video = obj.get("video")
if video is not None:
video.refresh(True)

View File

@@ -4,7 +4,7 @@ Persistent Handler Example
By default handlers are freed when loading new files, in some cases you may
wan't the handler stay running across multiple files (when the handler is
part of an addon for example).
part of an add-on for example).
For this the :data:`bpy.app.handlers.persistent` decorator needs to be used.
"""

View File

@@ -5,7 +5,7 @@ Intro
.. warning::
Most of this object should only be useful if you actually manipulate i18n stuff from Python.
If you are a regular addon, you should only bother about :const:`contexts` member,
If you are a regular add-on, you should only bother about :const:`contexts` member,
and the :func:`register`/:func:`unregister` functions! The :func:`pgettext` family of functions
should only be used in rare, specific cases (like e.g. complex "composited" UI strings...).
@@ -21,11 +21,11 @@ Intro
Then, call ``bpy.app.translations.register(__name__, your_dict)`` in your ``register()`` function, and
``bpy.app.translations.unregister(__name__)`` in your ``unregister()`` one.
The ``Manage UI translations`` addon has several functions to help you collect strings to translate, and
The ``Manage UI translations`` add-on has several functions to help you collect strings to translate, and
generate the needed python code (the translation dictionary), as well as optional intermediary po files
if you want some... See
`How to Translate Blender <http://wiki.blender.org/index.php/Dev:Doc/Process/Translate_Blender>`_ and
`Using i18n in Blender Code <http://wiki.blender.org/index.php/Dev:Source/Interface/Internationalization>`_
`How to Translate Blender <https://wiki.blender.org/index.php/Dev:Doc/Process/Translate_Blender>`_ and
`Using i18n in Blender Code <https://wiki.blender.org/index.php/Dev:Source/Interface/Internationalization>`_
for more info.
Module References

View File

@@ -1,10 +1,10 @@
bl_info = {
"name": "Example Addon Preferences",
"name": "Example Add-on Preferences",
"author": "Your Name Here",
"version": (1, 0),
"blender": (2, 65, 0),
"location": "SpaceBar Search -> Addon Preferences Example",
"description": "Example Addon",
"location": "SpaceBar Search -> Add-on Preferences Example",
"description": "Example Add-on",
"warning": "",
"wiki_url": "",
"tracker_url": "",
@@ -18,7 +18,7 @@ from bpy.props import StringProperty, IntProperty, BoolProperty
class ExampleAddonPreferences(AddonPreferences):
# this must match the addon name, use '__package__'
# this must match the add-on name, use '__package__'
# when defining this in a submodule of a python package.
bl_idname = __name__
@@ -37,7 +37,7 @@ class ExampleAddonPreferences(AddonPreferences):
def draw(self, context):
layout = self.layout
layout.label(text="This is a preferences view for our addon")
layout.label(text="This is a preferences view for our add-on")
layout.prop(self, "filepath")
layout.prop(self, "number")
layout.prop(self, "boolean")
@@ -46,7 +46,7 @@ class ExampleAddonPreferences(AddonPreferences):
class OBJECT_OT_addon_prefs_example(Operator):
"""Display example preferences"""
bl_idname = "object.addon_prefs_example"
bl_label = "Addon Preferences Example"
bl_label = "Add-on Preferences Example"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):

View File

@@ -2,9 +2,9 @@
Extending Menus
+++++++++++++++
When creating menus for addons you can't reference menus in Blender's default
scripts.
Instead, the addon can add menu items to existing menus.
When creating menus for add-ons you can't reference menus
in Blender's default scripts.
Instead, the add-on can add menu items to existing menus.
The function menu_draw acts like :class:`Menu.draw`.
"""

View File

@@ -13,7 +13,7 @@ be animated, accessed from the user interface and from python.
definitions are not, this means whenever you load blender the class needs
to be registered too.
This is best done by creating an addon which loads on startup and registers
This is best done by creating an add-on which loads on startup and registers
your properties.
.. note::

View File

@@ -49,7 +49,7 @@ vec2d[:] = vec3d[:2]
# Vectors support 'swizzle' operations
# See http://en.wikipedia.org/wiki/Swizzling_(computer_graphics)
# See https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)
vec.xyz = vec.zyx
vec.xy = vec4d.zw
vec.xyz = vec4d.wzz

View File

@@ -8,11 +8,11 @@ Physics Constraints (bge.constraints)
Examples
--------
.. include:: ../examples/bge.constraints.py
.. include:: __/examples/bge.constraints.py
:start-line: 1
:end-line: 4
.. literalinclude:: ../examples/bge.constraints.py
.. literalinclude:: __/examples/bge.constraints.py
:lines: 6-

View File

@@ -12,53 +12,53 @@ This module holds key constants for the SCA_KeyboardSensor.
.. code-block:: python
# Set a connected keyboard sensor to accept F1
import bge
# Set a connected keyboard sensor to accept F1
import bge
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
sensor.key = bge.events.F1KEY
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
sensor.key = bge.events.F1KEY
.. code-block:: python
code-block:: python
# Do the all keys thing
import bge
# Do the all keys thing
import bge
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
for key,status in sensor.events:
# key[0] == bge.events.keycode, key[1] = status
if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
if key == bge.events.WKEY:
# Activate Forward!
if key == bge.events.SKEY:
# Activate Backward!
if key == bge.events.AKEY:
# Activate Left!
if key == bge.events.DKEY:
# Activate Right!
for key,status in sensor.events:
# key[0] == bge.events.keycode, key[1] = status
if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
if key == bge.events.WKEY:
# Activate Forward!
if key == bge.events.SKEY:
# Activate Backward!
if key == bge.events.AKEY:
# Activate Left!
if key == bge.events.DKEY:
# Activate Right!
.. code-block:: python
code-block:: python
# The all keys thing without a keyboard sensor (but you will
# need an always sensor with pulse mode on)
import bge
# The all keys thing without a keyboard sensor (but you will
# need an always sensor with pulse mode on)
import bge
# Just shortening names here
keyboard = bge.logic.keyboard
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
# Just shortening names here
keyboard = bge.logic.keyboard
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED:
print("Activate Forward!")
if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED:
print("Activate Backward!")
if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED:
print("Activate Left!")
if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED:
print("Activate Right!")
if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED:
print("Activate Forward!")
if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED:
print("Activate Backward!")
if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED:
print("Activate Left!")
if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED:
print("Activate Right!")
*********

View File

@@ -378,6 +378,28 @@ General functions
Render next frame (if Python has control)
.. function:: setRender(render)
Sets the global flag that controls the render of the scene.
If True, the render is done after the logic frame.
If False, the render is skipped and another logic frame starts immediately.
.. note::
GPU VSync no longer limits the number of frame per second when render is off,
but the *Use Frame Rate* option still regulates the fps. To run as many frames
as possible, untick this option (Render Properties, System panel).
:arg render: the render flag
:type render: bool
.. function:: getRender()
Get the current value of the global render flag
:return: The flag value
:rtype: bool
**********************
Time related functions
**********************

View File

@@ -90,6 +90,48 @@ Constants
Right eye being used during stereoscopic rendering.
.. data:: RAS_OFS_RENDER_BUFFER
The pixel buffer for offscreen render is a RenderBuffer. Argument to :func:`offScreenCreate`
.. data:: RAS_OFS_RENDER_TEXTURE
The pixel buffer for offscreen render is a Texture. Argument to :func:`offScreenCreate`
*****
Types
*****
.. class:: RASOffScreen
An off-screen render buffer object.
Use :func:`offScreenCreate` to create it.
Currently it can only be used in the :class:`bge.texture.ImageRender`
constructor to render on a FBO rather than the default viewport.
.. attribute:: width
The width in pixel of the FBO
:type: integer
.. attribute:: height
The height in pixel of the FBO
:type: integer
.. attribute:: color
The underlying OpenGL bind code of the texture object that holds
the rendered image, 0 if the FBO is using RenderBuffer.
The choice between RenderBuffer and Texture is determined
by the target argument of :func:`offScreenCreate`.
:type: integer
*********
Functions
@@ -362,3 +404,22 @@ Functions
Get the current vsync value
:rtype: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE
.. function:: offScreenCreate(width,height[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER])
Create a Off-screen render buffer object.
:arg width: the width of the buffer in pixels
:type width: integer
:arg height: the height of the buffer in pixels
:type height: integer
:arg samples: the number of multisample for anti-aliasing (MSAA), 0 to disable MSAA
:type samples: integer
:arg target: the pixel storage: :data:`RAS_OFS_RENDER_BUFFER` to render on RenderBuffers (the default),
:data:`RAS_OFS_RENDER_TEXTURE` to render on texture.
The later is interesting if you want to access the texture directly (see :attr:`RASOffScreen.color`).
Otherwise the default is preferable as it's more widely supported by GPUs and more efficient.
If the GPU does not support MSAA+Texture (e.g. Intel HD GPU), MSAA will be disabled.
:type target: integer
:rtype: :class:`RASOffScreen`

File diff suppressed because it is too large Load Diff

View File

@@ -214,6 +214,16 @@ base class --- :class:`PyObjectPlus`
:arg iList: a list (2, 3 or 4 elements) of integer values
:type iList: list[integer]
.. method:: setUniformEyef(name)
Set a uniform with a float value that reflects the eye being render in stereo mode:
0.0 for the left eye, 0.5 for the right eye. In non stereo mode, the value of the uniform
is fixed to 0.0. The typical use of this uniform is in stereo mode to sample stereo textures
containing the left and right eye images in a top-bottom order.
:arg name: the uniform name
:type name: string
.. method:: validate()
Validate the shader object.

View File

@@ -60,37 +60,37 @@ base class --- :class:`KX_GameObject`
:type: float (read only)
..attribute:: shadowFrustumSize
.. attribute:: shadowFrustumSize
Size of the frustum used for creating the shadowmap.
:type: float (read only)
..attribute:: shadowBindId
.. attribute:: shadowBindId
The OpenGL shadow texture bind number/id.
:type: int (read only)
..attribute:: shadowMapType
.. attribute:: shadowMapType
The shadow shadow map type (0 -> Simple; 1 -> Variance)
:type: int (read only)
..attribute:: shadowBias
.. attribute:: shadowBias
The shadow buffer sampling bias.
:type: float (read only)
..attribute:: shadowBleedBias
.. attribute:: shadowBleedBias
The bias for reducing light-bleed on variance shadow maps.
:type: float (read only)
..attribute:: useShadow
.. attribute:: useShadow
Returns True if the light has Shadow option activated, else returns False.

View File

@@ -12,13 +12,13 @@ base class --- :class:`PyObjectPlus`
.. attribute:: name
The name assigned to the joystick by the operating system. (read-only)
:type: string
.. attribute:: activeButtons
A list of active button values. (read-only)
:type: list
.. attribute:: axisValues
@@ -27,8 +27,10 @@ base class --- :class:`PyObjectPlus`
:type: list of ints.
Each specifying the value of an axis between -1.0 and 1.0 depending on how far the axis is pushed, 0 for nothing.
The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
Each specifying the value of an axis between -1.0 and 1.0
depending on how far the axis is pushed, 0 for nothing.
The first 2 values are used by most joysticks and gamepads for directional control.
3rd and 4th values are only on some joysticks and can be used for arbitary controls.
* left:[-1.0, 0.0, ...]
* right:[1.0, 0.0, ...]

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
..
This document is appended to the auto generated bmesh api doc to avoid clogging up the C files with details.
to test this run:
./blender.bin -b -noaudio -P doc/python_api/sphinx_doc_gen.py -- --partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
./blender.bin -b -noaudio -P doc/python_api/sphinx_doc_gen.py -- \
--partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
Submodules:
@@ -22,7 +23,7 @@ The features exposed closely follow the C API,
giving python access to the functions used by blenders own mesh editing tools.
For an overview of BMesh data types and how they reference each other see:
`BMesh Design Document <http://wiki.blender.org/index.php/Dev:2.6/Source/Modeling/BMesh/Design>`_ .
`BMesh Design Document <https://wiki.blender.org/index.php/Dev:Source/Modeling/BMesh/Design>`_ .
.. note::
@@ -30,17 +31,16 @@ For an overview of BMesh data types and how they reference each other see:
**Disk** and **Radial** data is not exposed by the python api since this is for internal use only.
.. warning::
TODO items are...
.. warning:: TODO items are...
* add access to BMesh **walkers**
* add custom-data manipulation functions add/remove/rename.
Example Script
--------------
.. literalinclude:: ../../../release/scripts/templates_py/bmesh_simple.py
.. literalinclude:: __/__/__/release/scripts/templates_py/bmesh_simple.py
Stand-Alone Module
@@ -59,9 +59,9 @@ There are 2 ways to access BMesh data, you can create a new BMesh by converting
:class:`bpy.types.BlendData.meshes` or by accessing the current edit mode mesh.
see: :class:`bmesh.types.BMesh.from_mesh` and :mod:`bmesh.from_edit_mesh` respectively.
When explicitly converting from mesh data python **owns** the data, that is to say - that the mesh only exists while
python holds a reference to it, and the script is responsible for putting it back into a mesh data-block when the edits
are done.
When explicitly converting from mesh data python **owns** the data, that is to say -
that the mesh only exists while python holds a reference to it,
and the script is responsible for putting it back into a mesh data-block when the edits are done.
Note that unlike :mod:`bpy`, a BMesh does not necessarily correspond to data in the currently open blend file,
a BMesh can be created, edited and freed without the user ever seeing or having access to it.

View File

@@ -18,7 +18,7 @@ amongst our own scripts and make it easier to use python scripts from other proj
Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
This style guide is known as pep8 and can be found `here <http://www.python.org/dev/peps/pep-0008>`_
This style guide is known as pep8 and can be found `here <https://www.python.org/dev/peps/pep-0008/>`_
A brief listing of pep8 criteria.
@@ -316,7 +316,7 @@ use to join a list of strings (the list may be temporary). In the following exam
Join is fastest on many strings,
`string formatting <http://docs.python.org/py3k/library/string.html#string-formatting>`__
`string formatting <https://wiki.blender.org/index.php/Dev:Source/Modeling/BMesh/Design>`__
is quite fast too (better for converting data types). String arithmetic is slowest.

View File

@@ -1,3 +1,4 @@
*******
Gotchas
*******
@@ -38,7 +39,6 @@ but some operators are more picky about when they run.
In most cases you can figure out what context an operator needs
simply be seeing how it's used in Blender and thinking about what it does.
Unfortunately if you're still stuck - the only way to **really** know
whats going on is to read the source code for the poll function and see what its checking.
@@ -82,7 +82,6 @@ it should be reported to the bug tracker.
Stale Data
==========
No updates after setting values
-------------------------------
@@ -174,8 +173,8 @@ In this situation you can...
.. _info_gotcha_mesh_faces:
NGons and Tessellation Faces
============================
N-Gons and Tessellation Faces
=============================
Since 2.63 NGons are supported, this adds some complexity
since in some cases you need to access triangles/quads still (some exporters for example).
@@ -509,7 +508,7 @@ Unicode Problems
Python supports many different encodings so there is nothing stopping you from
writing a script in ``latin1`` or ``iso-8859-15``.
See `pep-0263 <http://www.python.org/dev/peps/pep-0263/>`_
See `pep-0263 <https://www.python.org/dev/peps/pep-0263/>`_
However this complicates matters for Blender's Python API because ``.blend`` files don't have an explicit encoding.
@@ -657,7 +656,7 @@ Here are some general hints to avoid running into these problems.
.. note::
To find the line of your script that crashes you can use the ``faulthandler`` module.
See `faulthandler docs <http://docs.python.org/dev/library/faulthandler.html>`_.
See the `faulthandler docs <https://docs.python.org/dev/library/faulthandler.html>`_.
While the crash may be in Blenders C/C++ code,
this can help a lot to track down the area of the script that causes the crash.

View File

@@ -43,8 +43,7 @@ scene manipulation, automation, defining your own toolset and customization.
On startup Blender scans the ``scripts/startup/`` directory for Python modules and imports them.
The exact location of this directory depends on your installation.
`See the directory layout docs
<https://www.blender.org/manual/getting_started/installing_blender/directorylayout.html>`__
See the :ref:`directory layout docs <blender_manual:getting-started_installing-config-directories>`.
Script Loading
@@ -77,22 +76,22 @@ To run as modules:
- The obvious way, ``import some_module`` command from the text window or interactive console.
- Open as a text block and tick "Register" option, this will load with the blend file.
- copy into one of the directories ``scripts/startup``, where they will be automatically imported on startup.
- define as an addon, enabling the addon will load it as a Python module.
- define as an add-on, enabling the add-on will load it as a Python module.
Addons
Add-ons
------
Some of Blenders functionality is best kept optional,
alongside scripts loaded at startup we have addons which are kept in their own directory ``scripts/addons``,
alongside scripts loaded at startup we have add-ons which are kept in their own directory ``scripts/addons``,
and only load on startup if selected from the user preferences.
The only difference between addons and built-in Python modules is that addons must contain a ``bl_info``
The only difference between add-ons and built-in Python modules is that add-ons must contain a ``bl_info``
variable which Blender uses to read metadata such as name, author, category and URL.
The user preferences addon listing uses **bl_info** to display information about each addon.
The User Preferences add-on listing uses **bl_info** to display information about each add-on.
`See Addons <http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons>`__
`See Add-ons <https://wiki.blender.org/index.php/Dev:Py/Scripts/Guidelines/Addons>`__
for details on the ``bl_info`` dictionary.
@@ -223,7 +222,7 @@ These functions usually appear at the bottom of the script containing class regi
You can also use them for internal purposes setting up data for your own tools but take care
since register won't re-run when a new blend file is loaded.
The register/unregister calls are used so it's possible to toggle addons and reload scripts while Blender runs.
The register/unregister calls are used so it's possible to toggle add-ons and reload scripts while Blender runs.
If the register calls were placed in the body of the script, registration would be called on import,
meaning there would be no distinction between importing a module or loading its classes into Blender.

View File

@@ -51,8 +51,7 @@ A quick list of helpful things to know before starting:
| ``scripts/startup/bl_operators`` for operators.
Exact location depends on platform, see:
`Configuration and Data Paths
<https://www.blender.org/manual/getting_started/installing_blender/directorylayout.html>`__.
:ref:`Configuration and Data Paths <blender_manual:getting-started_installing-config-directories>`.
Running Scripts
@@ -151,7 +150,7 @@ Data Creation/Removal
^^^^^^^^^^^^^^^^^^^^^
Those of you familiar with other Python API's may be surprised that
new datablocks in the bpy API can't be created by calling the class:
new data-blocks in the bpy API can't be created by calling the class:
>>> bpy.types.Mesh()
Traceback (most recent call last):
@@ -305,7 +304,7 @@ In Python, this is done by defining a class, which is a subclass of an existing
Example Operator
----------------
.. literalinclude:: ../../../release/scripts/templates_py/operator_simple.py
.. literalinclude:: __/__/__/release/scripts/templates_py/operator_simple.py
Once this script runs, ``SimpleOperator`` is registered with Blender
and can be called from the operator search popup or added to the toolbar.
@@ -336,7 +335,7 @@ Example Panel
Panels register themselves as a class, like an operator.
Notice the extra ``bl_`` variables used to set the context they display in.
.. literalinclude:: ../../../release/scripts/templates_py/ui_panel_simple.py
.. literalinclude:: __/__/__/release/scripts/templates_py/ui_panel_simple.py
To run the script:
@@ -393,11 +392,11 @@ so these are accessed as normal Python types.
Internal Types
--------------
Used for Blender datablocks and collections: :class:`bpy.types.bpy_struct`
Used for Blender data-blocks and collections: :class:`bpy.types.bpy_struct`
For data that contains its own attributes groups/meshes/bones/scenes... etc.
There are 2 main types that wrap Blenders data, one for datablocks
There are 2 main types that wrap Blenders data, one for data-blocks
(known internally as ``bpy_struct``), another for properties.
>>> bpy.context.object

View File

@@ -27,7 +27,7 @@ There are 3 main uses for the terminal, these are:
.. note::
For Linux and OSX users this means starting the terminal first, then running Blender from within it.
For Linux and macOS users this means starting the terminal first, then running Blender from within it.
On Windows the terminal can be enabled from the help menu.
@@ -306,7 +306,7 @@ Advantages include:
This is marked advanced because to run Blender as a Python module requires a special build option.
For instructions on building see
`Building Blender as a Python module <http://wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule>`_
`Building Blender as a Python module <https://wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule>`_
Python Safety (Build Option)

View File

@@ -1,6 +1,6 @@
Addon Tutorial
##############
Add-on Tutorial
###############
************
Introduction
@@ -36,6 +36,7 @@ Suggested reading before starting this tutorial.
To best troubleshoot any error message Python prints while writing scripts you run blender with from a terminal,
see :ref:`Use The Terminal <use_the_terminal>`.
Documentation Links
===================
@@ -46,51 +47,48 @@ While going through the tutorial you may want to look into our reference documen
- :mod:`bpy.context` api reference. -
*Handy to have a list of available items your script may operate on.*
- :class:`bpy.types.Operator`. -
*The following addons define operators, these docs give details and more examples of operators.*
*The following add-ons define operators, these docs give details and more examples of operators.*
******
Addons
******
*******
Add-ons
*******
What is an Add-on?
==================
What is an Addon?
=================
An addon is simply a Python module with some additional requirements so Blender can display it in a list with useful
An add-on is simply a Python module with some additional requirements so Blender can display it in a list with useful
information.
To give an example, here is the simplest possible addon.
To give an example, here is the simplest possible add-on.
.. code-block:: python
bl_info = {"name": "My Test Addon", "category": "Object"}
bl_info = {"name": "My Test Add-on", "category": "Object"}
def register():
print("Hello World")
def unregister():
print("Goodbye World")
- ``bl_info`` is a dictionary containing addon meta-data such as the title, version and author to be displayed in the
user preferences addon list.
- ``register`` is a function which only runs when enabling the addon, this means the module can be loaded without
activating the addon.
- ``unregister`` is a function to unload anything setup by ``register``, this is called when the addon is disabled.
- ``bl_info`` is a dictionary containing add-on metadata such as the title,
version and author to be displayed in the user preferences add-on list.
- ``register`` is a function which only runs when enabling the add-on,
this means the module can be loaded without activating the add-on.
- ``unregister`` is a function to unload anything setup by ``register``, this is called when the add-on is disabled.
Notice this add-on does not do anything related to Blender, (the :mod:`bpy` module is not imported for example).
Notice this addon does not do anything related to Blender, (the :mod:`bpy` module is not imported for example).
This is a contrived example of an add-on that serves to illustrate the point
that the base requirements of an add-on are simple.
This is a contrived example of an addon that serves to illustrate the point
that the base requirements of an addon are simple.
An addon will typically register operators, panels, menu items etc, but its worth noting that _any_ script can do this,
An add-on will typically register operators, panels, menu items etc, but its worth noting that _any_ script can do this,
when executed from the text editor or even the interactive console - there is nothing inherently different about an
addon that allows it to integrate with Blender, such functionality is just provided by the :mod:`bpy` module for any
add-on that allows it to integrate with Blender, such functionality is just provided by the :mod:`bpy` module for any
script to access.
So an addon is just a way to encapsulate a Python module in a way a user can easily utilize.
So an add-on is just a way to encapsulate a Python module in a way a user can easily utilize.
.. note::
@@ -99,14 +97,14 @@ So an addon is just a way to encapsulate a Python module in a way a user can eas
Messages will be printed when enabling and disabling.
Your First Addon
================
Your First Add-on
=================
The simplest possible addon above was useful as an example but not much else.
This next addon is simple but shows how to integrate a script into Blender using an ``Operator``
The simplest possible add-on above is useful as an example but not much else.
This next add-on is simple but shows how to integrate a script into Blender using an ``Operator``
which is the typical way to define a tool accessed from menus, buttons and keyboard shortcuts.
For the first example we'll make a script that simply moves all objects in a scene.
For the first example we will make a script that simply moves all objects in a scene.
Write The Script
@@ -123,20 +121,14 @@ Add the following script to the text editor in Blender.
obj.location.x += 1.0
.. image:: run_script.png
:width: 924px
:align: center
:height: 574px
:alt: Run Script button
Click the Run Script button, all objects in the active scene are moved by 1.0 Blender unit.
Next we'll make this script into an addon.
Click the :ref:`Run Script button <blender_manual:editors-text-run-script>`,
all objects in the active scene are moved by 1.0 Blender unit.
Write the Addon (Simple)
------------------------
Write the Add-on (Simple)
-------------------------
This addon takes the body of the script above, and adds them to an operator's ``execute()`` function.
This add-on takes the body of the script above, and adds them to an operator's ``execute()`` function.
.. code-block:: python
@@ -173,7 +165,7 @@ This addon takes the body of the script above, and adds them to an operator's ``
# This allows you to run the script directly from blenders text editor
# to test the addon without having to install it.
# to test the add-on without having to install it.
if __name__ == "__main__":
register()
@@ -206,33 +198,33 @@ Do this by pressing :kbd:`Spacebar` to bring up the operator search dialog and t
The objects should move as before.
*Keep this addon open in Blender for the next step - Installing.*
*Keep this add-on open in Blender for the next step - Installing.*
Install The Addon
-----------------
Install The Add-on
------------------
Once you have your addon within in Blender's text editor,
Once you have your add-on within in Blender's text editor,
you will want to be able to install it so it can be enabled in the user preferences to load on startup.
Even though the addon above is a test, lets go through the steps anyway so you know how to do it for later.
Even though the add-on above is a test, lets go through the steps anyway so you know how to do it for later.
To install the Blender text as an addon you will first have to save it to disk, take care to obey the naming
To install the Blender text as an add-on you will first have to save it to disk, take care to obey the naming
restrictions that apply to Python modules and end with a ``.py`` extension.
Once the file is on disk, you can install it as you would for an addon downloaded online.
Once the file is on disk, you can install it as you would for an add-on downloaded online.
Open the user :menuselection:`File -> User Preferences`,
Select the *Addon* section, press *Install Addon...* and select the file.
Open the user :menuselection:`File --> User Preferences`,
Select the *Add-on* section, press *Install Add-on...* and select the file.
Now the addon will be listed and you can enable it by pressing the check-box,
Now the add-on will be listed and you can enable it by pressing the check-box,
if you want it to be enabled on restart, press *Save as Default*.
.. note::
The destination of the addon depends on your Blender configuration.
When installing an addon the source and destination path are printed in the console.
You can also find addon path locations by running this in the Python console.
The destination of the add-on depends on your Blender configuration.
When installing an add-on the source and destination path are printed in the console.
You can also find add-on path locations by running this in the Python console.
.. code-block:: python
@@ -240,20 +232,20 @@ if you want it to be enabled on restart, press *Save as Default*.
print(addon_utils.paths())
More is written on this topic here:
`Directory Layout <https://www.blender.org/manual/getting_started/installing_blender/directorylayout.html>`_
:ref:`Directory Layout <blender_manual:getting-started_installing-config-directories>`.
Your Second Addon
=================
Your Second Add-on
==================
For our second addon, we will focus on object instancing - this is - to make linked copies of an object in a
For our second add-on, we will focus on object instancing - this is - to make linked copies of an object in a
similar way to what you may have seen with the array modifier.
Write The Script
----------------
As before, first we will start with a script, develop it, then convert into an addon.
As before, first we will start with a script, develop it, then convert into an add-on.
.. code-block:: python
@@ -324,17 +316,17 @@ allows vectors to be multiplied by numbers and matrices.
If you are interested in this area, read into :class:`mathutils.Vector` - there are many handy utility functions
such as getting the angle between vectors, cross product, dot products
as well as more advanced functions in :mod:`mathutils.geometry` such as bezier spline interpolation and
as well as more advanced functions in :mod:`mathutils.geometry` such as zier Spline interpolation and
ray-triangle intersection.
For now we'll focus on making this script an addon, but its good to know that this 3D math module is available and
For now we will focus on making this script an add-on, but its good to know that this 3D math module is available and
can help you with more advanced functionality later on.
Write the Addon
---------------
Write the Add-on
----------------
The first step is to convert the script as-is into an addon.
The first step is to convert the script as-is into an add-on.
.. code-block:: python
@@ -381,7 +373,7 @@ The first step is to convert the script as-is into an addon.
register()
Everything here has been covered in the previous steps, you may want to try run the addon still
Everything here has been covered in the previous steps, you may want to try run the add-on still
and consider what could be done to make it more useful.
@@ -434,7 +426,7 @@ however the link above includes examples of more advanced property usage.
Menu Item
^^^^^^^^^
Addons can add to the user interface of existing panels, headers and menus defined in Python.
Add-ons can add to the user interface of existing panels, headers and menus defined in Python.
For this example we'll add to an existing menu.
@@ -464,7 +456,7 @@ For docs on extending menus see: :doc:`bpy.types.Menu`.
Keymap
^^^^^^
In Blender addons have their own key-maps so as not to interfere with Blenders built in key-maps.
In Blender, add-ons have their own keymaps so as not to interfere with Blenders built in key-maps.
In the example below, a new object-mode :class:`bpy.types.KeyMap` is added,
then a :class:`bpy.types.KeyMapItem` is added to the key-map which references our newly added operator,
@@ -502,7 +494,7 @@ this allows you to have multiple keys accessing the same operator with different
.. note::
While :kbd:`Ctrl-Shift-Space` isn't a default Blender key shortcut, its hard to make sure addons won't
While :kbd:`Ctrl-Shift-Space` isn't a default Blender key shortcut, its hard to make sure add-ons won't
overwrite each others keymaps, At least take care when assigning keys that they don't
conflict with important functionality within Blender.
@@ -606,14 +598,14 @@ After selecting it from the menu, you can choose how many instance of the cube y
.. note::
Directly executing the script multiple times will add the menu each time too.
While not useful behavior, theres nothing to worry about since addons won't register them selves multiple
While not useful behavior, theres nothing to worry about since add-ons won't register them selves multiple
times when enabled through the user preferences.
Conclusions
===========
Addons can encapsulate certain functionality neatly for writing tools to improve your work-flow or for writing utilities
Add-ons can encapsulate certain functionality neatly for writing tools to improve your work-flow or for writing utilities
for others to use.
While there are limits to what Python can do within Blender, there is certainly a lot that can be achieved without
@@ -636,8 +628,8 @@ Here are some sites you might like to check on after completing this tutorial.
*For more background details on Blender/Python integration.*
- `How to Think Like a Computer Scientist <http://interactivepython.org/courselib/static/thinkcspy/index.html>`_ -
*Great info for those who are still learning Python.*
- `Blender Development (Wiki) <http://wiki.blender.org/index.php/Dev:Contents>`_ -
- `Blender Development (Wiki) <https://wiki.blender.org/index.php/Dev:Contents>`_ -
*Blender Development, general information and helpful links.*
- `Blender Artists (Coding Section) <http://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
- `Blender Artists (Coding Section) <https://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
*forum where people ask Python development questions*

View File

@@ -57,7 +57,7 @@ Operator Example
++++++++++++++++
This script shows how operators can be used to model a link of a chain.
.. literalinclude:: ../examples/bmesh.ops.1.py
.. literalinclude:: __/examples/bmesh.ops.1.py
"""

View File

@@ -27,7 +27,7 @@ output from this tool should be added into "doc/python_api/rst/change_log.rst"
blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
# create changelog
blender --background --python doc/python_api/sphinx_changelog_gen.py -- \
blender --background --factory-startup --python doc/python_api/sphinx_changelog_gen.py -- \
--api_from blender_2_63_0.py \
--api_to blender_2_64_0.py \
--api_out changes.rst
@@ -48,7 +48,8 @@ python doc/python_api/sphinx_changelog_gen.py -- \
'''
{"module.name":
{"parent.class":
{"basic_type", "member_name": ("Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types)}, ...
{"basic_type", "member_name":
("Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types)}, ...
}, ...
}
'''
@@ -99,34 +100,34 @@ def api_dump():
prop_range = None
dump_class[prop_id] = (
"prop_rna", # basic_type
prop.name, # name
prop_type, # type
prop_range, # range
prop_length, # length
prop.default, # default
prop.description, # descr
Ellipsis, # f_args
Ellipsis, # f_arg_types
Ellipsis, # f_ret_types
)
"prop_rna", # basic_type
prop.name, # name
prop_type, # type
prop_range, # range
prop_length, # length
prop.default, # default
prop.description, # descr
Ellipsis, # f_args
Ellipsis, # f_arg_types
Ellipsis, # f_ret_types
)
del props
# python props, tricky since we dont know much about them.
for prop_id, attr in struct_info.get_py_properties():
dump_class[prop_id] = (
"prop_py", # basic_type
Ellipsis, # name
Ellipsis, # type
Ellipsis, # range
Ellipsis, # length
Ellipsis, # default
attr.__doc__, # descr
Ellipsis, # f_args
Ellipsis, # f_arg_types
Ellipsis, # f_ret_types
)
"prop_py", # basic_type
Ellipsis, # name
Ellipsis, # type
Ellipsis, # range
Ellipsis, # length
Ellipsis, # default
attr.__doc__, # descr
Ellipsis, # f_args
Ellipsis, # f_arg_types
Ellipsis, # f_ret_types
)
# kludge func -> props
funcs = [(func.identifier, func) for func in struct_info.functions]
@@ -137,17 +138,17 @@ def api_dump():
func_args_type = tuple([prop.type for prop in func.args])
dump_class[func_id] = (
"func_rna", # basic_type
Ellipsis, # name
Ellipsis, # type
Ellipsis, # range
Ellipsis, # length
Ellipsis, # default
func.description, # descr
func_args_ids, # f_args
func_args_type, # f_arg_types
func_ret_types, # f_ret_types
)
"func_rna", # basic_type
Ellipsis, # name
Ellipsis, # type
Ellipsis, # range
Ellipsis, # length
Ellipsis, # default
func.description, # descr
func_args_ids, # f_args
func_args_type, # f_arg_types
func_ret_types, # f_ret_types
)
del funcs
# kludge func -> props
@@ -158,17 +159,17 @@ def api_dump():
func_args_ids = tuple(inspect.getargspec(attr).args)
dump_class[func_id] = (
"func_py", # basic_type
Ellipsis, # name
Ellipsis, # type
Ellipsis, # range
Ellipsis, # length
Ellipsis, # default
attr.__doc__, # descr
func_args_ids, # f_args
Ellipsis, # f_arg_types
Ellipsis, # f_ret_types
)
"func_py", # basic_type
Ellipsis, # name
Ellipsis, # type
Ellipsis, # range
Ellipsis, # length
Ellipsis, # default
attr.__doc__, # descr
func_args_ids, # f_args
Ellipsis, # f_arg_types
Ellipsis, # f_ret_types
)
del funcs
import pprint
@@ -330,21 +331,25 @@ def main():
# When --help or no args are given, print this help
usage_text = "Run blender in background mode with this script: "
"blender --background --python %s -- [options]" % os.path.basename(__file__)
"blender --background --factory-startup --python %s -- [options]" % os.path.basename(__file__)
epilog = "Run this before releases"
parser = argparse.ArgumentParser(description=usage_text, epilog=epilog)
parser.add_argument("--dump", dest="dump", action='store_true',
help="When set the api will be dumped into blender_version.py")
parser.add_argument(
"--dump", dest="dump", action='store_true',
help="When set the api will be dumped into blender_version.py")
parser.add_argument("--api_from", dest="api_from", metavar='FILE',
help="File to compare from (previous version)")
parser.add_argument("--api_to", dest="api_to", metavar='FILE',
help="File to compare from (current)")
parser.add_argument("--api_out", dest="api_out", metavar='FILE',
help="Output sphinx changelog")
parser.add_argument(
"--api_from", dest="api_from", metavar='FILE',
help="File to compare from (previous version)")
parser.add_argument(
"--api_to", dest="api_to", metavar='FILE',
help="File to compare from (current)")
parser.add_argument(
"--api_out", dest="api_out", metavar='FILE',
help="Output sphinx changelog")
args = parser.parse_args(argv) # In this example we wont use the args

View File

@@ -24,18 +24,18 @@ SCRIPT_HELP_MSG = """
API dump in RST files
---------------------
Run this script from blenders root path once you have compiled blender
Run this script from Blender's root path once you have compiled Blender
./blender.bin --background -noaudio --python doc/python_api/sphinx_doc_gen.py
blender --background --factory-startup -noaudio --python doc/python_api/sphinx_doc_gen.py
This will generate python files in doc/python_api/sphinx-in/
providing ./blender.bin is or links to the blender executable
providing ./blender is or links to the blender executable
To choose sphinx-in directory:
./blender.bin --background --python doc/python_api/sphinx_doc_gen.py -- --output ../python_api
blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py -- --output ../python_api
For quick builds:
./blender.bin --background --python doc/python_api/sphinx_doc_gen.py -- --partial bmesh.*
blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py -- --partial bmesh.*
Sphinx: HTML generation
@@ -46,8 +46,6 @@ Sphinx: HTML generation
cd doc/python_api
sphinx-build sphinx-in sphinx-out
This requires sphinx 1.0.7 to be installed.
Sphinx: PDF generation
----------------------
@@ -61,14 +59,14 @@ Sphinx: PDF generation
"""
try:
import bpy # blender module
import bpy # Blender module
except ImportError:
print("\nERROR: this script must run from inside Blender")
print(SCRIPT_HELP_MSG)
import sys
sys.exit()
import rna_info # blender module
import rna_info # Blender module
def rna_info_BuildRNAInfo_cache():
@@ -86,7 +84,7 @@ import shutil
import logging
from platform import platform
PLATFORM = platform().split('-')[0].lower() # 'linux', 'darwin', 'windows'
PLATFORM = platform().split('-')[0].lower() # 'linux', 'darwin', 'windows'
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
@@ -181,15 +179,13 @@ def handle_args():
dest="log",
default=False,
action='store_true',
help=(
"Log the output of the api dump and sphinx|latex "
"warnings and errors (default=False).\n"
"If given, save logs in:\n"
"* OUTPUT_DIR/.bpy.log\n"
"* OUTPUT_DIR/.sphinx-build.log\n"
"* OUTPUT_DIR/.sphinx-build_pdf.log\n"
"* OUTPUT_DIR/.latex_make.log",
),
help="Log the output of the api dump and sphinx|latex "
"warnings and errors (default=False).\n"
"If given, save logs in:\n"
"* OUTPUT_DIR/.bpy.log\n"
"* OUTPUT_DIR/.sphinx-build.log\n"
"* OUTPUT_DIR/.sphinx-build_pdf.log\n"
"* OUTPUT_DIR/.latex_make.log",
required=False)
# parse only the args passed after '--'
@@ -210,12 +206,12 @@ BPY_LOGGER.setLevel(logging.DEBUG)
"""
# for quick rebuilds
rm -rf /b/doc/python_api/sphinx-* && \
./blender.bin -b -noaudio --factory-startup -P doc/python_api/sphinx_doc_gen.py && \
./blender -b -noaudio --factory-startup -P doc/python_api/sphinx_doc_gen.py && \
sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
or
./blender.bin -b -noaudio --factory-startup -P doc/python_api/sphinx_doc_gen.py -- -f -B
./blender -b -noaudio --factory-startup -P doc/python_api/sphinx_doc_gen.py -- -f -B
"""
# Switch for quick testing so doc-builds don't take so long
@@ -224,12 +220,12 @@ if not ARGS.partial:
FILTER_BPY_OPS = None
FILTER_BPY_TYPES = None
EXCLUDE_INFO_DOCS = False
EXCLUDE_MODULES = ()
EXCLUDE_MODULES = []
else:
# can manually edit this too:
#FILTER_BPY_OPS = ("import.scene", ) # allow
#FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID") # allow
# FILTER_BPY_OPS = ("import.scene", ) # allow
# FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID") # allow
EXCLUDE_INFO_DOCS = True
EXCLUDE_MODULES = [
"aud",
@@ -262,6 +258,7 @@ else:
"bpy_extras",
"gpu",
"gpu.offscreen",
"idprop.types",
"mathutils",
"mathutils.bvhtree",
"mathutils.geometry",
@@ -275,7 +272,7 @@ else:
"freestyle.shaders",
"freestyle.types",
"freestyle.utils",
]
]
# ------
# Filter
@@ -301,7 +298,9 @@ else:
del m
del fnmatch
BPY_LOGGER.debug("Partial Doc Build, Skipping: %s\n" % "\n ".join(sorted(EXCLUDE_MODULES)))
BPY_LOGGER.debug(
"Partial Doc Build, Skipping: %s\n" %
"\n ".join(sorted(EXCLUDE_MODULES)))
#
# done filtering
@@ -311,19 +310,39 @@ try:
__import__("aud")
except ImportError:
BPY_LOGGER.debug("Warning: Built without 'aud' module, docs incomplete...")
EXCLUDE_MODULES = list(EXCLUDE_MODULES) + ["aud"]
EXCLUDE_MODULES.append("aud")
try:
__import__("freestyle")
except ImportError:
BPY_LOGGER.debug("Warning: Built without 'freestyle' module, docs incomplete...")
EXCLUDE_MODULES = list(EXCLUDE_MODULES) + ["freestyle",
"freestyle.chainingiterators",
"freestyle.functions",
"freestyle.predicates",
"freestyle.shaders",
"freestyle.types",
"freestyle.utils"]
EXCLUDE_MODULES.extend([
"freestyle",
"freestyle.chainingiterators",
"freestyle.functions",
"freestyle.predicates",
"freestyle.shaders",
"freestyle.types",
"freestyle.utils",
])
# Source files we use, and need to copy to the OUTPUT_DIR
# to have working out-of-source builds.
# Note that ".." is replaced by "__" in the RST files,
# to avoid having to match Blender's source tree.
EXTRA_SOURCE_FILES = (
"../../../release/scripts/templates_py/bmesh_simple.py",
"../../../release/scripts/templates_py/operator_simple.py",
"../../../release/scripts/templates_py/ui_panel_simple.py",
"../../../release/scripts/templates_py/ui_previews_custom_icon.py",
"../examples/bge.constraints.py",
"../examples/bge.texture.1.py",
"../examples/bge.texture.2.py",
"../examples/bge.texture.py",
"../examples/bmesh.ops.1.py",
"../examples/bpy.app.translations.py",
)
# examples
EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples"))
@@ -339,52 +358,59 @@ RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst"))
# extra info, not api reference docs
# stored in ./rst/info_*
INFO_DOCS = (
("info_quickstart.rst", "Blender/Python Quickstart: new to blender/scripting and want to get your feet wet?"),
("info_overview.rst", "Blender/Python API Overview: a more complete explanation of python integration"),
("info_tutorial_addon.rst", "Blender/Python Addon Tutorial: a step by step guide on how to write an addon from scratch"),
("info_api_reference.rst", "Blender/Python API Reference Usage: examples of how to use the API reference docs"),
("info_best_practice.rst", "Best Practice: Conventions to follow for writing good scripts"),
("info_tips_and_tricks.rst", "Tips and Tricks: Hints to help you while writing scripts for blender"),
("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"),
)
("info_quickstart.rst",
"Blender/Python Quickstart: new to Blender/scripting and want to get your feet wet?"),
("info_overview.rst",
"Blender/Python API Overview: a more complete explanation of Python integration"),
("info_tutorial_addon.rst",
"Blender/Python Add-on Tutorial: a step by step guide on how to write an add-on from scratch"),
("info_api_reference.rst",
"Blender/Python API Reference Usage: examples of how to use the API reference docs"),
("info_best_practice.rst",
"Best Practice: Conventions to follow for writing good scripts"),
("info_tips_and_tricks.rst",
"Tips and Tricks: Hints to help you while writing scripts for Blender"),
("info_gotcha.rst",
"Gotcha's: some of the problems you may come up against when writing scripts"),
)
# only support for properties atm.
RNA_BLACKLIST = {
# XXX messes up PDF!, really a bug but for now just workaround.
"UserPreferencesSystem": {"language", }
}
}
MODULE_GROUPING = {
"bmesh.types": (
("Base Mesh Type", '-'),
"BMesh",
("Mesh Elements", '-'),
"BMVert",
"BMEdge",
"BMFace",
"BMLoop",
("Sequence Accessors", '-'),
"BMElemSeq",
"BMVertSeq",
"BMEdgeSeq",
"BMFaceSeq",
"BMLoopSeq",
"BMIter",
("Selection History", '-'),
"BMEditSelSeq",
"BMEditSelIter",
("Custom-Data Layer Access", '-'),
"BMLayerAccessVert",
"BMLayerAccessEdge",
"BMLayerAccessFace",
"BMLayerAccessLoop",
"BMLayerCollection",
"BMLayerItem",
("Custom-Data Layer Types", '-'),
"BMLoopUV",
"BMDeformVert"
)
}
("Base Mesh Type", '-'),
"BMesh",
("Mesh Elements", '-'),
"BMVert",
"BMEdge",
"BMFace",
"BMLoop",
("Sequence Accessors", '-'),
"BMElemSeq",
"BMVertSeq",
"BMEdgeSeq",
"BMFaceSeq",
"BMLoopSeq",
"BMIter",
("Selection History", '-'),
"BMEditSelSeq",
"BMEditSelIter",
("Custom-Data Layer Access", '-'),
"BMLayerAccessVert",
"BMLayerAccessEdge",
"BMLayerAccessFace",
"BMLayerAccessLoop",
"BMLayerCollection",
"BMLayerItem",
("Custom-Data Layer Types", '-'),
"BMLoopUV",
"BMDeformVert"
)
}
# --------------------configure compile time options----------------------------
@@ -392,7 +418,7 @@ MODULE_GROUPING = {
blender_version_strings = [str(v) for v in bpy.app.version]
# converting bytes to strings, due to #30154
# converting bytes to strings, due to T30154
BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
BLENDER_DATE = str(bpy.app.build_date, 'utf_8')
@@ -460,10 +486,10 @@ MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None))
from types import (
MemberDescriptorType,
MethodType,
FunctionType,
)
MemberDescriptorType,
MethodType,
FunctionType,
)
_BPY_STRUCT_FAKE = "bpy_struct"
_BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection"
@@ -483,7 +509,7 @@ escape_rst.trans = str.maketrans({
"|": "\\|",
"*": "\\*",
"\\": "\\\\",
})
})
def is_struct_seq(value):
@@ -728,7 +754,7 @@ def py_c_func2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_
def pyprop2sphinx(ident, fw, identifier, py_prop):
'''
python property to sphinx
Python property to sphinx
'''
# readonly properties use "data" directive, variables use "attribute" directive
if py_prop.fset is None:
@@ -828,7 +854,8 @@ def pymodule2sphinx(basepath, module_name, module, title):
# naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
# type_name is only used for examples and messages
type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1] # "<class 'bpy.app.handlers'>" --> bpy.app.handlers
# "<class 'bpy.app.handlers'>" --> bpy.app.handlers
type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1]
if type(descr) == types.GetSetDescriptorType:
py_descr2sphinx("", fw, descr, module_name, type_name, key)
attribute_set.add(key)
@@ -889,7 +916,8 @@ def pymodule2sphinx(basepath, module_name, module, title):
for attribute, value, value_type in module_dir_value_type:
if value_type == FunctionType:
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof
# both the same at the moment but to be future proof
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}:
# note: can't get args from these, so dump the string as is
# this means any module used like this must have fully formatted docstrings.
py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
@@ -955,7 +983,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
if type(descr) == ClassMethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
# needed for pure python classes
# needed for pure Python classes
for key, descr in descr_items:
if type(descr) == FunctionType:
pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True)
@@ -978,12 +1006,15 @@ def pymodule2sphinx(basepath, module_name, module, title):
file.close()
# Changes in blender will force errors here
# Changes in Blender will force errors here
context_type_map = {
"active_base": ("ObjectBase", False),
"active_bone": ("EditBone", False),
"active_gpencil_frame": ("GreasePencilLayer", True),
"active_gpencil_layer": ("GPencilLayer", True),
"active_gpencil_brush": ("GPencilSculptBrush", False),
"active_gpencil_palette": ("GPencilPalette", True),
"active_gpencil_palettecolor": ("GPencilPaletteColor", True),
"active_node": ("Node", False),
"active_object": ("Object", False),
"active_operator": ("Operator", False),
@@ -1066,9 +1097,10 @@ def pycontext2sphinx(basepath):
fw(title_string("Context Access (bpy.context)", "="))
fw(".. module:: bpy.context\n")
fw("\n")
fw("The context members available depend on the area of blender which is currently being accessed.\n")
fw("The context members available depend on the area of Blender which is currently being accessed.\n")
fw("\n")
fw("Note that all context values are readonly, but may be modified through the data api or by running operators\n\n")
fw("Note that all context values are readonly,\n")
fw("but may be modified through the data api or by running operators\n\n")
def write_contex_cls():
@@ -1091,7 +1123,8 @@ def pycontext2sphinx(basepath):
if prop.identifier in struct_blacklist:
continue
type_descr = prop.get_type_description(class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID)
type_descr = prop.get_type_description(
class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID)
fw(".. data:: %s\n\n" % prop.identifier)
if prop.description:
fw(" %s\n\n" % prop.description)
@@ -1111,7 +1144,7 @@ def pycontext2sphinx(basepath):
del write_contex_cls
# end
# nasty, get strings directly from blender because there is no other way to get it
# nasty, get strings directly from Blender because there is no other way to get it
import ctypes
context_strings = (
@@ -1147,7 +1180,9 @@ def pycontext2sphinx(basepath):
# for member in sorted(unique):
# print(' "%s": ("", False),' % member)
if len(context_type_map) > len(unique):
raise Exception("Some types are not used: %s" % str([member for member in context_type_map if member not in unique]))
raise Exception(
"Some types are not used: %s" %
str([member for member in context_type_map if member not in unique]))
else:
pass # will have raised an error above
@@ -1226,11 +1261,11 @@ def pyrna2sphinx(basepath):
fw(ident + ":%s%s: %s\n" % (id_type, identifier, type_descr))
def write_struct(struct):
#if not struct.identifier.startswith("Sc") and not struct.identifier.startswith("I"):
# return
# if not struct.identifier.startswith("Sc") and not struct.identifier.startswith("I"):
# return
#if not struct.identifier == "Object":
# return
# if not struct.identifier == "Object":
# return
filepath = os.path.join(basepath, "bpy.types.%s.rst" % struct.identifier)
file = open(filepath, "w", encoding="utf-8")
@@ -1271,7 +1306,11 @@ def pyrna2sphinx(basepath):
fw(", ".join((":class:`%s`" % base_id) for base_id in base_ids))
fw("\n\n")
subclass_ids = [s.identifier for s in structs.values() if s.base is struct if not rna_info.rna_id_ignore(s.identifier)]
subclass_ids = [
s.identifier for s in structs.values()
if s.base is struct
if not rna_info.rna_id_ignore(s.identifier)
]
subclass_ids.sort()
if subclass_ids:
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n")
@@ -1322,7 +1361,7 @@ def pyrna2sphinx(basepath):
fw(" :type: %s\n\n" % type_descr)
# python attributes
# Python attributes
py_properties = struct.get_py_properties()
py_prop = None
for identifier, py_prop in py_properties:
@@ -1332,7 +1371,8 @@ def pyrna2sphinx(basepath):
for func in struct.functions:
args_str = ", ".join(prop.get_arg_default(force=False) for prop in func.args)
fw(" .. %s:: %s(%s)\n\n" % ("classmethod" if func.is_classmethod else "method", func.identifier, args_str))
fw(" .. %s:: %s(%s)\n\n" %
("classmethod" if func.is_classmethod else "method", func.identifier, args_str))
fw(" %s\n\n" % func.description)
for prop in func.args:
@@ -1343,8 +1383,10 @@ def pyrna2sphinx(basepath):
elif func.return_values: # multiple return values
fw(" :return (%s):\n" % ", ".join(prop.identifier for prop in func.return_values))
for prop in func.return_values:
# TODO, pyrna_enum2sphinx for multiple return values... actually dont think we even use this but still!!!
type_descr = prop.get_type_description(as_ret=True, class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID)
# TODO, pyrna_enum2sphinx for multiple return values... actually dont
# think we even use this but still!!!
type_descr = prop.get_type_description(
as_ret=True, class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID)
descr = prop.description
if not descr:
descr = prop.name
@@ -1357,7 +1399,7 @@ def pyrna2sphinx(basepath):
fw("\n")
# python methods
# Python methods
py_funcs = struct.get_py_functions()
py_func = None
@@ -1380,7 +1422,10 @@ def pyrna2sphinx(basepath):
del lines[:]
if _BPY_STRUCT_FAKE:
descr_items = [(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items()) if not key.startswith("__")]
descr_items = [
(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items())
if not key.startswith("__")
]
if _BPY_STRUCT_FAKE:
for key, descr in descr_items:
@@ -1476,19 +1521,28 @@ def pyrna2sphinx(basepath):
fw("\n")
if use_subclasses:
subclass_ids = [s.identifier for s in structs.values() if s.base is None if not rna_info.rna_id_ignore(s.identifier)]
subclass_ids = [
s.identifier for s in structs.values()
if s.base is None
if not rna_info.rna_id_ignore(s.identifier)
]
if subclass_ids:
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in sorted(subclass_ids)) + "\n\n")
fw(".. class:: %s\n\n" % class_name)
fw(" %s\n\n" % descr_str)
fw(" .. note::\n\n")
fw(" Note that bpy.types.%s is not actually available from within blender, it only exists for the purpose of documentation.\n\n" % class_name)
fw(" Note that bpy.types.%s is not actually available from within Blender,\n"
" it only exists for the purpose of documentation.\n\n" % class_name)
descr_items = [(key, descr) for key, descr in sorted(class_value.__dict__.items()) if not key.startswith("__")]
descr_items = [
(key, descr) for key, descr in sorted(class_value.__dict__.items())
if not key.startswith("__")
]
for key, descr in descr_items:
if type(descr) == MethodDescriptorType: # GetSetDescriptorType, GetSetDescriptorType's are not documented yet
# GetSetDescriptorType, GetSetDescriptorType's are not documented yet
if type(descr) == MethodDescriptorType:
py_descr2sphinx(" ", fw, descr, "bpy.types", class_name, key)
for key, descr in descr_items:
@@ -1499,17 +1553,21 @@ def pyrna2sphinx(basepath):
# write fake classes
if _BPY_STRUCT_FAKE:
class_value = bpy.types.Struct.__bases__[0]
fake_bpy_type(class_value, _BPY_STRUCT_FAKE, "built-in base class for all classes in bpy.types.", use_subclasses=True)
fake_bpy_type(
class_value, _BPY_STRUCT_FAKE,
"built-in base class for all classes in bpy.types.", use_subclasses=True)
if _BPY_PROP_COLLECTION_FAKE:
class_value = bpy.data.objects.__class__
fake_bpy_type(class_value, _BPY_PROP_COLLECTION_FAKE, "built-in class used for all collections.", use_subclasses=False)
fake_bpy_type(
class_value, _BPY_PROP_COLLECTION_FAKE,
"built-in class used for all collections.", use_subclasses=False)
# operators
def write_ops():
API_BASEURL = "http://svn.blender.org/svnroot/bf-blender/trunk/blender/release/scripts"
API_BASEURL_ADDON = "http://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts"
API_BASEURL_ADDON_CONTRIB = "http://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts"
API_BASEURL = "https://developer.blender.org/diffusion/B/browse/master/release/scripts/ "
API_BASEURL_ADDON = "https://developer.blender.org/diffusion/BA/"
API_BASEURL_ADDON_CONTRIB = "https://developer.blender.org/diffusion/BAC/"
op_modules = {}
for op in ops.values():
@@ -1574,6 +1632,13 @@ def write_sphinx_conf_py(basepath):
file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("import sys, os\n")
fw("\n")
fw("extensions = ['sphinx.ext.intersphinx']\n")
fw("\n")
fw("intersphinx_mapping = {'blender_manual': ('https://www.blender.org/manual/', None)}\n")
fw("\n")
fw("project = 'Blender'\n")
# fw("master_doc = 'index'\n")
fw("copyright = u'Blender Foundation'\n")
@@ -1585,11 +1650,12 @@ def write_sphinx_conf_py(basepath):
if ARGS.sphinx_theme == "blender-org":
fw("html_theme_path = ['../']\n")
# copied with the theme, exclude else we get an error [#28873]
# copied with the theme, exclude else we get an error [T28873]
fw("html_favicon = 'favicon.ico'\n") # in <theme>/static/
# not helpful since the source is generated, adds to upload size.
fw("html_copy_source = False\n")
fw("html_split_index = True\n")
fw("\n")
# needed for latex, pdf gen
@@ -1615,11 +1681,13 @@ def write_rst_contents(basepath):
fw(title_string("Blender Documentation Contents", "%", double=True))
fw("\n")
fw("Welcome, this document is an API reference for Blender %s, built %s.\n" % (BLENDER_VERSION_DOTS, BLENDER_DATE))
fw("Welcome, this document is an API reference for Blender %s, built %s.\n" %
(BLENDER_VERSION_DOTS, BLENDER_DATE))
fw("\n")
# fw("`A PDF version of this document is also available <%s>`_\n" % BLENDER_PDF_FILENAME)
fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files) <%s>`_\n" % BLENDER_ZIP_FILENAME)
fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files) <%s>`_\n" %
BLENDER_ZIP_FILENAME)
fw("\n")
@@ -1652,7 +1720,7 @@ def write_rst_contents(basepath):
# C modules
"bpy.props",
)
)
for mod in app_modules:
if mod not in EXCLUDE_MODULES:
@@ -1673,9 +1741,10 @@ def write_rst_contents(basepath):
"freestyle", "bgl", "blf",
"gpu", "gpu.offscreen",
"aud", "bpy_extras",
"idprop.types",
# bmesh, submodules are in own page
"bmesh",
)
)
for mod in standalone_modules:
if mod not in EXCLUDE_MODULES:
@@ -1713,7 +1782,8 @@ def write_rst_contents(basepath):
fw(" * mesh creation and editing functions\n")
fw(" \n")
fw(" These parts of the API are relatively stable and are unlikely to change significantly\n")
fw(" * data API, access to attributes of blender data such as mesh verts, material color, timeline frames and scene objects\n")
fw(" * data API, access to attributes of Blender data such as mesh verts, material color,\n")
fw(" timeline frames and scene objects\n")
fw(" * user interface functions for defining buttons, creation of menus, headers, panels\n")
fw(" * render engine integration\n")
fw(" * modules: bgl, mathutils & game engine.\n")
@@ -1785,11 +1855,11 @@ def write_rst_data(basepath):
fw(title_string("Data Access (bpy.data)", "="))
fw(".. module:: bpy\n")
fw("\n")
fw("This module is used for all blender/python access.\n")
fw("This module is used for all Blender/Python access.\n")
fw("\n")
fw(".. data:: data\n")
fw("\n")
fw(" Access to blenders internal data\n")
fw(" Access to Blender's internal data\n")
fw("\n")
fw(" :type: :class:`bpy.types.BlendData`\n")
fw("\n")
@@ -1804,37 +1874,38 @@ def write_rst_importable_modules(basepath):
Write the rst files of importable modules
'''
importable_modules = {
# python_modules
"bpy.path" : "Path Utilities",
"bpy.utils" : "Utilities",
"bpy_extras" : "Extra Utilities",
# Python_modules
"bpy.path": "Path Utilities",
"bpy.utils": "Utilities",
"bpy_extras": "Extra Utilities",
# C_modules
"aud" : "Audio System",
"blf" : "Font Drawing",
"gpu.offscreen" : "GPU Off-Screen Buffer",
"bmesh" : "BMesh Module",
"bmesh.types" : "BMesh Types",
"bmesh.utils" : "BMesh Utilities",
"bmesh.geometry" : "BMesh Geometry Utilities",
"bpy.app" : "Application Data",
"bpy.app.handlers" : "Application Handlers",
"bpy.app.translations" : "Application Translations",
"bpy.props" : "Property Definitions",
"mathutils" : "Math Types & Utilities",
"mathutils.geometry" : "Geometry Utilities",
"mathutils.bvhtree" : "BVHTree Utilities",
"mathutils.kdtree" : "KDTree Utilities",
"aud": "Audio System",
"blf": "Font Drawing",
"gpu.offscreen": "GPU Off-Screen Buffer",
"bmesh": "BMesh Module",
"bmesh.types": "BMesh Types",
"bmesh.utils": "BMesh Utilities",
"bmesh.geometry": "BMesh Geometry Utilities",
"bpy.app": "Application Data",
"bpy.app.handlers": "Application Handlers",
"bpy.app.translations": "Application Translations",
"bpy.props": "Property Definitions",
"idprop.types": "ID Property Access",
"mathutils": "Math Types & Utilities",
"mathutils.geometry": "Geometry Utilities",
"mathutils.bvhtree": "BVHTree Utilities",
"mathutils.kdtree": "KDTree Utilities",
"mathutils.interpolate": "Interpolation Utilities",
"mathutils.noise" : "Noise Utilities",
"freestyle" : "Freestyle Module",
"freestyle.types" : "Freestyle Types",
"freestyle.predicates" : "Freestyle Predicates",
"freestyle.functions" : "Freestyle Functions",
"freestyle.chainingiterators" : "Freestyle Chaining Iterators",
"freestyle.shaders" : "Freestyle Shaders",
"freestyle.utils" : "Freestyle Utilities",
}
"mathutils.noise": "Noise Utilities",
"freestyle": "Freestyle Module",
"freestyle.types": "Freestyle Types",
"freestyle.predicates": "Freestyle Predicates",
"freestyle.functions": "Freestyle Functions",
"freestyle.chainingiterators": "Freestyle Chaining Iterators",
"freestyle.shaders": "Freestyle Shaders",
"freestyle.utils": "Freestyle Utilities",
}
for mod_name, mod_descr in importable_modules.items():
if mod_name not in EXCLUDE_MODULES:
module = __import__(mod_name,
@@ -1849,7 +1920,7 @@ def copy_handwritten_rsts(basepath):
for info, info_desc in INFO_DOCS:
shutil.copy2(os.path.join(RST_DIR, info), basepath)
# TODO put this docs in blender's code and use import as per modules above
# TODO put this docs in Blender's code and use import as per modules above
handwritten_modules = [
"bge.logic",
"bge.render",
@@ -1890,6 +1961,21 @@ def copy_handwritten_rsts(basepath):
shutil.copy2(os.path.join(RST_DIR, f), basepath)
def copy_handwritten_extra(basepath):
for f_src in EXTRA_SOURCE_FILES:
if os.sep != "/":
f_src = os.sep.join(f_src.split("/"))
f_dst = f_src.replace("..", "__")
f_src = os.path.join(RST_DIR, f_src)
f_dst = os.path.join(basepath, f_dst)
os.makedirs(os.path.dirname(f_dst), exist_ok=True)
shutil.copy2(f_src, f_dst)
def rna2sphinx(basepath):
try:
@@ -1921,35 +2007,48 @@ def rna2sphinx(basepath):
# copy the other rsts
copy_handwritten_rsts(basepath)
# copy source files referenced
copy_handwritten_extra(basepath)
def align_sphinx_in_to_sphinx_in_tmp():
def align_sphinx_in_to_sphinx_in_tmp(dir_src, dir_dst):
'''
Move changed files from SPHINX_IN_TMP to SPHINX_IN
'''
import filecmp
sphinx_in_files = set(os.listdir(SPHINX_IN))
sphinx_in_tmp_files = set(os.listdir(SPHINX_IN_TMP))
# possible the dir doesn't exist when running recursively
os.makedirs(dir_dst, exist_ok=True)
sphinx_dst_files = set(os.listdir(dir_dst))
sphinx_src_files = set(os.listdir(dir_src))
# remove deprecated files that have been removed
for f in sorted(sphinx_in_files):
if f not in sphinx_in_tmp_files:
for f in sorted(sphinx_dst_files):
if f not in sphinx_src_files:
BPY_LOGGER.debug("\tdeprecated: %s" % f)
os.remove(os.path.join(SPHINX_IN, f))
f_dst = os.path.join(dir_dst, f)
if os.path.isdir(f_dst):
shutil.rmtree(f_dst, True)
else:
os.remove(f_dst)
# freshen with new files.
for f in sorted(sphinx_in_tmp_files):
f_from = os.path.join(SPHINX_IN_TMP, f)
f_to = os.path.join(SPHINX_IN, f)
for f in sorted(sphinx_src_files):
f_src = os.path.join(dir_src, f)
f_dst = os.path.join(dir_dst, f)
do_copy = True
if f in sphinx_in_files:
if filecmp.cmp(f_from, f_to):
do_copy = False
if os.path.isdir(f_src):
align_sphinx_in_to_sphinx_in_tmp(f_src, f_dst)
else:
do_copy = True
if f in sphinx_dst_files:
if filecmp.cmp(f_src, f_dst):
do_copy = False
if do_copy:
BPY_LOGGER.debug("\tupdating: %s" % f)
shutil.copy(f_from, f_to)
if do_copy:
BPY_LOGGER.debug("\tupdating: %s" % f)
shutil.copy(f_src, f_dst)
def refactor_sphinx_log(sphinx_logfile):
@@ -2036,7 +2135,7 @@ def main():
shutil.rmtree(SPHINX_OUT_PDF, True)
else:
# move changed files in SPHINX_IN
align_sphinx_in_to_sphinx_in_tmp()
align_sphinx_in_to_sphinx_in_tmp(SPHINX_IN_TMP, SPHINX_IN)
# report which example files weren't used
EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED

View File

@@ -3,11 +3,6 @@
# bash doc/python_api/sphinx_doc_gen.sh
# ssh upload means you need an account on the server
if [ "$1" == "" ] ; then
echo "Expected a single argument for the username on blender.org, aborting"
exit 1
fi
# ----------------------------------------------------------------------------
# Upload vars
@@ -22,9 +17,15 @@ if [ -z $BLENDER_BIN ] ; then
BLENDER_BIN="./blender.bin"
fi
SSH_USER=$1
SSH_HOST=$SSH_USER"@blender.org"
SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION, added after
if [ "$1" == "" ] ; then
echo "Expected a single argument for the username on blender.org, skipping upload step!"
DO_UPLOAD=false
else
SSH_USER=$1
SSH_HOST=$SSH_USER"@blender.org"
SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION, added after
fi
# ----------------------------------------------------------------------------
# Blender Version & Info
@@ -33,10 +34,12 @@ SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION,
# "_".join(str(v) for v in bpy.app.version)
# custom blender vars
blender_srcdir=$(dirname -- $0)/../..
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_header="$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h"
blender_version=$(grep "BLENDER_VERSION\s" "$blender_version_header" | awk '{print $3}')
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_version_header" | awk '{print $3}')
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_version_header" | awk '{print $3}')
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_version_header" | awk '{print $3}')
unset blender_version_header
if [ "$blender_version_cycle" = "release" ] ; then
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
@@ -48,6 +51,8 @@ SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
SPHINXBASE=doc/python_api
SPHINX_WORKDIR="$(mktemp --directory --suffix=.sphinx)"
# ----------------------------------------------------------------------------
# Generate reStructuredText (blender/python only)
@@ -59,23 +64,25 @@ if $DO_EXE_BLENDER ; then
-noaudio \
--factory-startup \
--python-exit-code 1 \
--python $SPHINXBASE/sphinx_doc_gen.py
--python $SPHINXBASE/sphinx_doc_gen.py \
-- \
--output=$SPHINX_WORKDIR
if (($? == 1)) ; then
if (($? != 0)) ; then
echo "Generating documentation failed, aborting"
exit 1
fi
fi
# ----------------------------------------------------------------------------
# Generate HTML (sphinx)
if $DO_OUT_HTML ; then
# sphinx-build -n -b html $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
# sphinx-build -n -b html $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
# annoying bug in sphinx makes it very slow unless we do this. should report.
cd $SPHINXBASE
cd $SPHINX_WORKDIR
sphinx-build -b html sphinx-in sphinx-out
# XXX, saves space on upload and zip, should move HTML outside
@@ -103,20 +110,21 @@ fi
# Generate PDF (sphinx/laytex)
if $DO_OUT_PDF ; then
sphinx-build -n -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
make -C $SPHINXBASE/sphinx-out
mv $SPHINXBASE/sphinx-out/contents.pdf $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
cd $SPHINX_WORKDIR
sphinx-build -n -b latex $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
make -C $SPHINX_WORKDIR/sphinx-out
mv $SPHINX_WORKDIR/sphinx-out/contents.pdf \
$SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
fi
# ----------------------------------------------------------------------------
# Upload to blender servers, comment this section for testing
if $DO_UPLOAD ; then
cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
cp $SPHINX_WORKDIR/sphinx-out/contents.html $SPHINX_WORKDIR/sphinx-out/index.html
ssh $SSH_USER@blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
rsync --progress -ave "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
rsync --progress -ave "ssh -p 22" $SPHINX_WORKDIR/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
## symlink the dir to a static URL
#ssh $SSH_USER@blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
@@ -134,11 +142,15 @@ if $DO_UPLOAD ; then
if $DO_OUT_PDF ; then
# rename so local PDF has matching name.
rsync --progress -ave "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
rsync --progress -ave "ssh -p 22" \
$SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf \
$SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
fi
if $DO_OUT_HTML_ZIP ; then
rsync --progress -ave "ssh -p 22" $SPHINXBASE/blender_python_reference_$BLENDER_VERSION.zip $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip
rsync --progress -ave "ssh -p 22" \
$SPHINX_WORKDIR/blender_python_reference_$BLENDER_VERSION.zip \
$SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip
fi
fi
@@ -149,5 +161,5 @@ fi
echo ""
echo "Finished! view the docs from: "
if $DO_OUT_HTML ; then echo " html:" $SPHINXBASE/sphinx-out/contents.html ; fi
if $DO_OUT_PDF ; then echo " pdf:" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf ; fi
if $DO_OUT_HTML ; then echo " html:" $SPHINX_WORKDIR/sphinx-out/contents.html ; fi
if $DO_OUT_PDF ; then echo " pdf:" $SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf ; fi

View File

@@ -0,0 +1,186 @@
#!/usr/bin/env python3
# ##### 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.
#
# Contributor(s): Bastien Montagne
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
"""
This is a helper script to generate Blender Python API documentation (using Sphinx), and update server data using rsync.
You'll need to specify your user login and password, obviously.
Example usage:
./sphinx_doc_update.py --mirror ../../../docs/remote_api_backup/ --source ../.. --blender ../../../build_cmake/bin/blender --user foobar --password barfoo
"""
import os
import shutil
import subprocess
import sys
import tempfile
import zipfile
DEFAULT_RSYNC_SERVER = "www.blender.org"
DEFAULT_RSYNC_ROOT = "/api/"
DEFAULT_SYMLINK_ROOT = "/data/www/vhosts/www.blender.org/api"
def argparse_create():
import argparse
global __doc__
# When --help or no args are given, print this help
usage_text = __doc__
parser = argparse.ArgumentParser(description=usage_text,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument(
"--mirror", dest="mirror_dir",
metavar='PATH', required=True,
help="Path to local rsync mirror of api doc server")
parser.add_argument(
"--source", dest="source_dir",
metavar='PATH', required=True,
help="Path to Blender git repository")
parser.add_argument(
"--blender", dest="blender",
metavar='PATH', required=True,
help="Path to Blender executable")
parser.add_argument(
"--rsync-server", dest="rsync_server", default=DEFAULT_RSYNC_SERVER,
metavar='RSYNCSERVER', type=str, required=False,
help=("rsync server address"))
parser.add_argument(
"--rsync-root", dest="rsync_root", default=DEFAULT_RSYNC_ROOT,
metavar='RSYNCROOT', type=str, required=False,
help=("Root path of API doc on rsync server"))
parser.add_argument(
"--user", dest="user",
metavar='USER', type=str, required=True,
help=("User to login on rsync server"))
parser.add_argument(
"--password", dest="password",
metavar='PASSWORD', type=str, required=True,
help=("Password to login on rsync server"))
return parser
def main():
# ----------
# Parse Args
args = argparse_create().parse_args()
rsync_base = "rsync://%s@%s:%s" % (args.user, args.rsync_server, args.rsync_root)
# I) Update local mirror using rsync.
rsync_mirror_cmd = ("rsync", "--delete-after", "-avzz", rsync_base, args.mirror_dir)
subprocess.run(rsync_mirror_cmd, env=dict(os.environ, RSYNC_PASSWORD=args.password))
with tempfile.TemporaryDirectory() as tmp_dir:
# II) Generate doc source in temp dir.
doc_gen_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
"--python", "%s/doc/python_api/sphinx_doc_gen.py" % args.source_dir, "--",
"--output", tmp_dir)
subprocess.run(doc_gen_cmd)
# III) Get Blender version info.
blenver = blenver_zip = ""
getver_file = os.path.join(tmp_dir, "blendver.txt")
getver_script = (""
"import sys, bpy\n"
"with open(sys.argv[-1], 'w') as f:\n"
" f.write('%d_%d%s_release\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
" if bpy.app.version_cycle in {'rc', 'release'} else '%d_%d_%d\\n' % bpy.app.version)\n"
" f.write('%d_%d_%d' % bpy.app.version)\n")
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
"--python-expr", getver_script, "--", getver_file)
subprocess.run(get_ver_cmd)
with open(getver_file) as f:
blenver, blenver_zip = f.read().split("\n")
os.remove(getver_file)
# IV) Build doc.
curr_dir = os.getcwd()
os.chdir(tmp_dir)
sphinx_cmd = ("sphinx-build", "-b", "html", "sphinx-in", "sphinx-out")
subprocess.run(sphinx_cmd)
shutil.rmtree(os.path.join("sphinx-out", ".doctrees"))
os.chdir(curr_dir)
# V) Cleanup existing matching dir in server mirror (if any), and copy new doc.
api_name = "blender_python_api_%s" % blenver
api_dir = os.path.join(args.mirror_dir, api_name)
if os.path.exists(api_dir):
shutil.rmtree(api_dir)
os.rename(os.path.join(tmp_dir, "sphinx-out"), api_dir)
# VI) Create zip archive.
zip_name = "blender_python_reference_%s" % blenver_zip # We can't use 'release' postfix here...
zip_path = os.path.join(args.mirror_dir, zip_name)
with zipfile.ZipFile(zip_path, 'w') as zf:
for dirname, _, filenames in os.walk(api_dir):
for filename in filenames:
filepath = os.path.join(dirname, filename)
zip_filepath = os.path.join(zip_name, os.path.relpath(filepath, api_dir))
zf.write(filepath, arcname=zip_filepath)
os.rename(zip_path, os.path.join(api_dir, "%s.zip" % zip_name))
# VII) Create symlinks and html redirects.
#~ os.symlink(os.path.join(DEFAULT_SYMLINK_ROOT, api_name, "contents.html"), os.path.join(api_dir, "index.html"))
os.symlink("./contents.html", os.path.join(api_dir, "index.html"))
if blenver.endswith("release"):
symlink = os.path.join(args.mirror_dir, "blender_python_api_current")
os.remove(symlink)
os.symlink("./%s" % api_name, symlink)
with open(os.path.join(args.mirror_dir, "250PythonDoc/index.html"), 'w') as f:
f.write("<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\""
"content=\"0;url=../%s/\"></head><body>Redirecting...</body></html>" % api_name)
else:
symlink = os.path.join(args.mirror_dir, "blender_python_api_master")
os.remove(symlink)
os.symlink("./%s" % api_name, symlink)
with open(os.path.join(args.mirror_dir, "blender_python_api/index.html"), 'w') as f:
f.write("<html><head><title>Redirecting...</title><meta http-equiv=\"REFRESH\""
"content=\"0;url=../%s/\"></head><body>Redirecting...</body></html>" % api_name)
# VIII) Upload (first do a dry-run so user can ensure everything is OK).
print("Doc generated in local mirror %s, please check it before uploading "
"(hit [Enter] to continue, [Ctrl-C] to exit):" % api_dir)
sys.stdin.read(1)
rsync_mirror_cmd = ("rsync", "--dry-run", "--delete-after", "-avzz", args.mirror_dir, rsync_base)
subprocess.run(rsync_mirror_cmd, env=dict(os.environ, RSYNC_PASSWORD=args.password))
print("Rsync upload simulated, please check every thing is OK (hit [Enter] to continue, [Ctrl-C] to exit):")
sys.stdin.read(1)
rsync_mirror_cmd = ("rsync", "--delete-after", "-avzz", args.mirror_dir, rsync_base)
subprocess.run(rsync_mirror_cmd, env=dict(os.environ, RSYNC_PASSWORD=args.password))
if __name__ == "__main__":
main()

View File

@@ -29,6 +29,14 @@ add_subdirectory(curve_fit_nd)
# Otherwise we get warnings here that we cant fix in external projects
remove_strict_flags()
# Not a strict flag, but noisy for code we don't maintain
if(CMAKE_COMPILER_IS_GNUCC)
remove_cc_flag(
"-Wmisleading-indentation"
)
endif()
add_subdirectory(rangetree)
add_subdirectory(wcwidth)
@@ -97,6 +105,7 @@ endif()
if(WITH_GTESTS)
add_subdirectory(gtest)
add_subdirectory(gmock)
endif()
if(WITH_SDL AND WITH_SDL_DYNLOAD)

6
extern/Eigen3/README.blender vendored Normal file
View File

@@ -0,0 +1,6 @@
Project: Eigen, template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms
URL: http://eigen.tuxfamily.org/index.php?title=Main_Page
License: GPLv3+
Upstream version: 3.2.7
Local modifications:
- OpenMP fix for MSVC2015, see http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1131

6
extern/binreloc/README.blender vendored Normal file
View File

@@ -0,0 +1,6 @@
Project: AutoPackage
URL: http://autopackage.org/docs/binreloc (original, defunct)
http://alien.cern.ch/cache/autopackage-1.0/site/docs/binreloc/ (cache)
License: Public Domain
Upstream version: Unknown (Last Release)
Local modifications: None

View File

@@ -151,8 +151,8 @@ static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1
int index = 0;
btScalar minDot = BT_LARGE_FLOAT;
if( count2 > 0 )
index = (int) normal1.minDot( vertices2, count2, minDot);
if( count2 > 0 )
index = (int) normal1.minDot( vertices2, count2, minDot);
btVector3 v1 = b2Mul(xf1, vertices1[edge1]);
btVector3 v2 = b2Mul(xf2, vertices2[index]);
@@ -174,9 +174,9 @@ static btScalar FindMaxSeparation(int* edgeIndex,
// Find edge normal on poly1 that has the largest projection onto d.
int edge = 0;
btScalar maxDot;
if( count1 > 0 )
edge = (int) dLocal1.maxDot( normals1, count1, maxDot);
btScalar maxDot;
if( count1 > 0 )
edge = (int) dLocal1.maxDot( normals1, count1, maxDot);
// Get the separation for the edge normal.
btScalar s = EdgeSeparation(poly1, xf1, edge, poly2, xf2);

View File

@@ -232,8 +232,8 @@ void btCompoundCollisionAlgorithm::processCollision (const btCollisionObjectWrap
m_compoundShapeRevision = compoundShape->getUpdateRevision();
}
if (m_childCollisionAlgorithms.size()==0)
return;
if (m_childCollisionAlgorithms.size()==0)
return;
const btDbvt* tree = compoundShape->getDynamicAabbTree();
//use a dynamic aabb tree to cull potential child-overlaps

4
extern/carve/README.blender vendored Normal file
View File

@@ -0,0 +1,4 @@
Project: Carve, CSG library
URL: https://code.google.com/archive/p/carve/
Upstream version 9a85d733a43d
Local modifications: See patches/ folder

View File

@@ -73,10 +73,12 @@ set(SRC
internal/ceres/file.cc
internal/ceres/generated/partitioned_matrix_view_d_d_d.cc
internal/ceres/generated/schur_eliminator_d_d_d.cc
internal/ceres/gradient_checker.cc
internal/ceres/gradient_checking_cost_function.cc
internal/ceres/gradient_problem.cc
internal/ceres/gradient_problem_solver.cc
internal/ceres/implicit_schur_complement.cc
internal/ceres/is_close.cc
internal/ceres/iterative_schur_complement_solver.cc
internal/ceres/lapack.cc
internal/ceres/levenberg_marquardt_strategy.cc
@@ -116,6 +118,7 @@ set(SRC
internal/ceres/triplet_sparse_matrix.cc
internal/ceres/trust_region_minimizer.cc
internal/ceres/trust_region_preprocessor.cc
internal/ceres/trust_region_step_evaluator.cc
internal/ceres/trust_region_strategy.cc
internal/ceres/types.cc
internal/ceres/wall_time.cc
@@ -204,6 +207,7 @@ set(SRC
internal/ceres/householder_vector.h
internal/ceres/implicit_schur_complement.h
internal/ceres/integral_types.h
internal/ceres/is_close.h
internal/ceres/iterative_schur_complement_solver.h
internal/ceres/lapack.h
internal/ceres/levenberg_marquardt_strategy.h
@@ -248,6 +252,7 @@ set(SRC
internal/ceres/triplet_sparse_matrix.h
internal/ceres/trust_region_minimizer.h
internal/ceres/trust_region_preprocessor.h
internal/ceres/trust_region_step_evaluator.h
internal/ceres/trust_region_strategy.h
internal/ceres/visibility_based_preconditioner.h
internal/ceres/wall_time.h

1035
extern/ceres/ChangeLog vendored

File diff suppressed because it is too large Load Diff

4
extern/ceres/README.blender vendored Normal file
View File

@@ -0,0 +1,4 @@
Project: Ceres Solver
URL: http://ceres-solver.org/
Upstream version 1.11 (aef9c9563b08d5f39eee1576af133a84749d1b48)
Local modifications: None

View File

@@ -173,26 +173,5 @@ if(WITH_OPENMP)
)
endif()
TEST_UNORDERED_MAP_SUPPORT()
if(HAVE_STD_UNORDERED_MAP_HEADER)
if(HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
add_definitions(-DCERES_STD_UNORDERED_MAP)
else()
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
add_definitions(-DCERES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE)
else()
add_definitions(-DCERES_NO_UNORDERED_MAP)
message(STATUS "Replacing unordered_map/set with map/set (warning: slower!)")
endif()
endif()
else()
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
add_definitions(-DCERES_TR1_UNORDERED_MAP)
else()
add_definitions(-DCERES_NO_UNORDERED_MAP)
message(STATUS "Replacing unordered_map/set with map/set (warning: slower!)")
endif()
endif()
blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}")
EOF

View File

@@ -149,6 +149,7 @@ internal/ceres/generated/schur_eliminator_4_4_d.cc
internal/ceres/generated/schur_eliminator_d_d_d.cc
internal/ceres/generate_eliminator_specialization.py
internal/ceres/generate_partitioned_matrix_view_specializations.py
internal/ceres/gradient_checker.cc
internal/ceres/gradient_checking_cost_function.cc
internal/ceres/gradient_checking_cost_function.h
internal/ceres/gradient_problem.cc
@@ -160,6 +161,8 @@ internal/ceres/householder_vector.h
internal/ceres/implicit_schur_complement.cc
internal/ceres/implicit_schur_complement.h
internal/ceres/integral_types.h
internal/ceres/is_close.cc
internal/ceres/is_close.h
internal/ceres/iterative_schur_complement_solver.cc
internal/ceres/iterative_schur_complement_solver.h
internal/ceres/lapack.cc
@@ -243,6 +246,8 @@ internal/ceres/trust_region_minimizer.cc
internal/ceres/trust_region_minimizer.h
internal/ceres/trust_region_preprocessor.cc
internal/ceres/trust_region_preprocessor.h
internal/ceres/trust_region_step_evaluator.cc
internal/ceres/trust_region_step_evaluator.h
internal/ceres/trust_region_strategy.cc
internal/ceres/trust_region_strategy.h
internal/ceres/types.cc

View File

@@ -130,7 +130,8 @@ class CostFunctionToFunctor {
const int num_parameter_blocks =
(N0 > 0) + (N1 > 0) + (N2 > 0) + (N3 > 0) + (N4 > 0) +
(N5 > 0) + (N6 > 0) + (N7 > 0) + (N8 > 0) + (N9 > 0);
CHECK_EQ(parameter_block_sizes.size(), num_parameter_blocks);
CHECK_EQ(static_cast<int>(parameter_block_sizes.size()),
num_parameter_blocks);
CHECK_EQ(N0, parameter_block_sizes[0]);
if (parameter_block_sizes.size() > 1) CHECK_EQ(N1, parameter_block_sizes[1]); // NOLINT

View File

@@ -357,6 +357,28 @@ class CERES_EXPORT Covariance {
const double*> >& covariance_blocks,
Problem* problem);
// Compute a part of the covariance matrix.
//
// The vector parameter_blocks contains the parameter blocks that
// are used for computing the covariance matrix. From this vector
// all covariance pairs are generated. This allows the covariance
// estimation algorithm to only compute and store these blocks.
//
// parameter_blocks cannot contain duplicates. Bad things will
// happen if they do.
//
// Note that the list of covariance_blocks is only used to determine
// what parts of the covariance matrix are computed. The full
// Jacobian is used to do the computation, i.e. they do not have an
// impact on what part of the Jacobian is used for computation.
//
// The return value indicates the success or failure of the
// covariance computation. Please see the documentation for
// Covariance::Options for more on the conditions under which this
// function returns false.
bool Compute(const std::vector<const double*>& parameter_blocks,
Problem* problem);
// Return the block of the cross-covariance matrix corresponding to
// parameter_block1 and parameter_block2.
//
@@ -394,6 +416,40 @@ class CERES_EXPORT Covariance {
const double* parameter_block2,
double* covariance_block) const;
// Return the covariance matrix corresponding to all parameter_blocks.
//
// Compute must be called before calling GetCovarianceMatrix and all
// parameter_blocks must have been present in the vector
// parameter_blocks when Compute was called. Otherwise
// GetCovarianceMatrix returns false.
//
// covariance_matrix must point to a memory location that can store
// the size of the covariance matrix. The covariance matrix will be
// a square matrix whose row and column count is equal to the sum of
// the sizes of the individual parameter blocks. The covariance
// matrix will be a row-major matrix.
bool GetCovarianceMatrix(const std::vector<const double *> &parameter_blocks,
double *covariance_matrix);
// Return the covariance matrix corresponding to parameter_blocks
// in the tangent space if a local parameterization is associated
// with one of the parameter blocks else returns the covariance
// matrix in the ambient space.
//
// Compute must be called before calling GetCovarianceMatrix and all
// parameter_blocks must have been present in the vector
// parameters_blocks when Compute was called. Otherwise
// GetCovarianceMatrix returns false.
//
// covariance_matrix must point to a memory location that can store
// the size of the covariance matrix. The covariance matrix will be
// a square matrix whose row and column count is equal to the sum of
// the sizes of the tangent spaces of the individual parameter
// blocks. The covariance matrix will be a row-major matrix.
bool GetCovarianceMatrixInTangentSpace(
const std::vector<const double*>& parameter_blocks,
double* covariance_matrix);
private:
internal::scoped_ptr<internal::CovarianceImpl> impl_;
};

View File

@@ -85,22 +85,6 @@ class DynamicNumericDiffCostFunction : public CostFunction {
options_(options) {
}
// Deprecated. New users should avoid using this constructor. Instead, use the
// constructor with NumericDiffOptions.
DynamicNumericDiffCostFunction(
const CostFunctor* functor,
Ownership ownership,
double relative_step_size)
: functor_(functor),
ownership_(ownership),
options_() {
LOG(WARNING) << "This constructor is deprecated and will be removed in "
"a future version. Please use the NumericDiffOptions "
"constructor instead.";
options_.relative_step_size = relative_step_size;
}
virtual ~DynamicNumericDiffCostFunction() {
if (ownership_ != TAKE_OWNERSHIP) {
functor_.release();
@@ -138,19 +122,19 @@ class DynamicNumericDiffCostFunction : public CostFunction {
std::vector<double> parameters_copy(parameters_size);
std::vector<double*> parameters_references_copy(block_sizes.size());
parameters_references_copy[0] = &parameters_copy[0];
for (int block = 1; block < block_sizes.size(); ++block) {
for (size_t block = 1; block < block_sizes.size(); ++block) {
parameters_references_copy[block] = parameters_references_copy[block - 1]
+ block_sizes[block - 1];
}
// Copy the parameters into the local temp space.
for (int block = 0; block < block_sizes.size(); ++block) {
for (size_t block = 0; block < block_sizes.size(); ++block) {
memcpy(parameters_references_copy[block],
parameters[block],
block_sizes[block] * sizeof(*parameters[block]));
}
for (int block = 0; block < block_sizes.size(); ++block) {
for (size_t block = 0; block < block_sizes.size(); ++block) {
if (jacobians[block] != NULL &&
!NumericDiff<CostFunctor, method, DYNAMIC,
DYNAMIC, DYNAMIC, DYNAMIC, DYNAMIC, DYNAMIC,

View File

@@ -27,194 +27,121 @@
// POSSIBILITY OF SUCH DAMAGE.
// Copyright 2007 Google Inc. All Rights Reserved.
//
// Author: wjr@google.com (William Rucklidge)
//
// This file contains a class that exercises a cost function, to make sure
// that it is computing reasonable derivatives. It compares the Jacobians
// computed by the cost function with those obtained by finite
// differences.
// Authors: wjr@google.com (William Rucklidge),
// keir@google.com (Keir Mierle),
// dgossow@google.com (David Gossow)
#ifndef CERES_PUBLIC_GRADIENT_CHECKER_H_
#define CERES_PUBLIC_GRADIENT_CHECKER_H_
#include <cstddef>
#include <algorithm>
#include <vector>
#include <string>
#include "ceres/cost_function.h"
#include "ceres/dynamic_numeric_diff_cost_function.h"
#include "ceres/internal/eigen.h"
#include "ceres/internal/fixed_array.h"
#include "ceres/internal/macros.h"
#include "ceres/internal/scoped_ptr.h"
#include "ceres/numeric_diff_cost_function.h"
#include "ceres/local_parameterization.h"
#include "glog/logging.h"
namespace ceres {
// An object that exercises a cost function, to compare the answers that it
// gives with derivatives estimated using finite differencing.
// GradientChecker compares the Jacobians returned by a cost function against
// derivatives estimated using finite differencing.
//
// The only likely usage of this is for testing.
// The condition enforced is that
//
// (J_actual(i, j) - J_numeric(i, j))
// ------------------------------------ < relative_precision
// max(J_actual(i, j), J_numeric(i, j))
//
// where J_actual(i, j) is the jacobian as computed by the supplied cost
// function (by the user) multiplied by the local parameterization Jacobian
// and J_numeric is the jacobian as computed by finite differences, multiplied
// by the local parameterization Jacobian as well.
//
// How to use: Fill in an array of pointers to parameter blocks for your
// CostFunction, and then call Probe(). Check that the return value is
// 'true'. See prober_test.cc for an example.
//
// This is templated similarly to NumericDiffCostFunction, as it internally
// uses that.
template <typename CostFunctionToProbe,
int M = 0, int N0 = 0, int N1 = 0, int N2 = 0, int N3 = 0, int N4 = 0>
// CostFunction, and then call Probe(). Check that the return value is 'true'.
class GradientChecker {
public:
// Here we stash some results from the probe, for later
// inspection.
struct GradientCheckResults {
// Computed cost.
Vector cost;
// This will not take ownership of the cost function or local
// parameterizations.
//
// function: The cost function to probe.
// local_parameterization: A vector of local parameterizations for each
// parameter. May be NULL or contain NULL pointers to indicate that the
// respective parameter does not have a local parameterization.
// options: Options to use for numerical differentiation.
GradientChecker(
const CostFunction* function,
const std::vector<const LocalParameterization*>* local_parameterizations,
const NumericDiffOptions& options);
// The sizes of these matrices are dictated by the cost function's
// parameter and residual block sizes. Each vector's length will
// term->parameter_block_sizes().size(), and each matrix is the
// Jacobian of the residual with respect to the corresponding parameter
// block.
// Contains results from a call to Probe for later inspection.
struct ProbeResults {
// The return value of the cost function.
bool return_value;
// Computed residual vector.
Vector residuals;
// The sizes of the Jacobians below are dictated by the cost function's
// parameter block size and residual block sizes. If a parameter block
// has a local parameterization associated with it, the size of the "local"
// Jacobian will be determined by the local parameterization dimension and
// residual block size, otherwise it will be identical to the regular
// Jacobian.
// Derivatives as computed by the cost function.
std::vector<Matrix> term_jacobians;
std::vector<Matrix> jacobians;
// Derivatives as computed by finite differencing.
std::vector<Matrix> finite_difference_jacobians;
// Derivatives as computed by the cost function in local space.
std::vector<Matrix> local_jacobians;
// Infinity-norm of term_jacobians - finite_difference_jacobians.
double error_jacobians;
// Derivatives as computed by nuerical differentiation in local space.
std::vector<Matrix> numeric_jacobians;
// Derivatives as computed by nuerical differentiation in local space.
std::vector<Matrix> local_numeric_jacobians;
// Contains the maximum relative error found in the local Jacobians.
double maximum_relative_error;
// If an error was detected, this will contain a detailed description of
// that error.
std::string error_log;
};
// Checks the Jacobian computed by a cost function.
// Call the cost function, compute alternative Jacobians using finite
// differencing and compare results. If local parameterizations are given,
// the Jacobians will be multiplied by the local parameterization Jacobians
// before performing the check, which effectively means that all errors along
// the null space of the local parameterization will be ignored.
// Returns false if the Jacobians don't match, the cost function return false,
// or if the cost function returns different residual when called with a
// Jacobian output argument vs. calling it without. Otherwise returns true.
//
// probe_point: The parameter values at which to probe.
// error_tolerance: A threshold for the infinity-norm difference
// between the Jacobians. If the Jacobians differ by more than
// this amount, then the probe fails.
//
// term: The cost function to test. Not retained after this call returns.
//
// results: On return, the two Jacobians (and other information)
// will be stored here. May be NULL.
// parameters: The parameter values at which to probe.
// relative_precision: A threshold for the relative difference between the
// Jacobians. If the Jacobians differ by more than this amount, then the
// probe fails.
// results: On return, the Jacobians (and other information) will be stored
// here. May be NULL.
//
// Returns true if no problems are detected and the difference between the
// Jacobians is less than error_tolerance.
static bool Probe(double const* const* probe_point,
double error_tolerance,
CostFunctionToProbe *term,
GradientCheckResults* results) {
CHECK_NOTNULL(probe_point);
CHECK_NOTNULL(term);
LOG(INFO) << "-------------------- Starting Probe() --------------------";
// We need a GradientCheckeresults, whether or not they supplied one.
internal::scoped_ptr<GradientCheckResults> owned_results;
if (results == NULL) {
owned_results.reset(new GradientCheckResults);
results = owned_results.get();
}
// Do a consistency check between the term and the template parameters.
CHECK_EQ(M, term->num_residuals());
const int num_residuals = M;
const std::vector<int32>& block_sizes = term->parameter_block_sizes();
const int num_blocks = block_sizes.size();
CHECK_LE(num_blocks, 5) << "Unable to test functions that take more "
<< "than 5 parameter blocks";
if (N0) {
CHECK_EQ(N0, block_sizes[0]);
CHECK_GE(num_blocks, 1);
} else {
CHECK_LT(num_blocks, 1);
}
if (N1) {
CHECK_EQ(N1, block_sizes[1]);
CHECK_GE(num_blocks, 2);
} else {
CHECK_LT(num_blocks, 2);
}
if (N2) {
CHECK_EQ(N2, block_sizes[2]);
CHECK_GE(num_blocks, 3);
} else {
CHECK_LT(num_blocks, 3);
}
if (N3) {
CHECK_EQ(N3, block_sizes[3]);
CHECK_GE(num_blocks, 4);
} else {
CHECK_LT(num_blocks, 4);
}
if (N4) {
CHECK_EQ(N4, block_sizes[4]);
CHECK_GE(num_blocks, 5);
} else {
CHECK_LT(num_blocks, 5);
}
results->term_jacobians.clear();
results->term_jacobians.resize(num_blocks);
results->finite_difference_jacobians.clear();
results->finite_difference_jacobians.resize(num_blocks);
internal::FixedArray<double*> term_jacobian_pointers(num_blocks);
internal::FixedArray<double*>
finite_difference_jacobian_pointers(num_blocks);
for (int i = 0; i < num_blocks; i++) {
results->term_jacobians[i].resize(num_residuals, block_sizes[i]);
term_jacobian_pointers[i] = results->term_jacobians[i].data();
results->finite_difference_jacobians[i].resize(
num_residuals, block_sizes[i]);
finite_difference_jacobian_pointers[i] =
results->finite_difference_jacobians[i].data();
}
results->cost.resize(num_residuals, 1);
CHECK(term->Evaluate(probe_point, results->cost.data(),
term_jacobian_pointers.get()));
NumericDiffCostFunction<CostFunctionToProbe, CENTRAL, M, N0, N1, N2, N3, N4>
numeric_term(term, DO_NOT_TAKE_OWNERSHIP);
CHECK(numeric_term.Evaluate(probe_point, results->cost.data(),
finite_difference_jacobian_pointers.get()));
results->error_jacobians = 0;
for (int i = 0; i < num_blocks; i++) {
Matrix jacobian_difference = results->term_jacobians[i] -
results->finite_difference_jacobians[i];
results->error_jacobians =
std::max(results->error_jacobians,
jacobian_difference.lpNorm<Eigen::Infinity>());
}
LOG(INFO) << "========== term-computed derivatives ==========";
for (int i = 0; i < num_blocks; i++) {
LOG(INFO) << "term_computed block " << i;
LOG(INFO) << "\n" << results->term_jacobians[i];
}
LOG(INFO) << "========== finite-difference derivatives ==========";
for (int i = 0; i < num_blocks; i++) {
LOG(INFO) << "finite_difference block " << i;
LOG(INFO) << "\n" << results->finite_difference_jacobians[i];
}
LOG(INFO) << "========== difference ==========";
for (int i = 0; i < num_blocks; i++) {
LOG(INFO) << "difference block " << i;
LOG(INFO) << (results->term_jacobians[i] -
results->finite_difference_jacobians[i]);
}
LOG(INFO) << "||difference|| = " << results->error_jacobians;
return results->error_jacobians < error_tolerance;
}
bool Probe(double const* const* parameters,
double relative_precision,
ProbeResults* results) const;
private:
CERES_DISALLOW_IMPLICIT_CONSTRUCTORS(GradientChecker);
std::vector<const LocalParameterization*> local_parameterizations_;
const CostFunction* function_;
internal::scoped_ptr<CostFunction> finite_diff_cost_function_;
};
} // namespace ceres

View File

@@ -33,9 +33,8 @@
// This file needs to compile as c code.
#ifdef __cplusplus
#include <cstddef>
#include "ceres/internal/config.h"
#if defined(CERES_TR1_MEMORY_HEADER)
#include <tr1/memory>
#else
@@ -50,6 +49,25 @@ using std::tr1::shared_ptr;
using std::shared_ptr;
#endif
// We allocate some Eigen objects on the stack and other places they
// might not be aligned to 16-byte boundaries. If we have C++11, we
// can specify their alignment anyway, and thus can safely enable
// vectorization on those matrices; in C++99, we are out of luck. Figure out
// what case we're in and write macros that do the right thing.
#ifdef CERES_USE_CXX11
namespace port_constants {
static constexpr size_t kMaxAlignBytes =
// Work around a GCC 4.8 bug
// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56019) where
// std::max_align_t is misplaced.
#if defined (__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 8
alignof(::max_align_t);
#else
alignof(std::max_align_t);
#endif
} // namespace port_constants
#endif
} // namespace ceres
#endif // __cplusplus

View File

@@ -69,7 +69,7 @@ struct CERES_EXPORT IterationSummary {
// Step was numerically valid, i.e., all values are finite and the
// step reduces the value of the linearized model.
//
// Note: step_is_valid is false when iteration = 0.
// Note: step_is_valid is always true when iteration = 0.
bool step_is_valid;
// Step did not reduce the value of the objective function
@@ -77,7 +77,7 @@ struct CERES_EXPORT IterationSummary {
// acceptance criterion used by the non-monotonic trust region
// algorithm.
//
// Note: step_is_nonmonotonic is false when iteration = 0;
// Note: step_is_nonmonotonic is always false when iteration = 0;
bool step_is_nonmonotonic;
// Whether or not the minimizer accepted this step or not. If the
@@ -89,7 +89,7 @@ struct CERES_EXPORT IterationSummary {
// relative decrease is not sufficient, the algorithm may accept the
// step and the step is declared successful.
//
// Note: step_is_successful is false when iteration = 0.
// Note: step_is_successful is always true when iteration = 0.
bool step_is_successful;
// Value of the objective function.

View File

@@ -164,6 +164,7 @@
#include "Eigen/Core"
#include "ceres/fpclassify.h"
#include "ceres/internal/port.h"
namespace ceres {
@@ -227,21 +228,23 @@ struct Jet {
T a;
// The infinitesimal part.
//
// Note the Eigen::DontAlign bit is needed here because this object
// gets allocated on the stack and as part of other arrays and
// structs. Forcing the right alignment there is the source of much
// pain and suffering. Even if that works, passing Jets around to
// functions by value has problems because the C++ ABI does not
// guarantee alignment for function arguments.
//
// Setting the DontAlign bit prevents Eigen from using SSE for the
// various operations on Jets. This is a small performance penalty
// since the AutoDiff code will still expose much of the code as
// statically sized loops to the compiler. But given the subtle
// issues that arise due to alignment, especially when dealing with
// multiple platforms, it seems to be a trade off worth making.
// We allocate Jets on the stack and other places they
// might not be aligned to 16-byte boundaries. If we have C++11, we
// can specify their alignment anyway, and thus can safely enable
// vectorization on those matrices; in C++99, we are out of luck. Figure out
// what case we're in and do the right thing.
#ifndef CERES_USE_CXX11
// fall back to safe version:
Eigen::Matrix<T, N, 1, Eigen::DontAlign> v;
#else
static constexpr bool kShouldAlignMatrix =
16 <= ::ceres::port_constants::kMaxAlignBytes;
static constexpr int kAlignHint = kShouldAlignMatrix ?
Eigen::AutoAlign : Eigen::DontAlign;
static constexpr size_t kAlignment = kShouldAlignMatrix ? 16 : 1;
alignas(kAlignment) Eigen::Matrix<T, N, 1, kAlignHint> v;
#endif
};
// Unary +
@@ -388,6 +391,8 @@ inline double atan (double x) { return std::atan(x); }
inline double sinh (double x) { return std::sinh(x); }
inline double cosh (double x) { return std::cosh(x); }
inline double tanh (double x) { return std::tanh(x); }
inline double floor (double x) { return std::floor(x); }
inline double ceil (double x) { return std::ceil(x); }
inline double pow (double x, double y) { return std::pow(x, y); }
inline double atan2(double y, double x) { return std::atan2(y, x); }
@@ -482,10 +487,51 @@ Jet<T, N> tanh(const Jet<T, N>& f) {
return Jet<T, N>(tanh_a, tmp * f.v);
}
// The floor function should be used with extreme care as this operation will
// result in a zero derivative which provides no information to the solver.
//
// floor(a + h) ~= floor(a) + 0
template <typename T, int N> inline
Jet<T, N> floor(const Jet<T, N>& f) {
return Jet<T, N>(floor(f.a));
}
// The ceil function should be used with extreme care as this operation will
// result in a zero derivative which provides no information to the solver.
//
// ceil(a + h) ~= ceil(a) + 0
template <typename T, int N> inline
Jet<T, N> ceil(const Jet<T, N>& f) {
return Jet<T, N>(ceil(f.a));
}
// Bessel functions of the first kind with integer order equal to 0, 1, n.
inline double BesselJ0(double x) { return j0(x); }
inline double BesselJ1(double x) { return j1(x); }
inline double BesselJn(int n, double x) { return jn(n, x); }
//
// Microsoft has deprecated the j[0,1,n]() POSIX Bessel functions in favour of
// _j[0,1,n](). Where available on MSVC, use _j[0,1,n]() to avoid deprecated
// function errors in client code (the specific warning is suppressed when
// Ceres itself is built).
inline double BesselJ0(double x) {
#if defined(_MSC_VER) && defined(_j0)
return _j0(x);
#else
return j0(x);
#endif
}
inline double BesselJ1(double x) {
#if defined(_MSC_VER) && defined(_j1)
return _j1(x);
#else
return j1(x);
#endif
}
inline double BesselJn(int n, double x) {
#if defined(_MSC_VER) && defined(_jn)
return _jn(n, x);
#else
return jn(n, x);
#endif
}
// For the formulae of the derivatives of the Bessel functions see the book:
// Olver, Lozier, Boisvert, Clark, NIST Handbook of Mathematical Functions,
@@ -743,7 +789,15 @@ template<typename T, int N> inline Jet<T, N> ei_pow (const Jet<T, N>& x,
// strange compile errors.
template <typename T, int N>
inline std::ostream &operator<<(std::ostream &s, const Jet<T, N>& z) {
return s << "[" << z.a << " ; " << z.v.transpose() << "]";
s << "[" << z.a << " ; ";
for (int i = 0; i < N; ++i) {
s << z.v[i];
if (i != N - 1) {
s << ", ";
}
}
s << "]";
return s;
}
} // namespace ceres
@@ -757,6 +811,7 @@ struct NumTraits<ceres::Jet<T, N> > {
typedef ceres::Jet<T, N> Real;
typedef ceres::Jet<T, N> NonInteger;
typedef ceres::Jet<T, N> Nested;
typedef ceres::Jet<T, N> Literal;
static typename ceres::Jet<T, N> dummy_precision() {
return ceres::Jet<T, N>(1e-12);
@@ -777,6 +832,21 @@ struct NumTraits<ceres::Jet<T, N> > {
HasFloatingPoint = 1,
RequireInitialization = 1
};
template<bool Vectorized>
struct Div {
enum {
#if defined(EIGEN_VECTORIZE_AVX)
AVX = true,
#else
AVX = false,
#endif
// Assuming that for Jets, division is as expensive as
// multiplication.
Cost = 3
};
};
};
} // namespace Eigen

View File

@@ -211,6 +211,28 @@ class CERES_EXPORT QuaternionParameterization : public LocalParameterization {
virtual int LocalSize() const { return 3; }
};
// Implements the quaternion local parameterization for Eigen's representation
// of the quaternion. Eigen uses a different internal memory layout for the
// elements of the quaternion than what is commonly used. Specifically, Eigen
// stores the elements in memory as [x, y, z, w] where the real part is last
// whereas it is typically stored first. Note, when creating an Eigen quaternion
// through the constructor the elements are accepted in w, x, y, z order. Since
// Ceres operates on parameter blocks which are raw double pointers this
// difference is important and requires a different parameterization.
//
// Plus(x, delta) = [sin(|delta|) delta / |delta|, cos(|delta|)] * x
// with * being the quaternion multiplication operator.
class EigenQuaternionParameterization : public ceres::LocalParameterization {
public:
virtual ~EigenQuaternionParameterization() {}
virtual bool Plus(const double* x,
const double* delta,
double* x_plus_delta) const;
virtual bool ComputeJacobian(const double* x,
double* jacobian) const;
virtual int GlobalSize() const { return 4; }
virtual int LocalSize() const { return 3; }
};
// This provides a parameterization for homogeneous vectors which are commonly
// used in Structure for Motion problems. One example where they are used is

View File

@@ -206,29 +206,6 @@ class NumericDiffCostFunction
}
}
// Deprecated. New users should avoid using this constructor. Instead, use the
// constructor with NumericDiffOptions.
NumericDiffCostFunction(CostFunctor* functor,
Ownership ownership,
int num_residuals,
const double relative_step_size)
:functor_(functor),
ownership_(ownership),
options_() {
LOG(WARNING) << "This constructor is deprecated and will be removed in "
"a future version. Please use the NumericDiffOptions "
"constructor instead.";
if (kNumResiduals == DYNAMIC) {
SizedCostFunction<kNumResiduals,
N0, N1, N2, N3, N4,
N5, N6, N7, N8, N9>
::set_num_residuals(num_residuals);
}
options_.relative_step_size = relative_step_size;
}
~NumericDiffCostFunction() {
if (ownership_ != TAKE_OWNERSHIP) {
functor_.release();

View File

@@ -309,6 +309,9 @@ class CERES_EXPORT Problem {
// Allow the indicated parameter block to vary during optimization.
void SetParameterBlockVariable(double* values);
// Returns true if a parameter block is set constant, and false otherwise.
bool IsParameterBlockConstant(double* values) const;
// Set the local parameterization for one of the parameter blocks.
// The local_parameterization is owned by the Problem by default. It
// is acceptable to set the same parameterization for multiple
@@ -461,6 +464,10 @@ class CERES_EXPORT Problem {
// parameter block has a local parameterization, then it contributes
// "LocalSize" entries to the gradient vector (and the number of
// columns in the jacobian).
//
// Note 3: This function cannot be called while the problem is being
// solved, for example it cannot be called from an IterationCallback
// at the end of an iteration during a solve.
bool Evaluate(const EvaluateOptions& options,
double* cost,
std::vector<double>* residuals,

View File

@@ -48,7 +48,6 @@
#include <algorithm>
#include <cmath>
#include <limits>
#include "glog/logging.h"
namespace ceres {
@@ -418,7 +417,6 @@ template <typename T>
inline void EulerAnglesToRotationMatrix(const T* euler,
const int row_stride_parameter,
T* R) {
CHECK_EQ(row_stride_parameter, 3);
EulerAnglesToRotationMatrix(euler, RowMajorAdapter3x3(R));
}
@@ -496,7 +494,6 @@ void QuaternionToRotation(const T q[4],
QuaternionToScaledRotation(q, R);
T normalizer = q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3];
CHECK_NE(normalizer, T(0));
normalizer = T(1) / normalizer;
for (int i = 0; i < 3; ++i) {

View File

@@ -134,7 +134,7 @@ class CERES_EXPORT Solver {
trust_region_problem_dump_format_type = TEXTFILE;
check_gradients = false;
gradient_check_relative_precision = 1e-8;
numeric_derivative_relative_step_size = 1e-6;
gradient_check_numeric_derivative_relative_step_size = 1e-6;
update_state_every_iteration = false;
}
@@ -701,12 +701,22 @@ class CERES_EXPORT Solver {
// this number, then the jacobian for that cost term is dumped.
double gradient_check_relative_precision;
// Relative shift used for taking numeric derivatives. For finite
// differencing, each dimension is evaluated at slightly shifted
// values; for the case of central difference, this is what gets
// evaluated:
// WARNING: This option only applies to the to the numeric
// differentiation used for checking the user provided derivatives
// when when Solver::Options::check_gradients is true. If you are
// using NumericDiffCostFunction and are interested in changing
// the step size for numeric differentiation in your cost
// function, please have a look at
// include/ceres/numeric_diff_options.h.
//
// delta = numeric_derivative_relative_step_size;
// Relative shift used for taking numeric derivatives when
// Solver::Options::check_gradients is true.
//
// For finite differencing, each dimension is evaluated at
// slightly shifted values; for the case of central difference,
// this is what gets evaluated:
//
// delta = gradient_check_numeric_derivative_relative_step_size;
// f_initial = f(x)
// f_forward = f((1 + delta) * x)
// f_backward = f((1 - delta) * x)
@@ -723,7 +733,7 @@ class CERES_EXPORT Solver {
// theory a good choice is sqrt(eps) * x, which for doubles means
// about 1e-8 * x. However, I have found this number too
// optimistic. This number should be exposed for users to change.
double numeric_derivative_relative_step_size;
double gradient_check_numeric_derivative_relative_step_size;
// If true, the user's parameter blocks are updated at the end of
// every Minimizer iteration, otherwise they are updated when the
@@ -801,6 +811,13 @@ class CERES_EXPORT Solver {
// Number of times inner iterations were performed.
int num_inner_iteration_steps;
// Total number of iterations inside the line search algorithm
// across all invocations. We call these iterations "steps" to
// distinguish them from the outer iterations of the line search
// and trust region minimizer algorithms which call the line
// search algorithm as a subroutine.
int num_line_search_steps;
// All times reported below are wall times.
// When the user calls Solve, before the actual optimization

View File

@@ -32,7 +32,7 @@
#define CERES_PUBLIC_VERSION_H_
#define CERES_VERSION_MAJOR 1
#define CERES_VERSION_MINOR 11
#define CERES_VERSION_MINOR 12
#define CERES_VERSION_REVISION 0
// Classic CPP stringifcation; the extra level of indirection allows the

View File

@@ -46,6 +46,7 @@ namespace internal {
using std::make_pair;
using std::pair;
using std::vector;
using std::adjacent_find;
void CompressedRowJacobianWriter::PopulateJacobianRowAndColumnBlockVectors(
const Program* program, CompressedRowSparseMatrix* jacobian) {
@@ -140,12 +141,21 @@ SparseMatrix* CompressedRowJacobianWriter::CreateJacobian() const {
// Sort the parameters by their position in the state vector.
sort(parameter_indices.begin(), parameter_indices.end());
CHECK(unique(parameter_indices.begin(), parameter_indices.end()) ==
parameter_indices.end())
<< "Ceres internal error: "
<< "Duplicate parameter blocks detected in a cost function. "
<< "This should never happen. Please report this to "
<< "the Ceres developers.";
if (adjacent_find(parameter_indices.begin(), parameter_indices.end()) !=
parameter_indices.end()) {
std::string parameter_block_description;
for (int j = 0; j < num_parameter_blocks; ++j) {
ParameterBlock* parameter_block = residual_block->parameter_blocks()[j];
parameter_block_description +=
parameter_block->ToString() + "\n";
}
LOG(FATAL) << "Ceres internal error: "
<< "Duplicate parameter blocks detected in a cost function. "
<< "This should never happen. Please report this to "
<< "the Ceres developers.\n"
<< "Residual Block: " << residual_block->ToString() << "\n"
<< "Parameter Blocks: " << parameter_block_description;
}
// Update the row indices.
const int num_residuals = residual_block->NumResiduals();

View File

@@ -38,6 +38,7 @@
namespace ceres {
using std::make_pair;
using std::pair;
using std::vector;
@@ -54,6 +55,12 @@ bool Covariance::Compute(
return impl_->Compute(covariance_blocks, problem->problem_impl_.get());
}
bool Covariance::Compute(
const vector<const double*>& parameter_blocks,
Problem* problem) {
return impl_->Compute(parameter_blocks, problem->problem_impl_.get());
}
bool Covariance::GetCovarianceBlock(const double* parameter_block1,
const double* parameter_block2,
double* covariance_block) const {
@@ -73,4 +80,20 @@ bool Covariance::GetCovarianceBlockInTangentSpace(
covariance_block);
}
bool Covariance::GetCovarianceMatrix(
const vector<const double*>& parameter_blocks,
double* covariance_matrix) {
return impl_->GetCovarianceMatrixInTangentOrAmbientSpace(parameter_blocks,
true, // ambient
covariance_matrix);
}
bool Covariance::GetCovarianceMatrixInTangentSpace(
const std::vector<const double *>& parameter_blocks,
double *covariance_matrix) {
return impl_->GetCovarianceMatrixInTangentOrAmbientSpace(parameter_blocks,
false, // tangent
covariance_matrix);
}
} // namespace ceres

View File

@@ -36,6 +36,8 @@
#include <algorithm>
#include <cstdlib>
#include <numeric>
#include <sstream>
#include <utility>
#include <vector>
@@ -43,6 +45,7 @@
#include "Eigen/SparseQR"
#include "Eigen/SVD"
#include "ceres/collections_port.h"
#include "ceres/compressed_col_sparse_matrix_utils.h"
#include "ceres/compressed_row_sparse_matrix.h"
#include "ceres/covariance.h"
@@ -51,6 +54,7 @@
#include "ceres/map_util.h"
#include "ceres/parameter_block.h"
#include "ceres/problem_impl.h"
#include "ceres/residual_block.h"
#include "ceres/suitesparse.h"
#include "ceres/wall_time.h"
#include "glog/logging.h"
@@ -61,6 +65,7 @@ namespace internal {
using std::make_pair;
using std::map;
using std::pair;
using std::sort;
using std::swap;
using std::vector;
@@ -86,8 +91,38 @@ CovarianceImpl::CovarianceImpl(const Covariance::Options& options)
CovarianceImpl::~CovarianceImpl() {
}
template <typename T> void CheckForDuplicates(vector<T> blocks) {
sort(blocks.begin(), blocks.end());
typename vector<T>::iterator it =
std::adjacent_find(blocks.begin(), blocks.end());
if (it != blocks.end()) {
// In case there are duplicates, we search for their location.
map<T, vector<int> > blocks_map;
for (int i = 0; i < blocks.size(); ++i) {
blocks_map[blocks[i]].push_back(i);
}
std::ostringstream duplicates;
while (it != blocks.end()) {
duplicates << "(";
for (int i = 0; i < blocks_map[*it].size() - 1; ++i) {
duplicates << blocks_map[*it][i] << ", ";
}
duplicates << blocks_map[*it].back() << ")";
it = std::adjacent_find(it + 1, blocks.end());
if (it < blocks.end()) {
duplicates << " and ";
}
}
LOG(FATAL) << "Covariance::Compute called with duplicate blocks at "
<< "indices " << duplicates.str();
}
}
bool CovarianceImpl::Compute(const CovarianceBlocks& covariance_blocks,
ProblemImpl* problem) {
CheckForDuplicates<pair<const double*, const double*> >(covariance_blocks);
problem_ = problem;
parameter_block_to_row_index_.clear();
covariance_matrix_.reset(NULL);
@@ -97,6 +132,20 @@ bool CovarianceImpl::Compute(const CovarianceBlocks& covariance_blocks,
return is_valid_;
}
bool CovarianceImpl::Compute(const vector<const double*>& parameter_blocks,
ProblemImpl* problem) {
CheckForDuplicates<const double*>(parameter_blocks);
CovarianceBlocks covariance_blocks;
for (int i = 0; i < parameter_blocks.size(); ++i) {
for (int j = i; j < parameter_blocks.size(); ++j) {
covariance_blocks.push_back(make_pair(parameter_blocks[i],
parameter_blocks[j]));
}
}
return Compute(covariance_blocks, problem);
}
bool CovarianceImpl::GetCovarianceBlockInTangentOrAmbientSpace(
const double* original_parameter_block1,
const double* original_parameter_block2,
@@ -120,9 +169,17 @@ bool CovarianceImpl::GetCovarianceBlockInTangentOrAmbientSpace(
ParameterBlock* block2 =
FindOrDie(parameter_map,
const_cast<double*>(original_parameter_block2));
const int block1_size = block1->Size();
const int block2_size = block2->Size();
MatrixRef(covariance_block, block1_size, block2_size).setZero();
const int block1_local_size = block1->LocalSize();
const int block2_local_size = block2->LocalSize();
if (!lift_covariance_to_ambient_space) {
MatrixRef(covariance_block, block1_local_size, block2_local_size)
.setZero();
} else {
MatrixRef(covariance_block, block1_size, block2_size).setZero();
}
return true;
}
@@ -240,6 +297,94 @@ bool CovarianceImpl::GetCovarianceBlockInTangentOrAmbientSpace(
return true;
}
bool CovarianceImpl::GetCovarianceMatrixInTangentOrAmbientSpace(
const vector<const double*>& parameters,
bool lift_covariance_to_ambient_space,
double* covariance_matrix) const {
CHECK(is_computed_)
<< "Covariance::GetCovarianceMatrix called before Covariance::Compute";
CHECK(is_valid_)
<< "Covariance::GetCovarianceMatrix called when Covariance::Compute "
<< "returned false.";
const ProblemImpl::ParameterMap& parameter_map = problem_->parameter_map();
// For OpenMP compatibility we need to define these vectors in advance
const int num_parameters = parameters.size();
vector<int> parameter_sizes;
vector<int> cum_parameter_size;
parameter_sizes.reserve(num_parameters);
cum_parameter_size.resize(num_parameters + 1);
cum_parameter_size[0] = 0;
for (int i = 0; i < num_parameters; ++i) {
ParameterBlock* block =
FindOrDie(parameter_map, const_cast<double*>(parameters[i]));
if (lift_covariance_to_ambient_space) {
parameter_sizes.push_back(block->Size());
} else {
parameter_sizes.push_back(block->LocalSize());
}
}
std::partial_sum(parameter_sizes.begin(), parameter_sizes.end(),
cum_parameter_size.begin() + 1);
const int max_covariance_block_size =
*std::max_element(parameter_sizes.begin(), parameter_sizes.end());
const int covariance_size = cum_parameter_size.back();
// Assemble the blocks in the covariance matrix.
MatrixRef covariance(covariance_matrix, covariance_size, covariance_size);
const int num_threads = options_.num_threads;
scoped_array<double> workspace(
new double[num_threads * max_covariance_block_size *
max_covariance_block_size]);
bool success = true;
// The collapse() directive is only supported in OpenMP 3.0 and higher. OpenMP
// 3.0 was released in May 2008 (hence the version number).
#if _OPENMP >= 200805
# pragma omp parallel for num_threads(num_threads) schedule(dynamic) collapse(2)
#else
# pragma omp parallel for num_threads(num_threads) schedule(dynamic)
#endif
for (int i = 0; i < num_parameters; ++i) {
for (int j = 0; j < num_parameters; ++j) {
// The second loop can't start from j = i for compatibility with OpenMP
// collapse command. The conditional serves as a workaround
if (j >= i) {
int covariance_row_idx = cum_parameter_size[i];
int covariance_col_idx = cum_parameter_size[j];
int size_i = parameter_sizes[i];
int size_j = parameter_sizes[j];
#ifdef CERES_USE_OPENMP
int thread_id = omp_get_thread_num();
#else
int thread_id = 0;
#endif
double* covariance_block =
workspace.get() +
thread_id * max_covariance_block_size * max_covariance_block_size;
if (!GetCovarianceBlockInTangentOrAmbientSpace(
parameters[i], parameters[j], lift_covariance_to_ambient_space,
covariance_block)) {
success = false;
}
covariance.block(covariance_row_idx, covariance_col_idx,
size_i, size_j) =
MatrixRef(covariance_block, size_i, size_j);
if (i != j) {
covariance.block(covariance_col_idx, covariance_row_idx,
size_j, size_i) =
MatrixRef(covariance_block, size_i, size_j).transpose();
}
}
}
}
return success;
}
// Determine the sparsity pattern of the covariance matrix based on
// the block pairs requested by the user.
bool CovarianceImpl::ComputeCovarianceSparsity(
@@ -252,18 +397,28 @@ bool CovarianceImpl::ComputeCovarianceSparsity(
vector<double*> all_parameter_blocks;
problem->GetParameterBlocks(&all_parameter_blocks);
const ProblemImpl::ParameterMap& parameter_map = problem->parameter_map();
HashSet<ParameterBlock*> parameter_blocks_in_use;
vector<ResidualBlock*> residual_blocks;
problem->GetResidualBlocks(&residual_blocks);
for (int i = 0; i < residual_blocks.size(); ++i) {
ResidualBlock* residual_block = residual_blocks[i];
parameter_blocks_in_use.insert(residual_block->parameter_blocks(),
residual_block->parameter_blocks() +
residual_block->NumParameterBlocks());
}
constant_parameter_blocks_.clear();
vector<double*>& active_parameter_blocks =
evaluate_options_.parameter_blocks;
active_parameter_blocks.clear();
for (int i = 0; i < all_parameter_blocks.size(); ++i) {
double* parameter_block = all_parameter_blocks[i];
ParameterBlock* block = FindOrDie(parameter_map, parameter_block);
if (block->IsConstant()) {
constant_parameter_blocks_.insert(parameter_block);
} else {
if (!block->IsConstant() && (parameter_blocks_in_use.count(block) > 0)) {
active_parameter_blocks.push_back(parameter_block);
} else {
constant_parameter_blocks_.insert(parameter_block);
}
}
@@ -386,8 +541,8 @@ bool CovarianceImpl::ComputeCovarianceValues() {
switch (options_.algorithm_type) {
case DENSE_SVD:
return ComputeCovarianceValuesUsingDenseSVD();
#ifndef CERES_NO_SUITESPARSE
case SUITE_SPARSE_QR:
#ifndef CERES_NO_SUITESPARSE
return ComputeCovarianceValuesUsingSuiteSparseQR();
#else
LOG(ERROR) << "SuiteSparse is required to use the "
@@ -624,7 +779,10 @@ bool CovarianceImpl::ComputeCovarianceValuesUsingDenseSVD() {
if (automatic_truncation) {
break;
} else {
LOG(ERROR) << "Cholesky factorization of J'J is not reliable. "
LOG(ERROR) << "Error: Covariance matrix is near rank deficient "
<< "and the user did not specify a non-zero"
<< "Covariance::Options::null_space_rank "
<< "to enable the computation of a Pseudo-Inverse. "
<< "Reciprocal condition number: "
<< singular_value_ratio * singular_value_ratio << " "
<< "min_reciprocal_condition_number: "

View File

@@ -55,12 +55,21 @@ class CovarianceImpl {
const double*> >& covariance_blocks,
ProblemImpl* problem);
bool Compute(
const std::vector<const double*>& parameter_blocks,
ProblemImpl* problem);
bool GetCovarianceBlockInTangentOrAmbientSpace(
const double* parameter_block1,
const double* parameter_block2,
bool lift_covariance_to_ambient_space,
double* covariance_block) const;
bool GetCovarianceMatrixInTangentOrAmbientSpace(
const std::vector<const double*>& parameters,
bool lift_covariance_to_ambient_space,
double *covariance_matrix) const;
bool ComputeCovarianceSparsity(
const std::vector<std::pair<const double*,
const double*> >& covariance_blocks,

Some files were not shown because too many files have changed in this diff Show More