1
1

Compare commits

..

501 Commits

Author SHA1 Message Date
ceddd2bcd9 Fix collision multithreading inconsistency
Multithreading makes collisions be detected in different orders, causing
the clustering step of collision resolution to generate possibly
slightly different results on each run. This commit makes collision
order consistent.
2018-09-19 15:55:53 +02:00
f47ace53f2 Fix mistake in collision indexing 2018-09-19 15:55:53 +02:00
7eb44c2f1b Fix incorrect poll function signature in rna_cloth.c 2018-07-23 01:36:39 +02:00
13818c47cf Merge branch 'master' into cloth-improvements 2018-07-19 16:33:44 +02:00
51f14cfa43 make.bat : restore msvc2015 support.
broke when i removed the 2013 support.
2018-07-18 20:00:34 -06:00
20191980f4 Cycles: increase volume stack to support 32 overlapping volumes.
This increases stack memory usage some, and ideally we'd support a dynamic
size. But this is quite difficult on the GPU and hopefully 32 is enough even
for very complex cases.
2018-07-18 22:58:52 +02:00
e81dc0b7bc Fix E key in Python console not working after recent changes. 2018-07-18 22:23:29 +02:00
L. E. Segovia
5078b9d2d0 Cycles: add Principled Hair BSDF.
This is a physically-based, easy-to-use shader for rendering hair and fur,
with controls for melanin, roughness and randomization.

Based on the paper "A Practical and Controllable Hair and Fur Model for
Production Path Tracing".

Implemented by Leonardo E. Segovia and Lukas Stockner, part of Google
Summer of Code 2018.
2018-07-18 13:59:06 +02:00
566b319335 Cleanup: Cryptomatte node style tweaks. 2018-07-18 13:59:06 +02:00
Stefan Werner
bdda0964e0 Compositor: Cryptomatte compositing node.
This patch adds a new matte node that implements the Cryptomatte specification.
It also incluces a custom eye dropper that works outside of a color picker.
Cryptomatte export for the Cycles render engine will be in a separate patch.

Reviewers: brecht

Reviewed By: brecht

Subscribers: brecht

Tags: #compositing

Differential Revision: https://developer.blender.org/D3531
2018-07-18 13:03:34 +02:00
41045478ab make.bat: remove msvc2013 support. 2018-07-17 14:44:47 -06:00
efe94793c0 Fix T56003: Opening image files as movies in VSE crashes.
metadata loading code was assuming all videos in Blender were from
FFMPEG... added empty place-holders for other types too, we probably
could load some metadata from pictures or AVI files too!
2018-07-17 13:55:43 +02:00
b85be88655 Fix (IRC-reported) wrong usercount handling of deprecated IPO datablocks.
versionning code would unref those twice... Reported by @ßergey on IRC, thanks!
2018-07-16 22:29:26 +02:00
e6af8758c8 Ghost: Fix memory leak happening with keyboard mapping access
So far only noticed system de-initialization doesn't perform full
object free. So rather harmless but yet stupid.
2018-07-16 17:32:57 +02:00
1e1c858cf1 Cleanup: Remove obscure flag which was only used for read in subsurf code
Some sort of rudiment from many years ago, is never set by 2.5x code.
2018-07-16 16:15:57 +02:00
72d1fb9934 Cleanup: Use const qualifier for UV vertex map 2018-07-16 15:58:12 +02:00
20f3cbfb78 Cleanup: More clear naming in UV vertex/element mappings
Also use unsigned short for loop index within a polygon for UV vertex
mapping, which matches UV element mapping.
2018-07-16 15:44:43 +02:00
43f0af734e Fix T55944: fbx export error with smoothing face
ddee0931b8 added PROP_RAW_BOOLEAN case for foreach_set, but missed
foreach_get

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3534
2018-07-16 15:03:21 +02:00
96b4e43e8d Fix T55527: creating a Quaternion without args should result in identity
quaternion

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3487
2018-07-16 15:03:21 +02:00
80795ff897 Buildbot: update for new VS2017 buildbot worker name. 2018-07-16 14:34:24 +02:00
ab9bd557ad Cleanup: doxy comments 2018-07-15 20:34:24 +02:00
edbb2d2279 Fix Cycles incorrect resize and CMYK conversion of uint16/half images. 2018-07-15 18:38:09 +02:00
83a4e1aaf9 Cycles: add voronoi features and distance settings from Blender.
Features to get the 2nd, 3rd, 4th closest point instead of the closest, and
various distance metrics. No viewport/Eevee support yet.

Patch by Michel Anders, Charlie Jolly and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D3503
2018-07-15 00:45:42 +02:00
4697604331 Cleanup: use float3 SSE instead of ssef for voronoi texture. 2018-07-14 23:58:20 +02:00
ceba8e28b7 Rename operator property from last commit
Restore operator had same option named differently.
2018-07-14 10:20:27 +02:00
50e3cd0bb3 Keymap: option to export all keymaps
Useful to store a snapshot of the current keymap state
so changes to the default keymap are ignored.

Also useful for testing keymap export works properly.
2018-07-14 10:15:46 +02:00
43973410f3 Cleanup: use f-string for addon_utils 2018-07-14 09:30:59 +02:00
7d73ba904e Cleanup: minor change for f-string use 2018-07-14 09:30:50 +02:00
87535dd73d Makefile: add note about environment vars 2018-07-13 18:16:05 +02:00
a6ec402f5a Remove invalid assert 2018-07-13 17:59:26 +02:00
f6367ecfb6 Cleanup: operator type API, header 2018-07-13 12:47:04 +02:00
8ff3f7f601 Cleanup: move WM type registration into own files
Type registration is mostly boiler plate logic,
which can be separated from other API's.
2018-07-13 12:20:42 +02:00
30bffb5a3a Nodes: add sqrt, ceil, floor and fract to math nodes.
This works for Cycles, Eevee, texture nodes and compositing. It helps to
reduce the number of math nodes required in various node setups.

Differential Revision: https://developer.blender.org/D3537
2018-07-13 11:00:10 +02:00
f4213c1408 Cleanup: id-property API use
Also clarify comments.
2018-07-13 10:51:49 +02:00
252ebf6bfd Cleanup: split keymap lookups into own functions
More will be added in 2.8, keep this manageable.
2018-07-13 10:30:18 +02:00
8c957468bc Keymap: dope-sheet hotkey to change falloff 2018-07-13 09:05:41 +02:00
fb5597540d Cleanup: right shift arguments 2018-07-13 08:36:10 +02:00
e77d2b4e3f Cleanup: remove legacy mesh save support
This was used for saving files for Blender 2.6x.
2018-07-12 21:35:57 +02:00
753a600e35 PyAPI: add undo redo handlers
Useful so Python can clean up before/after undo steps.
2018-07-12 14:43:35 +02:00
9a5fb0209e Fix T55949: increase color management exposure hard range. 2018-07-12 11:47:19 +02:00
d75b8e5f01 Cleanup: header guards 2018-07-12 11:19:22 +02:00
0108ce1fe5 Cleanup: pep8, cycles 2018-07-12 11:03:13 +02:00
b328a59373 Icons: support setting blender, inkscape commands 2018-07-12 09:14:13 +02:00
1db47a2ccd Fix PyRNA class registration w/ Python 3.7
In Python3.7 this now raises an error.
2018-07-12 08:30:39 +02:00
b843753ad5 Buildbot: initial configuration for Visual Studio 2017. 2018-07-11 21:38:00 +02:00
08274433e1 Fix T55912: saving Viewer Node image error.
Images from viewer node needs the lock parameter...
2018-07-11 14:32:43 +02:00
59b4c67536 Minor cleanup to logic in BKE's imbuf releasing code. 2018-07-11 14:32:06 +02:00
2b963ecb81 Cleanup: duplicate versioning block 2018-07-11 11:39:58 +02:00
0ed54cf9ba Depsgraph: Fix face dependency cycle when bone uses id property from self 2018-07-11 10:19:56 +02:00
d0920fba16 OpenSubdiv: Fix wrong topology refiner cast 2018-07-10 14:40:51 +02:00
c17cb50ae2 OpenSubdiv: Make more flexible C-API to specify FVar interpolation 2018-07-10 14:40:45 +02:00
80373bc4d2 CMake: Disable OpenAL and JACK when AUDASPACE is disabled
Previously CMake was raising a fatal error, which wasn't too helpful.

There is still some fatal messages about Audaspace and Game Engine,
but the latter one is on it's EOL and is removed in Blender 2.8.
2018-07-10 11:25:47 +02:00
719629f2aa GHOST: Fix memory leak in X11 DPI query
The X resource database is to be explicitly destroyed. This fixes 46 bytes
leak per every window DPI query (which happens a lot on window move/resize
and even on areas resize).

Unfortunately, this does not fully fix the leak since the known leak:

  https://bugs.freedesktop.org/show_bug.cgi?id=94604
2018-07-10 10:59:06 +02:00
f9107eae6a Keymap: minor changes for keymap display 2018-07-10 07:41:49 +02:00
f51c6efbc1 Fix transform plane constraint orientation cycle
Regression since 2.79b release
2018-07-10 06:51:25 +02:00
8c528a4f0a Cleanup: use const transform args 2018-07-09 17:57:05 +02:00
6793aebad2 Cleanup: remove 'Orientation' from keymap item name
It's constraint not an orientation,
in transform context it can be inferred.
2018-07-09 07:39:26 +02:00
70e2824126 Keymap: remove some hard coded transform events
Also re-order for display purposes
2018-07-09 07:29:12 +02:00
9856dd9fec Cleanup: right shift 2018-07-09 06:38:07 +02:00
5480de3fca Fix scale in Apply Pose As Rest Pose for bendy bones.
Scale is multiplicative, and adding it up causes the bone to bloat.
2018-07-07 15:10:41 +03:00
97cd8bfae1 Cleanup: isinstance can take multiple types 2018-07-07 11:29:57 +02:00
4b373ed086 Cleanup: pep8 2018-07-07 08:48:35 +02:00
252207cc7a Cleanup: redundant poll checks 2018-07-07 08:36:17 +02:00
b94222b090 PyDrivers: update bytecode check for Python3.6 2018-07-06 19:31:00 +02:00
22150eb409 Animation player: Ensure new frames are displayed while dragging mouse
Thanks Campbell for review!
2018-07-06 17:15:40 +02:00
3527857cdc Cleanup: use outliner_flag_* name prefix 2018-07-06 14:40:13 +02:00
0987c11c76 fix c++ comment style in 3cc2a9b934 2018-07-06 13:15:44 +02:00
12ce0cfb21 Ocean Modifier: removed unused refresh flags
The flags were set and cleared correctly, but nothing was actually reading
them.
2018-07-06 12:50:04 +02:00
7691040166 Ocean Modifier: removed the MOD_OCEAN_REFRESH_ADD flag
The flag was only used in readfile.c, and resulted in a delayed call to
BKE_ocean_add(); this call is now immediately made instead as it's not
very expensive.
2018-07-06 12:46:58 +02:00
3cc2a9b934 Fix T55581: kill running (render) jobs when deleting a scene
also fixed passing WM_JOB_TYPE_ANY to WM_jobs_kill_type()

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3498
2018-07-06 11:58:13 +02:00
Stefan Werner
df30b50f2f Cycles: Enabled half precision textures for OpenCL devices that support the cl_khr_fp16 extension. 2018-07-06 11:42:34 +02:00
Stefan Werner
d20d2bcb7f Cycles: Fixed OpenCL kernel build, it threw a compiler error. 2018-07-06 10:21:25 +02:00
1daa20ad9f Cleanup: strip trailing space for cycles 2018-07-06 10:17:58 +02:00
62fbb7d4a1 Empty Object: Center images by default 2018-07-06 10:05:37 +02:00
d56b90705e BKE_addons: utility to remove by name 2018-07-06 07:55:29 +02:00
52655f5161 Cleanup: flag checks 2018-07-05 22:49:42 +02:00
0e2915b292 RNA: correct callback type
Missed when changing callbacks from int to bool type.
2018-07-05 22:25:34 +02:00
Stefan Werner
4d00e95ee3 Cycles: Adding native support for UINT16 textures.
Textures in 16 bit integer format are sometimes used for displacement, bump and normal maps and can be exported by tools like Substance Painter. Without this patch, Cycles would promote those textures to single precision floating point, causing them to take up twice as much memory as needed.

Reviewers: #cycles, brecht, sergey

Reviewed By: #cycles, brecht, sergey

Subscribers: sergey, dingto, #cycles

Tags: #cycles

Differential Revision: https://developer.blender.org/D3523
2018-07-05 13:53:34 +02:00
cd17b32583 Cleanup: pep8 2018-07-05 07:53:21 +02:00
c960804747 Cycles Denoising: Pass tile buffers to every OpenCL kernel to conform to standard and get rid of set_tile_info 2018-07-04 14:38:03 +02:00
f1525cf534 Cycles Denoising: Correctly handle target buffer in tile unmapping and move device swap logic to the device_memory 2018-07-04 14:37:55 +02:00
9db8bdbc65 Cycles Denoising: Cleanup: Rename tiles to tile_info 2018-07-04 14:37:24 +02:00
97a0d6fcc7 Cycles Denoising: Refactor denoiser tile handling
This deduplicates the calls for tile (un)mapping and allows to have a target buffer that is different from the source buffer (needed for baking and animation denoising).
2018-07-04 14:36:01 +02:00
b10c64bd2f Cycles Denoising: Split main function into logical steps 2018-07-04 14:35:05 +02:00
969111f9b5 Cleanup: pep8 2018-07-03 22:35:37 +02:00
eb7286bfd2 Python: Print file:line when editing UI source 2018-07-03 07:22:26 +02:00
8c15d612a5 Cleanup: pep8 2018-07-03 06:55:02 +02:00
b66aa0b0a6 Cleanup: pep8 2018-07-03 06:48:44 +02:00
dbe1b07e05 Cleanup: right shift 2018-07-02 18:45:26 +02:00
73c577d46a Painting: fix uninitialized variable use 2018-07-02 18:16:37 +02:00
e5767eaad1 Cycles: Fix missing curve hair when building with GCC-8 in release mode
Reshuffle cast intrinsics to make XOR to operate on __m128i rather
than on __m128.

Hopefully this does not affect performance.
2018-07-02 15:16:14 +02:00
c6416ae653 Screen: support splitting from floating menu 2018-07-02 12:40:17 +02:00
b88e51dd55 Cleanup: use bool for poll functions 2018-07-02 11:51:31 +02:00
bfbfb1c47e Correct f-string in own recent changes 2018-07-02 09:18:38 +02:00
26c5a1c301 Cleanup: right shift in interface code 2018-07-01 20:12:07 +02:00
71e65daf5c Fix T55687: compile error when not using c++11. 2018-07-01 16:48:19 +02:00
9c5203c98f Fix T55626, fix T55106: Cycles motion blur + persistent images bug. 2018-07-01 16:32:35 +02:00
ddee0931b8 RNA: use bool for boolean RNA types
We were using int's for bool arguments in BKE,
just to avoid having wrapper functions.
2018-07-01 15:57:59 +02:00
3ec6f2172d Cleanup: reduce variable scope 2018-07-01 10:32:47 +02:00
fadad17c58 Cleanup: avoid calloc when immediately overwritten 2018-07-01 10:26:37 +02:00
9738de820a Cleanup: use f-string 2018-06-30 22:02:41 +02:00
bea62c5c1a Cleanup: split out context member query 2018-06-30 18:05:01 +02:00
bdc1108e8c Cleanup: remove unused context arg to menu 2018-06-30 12:31:53 +02:00
a42fd3de5d UI: Add 'interface_query.c'
Interface files are increasingly mixing up too much functionality,
add a file only to handle queries.

More functions can be moved/added here.
2018-06-30 10:49:04 +02:00
b26e9f0000 Cleanup: rename bmesh_queries -> bmesh_query
Other files with the same purpose already used 'query'.
2018-06-30 10:32:21 +02:00
5c0d8bcdc7 Cleanup: use f-string 2018-06-30 09:25:23 +02:00
728e92422e Fix T54524: keyframe and driver colors not showing in shape key list.
This reverts commit 357b72e0a7 which caused
the issue, we need a better fix for that cosmetic issue from T50862. For
now displaying keyframes and drivers is the more important one.
2018-06-29 21:23:13 +02:00
ccacf3ae3c Cycles: change AO node default to 16 samples and only local off. 2018-06-29 15:43:55 +02:00
b372766816 Cleanup: trailing newlines 2018-06-29 09:23:51 +02:00
af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
46dceefc35 WM: Remove Screen Cast
This feature is better handled by specialized tools.
2018-06-28 23:40:51 +02:00
Cédric Paille
aa6247a385 Alembic: speed up export of packed UV islands.
Differential Revision: https://developer.blender.org/D3510
2018-06-28 15:46:05 +02:00
f22ef1706d Fix T55662: Crash on text autocomplete
Regression from undo system upgrade.
2018-06-28 11:09:09 +02:00
274bde23fb CMake: enable WITH_ASSERT_ABORT by default
Assert from BLI_assert by default in debug builds
(instead of just printing a warning).

Some developers ignored this, causing errors for others.
Better debug builds cause hard error so code isn't ignored.

Disabling is still useful when bisecting or testing outdated code.
2018-06-28 10:48:06 +02:00
d5a8c0c414 UI: use two dot ellipses
Use less space for sign used when we don't have enough.
2018-06-28 10:45:39 +02:00
597122d72b Cleanup: use f-strings 2018-06-28 08:43:58 +02:00
9536f67e7e Fix Cycles tests build on macOS. 2018-06-28 00:11:01 +02:00
b633d760a2 Cleanup: style 2018-06-27 22:32:52 +02:00
532c8ac583 Cleanup: pep8 function indentation 2018-06-26 19:58:56 +02:00
ecb56eac57 UI: Add/Update bad tooltips
Part of T51061
2018-06-26 12:29:11 -04:00
599e979d90 Fix bug in DNA_struct_elem_find when checking the first field
find_elem(olddata=NULL) doesn't work reliably for existence checks; it will
return NULL both when the field is found at offset 0 and when it is not
found at all.
2018-06-26 17:35:21 +02:00
Stefan Werner
73eb1bfd55 Revert "Turned off clang warnings in third party includes."
This reverts commit d53093953f.
2018-06-26 10:26:56 +02:00
df237b964b PyAPI: add ImBuf.copy
DD348 by @kilon w/ edits.
2018-06-26 09:31:57 +02:00
a69f985f40 PyAPI: move deep-copy args check to py_capi_utils 2018-06-26 09:31:57 +02:00
87f598fd3f Cycles: Fix wrong row count for World MIS CDF calculation 2018-06-26 05:35:30 +02:00
Stefan Werner
d53093953f Turned off clang warnings in third party includes.
The latest clang compiler (at least the one in Xcode 9.4.1) warns about the register keyword and macro expansions using defined().
Since these warnings come from third party code, we can't address them directly in Blender. Silencing them via #pramgas will
at least keep the warnings during a build down to the ones that are relevant to Blender code.
2018-06-25 23:02:01 +02:00
8a7f317666 Cleanup: Nuke most of G.main from GPU code. 2018-06-25 12:32:48 +02:00
f33cb522dd Cleanup: Few more validation of G_MAIN usages... 2018-06-25 12:02:20 +02:00
b09387c388 Add back header needed win32 2018-06-25 09:46:03 +02:00
f3b9fa5393 CMake: correct remove_strict_cxx_flags_file
Was still using C-flags.
2018-06-25 07:30:00 +02:00
574c716f2d Cycles: change AO node color default to 1.0. 2018-06-24 12:24:30 +02:00
e61bbc00b7 Cleanup: move UI context menus into own file 2018-06-24 10:43:09 +02:00
f8a3636374 UI: alternate fix for empty context menu
block and layout could be NULL and checking this everywhere
wasn't practical.

Instead of lazy initializing, add UI_popup_menu_end_or_cancel
which cancels empty popup menus.
2018-06-23 10:31:10 +02:00
6cd0484de8 CMake: Make language explicit for per-file strict flags removal 2018-06-22 14:40:00 +02:00
ec27776d8e CMake: Cleanup, add_cc_flag -> add_c_flag 2018-06-22 14:29:13 +02:00
38247fc80b CMake: Cleanup, rename CC_REMOVE_STRICT_FLAGS to C_REMOVE_STRICT_FLAGS 2018-06-22 14:25:42 +02:00
0d7e758c91 CMake: Tweaks to removal of strict flags
Silences the following strict flags from external libraries:

- -Wclass-memaccess
- -Wswitch
- -Wtype-limits
- -Wint-in-bool-context

Needed to tweak macro a bit, since the old logic was wrong:
we can not use CXX flags for C compiler, need way more strict
separation between what goes where.
2018-06-22 14:25:42 +02:00
a5f046f449 Cleanup: rename 3D cursor calculation vars 2018-06-22 12:55:15 +02:00
2fe528424d Cleanup: remove last G.main from RNA.
Again, we cannot actually get rid of G_MAIN global access here, so in
most case just 'marked' them as valid, and added assert checks to ensure
we do only work with IDs in G_MAIN in those cases.
2018-06-22 12:35:41 +02:00
101fd7ec06 Tweak new BKE_id_is_in_global_main to accept NULL pointer (and consider them as valid). 2018-06-22 12:26:45 +02:00
cbf5c738d6 Cleanup: get rid of last G.main's in bpy area.
Essentially 'validating' them as G_MAIN, and adding some asserts in
dubious places, that handled IDs are actually in G_MAIN.
2018-06-22 11:37:47 +02:00
1870a1adc7 BKE_library: Add func to check an ID is actually in G_MAIN database. 2018-06-22 11:37:08 +02:00
a0dce6810d Edit Mode: Bevel Op: Offset Soft Max to 100
This is consistent with the modifier
2018-06-21 13:46:11 -04:00
68f4a4641e Fix T55568: second click event ignored 2018-06-21 19:26:21 +02:00
51f6b25afd Revert "Fix T55568: second click event ignored"
This reverts commit 52aa963f0e.

Fixed for keyboards, broke mouse buttons.
2018-06-21 19:24:53 +02:00
84dbf949d7 UI: don't show empty button context menu 2018-06-21 16:37:19 +02:00
cd6cb55ff3 Fix Cycles incorrect versioning for automatic sample world resolution. 2018-06-21 15:28:59 +02:00
a4f08297ed UI: preference for developer extras
Currently only used for "Edit Source" feature.
2018-06-21 14:54:21 +02:00
52aa963f0e Fix T55568: second click event ignored
Double-click handling caused the second click to be ignored
for keymaps that only handle click.
2018-06-21 14:04:43 +02:00
a283333cd8 Fix Cycles CUDA render errors with CUDA 9.2.
Work around what might be a compiler bug.
2018-06-21 12:32:32 +02:00
d6313f47af Fix T55564: Cycles OpenCL build error on some scenes. 2018-06-21 11:46:52 +02:00
f1bc9331b1 Fix T55491: Double click fail in menu popups 2018-06-21 10:07:18 +02:00
3995b33a42 WM: don't make LMB a special case for double click 2018-06-21 09:49:30 +02:00
d312dbea2d Cleanup: naming (make it clear vars are squared) 2018-06-20 15:58:46 +02:00
372754c164 Screen: split ED_area_actionzone_find_xy
Add ED_area_actionzone_refresh_xy which can tag redraw
find no longer changes changes to the action zone.
2018-06-20 15:34:20 +02:00
5cad6afac6 Cleanup: rename is_in_area_actionzone 2018-06-20 15:34:20 +02:00
daaf315bf2 Cleanup: quiet warning 2018-06-20 15:34:20 +02:00
fd48e685c3 Cleanup: remove some G.main from BKE's node.c
Validate some cases using G_MAIN instead (I don't think we want to work
on any other Main than G.main one when registering/unregistering nodes
etc.).

And when freeing, all ID not in Main shall now be tagged accordingly, so
we *should* not need to do that stupi search over all ntrees in G.main
to check wether we have to free it ourself or not!
2018-06-20 12:27:26 +02:00
d4519f54b3 UI: only show "Edit Translations" when addon used 2018-06-20 10:45:03 +02:00
0a8af46707 Final cleanup of G.mains in render area. 2018-06-19 19:25:06 +02:00
Stefan Werner
9ff135d85d Cycles: Fixed crash when the camera was inside 16 volumes or more. It still won't render those volumes correctly, but at least the crash is addressed. 2018-06-19 16:35:18 +02:00
b5893b1ba3 Fix (unreported) passing CDLayer 'ID' instead of bitflag to a cdlayer mask!
Probably harmless, since I bet CD_ORIGINDEX is nearly always generated,
but still...
2018-06-19 16:25:24 +02:00
668f39519c Fix T55528: Cycles AO node should default to 1 if radius is 0. 2018-06-19 11:45:05 +02:00
b09a8203e9 Cleanup DM generation code for ProjPaint.
Two branches were actually doing essentially the same thing here, no
need to artificially complicate things. ;)
2018-06-19 10:48:37 +02:00
64a2f98062 Fix (unreported) unauthorized relesing of derived_final DM in paint projection code.
NEVER free yourself DM returned by mesh_get_derived_final(), it's always
to one assigned to ob->derived_final!
2018-06-19 10:43:54 +02:00
751189e9d6 Vertex Paint: set sculpt object mode immediately
SculptSession.mode_type wasn't initialized until painting,
making it unreliable for checks in other parts of the code.

Also remove unnecessary initialization,
matching sculpt mode more closely.
2018-06-19 08:50:35 +02:00
f0c6f5ee77 editorconfig: correct C/C++ using space 2018-06-19 07:48:12 +02:00
38b72fb64b make.bat: Fix msvc-2017 detection.
D3485 by @manung

Differential Revision: https://developer.blender.org/D3485
2018-06-18 13:39:12 -06:00
ab59f9e65d editorconfig: add rst 2018-06-18 18:53:49 +02:00
b7b7468bef editorconfig: add line length, glsl 2018-06-18 18:21:35 +02:00
ce7c87fbda Add .editorconfig file
This is a fairly well supported file-type configuration
for indentation and trailing space stripping.

See editorconfig.org for details.
2018-06-18 18:09:45 +02:00
579631819f Fix T55503: File browser filter not working correctly.
There were two issues here, introduced by rB66aa4af836:
* Forgot to change length of some filter_glob var deep in filebrowser code.
* Truncating filter_glob in general can be dangerous, generating
unexpected patterns.

Last point was the root of the issue here, truncating to 63 chars string
left last group as 'match everything' `*` pattern.

To fix that to some extent, added a new BLI_path_extension_glob_validate
helper to BLI_path_util, which ensures we do not have last
wildcards-only group in our pattern, when there are more than one group.
2018-06-18 12:26:47 +02:00
b66ae8259e RNA: disable animation for file output options 2018-06-18 07:31:21 +02:00
86e20a2e63 Cleanup: trailing space cmake, make.bat 2018-06-17 20:18:09 +02:00
e7a68ef843 Cleanup: trailing space in CMake files 2018-06-17 20:15:24 +02:00
2ceff8bd63 Python: Allow untrusted py-drivers to run limited expressions
Limit to a restricted set of built-ins, as well as the math module.
Also restrict of op-codes, disallowing imports and attribute access.

This allows most math expressions to run
without any performance cost once the initial check is done.

See: D1862 for details.
2018-06-17 20:01:05 +02:00
a24b4e6090 Cleanup: trailing space for remaining source/ 2018-06-17 17:06:28 +02:00
76c2203f9c Cleanup: trailing space for blenloader 2018-06-17 17:06:07 +02:00
6fc8a74886 Cleanup: trailing space for blenkernel 2018-06-17 17:05:51 +02:00
a262ea8c47 Cleanup: trailing space for compositor 2018-06-17 17:05:29 +02:00
410880552b Cleanup: trailing space for freestyle 2018-06-17 17:05:14 +02:00
e74bd46ede Cleanup: trailing space for imbuf module 2018-06-17 17:04:54 +02:00
1eed46c788 Cleanup: trailing space for modifiers 2018-06-17 17:04:27 +02:00
78fbd146f3 Cleanup: trailing space for DNA headers 2018-06-17 17:04:09 +02:00
4be752a93c Cleanup: trailing space in source/gameengine/ 2018-06-17 17:03:10 +02:00
5513da65b2 Cleanup: trailing space for BLI 2018-06-17 16:32:54 +02:00
f19ecdeec6 Cleanup: remove unused BLI_rebase_path 2018-06-17 16:26:47 +02:00
a0a1fc8938 Cleanup: BLI path extension API
Use BLI_path_extension_* prefix.
2018-06-17 16:13:24 +02:00
6453814ec0 BLI_path: add string size debug define
Off by default, only for debugging.
2018-06-17 15:35:00 +02:00
42103a3eb8 CMake: add missing headers 2018-06-17 11:56:20 +02:00
2f1e34cfcc Cleanup: use clamp_* from BLI_math (replace macro) 2018-06-17 11:50:56 +02:00
36e82b7759 make.bat: Fix make showhashes not working.
broke in recent refactor.
2018-06-16 12:29:38 -06:00
ace8ad861d Fix T55427: Removing Vertex Group used by Data Transfer Modifier results in crash.
Only fixing crash, proper handling (a.k.a remapping) of all
possible cases here, for all possible data layers, is rather involved...
2018-06-16 16:22:00 +02:00
35c71aed25 UI: refactor drag-toggle for other button types 2018-06-16 16:04:26 +02:00
73abca1da0 UI: minor changes from 2.8
- Option to skip multi-data edits.
- Open hold buttons on drag.
- Utility function to set default value.
2018-06-16 15:44:13 +02:00
b955747875 Cycles Cleanup: Remove unneccessary color management call 2018-06-16 13:47:49 +02:00
799779d432 Cycles: change Ambient Occlusion shader to output colors.
This means the shader can now be used for procedural texturing. New
settings on the node are Samples, Inside, Local Only and Distance.

Original patch by Lukas with further changes by Brecht.

Differential Revision: https://developer.blender.org/D3479
2018-06-15 22:16:06 +02:00
2b9edbc98b WM: suppress drag events if motion is handled 2018-06-15 19:09:43 +02:00
d645b1a78a Cleanup: some more G.main removal.
We are really starting to scratch the last bits here...
2018-06-15 17:42:17 +02:00
49915e3241 Cleanup: validate G.main's in creator code.
Using G_MAIN here is valid!
2018-06-15 17:36:44 +02:00
da9b1b14ed Cleanup: some more G.main removal/validation... 2018-06-15 17:21:07 +02:00
2e25a48b05 Fix more Cycles CUDA errors after recent changes. 2018-06-15 16:28:09 +02:00
b84fad2ba3 Fix T55490, intersect two triangles fails.
Need to use the 'use_partial_connect' option in island connect,
so changed signatures of various functions to pass that into and
then down from BM_mesh_intersect (making true for intersect, false
for boolean).
Then fix bm_face_split_edgenet_partial_connect to work when
input edges are not necessarily wire, but at least not in the
face they are being connected in. That caused generalization
of core BM_vert_separate_hflag_wire (which is only used in
this one place in all Blender).
2018-06-15 08:48:45 -04:00
284e0ea756 Fix (unreported) Text Editor: scrollbar exiting early
caused by recent clickdrag changes
2018-06-15 10:27:30 +02:00
8148d549bb Fix Cycles CUDA error after recent changes. 2018-06-15 10:26:28 +02:00
cbc7ee28d7 WM: 2.8 screen compatibility
Without these minor changes loading files from 2.8 will crash.

Manually applied edits from 26786a2b87
2018-06-15 10:24:53 +02:00
3ee606621c Cycles: Query XYZ to/from Scene Linear conversion from OCIO instead of assuming sRGB
I've limited it to just the RGB<->XYZ stuff for now, correct image handling is the next step.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3478
2018-06-14 22:21:37 +02:00
064e701472 Cycles: Connect value inputs to Strength instead of Color when inserting an Emission node
Same result, but saves an additional ConvertNode.
2018-06-14 22:16:42 +02:00
716e138a1b Cycles: Automatically detect HDRI resolution by default and use non-square sampling map
The automatic mode checks all Enviroment Texture nodes and picks the largest image's resolution.
If there are no Enviroment Textures, it just uses the old default.

Also, the sampling map now isn't limited to square shapes. The automatic detection uses the exact image size,
the manual UI option now halves the value to get the height.

A default aspect ratio of 2:1 makes sense since this is what most HDRIs use.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3477
2018-06-14 22:07:07 +02:00
fd19069999 Cleanup: remove last G.main's from Collada code. 2018-06-14 15:15:51 +02:00
66407e15cb Cleanup: Remove last G.main's from WM code.
Was mostly validating valid usages of G.main -> G_MAIN actually.
2018-06-14 12:34:13 +02:00
0eb3246713 Fix T55470: Add option to not fix polygons' winding to Edit Normals modifier.
this is actually adding option to add buggy behavior, but.. NPR often
expects buggy behaviors, and its one of the main targets for normal editing.
So think it's reasonable to add that option (disabled by default of
course).

Note that am not really happy with UI, but:
* Not sure where to put it, it's kind of own self-contained area option.
* Don't to make it too much visible, using this should be the exception!
2018-06-14 11:41:12 +02:00
4d58fac1b4 Fix undo group to use human readable name, since this shows in the UI. 2018-06-13 18:39:30 +02:00
3102833962 Fix undo of transform after frame change undoing too much.
For grouped undo we should not skip the undo push, rather replace the
previous undo push. This way undo goes back to the state after the last
operation in the group.
2018-06-13 18:39:30 +02:00
90e6323ed8 Cycles: auto insert emission node when linking color to closure.
This is convenient for previewing the output of a node, and we agreed
to support this behavior in both Eevee and Cycles.
2018-06-13 18:39:30 +02:00
57cd52a4ab WM: check release event for particle edit mode
Caused by drag event.
2018-06-13 18:23:09 +02:00
f61c30f804 Cleanup: get rid of last G.main in BMesh code. 2018-06-13 16:29:12 +02:00
5ff1d845ea Cleanup: moar ugly G.main removal...
Note that due to RNA get/setters issue, that one may actually add some
G.main usages to the total... But at least it's not hidden anymore in a
very low-level, dark corner of BKE pointcache code!
2018-06-13 14:28:05 +02:00
2002fe27d9 Fix T55467: nodes cant be resized after recent clickdrag change 2018-06-13 14:03:46 +02:00
5788f24337 Cleanup: swapped X/Y UI_UNIT 2018-06-13 11:10:55 +02:00
67e8c1e1c7 Cleanup: remove more G.main from BKE area. 2018-06-13 10:57:10 +02:00
2788202417 Cleanup: moar G.main removal from BKE area. 2018-06-12 17:57:24 +02:00
f27ecd56ef Cleanup: BKE_scene_free should not have to worry about cleaning its usages.
This is supposed to be handled by calling code! Henceforce, no need to
call BKE_sequencer_clear_scene_in_allseqs() here, and... no need for
that ugly G.main case. ;)
2018-06-12 17:46:16 +02:00
b00d840359 WM: remove sloppy region type access
Avoid accidentally operating on the wrong region type.
2018-06-12 17:34:44 +02:00
760e79d809 WM: rename BKE_regiontype_from_id
This returns the first as a fallback, causing confusing usage.
Renamed and added a version of the function that doesn't.
2018-06-12 17:26:38 +02:00
ec4ce908db Fix T55452: Crash on saving with visible particle system.
Missing Main pointer in recent refactor/cleanup of G.main usages...
2018-06-12 16:17:05 +02:00
a6585fa4b1 Cleanup: moar removal of G.main in BKE area... 2018-06-12 15:16:45 +02:00
d617a6c85b Cleanup/simplify G.main usages.
Using G.main only to get main bled filepath, or built-in fonts, is OK.
So now using the 'valid' G_MAIN macro here instead.
2018-06-12 15:03:51 +02:00
be57cf9b2a Cleanup: remove moar G.main from BKE area. 2018-06-12 12:53:27 +02:00
5508b572ea Cleanup: remove some G.main from ED's animsys.
The easy ones - there some much, much trickier to tackle there...
2018-06-12 12:28:14 +02:00
75bcb70c60 Cleanup: remove some G.main from BKE area. 2018-06-12 11:21:54 +02:00
7bf4023689 Fix T55448: Typo in Cycles CUDA debug output
Reviewers: sergey, lukasstockner97

Reviewed By: lukasstockner97

Tags: #cycles, #bf_blender

Differential Revision: https://developer.blender.org/D3472
2018-06-12 10:45:32 +02:00
78a8d3685b Cleanup: remove moar ugly G.main usages...
BKE_image was an ugly nest, could fix all but the ones from compositor,
so moved ugly G.main there, at least we know where the Evil is that way ;)
2018-06-11 15:40:37 +02:00
b763c34e80 Cycles: Cleanup, silence strict compiler warning
There is one legit place in the code where memcpy was used as an
optimization trick. Was needed for older version of GCC, but now
it should be re-evaluated and checked if it still helps to have
that trick.

In other places it's somewhat lazy programming to zero out all
object members. That is absolutely unsafe, at the moment when
less trivial class is used as a member in that object things
will break.

Other cases were using memcpy into an object which comes from
an external library. We don't control that object, and we can
not guarantee it will always be safe for such memory tricks
and debugging bugs caused by such low level access is far fun.

Ideally we need to use more proper C++, but needs to be done with
big care, including benchmarks of each change, For now do
annoying but simple cast to void*.
2018-06-11 13:02:10 +02:00
a6e582164f Libmv: Cleanup, make strict compiler more happy
In C++ it is not really safe to memcpy objects, and newer GCC will warn
about this. However, we don't use our vector for unsafe-to-memcpy objects,
so just explicitly silence that warning.
2018-06-11 13:02:10 +02:00
d0956e9cb3 Cleanup: Moar G.main removal of Hell.
This commit actually adds some G.main... but at much, much higher level
than the ones it removes, so should still be better ;)
2018-06-11 12:15:14 +02:00
8055ed2741 Cleanup: remove some G.main usages... 2018-06-11 12:15:14 +02:00
13d238729b Fix bad level stubs 2018-06-11 11:36:22 +02:00
28c34ae7e2 Cleanup: Use BLI_strncpy
It has behavior which we expect, and silences strict compiler warning.
2018-06-11 11:06:15 +02:00
4d339f56fe Fix T55278: Lightmap Pack > New Image broken when active object is None
thanx bblanimation (Christopher Gearhart) for spotting the issue and
providing the fix!

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3449
2018-06-11 11:02:07 +02:00
9e8bd3a072 path_util: avoid overflow w/ strtoll use
Also style cleanup.
2018-06-11 10:46:02 +02:00
1d8d4e03f5 Fix PyConsole: Drag events finished early in modal text selection 2018-06-11 10:18:51 +02:00
7ac0272b77 Fix T55140: opened image doesn't show up in movie clip editor
atoi usage in BLI_stringdec could overflow, use strtoll instead and
check
valid range with INT_MIN and INT_MAX

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3452
2018-06-11 09:57:16 +02:00
474a145d78 Fix T55349: crash adding paint slot when object is on hidden layer
use better poll and get ob with 'ED_object_active_context' (instead of
'CTX_data_active_object')

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3467
2018-06-11 09:12:29 +02:00
d0a16772ad WM: add macros to check mouse button/gesture/wheel
Use to check click/drag,
fixes issue with mouse wheel triggering pie menu.
2018-06-10 12:08:09 +02:00
ae01df5779 Cleanup: trailing space in CMake files 2018-06-10 08:19:03 +02:00
2e14b7fb97 RNA: remove Layout.introspect
This was added as an experiment to extract information for docs
but this was never all that useful for its intended purpose.
2018-06-09 18:55:51 +02:00
83cb34ccd1 Cleanup: unused functions 2018-06-09 18:47:39 +02:00
638de72277 Cleanup: remove some G.main usages. 2018-06-09 15:17:04 +02:00
fb565ddb68 Cleanup: trailing space in RNA 2018-06-09 14:40:09 +02:00
56a47e58f4 Cleanup: style 2018-06-09 14:30:32 +02:00
9bcced83ee GHOST/X11: Print the keycode w/ debug enabled 2018-06-09 12:53:39 +02:00
6f4c7f1f01 GHOST/X11: Correct non-latin kb workaround case
Harmless since this is always enabled,
only do this for easier troubleshooting when disabling the define.
2018-06-09 12:04:07 +02:00
f3427cbc98 GHOST/X11: support accessing physical keycodes
This means we can check keys such as tilde in a generic way.
2018-06-09 11:23:41 +02:00
5165d62931 WM: correct recent change to click/drag detection
fb1915d870 - caused click/drag events not to be detected.

Now check a key is a mouse or keyboard event.
2018-06-08 22:17:21 +02:00
1857823839 WM: fix panel drag event handling 2018-06-08 18:58:41 +02:00
2dc7555522 WM: fix node link & background drag 2018-06-08 18:55:47 +02:00
540e85d567 GHOST/X11: Map unknown es,dk keys to accentgrave 2018-06-08 15:21:20 +02:00
4127aeb7a5 GHOST/X11: Map unknown de,fr keys to accentgrave
This still uses the correct string when typing text,
it just allows the key to be used in keymaps.

We should eventually add scan-code support.
2018-06-08 14:53:03 +02:00
fb1915d870 Prevent wheel causing spurious click/drag events 2018-06-08 14:09:45 +02:00
7b6af843c2 Cleanup: getting rid of G.main.
Sometimes one needs a *lot* of changes for a single G.main... :/
2018-06-08 12:17:22 +02:00
55606dbdbc CMake: disable WITH_COMPILER_ASAN for CMAKE_BUILD_TYPE Release 2018-06-08 11:45:53 +02:00
dff8a7db73 Fix regression in grease pencil drawing
Drag events finished drawing early.
2018-06-08 10:52:49 +02:00
20367898fe Fix T55301: Transform confirm on release fails w/ MMB 2018-06-08 08:48:21 +02:00
e3fe8ce00b WM: backport event/keymap type util from 2.8 2018-06-08 08:46:31 +02:00
a25c11fd8d Cleanup: trailing space
Remove from blender/nodes, collada, blenfont & render.
2018-06-08 08:07:48 +02:00
009c38df53 Fix recently added drag events closing menus 2018-06-08 08:01:43 +02:00
8f49299134 WM: fix drag events applying after release 2018-06-07 20:39:17 +02:00
cfc1ddeff7 GHOST/X11: Xinput/XIM support caused double key-up
All keyboard events were sending double key events (including modifiers)
when xinput was enabled with gnome (causing much confusion!).

I cant test if XIM works,
but this isn't useful to send double events, so disabling for now.
2018-06-07 20:35:06 +02:00
80dcb2ced8 Cleanup: typo, and 0 -> false for booleans. 2018-06-07 18:36:16 +02:00
d274c64d22 WM: add support for drag events
This allows for a single key to be mapped to both release and drag,
useful for pie menus to share a key with a different action.
2018-06-07 17:06:01 +02:00
df4525d1d9 Fix key repeat events resetting the click timer 2018-06-07 16:52:40 +02:00
863e395ad8 Cleanup: trailing space for windowmanager 2018-06-07 16:43:52 +02:00
e19686a35a WM: check for release instead of not pressed
Makes reasoning about events more predictable.
2018-06-07 16:19:59 +02:00
8a2db3ed21 Fix crash due to missing init of new bAnimContext bmain member in transform code.
From own previous G.main-busting commit.
2018-06-07 15:38:31 +02:00
6242940639 Fix double free in dyntopo-sculpt mode undo 2018-06-07 14:54:09 +02:00
5330f1c5d1 Fix sculpt assert on initialization 2018-06-07 13:39:49 +02:00
b3a7a75a26 Cleanup: remove moar G.main usages.
Notes:
* Really need to address RNA setters case, end up adding way too much
G.main here these days... :/
* Added Main pointer into bAnimContext, helps a lot in anim code ;)
2018-06-07 12:48:29 +02:00
16017178b2 Revert "Cycles: Cleanup: Don't use return on function returning void"
Not sure why exactly it is called a cleanup, the code was much more clear
and robust against possible missing return statements which are MANDATORY.

Missing return statement will:

- Cause two different BVH traversals to be run.

  Not is happening currently, but if more BVH layouts are added, it will
  become a problem.

- It is already causing assert() statements to fail, since functions are
  no longer returning when they are supposed to.

If there is any measurable reason to keep this change, let me know.
Otherwise just stick to reliable/tested/robust code.

This reverts commit ba65f7093b.
2018-06-07 11:57:57 +02:00
54f9cd5283 Cleanup: Nuke moar G.main usages... 2018-06-07 11:11:46 +02:00
409cfba1a3 Python API: Initial 'imbuf' API
Support only basic operations new/load/write & resize.

Add now so we can extend as needed & more easily accept patches.
2018-06-07 08:00:13 +02:00
0e68751b8a Fix BLI_ASSERT_UNIT macro w/ non-finite numbers 2018-06-06 19:49:27 +02:00
70b705b5fe UI: NLA: Influence should be a factor (RNA) 2018-06-06 12:09:13 -04:00
de702a4803 Alembic export: only free duplilists when not NULL 2018-06-06 15:54:03 +02:00
bfbd85e9d6 Fix error using freed bmain
Regression in 481cdb08ed
2018-06-06 09:36:50 +02:00
713027b832 make.bat : move all experimental options to their own section in the help. 2018-06-05 11:29:03 -06:00
983811607d make.bat : bring the help up to date with recent additions to the build script. 2018-06-05 10:40:14 -06:00
cd58ce85c2 make.bat : check for existence of ninja before using it. 2018-06-05 10:39:39 -06:00
5e44324b79 make.bat: change the way the vs buildtools are detected.
The recent change also used the buildtools instead of the regular compiler, you now have to explicitly state what you want to use :

2017 - the standard msvc compiler
2017pre - the msvc compiler from the preview installation
2017b - the msvc compiler from the buildtools installation
2018-06-05 10:38:48 -06:00
1628a6858e Fix crash in owmn previous commit. 2018-06-05 17:54:53 +02:00
481cdb08ed Cleanup: use new accessors to blendfile path (Main.name). 2018-06-05 16:33:46 +02:00
1d97e948d2 Cleanup: add hleper functions to get filepath from Main.
This helps making things clearer and cleaner. Func returning filepath of
G.main is separate, so that we can easily track its usages, and
hopefully deprecate it at some point. Though that usage of G.main is
likely the less evil one, you nearly always want current blendfile path
in those cases anyway.
2018-06-05 16:33:46 +02:00
c68429bc03 Cleanup: pep8
Use 'autopep8 --ignore E721,E722' on our UI code, only minor changes.
2018-06-05 16:32:11 +02:00
d860d23e1a make.bat: cache the vcredist directory.
When run from make.bat the environment is setup correctly and the VCToolsRedistDir environment variable exists, on later invocations of cmake this may no longer be the case and a warning was emitted about the missing runtime. we can't rely on InstallRequiredSystemLibraries.cmake here since it uses the compiler version to figure out the correct location and it doesn't know how to deal with clang.
2018-06-05 07:25:37 -06:00
88b46a6ce9 make.bat : Fix clang+asan msbuild project generation 2018-06-04 22:35:57 -06:00
6fee105943 Cleanup: correct menu name 2018-06-04 19:09:52 +02:00
58e8c71cbd Cleanup: strip ghost trailing space 2018-06-04 18:47:57 +02:00
f6740993f7 Cleanup: strip tests trailing space 2018-06-04 18:47:31 +02:00
747534af00 Particle System: move data creation into RNA update
Relying on evaluation to initialize data causes issues w/ 2.8.
2018-06-04 17:55:19 +02:00
7277f8973b Fix T55260: load Text File with Python from GUI Button results in 0 User
Let's just always ensure user_one when loading text from operator...
2018-06-04 12:46:59 +02:00
44505b38df Cleanup: strip trailing space in editors 2018-06-04 09:31:30 +02:00
6654e109df Cleanup: strip trailing space in GPU module 2018-06-04 09:09:12 +02:00
2d3d76693a Cleanup: newlines at EOF for Python modules 2018-06-04 08:54:40 +02:00
7719c11006 Cleanup: strip trailing space in Python module 2018-06-04 08:54:40 +02:00
854db8951b Cleanup: strip trailing space in bmesh module 2018-06-04 08:49:47 +02:00
ba65f7093b Cycles: Cleanup: Don't use return on function returning void 2018-06-04 00:07:17 +02:00
38eb91c848 Cleanup: correct variable name, doxy sections 2018-06-03 17:06:13 +02:00
335b193336 Cleanup: add argument names to screen callbacks 2018-06-03 15:11:31 +02:00
6221180963 Cleanup: remove blockscale & handler
Replace with link_flag, currently unused,
needed for dynamic space types which is planned.
2018-06-03 11:12:50 +02:00
815b1f24fa build_environment: support for msvc2017 and newer cmake.
-expanded build_deps.cmd with 2017 support, it can't locate msvc2017 so needs to be run from developer prompt.
-Newer cmake was unhappy with openal's cmakelists.txt
-collada has warning as error on and errored out on new msvc2017 warnings.
2018-06-02 13:59:56 -06:00
2ef695fabf build_environment: fix paths in osl.diff 2018-06-02 13:18:22 -06:00
Dalai Felinto
fec317de8d --debug-gpu-shader: Dump GLSL shaders to disk
This is really convenient for development. Either for profiling the
generated shaders or to check if the generated code is correct.

It writes the shaders to the temporary blender session folder.

(ported over from blender2.8)
2018-06-02 20:29:27 +02:00
c140f11946 Cleanup: warning 2018-06-02 11:58:01 +02:00
75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
051e186d5c Cleanup: some more G.main removal from editor code. 2018-06-01 17:08:38 +02:00
7c75c2db4f Add Asan support for clang on windows.
This will currently only work for the RelWithDebInfo configuration since asan
does not support the debug crt. for source line information in the reports,
you need a copy of llvm-symbolizer in the blender folder or set the
ASAN_SYMBOLIZER_PATH environment variable to point to it. Currently (as of
6.0.0) llvm-symbolizer does not ship with the binary clang/llvm distribution.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3446
2018-05-31 11:50:30 -06:00
cfea9c261c Cleanup: Remove G.main from some editor files. 2018-05-31 18:23:20 +02:00
da11e33b26 Cleanup: remove G.main from BKE mball code. 2018-05-31 16:44:05 +02:00
16100f8261 Cleanup: get rid of last G.main usages in BKE library code. 2018-05-31 16:04:04 +02:00
b53d358261 Cleanup: remove G.main from BKE modifier. 2018-05-31 15:24:30 +02:00
28369f725c Cleanup: remove G.main from BKE object
Had to add some G.main to modifiers, but in 2.8 we do not need that
anymore, so it's not that bad! ;)
2018-05-31 12:27:47 +02:00
24d1829243 Cleanup: nuke G.main out of BKE PackedFile code. 2018-05-31 11:07:14 +02:00
84a9647f22 Cleanup: use doxy sections for space types
Also use struct names in enum/define comments.
2018-05-31 09:49:58 +02:00
d9324b61d5 Cleanup: return types in stubs 2018-05-31 09:49:44 +02:00
Hristo Gueorguiev
6c0705009e Fix OpenCL compilation error - BPT without SSS. 2018-05-31 00:08:56 +02:00
c0f42a7526 make.bat: fix support for building with just the build tools installed. 2018-05-30 11:11:35 -06:00
10a2562bc5 Fix missing movieclip ID type in allowed ones for Outliner... 2018-05-30 16:14:55 +02:00
18c12803bd Edit Mode: add success return value
Also remove fix for T6614, since BKE_object_obdata_is_libdata
no longer checks proxy.
2018-05-30 08:41:06 +02:00
2c03d6a12b DNA: add OB_DATA_SUPPORT_EDITMODE macro 2018-05-30 07:31:35 +02:00
f7af08b5fe Cleanup: Get rid of G.main in BKE_material.
Note that in some cases, this only moves the G.main case to somne other
places - in particular, RNA getters/setters are becoming annoying here...
2018-05-29 15:49:21 +02:00
c72a204001 make.bat : fix release build not getting the right settings. 2018-05-28 21:50:59 -06:00
d6a4b23f8b make.bat : improve error message while detecting the msvc runtime when using clang 2018-05-28 20:07:24 -06:00
9450792bf2 make.bat : add support for building with ninja and clang together. 2018-05-28 19:56:17 -06:00
81060ff6b2 Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming

Things to note:

1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)

2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)

victor_cpu
	msvc:3099.51
	clang:2796.43

pavillon_barcelona_cpu
	msvc:1872.05
	clang:1827.72

koro_cpu
	msvc:1097.58
	clang:1006.51

fishy_cat_cpu
	msvc:815.37
	clang:722.2

classroom_cpu
	msvc:1705.39
	clang:1575.43

bmw27_cpu
	msvc:552.38
	clang:561.53

barbershop_interior_cpu
	msvc:2134.93
	clang:1922.33

3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.

4) X64 only currently, X86 builds but crashes on startup.

5) Tested with llvm/clang 6.0.0

6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration

7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.

8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.

9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
dc0eed178a Fix Cycles + OSL build error, pass main to node editing functions. 2018-05-28 00:04:14 +02:00
fd2c48726f UI: center align number buttons w/o text
This makes supporting split properties and text possible, see T54951
2018-05-27 21:08:50 +02:00
38cb29d67e Cleanup: Nuke most of remaining evil G.main from RNA.
The few ones in getters/setters we cannot remove as easily, for now we
can live with those I think...
2018-05-27 18:46:39 +02:00
edce44d693 Cycles: Fix problems in the IES loader when rendering with no file selected 2018-05-27 17:16:15 +02:00
56254a42e0 UI: replace BLI_strncpy w/ memcpy
Size is already checked.
2018-05-27 12:50:03 +02:00
bc3727a943 Recently added IES conflicts w/ EEVEE 2018-05-27 11:01:46 +02:00
06cb460cd7 3D View: minor change to NDOF view orbit
This change is needed for 2.8, where the NULL check isn't a reliable way
of testing if dynamic offset is needed.
2018-05-27 10:34:01 +02:00
12a9e9ae33 Fix restrict error in BLI_str_format_byte_unit
Don't use sprintf to append a string to it's self.

Also correct BLI_str_rstrip_float_zero's return value.
2018-05-27 10:28:04 +02:00
7a0699db34 make.bat : Fix builtime.txt being written in the wrong folder. 2018-05-26 19:20:07 -06:00
48155c210a Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.

Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.

The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.

The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.

Reviewers: #cycles, dingto, sergey, brecht

Reviewed By: #cycles, dingto, brecht

Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey

Differential Revision: https://developer.blender.org/D1543
2018-05-27 01:24:57 +02:00
ef502854fe Threads: add spinlock hit for hyperthreading processors on Windows.
Suggested by Percy Ross Tiglao.
2018-05-26 22:35:30 +02:00
c9db7ceff2 make.bat: Add support for building with ninja.
ninja is an alternative to msbuild designed for fast rebuilds. However there is no IDE support, builds only from the command line.

Comparison between msbuild and ninja for a full build, build time in seconds.

Full Clean Build
msbuild     867.5
Ninja       801.2
Difference  -66.3 (-7.6%)

Minor Change
msbuild      43.0
Ninja        14.9
Difference  -28.1 (-64.4%)

No Changes
msbuild      23.0
Ninja         6.1
Difference  -16.9 (-73.5%)
2018-05-25 21:46:42 -06:00
bae880dc9e make.bat/cleanup: removed stray echo in make.bat 2018-05-25 17:59:07 -06:00
857e4e04d8 make.bat: refactor make.bat
make.bat was starting to become hard to maintain, this refactors it into separate batch files for each stage of the process.

-Improved detection of msvc2013/2015
-Improved failure handling.
-Added check for working msbuild and C++ compiler
-Added verbose switch to ease trouble shooting.
-Added Check if svn/cmake/git are in the path before using them
-Display the build configuration before asking to download the libraries
-Offer an option to recover an interrupted checkout of the libraries.
-Automatically check out sub-modules in-case they are missing.
2018-05-25 17:57:13 -06:00
4dee702332 Add number and memory size formatting throughout the UI
This commit adds number formatting (thousands separator) to the baking panel. It also adds a new function to format memory sizes (KB/GB/etc) and applies it to the baking panel and scene stats. The new function is unit tested.

Reviewers: Severin
Tags: #user_interface
Differential Revision: https://developer.blender.org/D1248
2018-05-25 22:41:49 +02:00
9dca74f0e5 [windows/make.bat] use a more reliable way of locating visual studio 2017.
The registry hack we were using wasn't very reliable, the recommended way to locating visual studio is using vswhere (15.2 and up), using it also allows to switch between the regular and pre-release versions.
2018-05-25 10:24:01 -06:00
9812943931 WM: check modal handlers for keymap lookups
Keep in sync with 2.8x
2018-05-25 10:51:05 +02:00
e31b8303ed UI: fix assert
Replace hard-coded button size check with UI_UNIT_X.

Caused icon-only buttons to have strings assigned based on UI-scale.
2018-05-25 10:45:48 +02:00
d02335a195 3D View: add pixelsize function w/o UI scale 2018-05-25 10:00:51 +02:00
5e2f9c5c67 Cycles: Cleanup: Remove duplicated atan2f definition for OpenCL
Turns out that atan2f was already defined for OpenCL.
2018-05-24 19:08:06 +02:00
b4a8b81399 Cycles Denoising: Don't use atomics in the accumulation kernel on CPUs
The GPU kernel needs to use atomics for accumulation since all offsets are processed in
parallel, but on CPUs that's not the case, so we can disable them there for a considerable speedup.
2018-05-24 18:44:56 +02:00
6862762685 Cycles/Compositor: Add arctan2 operation to the Math node
The Math node currently has the normal atan() function, but for
actual angles this is fairly useless without additional nodes to handle the signs.

Since the node has two inputs anyways, it only makes sense to add an arctan2 option.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D3430
2018-05-24 16:46:02 +02:00
8d9faf840b 3D View: remove poll 3D view for copy/paste
These operators only need selected objects.
2018-05-24 16:40:33 +02:00
1318660b04 Fix T55034: Setting duplication group for multiple selected items only
affects one item

UI editing multiple selected items missed the case of PROP_POINTER
properties

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3373
2018-05-24 09:02:17 +02:00
3e9b592b08 Fix Extend property of Lasso select tool in Mask editor not working
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3361
2018-05-24 08:41:13 +02:00
54f2e58452 Fix T54336: Extend property of Lasso select tool in Node editor does not
work

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3360
2018-05-24 08:34:31 +02:00
176e18436c Fix T55137: Compilation failing on non-x86-64 architectures
Some conversion helper functions were (most likely by accident) contained
inside an ifdef for SSE2 support, so on e.g. ARM they would be undefined
and therefore cause compilation to fail.
2018-05-24 01:41:18 +02:00
d886e32270 Cleanup: strip trailing space from interface files 2018-05-23 10:48:50 +02:00
103a31f712 Fix incorrect size in aligned lockfree realloc
Thanks to @alikendarfen for finding.
2018-05-23 07:24:57 +02:00
3ada840e65 blenderplayer: add stubs 2018-05-22 17:56:56 +02:00
76ece90d4a Fix T55093: Bisect + fill crash 2018-05-22 17:23:25 +02:00
28c20fc393 Memory allocator: use lockfree calls internally
Was already used in some areas.
2018-05-22 08:45:47 +02:00
9f66d00287 CMake: only include licences for enabled libs 2018-05-21 18:41:59 +02:00
605e184167 Cleanup: use const for transform internal API 2018-05-21 17:24:14 +02:00
882daeffc5 RNA: support for PARM_OUTPUT & PARM_RNAPTR 2018-05-21 12:34:11 +02:00
6d8aa85051 Fix too much memory usage for Cycles attribute map.
Thanks to Thomas Krebs for identifying the problem and solution.
2018-05-21 11:14:59 +02:00
9f2ae547c0 Fix/workaround RNA build error in C++ API.
It seems output parameter needs to be the last one.
2018-05-21 11:13:56 +02:00
4198c18f15 Cleanup: correct variable names 2018-05-21 10:53:50 +02:00
12a60265cd WM: utility to find a keymap item from an operator
Also RNA access to WM_keyconfig_update,
needed when generating dynamic keymaps used in menus immediately after.
2018-05-21 10:35:44 +02:00
d712dd2f19 Cycles tests: move to render/ folder, to share with Eevee. 2018-05-18 16:46:48 +02:00
e077285745 CMake: Add WITH_COMPILER_ASAN option
This supports easy toggling of Address Sanitizer.
2018-05-18 15:22:16 +02:00
4d19f24ba7 Cleanup: remove deprecated definitions 2018-05-18 15:22:16 +02:00
5e7a21a5f5 Fix T55115: crash when iterating SmokeDomainSettings color_grid property
through python
2018-05-18 14:34:27 +02:00
1cc4ab481e Fix crash drawing polygon curves 2018-05-18 14:23:53 +02:00
cb50c288d4 Add missing header 2018-05-18 13:43:41 +02:00
278e3f7d5f Logging: add --show-log-backtrace
Useful in debug builds to see a functions callers.
2018-05-18 11:00:47 +02:00
96fba1e101 Color: Assume Rec 709 in remaining comp nodes
Part of T54798
2018-05-17 17:20:32 -04:00
0e0d99161a RNA: move enums to rna_rna.c
Needed for use in rna non runtime code.
2018-05-17 19:10:45 +02:00
b290048257 makesrna: error check from 2.8 2018-05-17 19:05:46 +02:00
4461be1b72 Fix T55032: Redo w/ file saved in edit-mode failed
It's important edit-mode has a step stored for redo to work,
file load now ensures this in a generic way.
2018-05-15 19:37:06 +02:00
91504ed26e Fix assert using '//' on an unsaved file
Annoying for debug builds.
2018-05-15 17:27:36 +02:00
3eb9cc69f2 Cleanup: last spacetype enum name 2018-05-15 11:12:49 +02:00
9636cab009 Undo System: remove nested edit-mode undo calls
Regression in recent undo system changes,
This caused T55048.

When each mode had its own undo stack it was important
to initialize it when entering edit-mode.
2018-05-15 10:10:48 +02:00
ae8225ba6d Fix BMesh bisect not flagging dirty indices 2018-05-15 09:04:12 +02:00
43ee4d5d7c Cleanup: quiet GCC -Wtype-limits
While the warning can normally be disabled, we don't have have as much
control of warnings when macros are used.
2018-05-14 09:00:42 +02:00
c1d737eb95 BLI_utildefines: re-ordering array delete macro 2018-05-14 08:38:53 +02:00
b99d064e91 Cleanup: trailing space 2018-05-13 06:44:03 +02:00
c84b8d4801 Cleanup: modifier arg wrapping 2018-05-12 08:04:56 +02:00
f197134426 Platform: macOS. Allow building on directory with whitespace (For example /Volumes/External HD/blender-build) 2018-05-11 21:56:13 +03:00
925e775818 EditMesh: remove duplicate rip macro
Change the fill setting in the keymap,
this allows tool access the macro with either setting.
2018-05-11 20:02:12 +02:00
73a7885ab3 WM: initialize last used macro properties 2018-05-11 20:01:51 +02:00
d5c1c0b10d Fix (unreported) broken freeing code for Sequencer.
Freeing sequencer would always do usercount, which is now forbidden when
called from main ID freeing code.

Annoying in 2.7x, much more critical issue in 2.8!

Also, moved RNA sequencer API functions to proper rna_scene_api.c file.
2018-05-11 11:23:11 +02:00
d7f5520fdf Merge branch 'master' into cloth-improvements 2017-04-20 18:37:07 +02:00
bbf2f3ac2a Merge branch 'master' into cloth-improvements 2017-04-13 15:48:55 +02:00
320771dc74 Copy cache when copying cloth object 2017-04-04 11:56:25 +02:00
607a2d80d3 Replace collision spinlocks with atomic_ops 2017-04-03 16:49:38 +02:00
bc738592df Multithread self collision detection 2017-04-03 16:04:41 +02:00
6b818dcf79 Self collision refactor (prep for threading) 2017-04-03 16:04:41 +02:00
102b2a7418 Multithread object collision detection 2017-04-03 16:04:32 +02:00
5d07a070cb Collision refactor (prep for threading) 2017-04-03 12:00:23 +02:00
87825084d5 Implement cloth trouble indication map
This allows one to set a vertex group, to which "trouble" data is
written. This allows one to see where issues occured for instance in the
event of a cloth explosion.
2017-03-30 19:51:53 +02:00
d6a6417e3b Fix silly mistake in collision impulse clamping
Forgot to ignore clamping when set to zero, so collisions were just
being completely ignored at that value :\
2017-03-19 12:34:11 -03:00
03412896f6 Fix vertex group influence UI 2017-03-18 19:41:34 -03:00
87625ccce9 Fix blenderplayer linking 2017-03-18 19:35:41 -03:00
666a9385c4 Implement collision impulse clamping (to prevent explosions) 2017-03-18 16:53:12 -03:00
6249fb68e0 Fix max subframe handling in adaptive subframes 2017-03-18 13:04:19 -03:00
6edd60d959 Implement instability compensation 2017-03-18 13:03:54 -03:00
fe9debc47b Fix critical collision bug
Collision object coordinates were not being updated when moving back in
time, causing simulation recalculations to somethimes have the collision
object only at the final position on the first simulated frame.

This also changes collision objects to use static bvh (like the cloth
bvh), which should cause a slight performance improvement.
2017-03-17 00:49:58 -03:00
84213a3ce1 Fix basemesh target object poll function 2017-03-16 22:42:50 -03:00
3f0b3a4fb0 Merge branch 'master' into cloth-develop 2017-03-16 17:56:34 -03:00
5ad6bdb021 Implement rest planarity factor scaling 2017-03-15 05:36:44 -03:00
d6bee4bffd Implement weight keys for pinning 2017-03-14 02:50:49 -03:00
b034660643 Implement combined vertex weight by group influeces (Weight Keys) 2017-03-14 02:50:49 -03:00
dbb20c3913 Refactor: remove unnecessary re-initialization
Cloth was being re-initialized whenever pinning settings were changed.
This has been necessary in the past, as pins were only computed during
initialization, but ever since animated vertex weight support was added,
by having pins recalculate on every step, this re-initialization has
become unnecessary.
2017-03-14 02:50:40 -03:00
5315339162 Refactor: remove goal springs in favor of per vert computation 2017-03-14 01:00:16 -03:00
7fa9ab01d6 Implement animated cloth velocity initialization
This allows the initial cloth velocity to be set by the vertex
velocities in the underlying animation.
2017-03-13 01:31:10 -03:00
c6f05db912 Add support for external basemesh object
This allows the usage of a different object as the rest shape, which
enables more flexibility regarding animated rest shapes.
2017-03-12 16:26:49 -03:00
a87cd01425 Remove a few warnings and some cleanup 2017-03-04 01:38:44 -03:00
77df327fa8 Implement normal override for the new collision function 2017-03-04 01:12:11 -03:00
0607cd2e15 Replace plNearestPoints with a deticated solution
Implement a dedicated collision detection function (was previously
relying on Bullet's generic `plNearestPoints`).
This function computes all the collision data to be used for response:
coordinates, distance, direction vector.

This new function has three advantages:

* Remove a dependency from cloth simulation (Bullet).
* Give more pleasing collision results (this function is tailored
specifically for our collision response method).
* Much faster computation (not benchmarked extensively, but observed
overal simulation time was cut roughly in half with "collision-heavy"
simulations).
2017-03-04 00:24:35 -03:00
9f0176d795 Simplify impulse clustering pointer stuff 2017-03-03 20:41:34 -03:00
215df08c0f Expose slice intersection function (math_geom) 2017-03-03 20:36:50 -03:00
7b6d09e9bd Fix stack overflow in spring angle calculation 2017-02-12 01:48:10 -02:00
5e28df26de Fix regression on plasticity caused by sewing springs
I must have been sleeping when I committed the fix for the sewing
springs regression, causing another silly regression on plasticity...
2017-02-04 03:57:26 -02:00
e3b5229da2 Add collision response quality control 2017-02-03 19:59:08 -02:00
bc3b482b9d Implement separate normal override and single sided collisions
This adds single sided collisions without necessarily using normal
override, and adds a separate normal override option. (code can do with
some cosmetic cleanup)

Also removed a printf I had forgotten.
2017-02-01 14:00:13 -02:00
6f9cddec21 Implement collision impulse based adaptive step size calculation 2017-02-01 04:09:54 -02:00
1cc8f2d79b Apply all object collisions simultaneously
This makes all multi-object collisions be solved simultaneously, as not
to give any of them priority over the others (as in the sequential
collision solve that was implemented)

Note that self collisions have not been integrated, and are instead
solved independently after the object collisions. This is so that they
don't have to fight against the object collisions, as those are
generally more robust, and might cause issues with the self collisions.
2017-02-01 01:17:00 -02:00
fdea8ecb5b Implement velocity based adaptive step size calculation 2017-02-01 01:15:13 -02:00
06090d7a31 Implement usage of dt property (preparation for adaptive time steps) 2017-01-31 17:32:18 -02:00
8d1b6b76a2 Use impulse clustering for self collisions
Also adjust impulse scaling to work better with the new clustering.
2017-01-31 03:14:56 -02:00
a32251b4ed Use optimized approximated impulse clustering 2017-01-31 01:53:46 -02:00
4e42d01c65 Implement directional cluster based impulse pruning 2017-01-31 01:39:52 -02:00
ade28fe8a2 Optimization: Use inertial solve for pre-collision
Instead of doing a full implicit pre-collision solve, do a simple
inertial solve (avance using velocities from previous step), this saves
time by doing one less solve per step, and also improves resting
stability by eliminating the influence of external forces disturbing the
mesh in contacting areas.

This improves general cloth performance by about 30-40% in relation to
the new cloth code, and improves performance by about 3 times in
relation to the original cloth code. This also makes collisions more
reliable by removing the need for positional interpolation, and thus
decreases the number of subframes required for a successful solve.
2017-01-30 03:47:11 -02:00
115aea5f2f Optimization: Use static BVH for collision intersection
No need to use moving BVH for intersection checking, as in the end
collisions are only evaluated at the next state anyway, so can use
static BVH to reduce the amount of intersections to check.

Moving BVH will only make sense if ccd is implemented.
2017-01-29 20:40:43 -02:00
5de2fc2679 Use pre-solved locations for col response evaluation 2017-01-29 20:35:46 -02:00
e735eda393 Bring back impulse scaled repulses
It seems I was a bit too optimistic in thinking that just distance based
repulses could handle contacts nicely. Turns out impulse scaled repulses
really have enough of an influence in making the collision response more
effective, that it is worth keeping it for now, even if at the cost of a
very slight stability reduction and and a bit of an increase in
collision elasticity.

I hope to come up with a better solution, and elliminate this, after
cluster based impulse pruning is implemented.
2017-01-28 02:40:14 -02:00
6054fff2a6 Fix regression on sewing springs caused by plasticity 2017-01-24 00:25:45 -02:00
7d99e1418b Remove epsilon from velocity conditional.
Also added a comment about the wrong duplicate impulse elimination being
used.
2017-01-23 17:25:05 -02:00
983d671df8 Fix mistake with backside relative velocities
also removed unused include...
2017-01-22 04:00:38 -02:00
0018eae5ed Enable compression springs for hair 2017-01-21 00:46:30 -02:00
add9835df6 Clean-up some collision data allocation stuff
Self collision pointer logic has been simplified and allocations
reduced, as it only collides with one object (self).

Also, allocation size for all collisions has been reduced to 1/4,
because it was allocating extra space for deprecated stuff.
2017-01-20 02:31:04 -02:00
309b12ac27 Implement self col groups for new self col system 2017-01-20 02:03:05 -02:00
0f5dc7ad80 Remove edgeset stuff (no longer used) 2017-01-20 00:42:43 -02:00
82d3cd586c Remove unused selfbvh stuff 2017-01-19 22:12:48 -02:00
73b9899c92 Move use_normal to col object settings (was in cloth settings) 2017-01-19 22:10:14 -02:00
b2dc669ee7 Use proper friction property for self col and redesign col UI 2017-01-19 22:08:25 -02:00
8d454ff13a Separate self collision distance from object collision distance 2017-01-19 21:23:31 -02:00
998900794d Remove self collision quality (integrated with object collision)
Self collisions are now impulse based, and utilize the same solver as
the object collisions. Having separate quality controls would cause
issues when self and object collisions occur simultaneously.
2017-01-19 20:10:05 -02:00
61f8a1cfd7 Remove old repulsion stuff
Repulsions were long unused, and are now more obsolete than ever, with
the more stable collision response.
2017-01-19 20:06:58 -02:00
403b835992 Remove unused functions in collision.c 2017-01-19 19:38:55 -02:00
8759ec4eae Move fricion to collider object settings 2017-01-19 12:38:07 -02:00
80ed76cb66 New self collision implementation (needs some cleanup) 2017-01-19 02:13:01 -02:00
2d48769a8b Fix stability issue and further make collisions inelastic
The repulse when colliding points are approaching was being scaled
incorrectly by the impulse, causing some undesired elasticity in the
collision. I imagine this was a workaround to avoid penetrations
because the collision responce was being calculated with respect to
the incorrect state, but this is no longer necessary now that that has
been fixed. (had missed this case in my previous elasticity commit)

Other than that, I have bary interpolated the static repulses to avoid a
nasty instability issue in some corner cases.
2017-01-18 23:06:33 -02:00
c8d1bbf31c Fix collision distance calculation (makes collisions perfectly inelastic)
Collision distance was computed with respect to the positions before the
pre-collision solve, but should rather be computed with respect to the
newly solved positions.

This fixes the issue of the collisions being semi-elastic (bouncy),
making them pretty much perfectly inelastic. This also improves the
effectiveness of the collision response, preventing penetrations even
with far less collision steps.
2017-01-17 22:05:25 -02:00
d4a46809d0 Implement single sided collisions 2017-01-16 23:31:22 -02:00
9596871292 Fix collision response scalings (had missed a few before) 2017-01-16 01:42:13 -02:00
22f67557d1 Make caching a bit more sane (fixes plasticity issue)
This cleans up the cloth caching logic a bit.

Now, a simulation step only occurs if the current time is exactly one
frame after the last simulated step, thus preventing time gaps and
runtime data corruption. Also, now the cloth is only re-initialized
if the cache is actually outdated, instead of always being reset when
on the first frame.

This solves a bug where the cache was freed when moving the time to
a point within the cached period.

These changes also fix the issue of non-cached runtime simulation state
properties (e.g. plasticity) being reset when going to the first frame
or retaining a future state when simulating over an existing cache with
time gaps.
2017-01-13 20:10:22 -02:00
63f023111d Apply collision responce on state before pre-collision solve (breaks selfcol)
This uses the pre-collision solve result only to find the collisions and
calculate the responce impulses, but rolls back to before the
pre-collision solve when it is time to actually apply the responce.

This prevents the cloth from undergoing a double solve per time-step,
which essentially made colliding clothes move much faster than
non-colliding clothes.
2017-01-12 22:41:50 -02:00
66d19ebeb3 Remove weird impulse scaling 2017-01-12 14:54:43 -02:00
69e8ee7851 Fix collision extra solve update and remove redundant result applies 2017-01-12 02:05:28 -02:00
5aacca55fa UI Cleanup: Add new property scaling panel 2017-01-07 02:04:57 -02:00
a6c0ab8cb5 UI Cleanup: Add dedicated cloth shape panel 2017-01-07 00:44:25 -02:00
fb542eadd4 UI Cleanup: Separate object collisions from self collisions 2017-01-07 00:44:25 -02:00
f30048504b UI Cleanup: Remove scaling flag 2017-01-07 00:44:24 -02:00
e3df66f1b7 UI Cleanup: Separate shrinking from sewing 2017-01-07 00:44:24 -02:00
d1b25a08d7 UI Cleanup: Remove cloth pin flag 2017-01-07 00:44:24 -02:00
3fb5d20cc0 UI Cleanup: Reorganize main cloth panel and improve tool-tips
Also removed the "vel_damping" option from the UI, because it sucks,
and nobody shall ever use, or speak of it again. (though I left its
implementation and RNA definition, for historic reasons perhaps?)
2017-01-07 00:44:24 -02:00
63aaa7c84a Fix artifacts caused by double plastic computation whith collisions 2017-01-06 18:00:23 -02:00
929aa7c046 Fix plasticity issue with shearing springs 2017-01-06 04:45:37 -02:00
55b9eebede Implement rest planarity factor option 2017-01-06 04:45:26 -02:00
887dfc298d Refactor/Optimization: Integrate bend springs into struct/shear
A bending spring runs along each structural and shearing spring. Taking
advantage of that, this integrates the required data for both into the
same spring struct instance. This greatly simplifies bending spring
generation code, and also reduces the memory usage for spring storage
in about 40-50%.

This change also fixes minor memory management issues.
2017-01-05 20:48:48 -02:00
a2dbe9f340 Cleanup: Fix some returns and potential memory leaks 2017-01-05 00:43:54 -02:00
81a8a015b8 Cleanup: fix some types, and remove unused var 2017-01-05 00:38:31 -02:00
4cbb4bc6be Fix mistake in angular spring generation 2017-01-05 00:33:19 -02:00
85af281f85 Implement angular spring support for dynamic mesh 2017-01-04 21:49:56 -02:00
d12c650349 Implement proper sub-step independent plasticity scaling 2017-01-04 19:47:48 -02:00
bb32d9240f Implement angular plasticity (has issues)
Same issues as the previous structural plasticity commit.
2016-12-15 21:10:27 -02:00
eca3877ac4 Implement structural plasticity (has issues)
The issue here is that the rest length factor isn't cached, because the
cache only allows you to store a single type of data per cache (I'll try
to fix this later), so if you interrupt the simulation midway through,
going to the start frame, the plastic deformations will be reset.
2016-12-15 21:10:11 -02:00
e843c10ad5 Fixed some typos, and missing initializations 2016-12-15 15:21:29 -02:00
dc526671c7 Implement angular bending damping 2016-12-08 19:35:33 -02:00
1d8a08fb9f Add some comments about methods used for mass-spring model 2016-12-08 16:32:09 -02:00
54186c5aa9 Set better default values for the new mass-spring model 2016-12-08 16:32:08 -02:00
f9dad94d9e Implement bending springs along shear springs within polygons
This adds bending springs within polygons, so that they resist
changing planarity.
2016-12-08 16:32:08 -02:00
8a0d8ddf27 Implement shear springs for ngons 2016-12-08 16:32:08 -02:00
cb4d349803 Initial implementation of angular bending springs
This implements bending resistant forces between adjacent polygons in
cloth simulation. Note that derivatives are not yet included in the
computations (and might not even be needed, as the simulation is already
quite stable). Angular damping is not yet implemented either.
2016-12-08 16:31:51 -02:00
ce6227b6be Add cent_poly_v3 function 2016-12-06 22:04:59 -02:00
04e157e44a Rename angular hair spring things to hair instead of angular
This is to make a clear distinction between the existing angular hair
springs, and the new generic angular springs.
2016-12-05 21:39:29 -02:00
5d2a092f40 Scale damping by spring length as well
I had forgotten to scale the damping forces...
This made for uneven damping on irregular meshes.
2016-12-05 13:01:55 -02:00
73fd331025 Fix previous error with spring length scaling
Zero-length springs weren't being scaled properly, leading to phantom
forces that introduced rigid-body motion into the simulation.
2016-12-05 12:58:57 -02:00
56c21ff707 Implement improved compression model
This implements the Choi and Ko compression model, with an added damping
component, instead of using the same model as for tension, which
improves stability of the internal forces.
2016-12-05 12:15:12 -02:00
c03db4c501 Code clean-up (remove unnecessary struct members and add comments)
Spring forces and jacobians (f, dfdx and dfdv), were unnecessarily being
stored in sring struct. They are only used locally at computation time,
and don't have to remain in memory.

editrestlen was unused.
2016-12-04 01:49:57 -02:00
fa5669164b Implement separate tension and compression components 2016-12-01 10:15:36 -02:00
5721918848 Separate shear damping from structural damping 2016-11-30 17:44:27 -02:00
dc6fd8a257 Make structural springs act in both extension and compression 2016-11-30 17:05:35 -02:00
fe5735c6cf Fix spring force scaling based on length 2016-11-30 17:04:59 -02:00
97b232ec70 Separate cloth shear from structural stiffness 2016-11-30 00:26:13 -02:00
4844 changed files with 487213 additions and 354050 deletions

View File

@@ -1,7 +1,6 @@
{
"project_id" : "Blender",
"conduit_uri" : "https://developer.blender.org/",
"git.default-relative-commit" : "origin/blender2.8",
"arc.land.update.default" : "rebase",
"arc.land.onto.default" : "blender2.8"
"git.default-relative-commit" : "origin/master",
"arc.land.update.default" : "rebase"
}

44
.editorconfig Normal file
View File

@@ -0,0 +1,44 @@
# C/C++
[*.{c,cc,h,hh,inl,glsl}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120
# CMake & Text
[*.{cmake,txt}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120
# Python
[*.py]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120
# Shell
[*.sh]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120
# reStructuredText
[*.rst]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 3
max_line_length = 120

8
.gitmodules vendored
View File

@@ -1,20 +1,20 @@
[submodule "release/scripts/addons"]
path = release/scripts/addons
url = ../blender-addons.git
branch = blender2.8
ignore = all
branch = master
[submodule "release/scripts/addons_contrib"]
path = release/scripts/addons_contrib
url = ../blender-addons-contrib.git
branch = master
ignore = all
branch = master
[submodule "release/datafiles/locale"]
path = release/datafiles/locale
url = ../blender-translations.git
branch = master
ignore = all
branch = master
[submodule "source/tools"]
path = source/tools
url = ../blender-dev-tools.git
branch = master
ignore = all
branch = master

View File

@@ -66,21 +66,12 @@ endif()
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
# global compile definitions since add_definitions() adds for all.
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
$<$<CONFIG:MinSizeRel>:NDEBUG>
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
)
else()
# keep until CMake-3.0 is min requirement
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG _DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL NDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO NDEBUG)
endif()
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
$<$<CONFIG:MinSizeRel>:NDEBUG>
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
)
#-----------------------------------------------------------------------------
# Set policy
@@ -165,6 +156,7 @@ option_defaults_init(
_init_OPENCOLORIO
_init_SDL
_init_FFTW3
_init_GAMEENGINE
_init_OPENSUBDIV
)
@@ -205,7 +197,7 @@ mark_as_advanced(WITH_BLENDER)
option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.
@@ -234,10 +226,15 @@ option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced(WITH_SYSTEM_BULLET)
option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE})
if(APPLE)
set(WITH_GAMEENGINE_DECKLINK OFF)
else()
option(WITH_GAMEENGINE_DECKLINK "Support BlackMagicDesign DeckLink cards in the Game Engine" ON)
endif()
option(WITH_PLAYER "Build Player" OFF)
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
option(WITH_CLAY_ENGINE "Enable Clay engine" ON)
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
@@ -319,6 +316,7 @@ option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON)
# Audio/Video format support
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
@@ -381,14 +379,10 @@ if(UNIX AND NOT APPLE)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
if(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
mark_as_advanced(PYTHON_NUMPY_PATH)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
if(WITH_PYTHON_INSTALL)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
mark_as_advanced(PYTHON_NUMPY_PATH)
if(UNIX AND NOT APPLE)
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@ -450,7 +444,7 @@ mark_as_advanced(WITH_MEM_VALGRIND)
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
mark_as_advanced(WITH_ASSERT_ABORT)
option(WITH_BOOST "Enable features depending on boost" ON)
@@ -469,16 +463,28 @@ endif()
# OpenGL
option(WITH_GLEW_MX "Support multiple GLEW contexts (experimental)" OFF )
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
mark_as_advanced(
WITH_GLEW_MX
WITH_GLEW_ES
WITH_GL_EGL
WITH_GL_PROFILE_COMPAT
WITH_GL_PROFILE_CORE
WITH_GL_PROFILE_ES20
)
if(WITH_GL_PROFILE_COMPAT)
set(WITH_GLU ON)
else()
set(WITH_GLU OFF)
endif()
if(WIN32)
option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
mark_as_advanced(WITH_GL_ANGLE)
@@ -504,10 +510,11 @@ if(APPLE)
set(WITH_CXX11 ON)
elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
set(_c11_init ON)
set(_cxx11_init ON)
else()
set(_c11_init OFF)
set(_cxx11_init OFF)
endif()
set(_cxx11_init ON)
option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
mark_as_advanced(WITH_C11)
@@ -520,6 +527,53 @@ if(CMAKE_COMPILER_IS_GNUCC)
mark_as_advanced(WITH_LINKER_GOLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
mark_as_advanced(WITH_COMPILER_ASAN)
if(WITH_COMPILER_ASAN)
set(_asan_defaults "\
-fsanitize=address \
-fsanitize=bool \
-fsanitize=bounds \
-fsanitize=enum \
-fsanitize=float-cast-overflow \
-fsanitize=float-divide-by-zero \
-fsanitize=nonnull-attribute \
-fsanitize=returns-nonnull-attribute \
-fsanitize=signed-integer-overflow \
-fsanitize=undefined \
-fsanitize=vla-bound \
-fno-sanitize=alignment \
")
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
endif()
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
mark_as_advanced(COMPILER_ASAN_CFLAGS)
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
mark_as_advanced(COMPILER_ASAN_CXXFLAGS)
unset(_asan_defaults)
if(NOT MSVC)
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
else()
find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
)
endif()
mark_as_advanced(COMPILER_ASAN_LIBRARY)
endif()
endif()
# Dependency graph
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
if(WIN32)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@ -571,25 +625,28 @@ endif()
#-----------------------------------------------------------------------------
# Check for conflicting/unsupported configurations
if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
if(NOT WITH_BLENDER AND NOT WITH_PLAYER AND NOT WITH_CYCLES_STANDALONE)
message(FATAL_ERROR
"At least one of WITH_BLENDER or WITH_CYCLES_STANDALONE "
"must be enabled, nothing to do!"
"At least one of WITH_BLENDER or WITH_PLAYER or "
"WITH_CYCLES_STANDALONE must be enabled, nothing to do!"
)
endif()
if(NOT WITH_CXX11)
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
endif()
if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
endif()
if(NOT WITH_AUDASPACE)
if(WITH_OPENAL)
message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
message(WARNING "WITH_OPENAL requires WITH_AUDASPACE which is disabled")
set(WITH_OPENAL OFF)
endif()
if(WITH_JACK)
message(FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE")
message(WARNING "WITH_JACK requires WITH_AUDASPACE which is disabled")
set(WITH_JACK OFF)
endif()
if(WITH_GAMEENGINE)
message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
endif()
endif()
@@ -598,6 +655,10 @@ if(NOT WITH_SDL AND WITH_GHOST_SDL)
endif()
# python module, needs some different options
if(WITH_PYTHON_MODULE AND WITH_PLAYER)
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF")
endif()
if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
endif()
@@ -625,10 +686,15 @@ if(NOT WITH_BOOST)
endmacro()
set_and_warn(WITH_CYCLES OFF)
set_and_warn(WITH_AUDASPACE OFF)
set_and_warn(WITH_INTERNATIONAL OFF)
set_and_warn(WITH_OPENVDB OFF)
set_and_warn(WITH_OPENCOLORIO OFF)
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
set_and_warn(WITH_OPENAL OFF) # depends on AUDASPACE
set_and_warn(WITH_GAMEENGINE OFF) # depends on AUDASPACE
set_and_warn(WITH_PLAYER OFF) # depends on GAMEENGINE
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO)
# Keep enabled
else()
@@ -697,9 +763,30 @@ TEST_SHARED_PTR_SUPPORT()
TEST_UNORDERED_MAP_SUPPORT()
if(WITH_AUDASPACE)
if(NOT WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings")
if(WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_DEFINITIONS
-DWITH_AUDASPACE
-DWITH_SYSTEM_AUDASPACE
"-DAUD_DEVICE_H=<AUD_Device.h>"
"-DAUD_SPECIAL_H=<AUD_Special.h>"
"-DAUD_SOUND_H=<AUD_Sound.h>"
"-DAUD_HANDLE_H=<AUD_Handle.h>"
"-DAUD_SEQUENCE_H=<AUD_Sequence.h>"
"-DAUD_TYPES_H=<AUD_Types.h>"
"-DAUD_PYTHON_H=<python/PyAPI.h>"
)
else()
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
set(AUDASPACE_DEFINITIONS
-DWITH_AUDASPACE
"-DAUD_DEVICE_H=<AUD_C-API.h>"
"-DAUD_SPECIAL_H=<AUD_C-API.h>"
"-DAUD_SOUND_H=<AUD_C-API.h>"
"-DAUD_HANDLE_H=<AUD_C-API.h>"
"-DAUD_SEQUENCE_H=<AUD_C-API.h>"
"-DAUD_TYPES_H=<AUD_Space.h>"
)
endif()
endif()
@@ -768,7 +855,8 @@ set(C_WARNINGS)
set(CXX_WARNINGS)
# for gcc -Wno-blah-blah
set(CC_REMOVE_STRICT_FLAGS)
set(C_REMOVE_STRICT_FLAGS)
set(CXX_REMOVE_STRICT_FLAGS)
# libraries to link the binary with passed to target_link_libraries()
# known as LLIBS to scons
@@ -780,6 +868,21 @@ set(PLATFORM_LINKLIBS "")
set(PLATFORM_LINKFLAGS "")
set(PLATFORM_LINKFLAGS_DEBUG "")
if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(WITH_COMPILER_ASAN)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif()
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
endif()
endif()
#-----------------------------------------------------------------------------
#Platform specifics
@@ -952,11 +1055,19 @@ endif()
find_package(OpenGL)
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
if(WITH_GLU)
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
list(APPEND GL_DEFINITIONS -DWITH_GLU)
endif()
if(WITH_SYSTEM_GLES)
find_package_wrapper(OpenGLES)
endif()
if(WITH_GL_PROFILE_ES20)
if(WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE)
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
elseif(WITH_GL_PROFILE_ES20)
if(WITH_SYSTEM_GLES)
if(NOT OPENGLES_LIBRARY)
message(FATAL_ERROR
@@ -1016,9 +1127,6 @@ if(WITH_GL_PROFILE_ES20)
endif()
else()
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
endif()
if(WITH_GL_EGL)
@@ -1066,10 +1174,16 @@ if(WITH_GL_EGL)
endif()
if(WITH_GL_PROFILE_COMPAT)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_COMPAT)
endif()
if(WITH_GL_PROFILE_CORE)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
endif()
if(WITH_GL_PROFILE_ES20)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20)
else()
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
endif()
if(WITH_GL_EGL)
@@ -1106,6 +1220,10 @@ endif()
#-----------------------------------------------------------------------------
# Configure GLEW
if(WITH_GLEW_MX)
list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
endif()
if(WITH_SYSTEM_GLEW)
find_package(GLEW)
@@ -1115,7 +1233,11 @@ if(WITH_SYSTEM_GLEW)
message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
endif()
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
if(WITH_GLEW_MX)
set(BLENDER_GLEW_LIBRARIES ${GLEW_MX_LIBRARY})
else()
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
endif()
else()
if(WITH_GLEW_ES)
set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
@@ -1123,11 +1245,12 @@ else()
list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
# These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
if(WITH_GL_PROFILE_ES20)
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
else()
if(NOT WITH_GL_PROFILE_ES20)
# No ES functions are needed
list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
elseif(NOT (WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT))
# ES is enabled, but the other functions are all disabled
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
endif()
if(WITH_GL_PROFILE_ES20)
@@ -1154,7 +1277,7 @@ else()
list(APPEND GL_DEFINITIONS -DGLEW_STATIC)
# This won't affect the non-experimental glew library,
# This won't affect the non-experimental glew library,
# but is used for conditional compilation elsewhere.
list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
@@ -1164,7 +1287,9 @@ else()
endif()
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
if(NOT WITH_GLU)
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
endif()
#-----------------------------------------------------------------------------
# Configure Bullet
@@ -1358,16 +1483,22 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif()
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_TYPE_LIMITS -Wno-type-limits)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT -Wno-int-in-bool-context)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT -Wno-format)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
endif()
if(NOT APPLE)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -1396,23 +1527,23 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -1444,7 +1575,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
"/wd4267" # conversion from 'size_t' to 'type', possible loss of data
"/wd4305" # truncation from 'type1' to 'type2'
"/wd4800" # forcing value to bool 'true' or 'false'
"/wd4828" # The file contains a character that is illegal
"/wd4828" # The file contains a character that is illegal
# errors:
"/we4013" # 'function' undefined; assuming extern returning int
"/we4133" # incompatible pointer types
@@ -1470,15 +1601,10 @@ if(WITH_PYTHON)
)
endif()
if(WIN32)
if(WIN32 OR APPLE)
# pass, we have this in an archive to extract
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
find_python_package(numpy)
unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
find_python_package(numpy)
endif()
if(WIN32 OR APPLE)
@@ -1509,7 +1635,12 @@ else()
endif()
# Visual Studio has all standards it supports available by default
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
# Clang on windows copies this behavior and does not support these switches
if(
CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR
(CMAKE_C_COMPILER_ID MATCHES "Intel")
)
# Use C99 + GNU extensions, works with GCC, Clang, ICC
if(WITH_C11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
@@ -1563,7 +1694,7 @@ if(WITH_GTESTS)
include(GTestTesting)
endif()
if(WITH_BLENDER)
if(WITH_BLENDER OR WITH_PLAYER)
add_subdirectory(intern)
add_subdirectory(extern)
@@ -1588,6 +1719,13 @@ if(WITH_BLENDER)
endif()
#-----------------------------------------------------------------------------
# Blender Player
if(WITH_PLAYER)
add_subdirectory(source/blenderplayer)
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
@@ -1602,6 +1740,9 @@ include(build_files/cmake/packaging.cmake)
if(WITH_BLENDER)
openmp_delayload(blender)
endif()
if(WITH_PLAYER)
openmp_delayload(blenderplayer)
endif()
#-----------------------------------------------------------------------------
# Print Final Configuration
@@ -1635,6 +1776,8 @@ if(FIRST_RUN)
message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
info_cfg_text("Build Options:")
info_cfg_option(WITH_GAMEENGINE)
info_cfg_option(WITH_PLAYER)
info_cfg_option(WITH_BULLET)
info_cfg_option(WITH_IK_SOLVER)
info_cfg_option(WITH_IK_ITASC)
@@ -1703,7 +1846,10 @@ if(FIRST_RUN)
info_cfg_text("OpenGL:")
info_cfg_option(WITH_GLEW_ES)
info_cfg_option(WITH_GLU)
info_cfg_option(WITH_GL_EGL)
info_cfg_option(WITH_GL_PROFILE_COMPAT)
info_cfg_option(WITH_GL_PROFILE_CORE)
info_cfg_option(WITH_GL_PROFILE_ES20)
if(WIN32)
info_cfg_option(WITH_GL_ANGLE)

View File

@@ -236,10 +236,11 @@ help: .FORCE
@echo " * check_descriptions - check for duplicate/invalid descriptions"
@echo ""
@echo "Utilities (not associated with building blender)"
@echo " * icons - updates PNG icons from SVG files."
@echo " * icons_geom - updates Geometry icons from BLEND file."
@echo " * tgz - create a compressed archive of the source code."
@echo " * update - updates git and all submodules"
@echo " * icons - Updates PNG icons from SVG files."
@echo " Set environment variables 'BLENDER_BIN' and 'INKSCAPE_BIN'"
@echo " to define your own commands."
@echo " * tgz - create a compressed archive of the source code."
@echo " * update - updates git and all submodules"
@echo ""
@echo "Environment Variables"
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
@@ -424,10 +425,6 @@ icons: .FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
icons_geom: .FORCE
BLENDER_BIN="$(BUILD_DIR)/bin/blender" \
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
update: .FORCE
if [ "$(OS_NCASE)" = "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \

View File

@@ -58,4 +58,3 @@ if(MSVC)
DEPENDEES mkdir update patch download configure build install
)
endif()

View File

@@ -33,8 +33,8 @@ set(NUMPY_POSTFIX)
if(WIN32)
set(NUMPY_INSTALL
${CMAKE_COMMAND} -E copy_directory "${BUILD_DIR}/python/src/external_python/run/lib/site-packages/numpy/core/include/numpy" "${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/numpy" &&
${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
)
set(NUMPY_PATCH ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff )
else()

View File

@@ -39,5 +39,6 @@ if(BUILD_MODE STREQUAL Release)
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
)
endif()

View File

@@ -46,7 +46,7 @@ if(MSVC)
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc
)
if(BUILD_MODE STREQUAL Release)

View File

@@ -56,24 +56,27 @@ if(WIN32)
# For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
# TODO FIXME highly MSVC specific
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(MSVC_VERSION GREATER 1909)
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS)

View File

@@ -216,4 +216,3 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -216,4 +216,3 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe")
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -25,7 +25,7 @@ ExternalProject_Add(external_x264
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${X264_HASH}
PREFIX ${BUILD_DIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
--enable-static
--enable-pic
--disable-lavf

View File

@@ -37,4 +37,3 @@ endif()
if(MSVC)
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
endif()

View File

@@ -25,7 +25,7 @@
ARGS=$( \
getopt \
-o s:i:t:h \
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
with-all,with-opencollada,with-jack,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
force-all,force-python,force-numpy,force-boost,\
@@ -104,6 +104,11 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--no-confirm
Disable any interaction with user (suitable for automated run).
--use-cxx11
Build all libraries in cpp11 'mode' (will be mandatory soon in blender2.8 branch).
NOTE: If your compiler is gcc-6.0 or above, you probably *want* to enable this option (since it's default
standard starting from this version).
--with-all
By default, a number of optional and not-so-often needed libraries are not installed.
This option will try to install them, at the cost of potential conflicts (depending on
@@ -285,7 +290,7 @@ SUDO="sudo"
NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=true # Mandatory in blender2.8
USE_CXX11=false
PYTHON_VERSION="3.6.2"
PYTHON_VERSION_MIN="3.6"
@@ -496,6 +501,9 @@ while true; do
--no-confirm)
NO_CONFIRM=true; shift; continue
;;
--use-cxx11)
USE_CXX11=true; shift; continue
;;
--with-all)
WITH_ALL=true; shift; continue
;;
@@ -796,7 +804,7 @@ FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
CXXFLAGS_BACK=$CXXFLAGS
if [ "$USE_CXX11" = true ]; then
WARNING "C++11 is now mandatory for blender2.8, this *should* go smoothly with any very recent distribution.
WARNING "You are trying to use c++11, this *should* go smoothely with any very recent distribution
However, if you are experiencing linking errors (also when building Blender itself), please try the following:
* Re-run this script with '--build-all --force-all' options.
* Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
@@ -2677,10 +2685,10 @@ install_DEB() {
install_packages_DEB $_packages
PRINT""
LIBSNDFILE_DEV="libsndfile1-dev"
check_package_DEB $LIBSNDFILE_DEV
SNDFILE_DEV="libsndfile1-dev"
check_package_DEB $SNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_DEB $LIBSNDFILE_DEV
install_packages_DEB $SNDFILE_DEV
fi
PRINT ""
@@ -3275,10 +3283,10 @@ install_RPM() {
fi
PRINT""
LIBSNDFILE_DEV="libsndfile-devel"
check_package_RPM $LIBSNDFILE_DEV
SNDFILE_DEV="libsndfile-devel"
check_package_RPM $SNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_RPM $LIBSNDFILE_DEV
install_packages_RPM $SNDFILE_DEV
fi
if [ "$WITH_ALL" = true ]; then
@@ -3682,10 +3690,10 @@ install_ARCH() {
install_packages_ARCH $_packages
PRINT""
LIBSNDFILE_DEV="libsndfile"
check_package_ARCH $LIBSNDFILE_DEV
SNDFILE_DEV="libsndfile"
check_package_ARCH $SNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_ARCH $LIBSNDFILE_DEV
install_packages_ARCH $SNDFILE_DEV
fi
PRINT ""

View File

@@ -13,3 +13,25 @@
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
-# endif
-#endif
--- a/boost/type_traits/has_nothrow_assign.hpp 2015-12-13 05:49:42 -0700
+++ b/boost/type_traits/has_nothrow_assign.hpp 2018-05-27 11:11:02 -0600
@@ -24,7 +24,7 @@
#include <boost/type_traits/remove_reference.hpp>
#endif
#endif
-#if defined(__GNUC__) || defined(__SUNPRO_CC)
+#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__clang__)
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/is_assignable.hpp>
--- a/boost/type_traits/has_nothrow_constructor.hpp 2015-12-13 05:49:42 -0700
+++ b/boost/type_traits/has_nothrow_constructor.hpp 2018-05-27 11:11:02 -0600
@@ -17,7 +17,7 @@
#if defined(BOOST_MSVC) || defined(BOOST_INTEL)
#include <boost/type_traits/has_trivial_constructor.hpp>
#endif
-#if defined(__GNUC__ ) || defined(__SUNPRO_CC)
+#if defined(__GNUC__ ) || defined(__SUNPRO_CC) || defined(__clang__)
#include <boost/type_traits/is_default_constructible.hpp>
#endif

View File

@@ -75,7 +75,7 @@ macro(PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
@@ -177,7 +177,7 @@ if(ILMBASE_INCLUDE_DIR)
"\\1" XYZ ${ILMBASE_BUILD_SPECIFICATION})
set("ILMBASE_VERSION" ${XYZ} CACHE STRING "Version of ILMBase lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("ILMBASE_VERSION" "2.0" CACHE STRING "Version of ILMBase lib")
endif()

View File

@@ -175,7 +175,7 @@ if(OPENEXR_INCLUDE_DIR)
"\\1" XYZ ${OPENEXR_BUILD_SPECIFICATION})
set("OPENEXR_VERSION" ${XYZ} CACHE STRING "Version of OpenEXR lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("OPENEXR_VERSION" "2.0" CACHE STRING "Version of OpenEXR lib")
endif()

View File

@@ -6,7 +6,7 @@
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
# and basename_LIBRARY_RELEASE will be set to the release value. If only
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
#
# If the generator supports configuration types, then basename_LIBRARY and
# basename_LIBRARIES will be set with debug and optimized flags specifying the
@@ -53,10 +53,10 @@ macro( select_library_configurations basename )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( ${basename}_LIBRARY
set( ${basename}_LIBRARY
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
set( ${basename}_LIBRARIES
set( ${basename}_LIBRARIES
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
@@ -67,16 +67,15 @@ macro( select_library_configurations basename )
endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
"The ${basename} library" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif( ${basename}_LIBRARY )
mark_as_advanced( ${basename}_LIBRARY
mark_as_advanced( ${basename}_LIBRARY
${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro( select_library_configurations )

View File

@@ -0,0 +1,13 @@
diff -Naur external_openal_original/CMakeLists.txt external_openal/CMakeLists.txt
--- external_openal_original/CMakeLists.txt 2016-01-24 20:12:39 -0700
+++ external_openal/CMakeLists.txt 2018-06-02 12:16:52 -0600
@@ -885,7 +885,8 @@
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
IF(HAVE_WINDOWS_H)
# Check MMSystem backend
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
+ set(CMAKE_REQUIRED_FLAGS "-D_WIN32_WINNT=0x0502")
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
IF(HAVE_MMSYSTEM_H)
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
IF(HAVE_LIBWINMM)

View File

@@ -10,3 +10,29 @@ diff -Naur osl/src/external_osl/src/cmake/flexbison.cmake osl_bak/src/external_o
MAIN_DEPENDENCY ${flexsrc}
DEPENDS ${${compiler_headers}}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
--- osl/src/external_osl/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
+++ osl/src/external_osl/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
@@ -44,12 +44,18 @@
// same if another packages is compiling against OSL and using these headers
// (OSL may be C++11 but the client package may be older, or vice versa --
// use these two symbols to differentiate these cases, when important).
-#if (__cplusplus >= 201402L)
-# define OSL_CPLUSPLUS_VERSION 14
-#elif (__cplusplus >= 201103L)
-# define OSL_CPLUSPLUS_VERSION 11
+
+// Force C++03 for MSVC in blender since svn the libraries are build with that
+#if !defined(_MSC_VER)
+ #if (__cplusplus >= 201402L)
+ # define OSL_CPLUSPLUS_VERSION 14
+ #elif (__cplusplus >= 201103L)
+ # define OSL_CPLUSPLUS_VERSION 11
+ #else
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
+ #endif
#else
-# define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
#endif
// Symbol export defines

View File

@@ -14,10 +14,18 @@ if NOT "%1" == "" (
set BuildDir=VS14
goto par2
)
if "%1" == "2017" (
echo "Building for VS2017"
set VSVER=15.0
set VSVER_SHORT=15
set BuildDir=VS15
goto par2
)
)
:usage
Echo Usage build_deps 2013/2015 x64/x86
Echo Usage build_deps 2013/2015/2017 x64/x86
goto exit
:par2
if NOT "%2" == "" (
@@ -31,6 +39,10 @@ if NOT "%2" == "" (
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017
)
goto start
)
if "%2" == "x64" (
@@ -43,6 +55,10 @@ if NOT "%2" == "" (
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
)
goto start
)
)

View File

@@ -21,8 +21,9 @@ else()
message(FATAL_ERROR "Unknown build environment")
endif()
# Default to only build Blender
# Default to only build Blender, not the player
set(WITH_BLENDER ON CACHE BOOL "" FORCE)
set(WITH_PLAYER OFF CACHE BOOL "" FORCE)
# ######## Linux-specific build options ########
# Options which are specific to Linux-only platforms
@@ -73,7 +74,7 @@ set(SNDFILE_LIBRARY "/usr/lib${MULTILIB}/libsndfile.a;/usr/lib${MULTILI
# OpenAL libraries
set(OPENAL_ROOT_DIR "/opt/lib/openal" CACHE STRING "" FORCE)
set(OPENAL_INCLUDE_DIR "${OPENAL_ROOT_DIR}/include/AL" CACHE STRING "" FORCE)
set(OPENAL_INCLUDE_DIR "${OPENAL_ROOT_DIR}/include" CACHE STRING "" FORCE)
set(OPENAL_LIBRARY
${OPENAL_ROOT_DIR}/lib/libopenal.a
${OPENAL_ROOT_DIR}/lib/libcommon.a

View File

@@ -0,0 +1,12 @@
# This is applied as an override on top of blender_linux.config
# Disables all the areas which are not needed for the player.
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_BLENDER OFF CACHE BOOL "" FORCE)
set(WITH_PLAYER ON CACHE BOOL "" FORCE)

View File

@@ -60,6 +60,7 @@ if 'cmake' in builder:
# Config file to be used (relative to blender's sources root)
cmake_config_file = "build_files/cmake/config/blender_full.cmake"
cmake_player_config_file = None
cmake_cuda_config_file = None
# Set build options.
@@ -77,7 +78,13 @@ if 'cmake' in builder:
# cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')
elif builder.startswith('win'):
if builder.endswith('_vc2015'):
if builder.endswith('_vs2017'):
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 15 2017 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 15 2017'])
elif builder.endswith('_vc2015'):
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
elif builder.startswith('win32'):
@@ -100,13 +107,14 @@ if 'cmake' in builder:
elif glibc == 'glibc211':
deb_name = "squeeze"
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'):
chroot_name = 'buildbot_' + deb_name + '_x86_64'
targets = ['blender']
targets = ['player', 'blender']
elif builder.endswith('i686_cmake'):
bits = 32
chroot_name = 'buildbot_' + deb_name + '_i686'
targets = ['blender']
targets = ['player', 'blender']
cmake_extra_options.extend(["-DCMAKE_C_COMPILER=/usr/bin/gcc-7",
"-DCMAKE_CXX_COMPILER=/usr/bin/g++-7"])
@@ -157,7 +165,9 @@ if 'cmake' in builder:
os.chdir(target_build_dir)
# Tweaking CMake options to respect the target
target_cmake_options = cmake_options[:]
if target == 'cuda':
if target == 'player':
target_cmake_options.append("-C" + os.path.join(blender_dir, cmake_player_config_file))
elif target == 'cuda':
target_cmake_options += cuda_cmake_options
target_chroot_prefix = cuda_chroot_prefix[:]
target_name = 'cycles_kernel_cuda'

View File

@@ -126,6 +126,7 @@ if builder.find('cmake') != -1:
elif builder.startswith('linux_'):
blender = os.path.join(install_dir, 'blender')
blenderplayer = os.path.join(install_dir, 'blenderplayer')
buildinfo_h = os.path.join(build_dir, "source", "creator", "buildinfo.h")
blender_h = os.path.join(blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
@@ -148,7 +149,7 @@ if builder.find('cmake') != -1:
# Strip all unused symbols from the binaries
print("Stripping binaries...")
chroot_prefix = ['schroot', '-c', chroot_name, '--']
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender])
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender, blenderplayer])
print("Stripping python...")
py_target = os.path.join(install_dir, blender_version)

View File

@@ -51,7 +51,7 @@ FIND_LIBRARY(ALEMBIC_LIBRARY
lib64 lib lib/static
)
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# 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)

View File

@@ -40,7 +40,7 @@ FIND_PATH(EIGEN3_INCLUDE_DIR
include/eigen3
)
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG

View File

@@ -52,7 +52,7 @@ FIND_LIBRARY(FFTW3_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fftw3 DEFAULT_MSG

View File

@@ -9,6 +9,7 @@
#
# also defined,
# GLEW_LIBRARY, where to find the Glew library.
# GLEW_MX_LIBRARY, where to find the GlewMX library.
#=============================================================================
# Copyright 2014 Blender Foundation.
@@ -49,7 +50,17 @@ FIND_LIBRARY(GLEW_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
FIND_LIBRARY(GLEW_MX_LIBRARY
NAMES
GLEWmx
HINTS
${_glew_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glew DEFAULT_MSG
@@ -62,6 +73,7 @@ ENDIF(GLEW_FOUND)
MARK_AS_ADVANCED(
GLEW_INCLUDE_DIR
GLEW_LIBRARY
GLEW_MX_LIBRARY
)
UNSET(_glew_SEARCH_DIRS)

View File

@@ -115,7 +115,7 @@ if(Boost_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_icu_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# handle the QUIETLY and REQUIRED arguments and set ICU_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set ICU_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Icu DEFAULT_MSG

View File

@@ -52,7 +52,7 @@ FIND_LIBRARY(JACK_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set JACK_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set JACK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jack DEFAULT_MSG

View File

@@ -53,7 +53,7 @@ FIND_LIBRARY(JEMALLOC_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG

View File

@@ -93,4 +93,3 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
MARK_AS_ADVANCED(
LLVM_LIBRARY
)

View File

@@ -50,7 +50,7 @@ FIND_LIBRARY(LZO_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG

View File

@@ -1,7 +1,7 @@
# - Find OpenCOLLADA library
# Find the native OpenCOLLADA includes and library
# This module defines
# OPENCOLLADA_INCLUDE_DIRS, where to find COLLADABaseUtils/ and
# OPENCOLLADA_INCLUDE_DIRS, where to find COLLADABaseUtils/ and
# COLLADAFramework/, Set when OPENCOLLADA_INCLUDE_DIR is found.
# OPENCOLLADA_LIBRARIES, libraries to link against to use OpenCOLLADA.
# OPENCOLLADA_ROOT_DIR, The base directory to search for OpenCOLLADA.
@@ -129,7 +129,7 @@ FOREACH(COMPONENT ${_opencollada_FIND_STATIC_COMPONENTS})
ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set OPENCOLLADA_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENCOLLADA_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCOLLADA DEFAULT_MSG

View File

@@ -68,7 +68,7 @@ FOREACH(COMPONENT ${_opencolorio_FIND_COMPONENTS})
ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenColorIO DEFAULT_MSG

View File

@@ -106,7 +106,7 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}-${_openexr_libs_ver} ${COMPONENT}
${COMPONENT}-${_openexr_libs_ver} ${COMPONENT}
HINTS
${_openexr_SEARCH_DIRS}
PATH_SUFFIXES
@@ -117,7 +117,7 @@ ENDFOREACH()
UNSET(_openexr_libs_ver)
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG

View File

@@ -64,7 +64,7 @@ FIND_FILE(OPENIMAGEIO_IDIFF
bin
)
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO DEFAULT_MSG

View File

@@ -53,7 +53,7 @@ FIND_LIBRARY(OPENJPEG_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set OPENJPEG_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENJPEG_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG

View File

@@ -50,7 +50,7 @@ FIND_LIBRARY(PCRE_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG

View File

@@ -53,7 +53,7 @@ FIND_LIBRARY(PUGIXML_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PUGIXML DEFAULT_MSG

View File

@@ -175,7 +175,7 @@ UNSET(_IS_INC_CONF_DEF)
UNSET(_IS_LIB_DEF)
UNSET(_IS_LIB_PATH_DEF)
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibsUnix DEFAULT_MSG

View File

@@ -1,15 +1,15 @@
# - Find SndFile library
# Find the native SndFile includes and library
# This module defines
# LIBSNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
# LIBSNDFILE_INCLUDE_DIR is found.
# LIBSNDFILE_LIBRARIES, libraries to link against to use SndFile.
# LIBSNDFILE_ROOT_DIR, The base directory to search for SndFile.
# SNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
# SNDFILE_INCLUDE_DIR is found.
# SNDFILE_LIBRARIES, libraries to link against to use SndFile.
# SNDFILE_ROOT_DIR, The base directory to search for SndFile.
# This can also be an environment variable.
# LIBSNDFILE_FOUND, If false, do not try to use SndFile.
# SNDFILE_FOUND, If false, do not try to use SndFile.
#
# also defined, but not for general use are
# LIBSNDFILE_LIBRARY, where to find the SndFile library.
# SNDFILE_LIBRARY, where to find the SndFile library.
#=============================================================================
# Copyright 2011 Blender Foundation.
@@ -22,26 +22,26 @@
# See the License for more information.
#=============================================================================
# If LIBSNDFILE_ROOT_DIR was defined in the environment, use it.
IF(NOT LIBSNDFILE_ROOT_DIR AND NOT $ENV{LIBSNDFILE_ROOT_DIR} STREQUAL "")
SET(LIBSNDFILE_ROOT_DIR $ENV{LIBSNDFILE_ROOT_DIR})
# If SNDFILE_ROOT_DIR was defined in the environment, use it.
IF(NOT SNDFILE_ROOT_DIR AND NOT $ENV{SNDFILE_ROOT_DIR} STREQUAL "")
SET(SNDFILE_ROOT_DIR $ENV{SNDFILE_ROOT_DIR})
ENDIF()
SET(_sndfile_SEARCH_DIRS
${LIBSNDFILE_ROOT_DIR}
${SNDFILE_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
)
FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h
FIND_PATH(SNDFILE_INCLUDE_DIR sndfile.h
HINTS
${_sndfile_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(LIBSNDFILE_LIBRARY
FIND_LIBRARY(SNDFILE_LIBRARY
NAMES
sndfile
HINTS
@@ -50,18 +50,18 @@ FIND_LIBRARY(LIBSNDFILE_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LIBSNDFILE_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
IF(LIBSNDFILE_FOUND)
SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
ENDIF(LIBSNDFILE_FOUND)
IF(SNDFILE_FOUND)
SET(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
SET(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
ENDIF(SNDFILE_FOUND)
MARK_AS_ADVANCED(
LIBSNDFILE_INCLUDE_DIR
LIBSNDFILE_LIBRARY
SNDFILE_INCLUDE_DIR
SNDFILE_LIBRARY
)

View File

@@ -52,7 +52,7 @@ FIND_LIBRARY(SPACENAV_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set SPACENAV_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set SPACENAV_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Spacenav DEFAULT_MSG

View File

@@ -50,7 +50,7 @@ FIND_LIBRARY(XML2_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set XML2_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set XML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG

View File

@@ -13,7 +13,7 @@ if(NOT DEFINED RPMBUILD)
if(RPMBUILD)
message(STATUS "RPM Build Found: ${RPMBUILD}")
else()
else()
message(STATUS "RPM Build Not Found (rpmbuild). RPM generation will not be available")
endif()
@@ -21,6 +21,6 @@ endif()
if(RPMBUILD)
set(RPMBUILD_FOUND TRUE)
else()
else()
set(RPMBUILD_FOUND FALSE)
endif()
endif()

View File

@@ -16,6 +16,7 @@ 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)
@@ -23,6 +24,7 @@ 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)
@@ -49,6 +51,7 @@ 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)

View File

@@ -5,7 +5,8 @@
# cmake -C../blender/build_files/cmake/config/blender_headless.cmake ../blender
#
set(WITH_HEADLESS ON CACHE BOOL "" FORCE)
set(WITH_HEADLESS ON CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.

View File

@@ -21,6 +21,7 @@ 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)
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
@@ -28,6 +29,7 @@ set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_FRAMESERVER OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)

View File

@@ -16,6 +16,7 @@ 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)
@@ -23,6 +24,7 @@ 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)
@@ -49,6 +51,7 @@ 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_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61 CACHE STRING "" FORCE)

View File

@@ -12,6 +12,9 @@ set(WITH_INSTALL_PORTABLE OFF CACHE BOOL "" FORCE)
# no point int copying python into python
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
# dont build the game engine
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)

View File

@@ -6,6 +6,7 @@
# disable Blender
set(WITH_BLENDER OFF CACHE BOOL "" FORCE)
set(WITH_PLAYER OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_BLENDER OFF CACHE BOOL "" FORCE)
# build Cycles

View File

@@ -51,7 +51,7 @@ endmacro()
function(list_assert_duplicates
list_id
)
# message(STATUS "list data: ${list_id}")
list(LENGTH list_id _len_before)
@@ -242,7 +242,7 @@ function(blender_add_lib__impl
# listed is helpful for IDE's (QtCreator/MSVC)
blender_source_group("${sources}")
#if enabled, set the FOLDER property for visual studio projects
#if enabled, set the FOLDER property for visual studio projects
if(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir})
@@ -326,7 +326,7 @@ function(SETUP_LIBDIRS)
link_directories(${JACK_LIBPATH})
endif()
if(WITH_CODEC_SNDFILE)
link_directories(${LIBSNDFILE_LIBPATH})
link_directories(${SNDFILE_LIBPATH})
endif()
if(WITH_FFTW3)
link_directories(${FFTW3_LIBPATH})
@@ -352,6 +352,11 @@ function(SETUP_LIBDIRS)
endif()
endfunction()
macro(setup_platform_linker_flags)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
endmacro()
function(setup_liblinks
target
)
@@ -407,7 +412,7 @@ function(setup_liblinks
target_link_libraries(${target} ${JACK_LIBRARIES})
endif()
if(WITH_CODEC_SNDFILE)
target_link_libraries(${target} ${LIBSNDFILE_LIBRARIES})
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
endif()
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
target_link_libraries(${target} ${SDL_LIBRARY})
@@ -555,12 +560,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
endif()
endif()
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
list(APPEND BLENDER_LINK_LIBS
audaspace
audaspace-py)
endif()
# Sort libraries
set(BLENDER_SORTED_LIBS
bf_windowmanager
@@ -583,7 +582,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_editor_space_sequencer
bf_editor_space_text
bf_editor_space_time
bf_editor_space_topbar
bf_editor_space_userpref
bf_editor_space_view3d
bf_editor_space_clip
@@ -594,7 +592,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_editor_curve
bf_editor_gpencil
bf_editor_interface
bf_editor_manipulator_library
bf_editor_mesh
bf_editor_metaball
bf_editor_object
@@ -602,7 +599,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_editor_armature
bf_editor_physics
bf_editor_render
bf_editor_scene
bf_editor_screen
bf_editor_sculpt_paint
bf_editor_sound
@@ -615,7 +611,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_python
bf_python_ext
bf_python_mathutils
bf_python_gawain
bf_python_bmesh
bf_freestyle
bf_ikplugin
@@ -623,14 +618,11 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_alembic
bf_bmesh
bf_gpu
bf_draw
bf_blenloader
bf_blenkernel
bf_physics
bf_nodes
bf_rna
bf_editor_manipulator_library # rna -> manipulator bad-level calls
bf_python
bf_imbuf
bf_blenlib
bf_depsgraph
@@ -671,8 +663,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_blenfont
bf_blentranslation
bf_intern_audaspace
audaspace
audaspace-py
bf_intern_mikktspace
bf_intern_dualcon
bf_intern_cycles
@@ -684,7 +674,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
cycles_util
cycles_subd
bf_intern_opencolorio
bf_intern_gawain
bf_intern_eigen
extern_rangetree
extern_wcwidth
@@ -761,6 +750,10 @@ function(SETUP_BLENDER_SORTED_LIBS)
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
endif()
if(WITH_GAMEENGINE_DECKLINK)
list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
endif()
if(WIN32)
list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
endif()
@@ -1048,13 +1041,19 @@ macro(remove_cc_flag
endmacro()
macro(add_cc_flag
macro(add_c_flag
flag)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
endmacro()
macro(add_cxx_flag
flag)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
endmacro()
macro(remove_strict_flags)
if(CMAKE_COMPILER_IS_GNUCC)
@@ -1077,7 +1076,8 @@ macro(remove_strict_flags)
)
# negate flags implied by '-Wall'
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -1089,7 +1089,8 @@ macro(remove_strict_flags)
)
# negate flags implied by '-Wall'
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
endif()
if(MSVC)
@@ -1119,28 +1120,39 @@ endmacro()
# note, we can only append flags on a single file so we need to negate the options.
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
# probably add more removals here.
macro(remove_strict_flags_file
macro(remove_strict_c_flags_file
filenames)
foreach(_SOURCE ${ARGV})
if(CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
set_source_files_properties(${_SOURCE}
PROPERTIES
COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
)
endif()
if(MSVC)
# TODO
endif()
endforeach()
unset(_SOURCE)
endmacro()
macro(remove_strict_cxx_flags_file
filenames)
remove_strict_c_flags_file(${filenames} ${ARHV})
foreach(_SOURCE ${ARGV})
if(CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set_source_files_properties(${_SOURCE}
PROPERTIES
COMPILE_FLAGS "${CXX_REMOVE_STRICT_FLAGS}"
)
endif()
if(MSVC)
# TODO
endif()
endforeach()
unset(_SOURCE)
endmacro()
# External libs may need 'signed char' to be default.
@@ -1522,7 +1534,6 @@ function(find_python_package
NAMES
${package}
HINTS
"${PYTHON_LIBPATH}/"
"${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
"${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
PATH_SUFFIXES

View File

@@ -23,8 +23,6 @@
# Libraries configuration for Apple.
set(MACOSX_DEPLOYMENT_TARGET "10.9")
macro(find_package_wrapper)
# do nothing, just satisfy the macro
endmacro()
@@ -45,7 +43,7 @@ if(WITH_OPENAL)
find_package(OpenAL)
if(OPENAL_FOUND)
set(WITH_OPENAL ON)
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include/AL")
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
else()
set(WITH_OPENAL OFF)
endif()
@@ -81,10 +79,10 @@ if(WITH_JACK)
endif()
if(WITH_CODEC_SNDFILE)
set(LIBSNDFILE ${LIBDIR}/sndfile)
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
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)
@@ -358,7 +356,7 @@ if(WITH_LLVM)
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
else()
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
endif()
@@ -418,7 +416,7 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
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"
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")

View File

@@ -51,9 +51,9 @@ string(REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${XCODE_CHECK}) # truncate
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# earlier xcode has no bundled developer dir, no sense in getting xcode path from
if(${XCODE_VERSION} VERSION_GREATER 4.2)
if(${XCODE_VERSION} VERSION_GREATER 4.2)
# reduce to XCode name without dp extension
string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME)
string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME)
if(${DP_NAME} MATCHES Xcode5)
set(XCODE_VERSION 5)
endif()
@@ -64,7 +64,7 @@ if(${CMAKE_GENERATOR} MATCHES "Xcode")
message(FATAL_ERROR "Xcode 4.3 and higher must be used with cmake 2.8-8 or higher")
endif()
### end cmake incompatibility with xcode 4.3 and higher ###
if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4 AND ${XCODE_VERSION} VERSION_LESS 4.3)
# Xcode 4 defaults to the Apple LLVM Compiler.
# Override the default compiler selection because Blender only compiles with gcc up to xcode 4.2
@@ -85,7 +85,7 @@ if(${XCODE_VERSION} VERSION_LESS 4.3)
else()
# note: xcode-select path could be ambigous,
# cause /Applications/Xcode.app/Contents/Developer or /Applications/Xcode.app would be allowed
# so i use a selfcomposed bundlepath here
# so i use a selfcomposed bundlepath here
set(OSX_SYSROOT_PREFIX ${XCODE_BUNDLE}/Contents/Developer/Platforms/MacOSX.platform)
message(STATUS "OSX_SYSROOT_PREFIX: " ${OSX_SYSROOT_PREFIX})
set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk

View File

@@ -148,7 +148,7 @@ endif()
# Codecs
if(WITH_CODEC_SNDFILE)
find_package_wrapper(SndFile)
if(NOT LIBSNDFILE_FOUND)
if(NOT SNDFILE_FOUND)
set(WITH_CODEC_SNDFILE OFF)
endif()
endif()

View File

@@ -29,7 +29,16 @@ if(NOT MSVC)
message(FATAL_ERROR "Compiler is unsupported")
endif()
# Libraries configuration for Windows when compiling with MSVC.
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(MSVC_CLANG On)
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
if (DEFINED MSVC_REDIST_DIR)
file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR)
else()
message("Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt.")
endif()
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
@@ -119,8 +128,18 @@ set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
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")
remove_cc_flag("/MDd" "/MD")
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
if(NOT WITH_CXX11) # C++11 is on by default in clang-cl and can't be turned off, if c++11 is not enabled in blender repress some c++11 related warnings.
set(CXX_WARN_FLAGS "-Wno-inconsistent-missing-override")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
@@ -131,7 +150,7 @@ 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} /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.
@@ -144,7 +163,7 @@ else()
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
endif()
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
if(NOT DEFINED LIBDIR)
@@ -406,7 +425,7 @@ if(WITH_OPENIMAGEIO)
set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
@@ -455,7 +474,7 @@ if(WITH_OPENVDB)
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include ${TBB_INCLUDE_DIR})
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
endif()
if(WITH_ALEMBIC)
@@ -532,7 +551,7 @@ set(WINTAB_INC ${LIBDIR}/wintab/include)
if(WITH_OPENAL)
set(OPENAL ${LIBDIR}/openal)
set(OPENALDIR ${LIBDIR}/openal)
set(OPENAL_INCLUDE_DIR ${OPENAL}/include/AL)
set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
set(OPENAL_LIBPATH ${OPENAL}/lib)
if(MSVC)
set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/openal32.lib)
@@ -543,10 +562,11 @@ if(WITH_OPENAL)
endif()
if(WITH_CODEC_SNDFILE)
set(LIBSNDFILE ${LIBDIR}/sndfile)
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib) # TODO, deprecate
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
set(SNDFILE ${LIBDIR}/sndfile)
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
set(SNDFILE_LIBRARIES ${SNDFILE_LIBPATH}/libsndfile-1.lib)
endif()
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)

View File

@@ -0,0 +1,14 @@
echo No explicit msvc version requested, autodetecting version.
call "%~dp0\detect_msvc2017.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2015.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
echo Compiler Detection failed. Use verbose switch for more information.
exit /b 1
:DetectionComplete
echo Compiler Detection successfull, detected VS%BUILD_VS_YEAR%
exit /b 0

View File

@@ -0,0 +1,26 @@
if "%NOBUILD%"=="1" goto EOF
echo %TIME% > %BUILD_DIR%\buildtime.txt
msbuild ^
%BUILD_DIR%\Blender.sln ^
/target:build ^
/property:Configuration=%BUILD_TYPE% ^
/maxcpucount:2 ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM% ^
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log
if errorlevel 1 (
echo Error during build, see %BUILD_DIR%\Build.log for details
exit /b 1
)
msbuild ^
%BUILD_DIR%\INSTALL.vcxproj ^
/property:Configuration=%BUILD_TYPE% ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM%
if errorlevel 1 (
echo Error during install phase
exit /b 1
)
echo %TIME% >> %BUILD_DIR%\buildtime.txt
:EOF

View File

@@ -0,0 +1,16 @@
if "%NOBUILD%"=="1" goto EOF
set HAS_ERROR=
cd %BUILD_DIR%
echo %TIME% > buildtime.txt
ninja install
if errorlevel 1 (
set HAS_ERROR=1
)
echo %TIME% >>buildtime.txt
cd %BLENDER_DIR%
if "%HAS_ERROR%" == "1" (
echo Error during build
exit /b 1
)
:EOF

View File

@@ -0,0 +1,53 @@
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_ARCH%"=="x64" (
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
) else if "%BUILD_ARCH%"=="x86" (
set BUILD_VS_SVNDIR=windows_%BUILD_VS_LIBDIRPOST%
)
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
if NOT "%verbose%" == "" (
echo Library Directory = "%BUILD_VS_LIBDIR%"
)
if NOT EXIST %BUILD_VS_LIBDIR% (
rem libs not found, but svn is on the system
echo
if not "%SVN%"=="" (
echo.
echo The required external libraries in %BUILD_VS_LIBDIR% are missing
echo.
set /p GetLibs= "Would you like to download them? (y/n)"
if /I "!GetLibs!"=="Y" (
echo.
echo Downloading %BUILD_VS_SVNDIR% libraries, please wait.
echo.
:RETRY
"%SVN%" checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/%BUILD_VS_SVNDIR% %BUILD_VS_LIBDIR%
if errorlevel 1 (
set /p LibRetry= "Error during donwload, retry? y/n"
if /I "!LibRetry!"=="Y" (
cd %BUILD_VS_LIBDIR%
"%SVN%" cleanup
cd %BLENDER_DIR%
goto RETRY
)
echo.
echo Error: Download of external libraries failed.
echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in
echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successfull blender build
echo.
exit /b 1
)
)
)
)
if NOT EXIST %BUILD_VS_LIBDIR% (
echo.
echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
echo This is needed for building, aborting!
echo.
exit /b 1
)

View File

@@ -0,0 +1,6 @@
set BLENDER_DIR_NOSPACES=%BLENDER_DIR: =%
if not "%BLENDER_DIR%"=="%BLENDER_DIR_NOSPACES%" (
echo There are spaces detected in the build path "%BLENDER_DIR%", this is currently not supported, exiting....
exit /b 1
)

View File

@@ -0,0 +1,20 @@
if NOT exist "%BLENDER_DIR%/source/tools" (
echo Checking out sub-modules
if not "%GIT%" == "" (
"%GIT%" submodule update --init --recursive --progress
if errorlevel 1 goto FAIL
"%GIT%" submodule foreach git checkout master
if errorlevel 1 goto FAIL
"%GIT%" submodule foreach git pull --rebase origin master
if errorlevel 1 goto FAIL
goto EOF
) else (
echo Blender submodules not found, and git not found in path to retrieve them.
goto FAIL
)
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -0,0 +1,74 @@
if "%BUILD_ARCH%"=="x64" (
set MSBUILD_PLATFORM=x64
) else if "%BUILD_ARCH%"=="x86" (
set MSBUILD_PLATFORM=win32
if "%WITH_CLANG%"=="1" (
echo Clang not supported for X86
exit /b 1
)
)
if "%WITH_CLANG%"=="1" (
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
if "%WITH_ASAN%"=="1" (
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
)
) else (
if "%WITH_ASAN%"=="1" (
echo ASAN is only supported with clang.
exit /b 1
)
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS%
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
)
if "%MUST_CLEAN%"=="1" (
echo Cleaning %BUILD_DIR%
msbuild ^
%BUILD_DIR%\Blender.sln ^
/target:clean ^
/property:Configuration=%BUILD_TYPE% ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM%
)
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
if "%MUST_CONFIGURE%"=="1" (
if NOT "%verbose%" == "" (
echo %CMAKE% %BUILD_CMAKE_ARGS% -H%BLENDER_DIR% -B%BUILD_DIR%
)
cmake ^
%BUILD_CMAKE_ARGS% ^
-H%BLENDER_DIR% ^
-B%BUILD_DIR%
if %ERRORLEVEL% NEQ 0 (
echo "Configuration Failed"
exit /b 1
)
)
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
echo msbuild ^
%BUILD_DIR%\Blender.sln ^
/target:build ^
/property:Configuration=%BUILD_TYPE% ^
/maxcpucount:2 ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM% ^
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd
echo msbuild ^
%BUILD_DIR%\INSTALL.vcxproj ^
/property:Configuration=%BUILD_TYPE% ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM% >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd

View File

@@ -0,0 +1,80 @@
ninja --version 1>NUL 2>&1
if %ERRORLEVEL% NEQ 0 (
echo "Ninja not detected in the path"
exit /b 1
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
if "%WITH_CLANG%" == "1" (
set LLVM_DIR=
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
if DEFINED LLVM_DIR (
if NOT "%verbose%" == "" (
echo LLVM Detected at "%LLVM_DIR%"
)
goto DetectionComplete
)
REM Check 32 bits
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
if DEFINED LLVM_DIR (
if NOT "%verbose%" == "" (
echo LLVM Detected at "%LLVM_DIR%"
)
goto DetectionComplete
)
echo LLVM not found
exit /b 1
:DetectionComplete
set CC=%LLVM_DIR%\bin\clang-cl
set CXX=%LLVM_DIR%\bin\clang-cl
rem build and tested against 2017 15.7
set CFLAGS=-m64 -fmsc-version=1914
set CXXFLAGS=-m64 -fmsc-version=1914
if "%WITH_ASAN%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
)
)
if "%WITH_ASAN%"=="1" (
if "%WITH_CLANG%" == "" (
echo ASAN is only supported with clang.
exit /b 1
)
)
if NOT "%verbose%" == "" (
echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
)
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
)
if "%MUST_CLEAN%"=="1" (
echo Cleaning %BUILD_DIR%
cd %BUILD_DIR%
%CMAKE% cmake --build . --config Clean
)
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
if "%MUST_CONFIGURE%"=="1" (
cmake ^
%BUILD_CMAKE_ARGS% ^
-H%BLENDER_DIR% ^
-B%BUILD_DIR%
if %ERRORLEVEL% NEQ 0 (
echo "Configuration Failed"
exit /b 1
)
)
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
echo ninja install >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd

View File

@@ -0,0 +1,16 @@
if "%BUILD_ARCH%"=="" (
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
set WINDOWS_ARCH= Win64
set BUILD_ARCH=x64
) else if "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
set WINDOWS_ARCH= Win64
set BUILD_ARCH=x64
) else (
set WINDOWS_ARCH=
set BUILD_ARCH=x86
)
) else if "%BUILD_ARCH%"=="x64" (
set WINDOWS_ARCH= Win64
) else if "%BUILD_ARCH%"=="x86" (
set WINDOWS_ARCH=
)

View File

@@ -0,0 +1,3 @@
set BUILD_VS_VER=14
set BUILD_VS_YEAR=2015
call "%~dp0\detect_msvc_classic.cmd"

View File

@@ -0,0 +1,76 @@
if NOT "%verbose%" == "" (
echo Detecting msvc 2017
)
set BUILD_VS_VER=15
set BUILD_VS_YEAR=2017
set ProgramFilesX86=%ProgramFiles(x86)%
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
if not exist "%vs_where%" (
if NOT "%verbose%" == "" (
echo Visual Studio 2017 ^(15.2 or newer^) is not detected
goto FAIL
)
)
if NOT "%verbose%" == "" (
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
)
if "%VS_InstallDir%"=="" (
if NOT "%verbose%" == "" (
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
goto FAIL
)
)
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
if exist "%VCVARS%" (
call "%VCVARS%" %BUILD_ARCH%
) else (
if NOT "%verbose%" == "" (
echo "%VCVARS%" not found
)
goto FAIL
)
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
if NOT "%verbose%" == "" (
echo Visual Studio 2017 is detected successfully
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -0,0 +1,69 @@
if NOT "%verbose%" == "" (
echo Detecting msvc %BUILD_VS_YEAR%
)
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
if DEFINED MSVC_VC_DIR (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% on Win64 detected at "%MSVC_VC_DIR%"
)
goto msvc_detect_finally
)
REM Check 32 bits
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
if DEFINED MSVC_VC_DIR (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% on Win32 detected at "%MSVC_VC_DIR%"
)
goto msvc_detect_finally
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% not found.
)
goto FAIL
:msvc_detect_finally
set VCVARS=%MSVC_VC_DIR%\vcvarsall.bat
if not exist "%VCVARS%" (
echo "%VCVARS%" not found.
goto FAIL
)
call "%vcvars%" %BUILD_ARCH%
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
goto DetectionComplete
:FAIL
exit /b 1
:DetectionComplete
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% Detected successfuly
)
exit /b 0

View File

@@ -0,0 +1,13 @@
REM find all dependencies and set the corresponding environement variables.
for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
if NOT "%verbose%" == "" (
echo svn : %SVN%
echo cmake : %CMAKE%
echo git : %GIT%
)
if "%CMAKE%" == "" (
echo Cmake not found in path, required for building, exiting...
exit /b 1
)

View File

@@ -0,0 +1,86 @@
set BUILD_DIR=%BLENDER_DIR%..\build_windows
set BUILD_TYPE=Release
:argv_loop
if NOT "%1" == "" (
REM Help Message
if "%1" == "help" (
set SHOW_HELP=1
goto EOF
)
REM Build Types
if "%1" == "debug" (
set BUILD_TYPE=Debug
REM Build Configurations
) else if "%1" == "noge" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_GAMEENGINE=OFF -DWITH_PLAYER=OFF
set BUILD_NGE=_noge
) else if "%1" == "builddir" (
set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
shift /1
) else if "%1" == "with_tests" (
set TESTS_CMAKE_ARGS=-DWITH_GTESTS=On
) else if "%1" == "full" (
set TARGET=Full
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
-C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
) else if "%1" == "lite" (
set TARGET=Lite
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
) else if "%1" == "cycles" (
set TARGET=Cycles
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
) else if "%1" == "headless" (
set TARGET=Headless
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
) else if "%1" == "bpy" (
set TARGET=Bpy
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
) else if "%1" == "clang" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
set WITH_CLANG=1
) else if "%1" == "release" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
set TARGET=Release
) else if "%1" == "asan" (
set WITH_ASAN=1
) else if "%1" == "x86" (
set BUILD_ARCH=x86
) else if "%1" == "x64" (
set BUILD_ARCH=x64
) else if "%1" == "2017" (
set BUILD_VS_YEAR=2017
) else if "%1" == "2017pre" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-prerelease
set BUILD_VS_YEAR=2017
) else if "%1" == "2017b" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2015" (
set BUILD_VS_YEAR=2015
) else if "%1" == "packagename" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
shift /1
) else if "%1" == "nobuild" (
set NOBUILD=1
) else if "%1" == "showhash" (
SET BUILD_SHOW_HASHES=1
REM Non-Build Commands
) else if "%1" == "update" (
SET BUILD_UPDATE=1
) else if "%1" == "ninja" (
SET BUILD_WITH_NINJA=1
) else if "%1" == "clean" (
set MUST_CLEAN=1
) else if "%1" == "verbose" (
set VERBOSE=1
) else (
echo Command "%1" unknown, aborting!
exit /b 1
)
shift /1
goto argv_loop
)
:EOF
exit /b 0

View File

@@ -0,0 +1,27 @@
rem reset all variables so they do not get accidentally get carried over from previous builds
set BUILD_DIR_OVERRRIDE=
set BUILD_CMAKE_ARGS=
set BUILD_ARCH=
set BUILD_VS_VER=
set BUILD_VS_YEAR=
set BUILD_VS_LIBDIRPOST=
set BUILD_VS_LIBDIR=
set BUILD_VS_SVNDIR=
set BUILD_NGE=
set KEY_NAME=
set MSBUILD_PLATFORM=
set MUST_CLEAN=
set NOBUILD=
set TARGET=
set VERBOSE=
set WINDOWS_ARCH=
set TESTS_CMAKE_ARGS=
set VSWHERE_ARGS=
set BUILD_UPDATE=
set BUILD_SHOW_HASHES=
set SHOW_HELP=
set BUILD_WITH_NINJA=
set WITH_CLANG=
set WITH_ASAN=
set CLANG_CMAKE_ARGS=
set ASAN_CMAKE_ARGS=

View File

@@ -0,0 +1,4 @@
set BUILD_DIR=%BUILD_DIR%_%TARGET%%BUILD_NGE%_%BUILD_ARCH%_vc%BUILD_VS_VER%_%BUILD_TYPE%
if NOT "%BUILD_DIR_OVERRRIDE%"=="" (
set BUILD_DIR=%BUILD_DIR_OVERRRIDE%
)

View File

@@ -0,0 +1,12 @@
if "%GIT%" == "" (
echo Git not found, cannot show hashes.
goto EOF
)
cd "%BLENDER_DIR%"
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Branch_hash=%%i
cd "%BLENDER_DIR%/release/datafiles/locale"
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Locale_hash=%%i
cd "%BLENDER_DIR%/release/scripts/addons"
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Addons_Hash=%%i
cd "%BLENDER_DIR%"
:EOF

View File

@@ -0,0 +1,35 @@
echo.
echo Convenience targets
echo - release ^(identical to the official blender.org builds^)
echo - full ^(same as release minus the cuda kernels^)
echo - lite
echo - headless
echo - cycles
echo - bpy
echo.
echo Utilities ^(not associated with building^)
echo - clean ^(Target must be set^)
echo - update
echo - nobuild ^(only generate project files^)
echo - showhash ^(Show git hashes of source tree^)
echo.
echo Configuration options
echo - verbose ^(enable diagnostic output during configuration^)
echo - with_tests ^(enable building unit tests^)
echo - noge ^(disable building game enginge and player^)
echo - debug ^(Build an unoptimized debuggable build^)
echo - packagename [newname] ^(override default cpack package name^)
echo - buildir [newdir] ^(override default build folder^)
echo - x86 ^(override host auto-detect and build 32 bit code^)
echo - x64 ^(override host auto-detect and build 64 bit code^)
echo - 2017 ^(build with visual studio 2017^)
echo - 2017pre ^(build with visual studio 2017 pre-release^)
echo - 2017b ^(build with visual studio 2017 Build Tools^)
echo.
echo Experimental options
echo - 2015 ^(build with visual studio 2015^)
echo - clang ^(enable building with clang^)
echo - asan ^(enable asan when building with clang^)
echo - ninja ^(enable building with ninja instead of msbuild^)
echo.

View File

@@ -0,0 +1,16 @@
if "%SVN%" == "" (
echo svn not found, cannot update libraries
goto UPDATE_GIT
)
"%SVN%" up "%BLENDER_DIR%/../lib/*"
:UPDATE_GIT
if "%GIT%" == "" (
echo Git not found, cannot update code
goto EOF
)
"%GIT%" pull --rebase
"%GIT%" submodule foreach git pull --rebase origin master
:EOF

View File

@@ -7,7 +7,7 @@
# 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,
# 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.
@@ -22,21 +22,21 @@
#
# Name:
# dna.py
#
#
# Description:
# Creates a browsable DNA output to HTML.
#
#
# Author:
# Jeroen Bakker
#
#
# Version:
# v0.1 (12-05-2009) - migration of original source code to python.
# Added code to support blender 2.5 branch
# v0.2 (25-05-2009) - integrated with BlendFileReader.py
#
#
# Input:
# blender build executable
#
#
# Output:
# dna.html
# dna.css (will only be created when not existing)
@@ -76,12 +76,12 @@ class DNACatalogHTML:
DNACatalog is a catalog of all information in the DNA1 file-block
'''
def __init__(self, catalog, bpy_module = None):
def __init__(self, catalog, bpy_module=None):
self.Catalog = catalog
self.bpy = bpy_module
def WriteToHTML(self, handle):
dna_html_template = """
<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
<html>
@@ -105,10 +105,10 @@ class DNACatalogHTML:
${structs_content}
</body>
</html>"""
header = self.Catalog.Header
bpy = self.bpy
# ${version} and ${revision}
if bpy:
version = '.'.join(map(str, bpy.app.version))
@@ -116,7 +116,7 @@ class DNACatalogHTML:
else:
version = str(header.Version)
revision = 'Unknown'
# ${bitness}
if header.PointerSize == 8:
bitness = '64 bit'
@@ -125,10 +125,10 @@ class DNACatalogHTML:
# ${endianness}
if header.LittleEndianness:
endianess= 'Little endianness'
endianess = 'Little endianness'
else:
endianess= 'Big endianness'
endianess = 'Big endianness'
# ${structs_list}
log.debug("Creating structs index")
structs_list = ''
@@ -136,7 +136,7 @@ class DNACatalogHTML:
structureIndex = 0
for structure in self.Catalog.Structs:
structs_list += list_item.format(structureIndex, structure.Type.Name)
structureIndex+=1
structureIndex += 1
# ${structs_content}
log.debug("Creating structs content")
@@ -144,20 +144,20 @@ class DNACatalogHTML:
for structure in self.Catalog.Structs:
log.debug(structure.Type.Name)
structs_content += self.Structure(structure)
d = dict(
version = version,
revision = revision,
bitness = bitness,
endianness = endianess,
structs_list = structs_list,
structs_content = structs_content
version=version,
revision=revision,
bitness=bitness,
endianness=endianess,
structs_list=structs_list,
structs_content=structs_content
)
dna_html = Template(dna_html_template).substitute(d)
dna_html = self.format(dna_html)
handle.write(dna_html)
def Structure(self, structure):
struct_table_template = """
<table><a name="${struct_name}"></a>
@@ -178,23 +178,23 @@ class DNACatalogHTML:
</table>
<label>Total size: ${size} bytes</label><br/>
<label>(<a href="#top">top</a>)</label><br/>"""
d = dict(
struct_name = structure.Type.Name,
fields = self.StructureFields(structure, None, 0),
size = str(structure.Type.Size)
struct_name=structure.Type.Name,
fields=self.StructureFields(structure, None, 0),
size=str(structure.Type.Size)
)
struct_table = Template(struct_table_template).substitute(d)
return struct_table
def StructureFields(self, structure, parentReference, offset):
fields = ''
for field in structure.Fields:
fields += self.StructureField(field, structure, parentReference, offset)
offset += field.Size(self.Catalog.Header)
return fields
def StructureField(self, field, structure, parentReference, offset):
structure_field_template = """
<tr>
@@ -205,7 +205,7 @@ class DNACatalogHTML:
<td>${offset}</td>
<td>${size}</td>
</tr>"""
if field.Type.Structure is None or field.Name.IsPointer():
# ${reference}
@@ -216,37 +216,37 @@ class DNACatalogHTML:
struct = '<a href="#{0}">{0}</a>'.format(structure.Type.Name)
else:
struct = structure.Type.Name
# ${type}
type = field.Type.Name
# ${name}
name = field.Name.Name
# ${offset}
# offset already set
# ${size}
size = field.Size(self.Catalog.Header)
d = dict(
reference = reference,
struct = struct,
type = type,
name = name,
offset = offset,
size = size
reference=reference,
struct=struct,
type=type,
name=name,
offset=offset,
size=size
)
structure_field = Template(structure_field_template).substitute(d)
elif field.Type.Structure is not None:
reference = field.Name.AsReference(parentReference)
structure_field = self.StructureFields(field.Type.Structure, reference, offset)
structure_field = self.StructureFields(field.Type.Structure, reference, offset)
return structure_field
def indent(self, input, dent, startswith = ''):
def indent(self, input, dent, startswith=''):
output = ''
if dent < 0:
for line in input.split('\n'):
@@ -257,19 +257,19 @@ class DNACatalogHTML:
output += line.lstrip() + '\n' # remove indentation completely
elif dent > 0:
for line in input.split('\n'):
output += ' '* dent + line + '\n'
output += ' ' * dent + line + '\n'
return output
def format(self, input):
diff = {
'\n<!DOCTYPE':'<!DOCTYPE',
'\n</ul>' :'</ul>',
'<a name' :'\n<a name',
'<tr>\n' :'<tr>',
'<tr>' :' <tr>',
'</th>\n' :'</th>',
'</td>\n' :'</td>',
'<tbody>\n' :'<tbody>'
'\n<!DOCTYPE': '<!DOCTYPE',
'\n</ul>': '</ul>',
'<a name': '\n<a name',
'<tr>\n': '<tr>',
'<tr>': ' <tr>',
'</th>\n': '</th>',
'</td>\n': '</td>',
'<tbody>\n': '<tbody>'
}
output = self.indent(input, 0)
for key, value in diff.items():
@@ -283,17 +283,17 @@ class DNACatalogHTML:
'''
css = """
@CHARSET "ISO-8859-1";
body {
font-family: verdana;
font-size: small;
}
div.title {
font-size: large;
text-align: center;
}
h1 {
page-break-before: always;
}
@@ -304,7 +304,7 @@ class DNACatalogHTML:
margin-right: 3%;
padding-left: 40px;
}
h1:hover{
background-color: #EBEBEB;
}
@@ -312,7 +312,7 @@ class DNACatalogHTML:
h3 {
padding-left: 40px;
}
table {
border-width: 1px;
border-style: solid;
@@ -321,21 +321,21 @@ class DNACatalogHTML:
width: 94%;
margin: 20px 3% 10px;
}
caption {
margin-bottom: 5px;
}
th {
background-color: #000000;
color:#ffffff;
padding-left:5px;
padding-right:5px;
}
tr {
}
td {
border-width: 1px;
border-style: solid;
@@ -343,12 +343,12 @@ class DNACatalogHTML:
padding-left:5px;
padding-right:5px;
}
label {
float:right;
margin-right: 3%;
}
ul.multicolumn {
list-style:none;
float:left;
@@ -361,18 +361,18 @@ class DNACatalogHTML:
width:200px;
margin-right:0px;
}
a {
color:#a000a0;
text-decoration:none;
}
a:hover {
color:#a000a0;
text-decoration:underline;
}
"""
css = self.indent(css, 0)
handle.write(css)
@@ -389,13 +389,13 @@ def usage():
print("\tdefault: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py")
print("\twith options: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
######################################################
# Main
######################################################
def main():
import os, os.path
try:
@@ -408,37 +408,37 @@ def main():
else:
filename = 'dna'
dir = os.path.dirname(__file__)
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
Path_HTML = os.path.join(dir, filename + '.html') # output html file
Path_CSS = os.path.join(dir, 'dna.css') # output css file
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
Path_HTML = os.path.join(dir, filename + '.html') # output html file
Path_CSS = os.path.join(dir, 'dna.css') # output css file
# create a blend file for dna parsing
if not os.path.exists(Path_Blend):
log.info("1: write temp blend file with SDNA info")
log.info(" saving to: " + Path_Blend)
try:
bpy.ops.wm.save_as_mainfile(filepath = Path_Blend, copy = True, compress = False)
bpy.ops.wm.save_as_mainfile(filepath=Path_Blend, copy=True, compress=False)
except:
log.error("Filename {0} does not exist and can't be created... quitting".format(Path_Blend))
return
else:
log.info("1: found blend file with SDNA info")
log.info(" " + Path_Blend)
# read blend header from blend file
log.info("2: read file:")
if not dir in sys.path:
sys.path.append(dir)
import BlendFileReader
handle = BlendFileReader.openBlendFile(Path_Blend)
blendfile = BlendFileReader.BlendFile(handle)
catalog = DNACatalogHTML(blendfile.Catalog, bpy)
# close temp file
handle.close()
# deleting or not?
if '--dna-keep-blend' in sys.argv:
# keep the blend, useful for studying hexdumps
@@ -449,7 +449,7 @@ def main():
log.info("5: close and delete temp blend:")
log.info(" {0}".format(Path_Blend))
os.remove(Path_Blend)
# export dna to xhtml
log.info("6: export sdna to xhtml file: %r" % Path_HTML)
handleHTML = open(Path_HTML, "w")
@@ -466,12 +466,12 @@ def main():
if not bpy.app.background:
log.info("7: quit blender")
bpy.ops.wm.exit_blender()
except ImportError:
log.warning(" skipping, not running in Blender")
usage()
sys.exit(2)
if __name__ == '__main__':
main()

View File

@@ -7,7 +7,7 @@
# 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,
# 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.
@@ -34,6 +34,7 @@ log = logging.getLogger("BlendFileReader")
# module global routines
######################################################
def ReadString(handle, length):
'''
ReadString reads a String of given length or a zero terminating String
@@ -45,7 +46,7 @@ def ReadString(handle, length):
# length == 0 means we want a zero terminating string
result = ""
s = ReadString(handle, 1)
while s!="\0":
while s != "\0":
result += s
s = ReadString(handle, 1)
return result
@@ -57,7 +58,7 @@ def Read(type, handle, fileheader):
'''
def unpacked_bytes(type_char, size):
return struct.unpack(fileheader.StructPre + type_char, handle.read(size))[0]
if type == 'ushort':
return unpacked_bytes("H", 2) # unsigned short
elif type == 'short':
@@ -94,10 +95,10 @@ def openBlendFile(filename):
log.debug("decompressing started")
fs = gzip.open(filename, "rb")
handle = tempfile.TemporaryFile()
data = fs.read(1024*1024)
while data:
handle.write(data)
data = fs.read(1024*1024)
data = fs.read(1024 * 1024)
while data:
handle.write(data)
data = fs.read(1024 * 1024)
log.debug("decompressing finished")
fs.close()
log.debug("resetting decompressed file")
@@ -112,7 +113,7 @@ def Align(handle):
offset = handle.tell()
trim = offset % 4
if trim != 0:
handle.seek(4-trim, os.SEEK_CUR)
handle.seek(4 - trim, os.SEEK_CUR)
######################################################
@@ -121,14 +122,14 @@ def Align(handle):
class BlendFile:
'''
Reads a blendfile and store the header, all the fileblocks, and catalogue
Reads a blendfile and store the header, all the fileblocks, and catalogue
structs foound in the DNA fileblock
- BlendFile.Header (BlendFileHeader instance)
- BlendFile.Blocks (list of BlendFileBlock instances)
- BlendFile.Catalog (DNACatalog instance)
'''
def __init__(self, handle):
log.debug("initializing reading blend-file")
self.Header = BlendFileHeader(handle)
@@ -141,13 +142,13 @@ class BlendFile:
found_dna_block = True
else:
fileblock.Header.skip(handle)
self.Blocks.append(fileblock)
fileblock = BlendFileBlock(handle, self)
# appending last fileblock, "ENDB"
self.Blocks.append(fileblock)
# seems unused?
"""
def FindBlendFileBlocksWithCode(self, code):
@@ -164,27 +165,27 @@ class BlendFileHeader:
BlendFileHeader allocates the first 12 bytes of a blend file.
It contains information about the hardware architecture.
Header example: BLENDER_v254
BlendFileHeader.Magic (str)
BlendFileHeader.PointerSize (int)
BlendFileHeader.LittleEndianness (bool)
BlendFileHeader.StructPre (str) see http://docs.python.org/py3k/library/struct.html#byte-order-size-and-alignment
BlendFileHeader.Version (int)
'''
def __init__(self, handle):
log.debug("reading blend-file-header")
self.Magic = ReadString(handle, 7)
log.debug(self.Magic)
pointersize = ReadString(handle, 1)
log.debug(pointersize)
if pointersize == "-":
self.PointerSize = 8
if pointersize == "_":
self.PointerSize = 4
endianness = ReadString(handle, 1)
log.debug(endianness)
if endianness == "v":
@@ -193,11 +194,11 @@ class BlendFileHeader:
if endianness == "V":
self.LittleEndianness = False
self.StructPre = ">"
version = ReadString(handle, 3)
log.debug(version)
self.Version = int(version)
log.debug("{0} {1} {2} {3}".format(self.Magic, self.PointerSize, self.LittleEndianness, version))
@@ -206,11 +207,11 @@ class BlendFileBlock:
BlendFileBlock.File (BlendFile)
BlendFileBlock.Header (FileBlockHeader)
'''
def __init__(self, handle, blendfile):
self.File = blendfile
self.Header = FileBlockHeader(handle, blendfile.Header)
def Get(self, handle, path):
log.debug("find dna structure")
dnaIndex = self.Header.SDNAIndex
@@ -232,7 +233,7 @@ class FileBlockHeader:
Count (int)
FileOffset (= file pointer of datablock)
'''
def __init__(self, handle, fileheader):
self.Code = ReadString(handle, 4).strip()
if self.Code != "ENDB":
@@ -257,28 +258,28 @@ class FileBlockHeader:
class DNACatalog:
'''
DNACatalog is a catalog of all information in the DNA1 file-block
Header = None
Names = None
Types = None
Structs = None
'''
def __init__(self, fileheader, handle):
log.debug("building DNA catalog")
self.Names=[]
self.Types=[]
self.Structs=[]
self.Names = []
self.Types = []
self.Structs = []
self.Header = fileheader
SDNA = ReadString(handle, 4)
# names
NAME = ReadString(handle, 4)
numberOfNames = Read('uint', handle, fileheader)
log.debug("building #{0} names".format(numberOfNames))
for i in range(numberOfNames):
name = ReadString(handle,0)
name = ReadString(handle, 0)
self.Names.append(DNAName(name))
Align(handle)
@@ -287,7 +288,7 @@ class DNACatalog:
numberOfTypes = Read('uint', handle, fileheader)
log.debug("building #{0} types".format(numberOfTypes))
for i in range(numberOfTypes):
type = ReadString(handle,0)
type = ReadString(handle, 0)
self.Types.append(DNAType(type))
Align(handle)
@@ -321,24 +322,24 @@ class DNACatalog:
class DNAName:
'''
DNAName is a C-type name stored in the DNA.
Name = str
'''
def __init__(self, name):
self.Name = name
def AsReference(self, parent):
if parent is None:
result = ""
else:
result = parent+"."
result = parent + "."
result = result + self.ShortName()
return result
def ShortName(self):
result = self.Name;
result = self.Name
result = result.replace("*", "")
result = result.replace("(", "")
result = result.replace(")", "")
@@ -346,12 +347,12 @@ class DNAName:
if Index != -1:
result = result[0:Index]
return result
def IsPointer(self):
return self.Name.find("*")>-1
return self.Name.find("*") > -1
def IsMethodPointer(self):
return self.Name.find("(*")>-1
return self.Name.find("(*") > -1
def ArraySize(self):
result = 1
@@ -360,10 +361,10 @@ class DNAName:
while Index != -1:
Index2 = Temp.find("]")
result*=int(Temp[Index+1:Index2])
Temp = Temp[Index2+1:]
result *= int(Temp[Index + 1:Index2])
Temp = Temp[Index2 + 1:]
Index = Temp.find("[")
return result
@@ -375,46 +376,46 @@ class DNAType:
Size = int
Structure = DNAStructure
'''
def __init__(self, aName):
self.Name = aName
self.Structure=None
self.Structure = None
class DNAStructure:
'''
DNAType is a C-type structure stored in the DNA
Type = DNAType
Fields = [DNAField]
'''
def __init__(self, aType):
self.Type = aType
self.Type.Structure = self
self.Fields=[]
self.Fields = []
def GetField(self, header, handle, path):
splitted = path.partition(".")
name = splitted[0]
rest = splitted[2]
offset = 0;
offset = 0
for field in self.Fields:
if field.Name.ShortName() == name:
log.debug("found "+name+"@"+str(offset))
log.debug("found " + name + "@" + str(offset))
handle.seek(offset, os.SEEK_CUR)
return field.DecodeField(header, handle, rest)
else:
offset += field.Size(header)
log.debug("error did not find "+path)
log.debug("error did not find " + path)
return None
class DNAField:
'''
DNAField is a coupled DNAType and DNAName.
Type = DNAType
Name = DNAName
'''
@@ -422,25 +423,24 @@ class DNAField:
def __init__(self, aType, aName):
self.Type = aType
self.Name = aName
def Size(self, header):
if self.Name.IsPointer() or self.Name.IsMethodPointer():
return header.PointerSize*self.Name.ArraySize()
return header.PointerSize * self.Name.ArraySize()
else:
return self.Type.Size*self.Name.ArraySize()
return self.Type.Size * self.Name.ArraySize()
def DecodeField(self, header, handle, path):
if path == "":
if self.Name.IsPointer():
return Read('pointer', handle, header)
if self.Type.Name=="int":
if self.Type.Name == "int":
return Read('int', handle, header)
if self.Type.Name=="short":
if self.Type.Name == "short":
return Read('short', handle, header)
if self.Type.Name=="float":
if self.Type.Name == "float":
return Read('float', handle, header)
if self.Type.Name=="char":
if self.Type.Name == "char":
return ReadString(handle, self.Name.ArraySize())
else:
return self.Type.Structure.GetField(header, handle, path)

View File

@@ -36,6 +36,62 @@
/* ================================ */
/** \defgroup bge Game Engine */
/** \defgroup gamelogic Game Logic
* \ingroup bge
*/
/** \defgroup bgeconv Converter
* \ingroup bge
*/
/** \defgroup blroutines Blender Routines
* \ingroup bge
*/
/** \defgroup expressions Expressions
* \ingroup bge
*/
/** \defgroup player Game Player
* \ingroup bge
*/
/** \defgroup ketsji Ketsji
* \ingroup bge
* \todo check all headers and code files for proper licenses
*/
/** \defgroup ketsjinet Ketsji Network
* \ingroup ketsji
*/
/** \defgroup bgenet Network
* \ingroup bge
*/
/** \defgroup bgenetlb Loopback Network
* \ingroup bgenet
*/
/** \defgroup phys Physics
* \ingroup bge
*/
/** \defgroup physbullet Bullet Physics
* \ingroup phys
*/
/** \defgroup physdummy Dummy Physics (none)
* \ingroup phys
*/
/** \defgroup bgerast Rasterizer
* \ingroup bge
*/
/** \defgroup bgerastoglfilters OpenGL Filters
* \ingroup bgerast
*/
/** \defgroup bgerastogl OpenGL Rasterizer
* \ingroup bgerast
*/
/** \defgroup bgesg BGE SceneGraph
* \ingroup bge
*/
/** \defgroup bgevideotex BGE Video Texture
* \ingroup bge
*/
/* ================================ */
/** \defgroup blender Blender */
/** \defgroup blt BlenTranslation
@@ -168,10 +224,6 @@
* \ingroup editors
*/
/** \defgroup edscene scene
* \ingroup editors
*/
/** \defgroup edsculpt sculpt and paint
* \ingroup editors
*/
@@ -212,6 +264,10 @@
* \ingroup editors
*/
/** \defgroup splogic game logic editor
* \ingroup editors
*/
/** \defgroup spnla NLA editor
* \ingroup editors
*/

View File

@@ -42,6 +42,7 @@ def man_format(data):
data = data.replace("\t", " ")
return data
if len(sys.argv) != 3:
import getopt
raise getopt.GetoptError("Usage: %s <path-to-blender> <output-filename>" % sys.argv[0])

View File

@@ -0,0 +1,37 @@
"""
Basic Physics Constraint
++++++++++++++++++++++++
Example of how to create a hinge Physics Constraint between two objects.
"""
from bge import logic
from bge import constraints
# get object list
objects = logic.getCurrentScene().objects
# get object named Object1 and Object 2
object_1 = objects["Object1"]
object_2 = objects["Object2"]
# want to use Edge constraint type
constraint_type = 2
# get Object1 and Object2 physics IDs
physics_id_1 = object_1.getPhysicsId()
physics_id_2 = object_2.getPhysicsId()
# use bottom right edge of Object1 for hinge position
edge_position_x = 1.0
edge_position_y = 0.0
edge_position_z = -1.0
# rotate the pivot z axis about 90 degrees
edge_angle_x = 0.0
edge_angle_y = 0.0
edge_angle_z = 90.0
# create an edge constraint
constraints.createConstraint(physics_id_1, physics_id_2,
constraint_type,
edge_position_x, edge_position_y, edge_position_z,
edge_angle_x, edge_angle_y, edge_angle_z)

View File

@@ -0,0 +1,40 @@
"""
Texture Replacement
+++++++++++++++++++
Example of how to replace a texture in game with an external image.
``createTexture()`` and ``removeTexture()`` are to be called from a
module Python Controller.
"""
from bge import logic
from bge import texture
def createTexture(cont):
"""Create a new Dynamic Texture"""
obj = cont.owner
# get the reference pointer (ID) of the internal texture
ID = texture.materialID(obj, 'IMoriginal.png')
# create a texture object
object_texture = texture.Texture(obj, ID)
# create a new source with an external image
url = logic.expandPath("//newtexture.jpg")
new_source = texture.ImageFFmpeg(url)
# the texture has to be stored in a permanent Python object
logic.texture = object_texture
# update/replace the texture
logic.texture.source = new_source
logic.texture.refresh(False)
def removeTexture(cont):
"""Delete the Dynamic Texture, reversing back the final to its original state."""
try:
del logic.texture
except:
pass

View File

@@ -0,0 +1,239 @@
"""
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

@@ -0,0 +1,46 @@
"""
Basic Video Playback
++++++++++++++++++++
Example of how to replace a texture in game with a video.
It needs to run everyframe.
To avoid any confusion with the location of the file,
we will use ``GameLogic.expandPath()`` to build an absolute file name,
assuming the video file is in the same directory as the blend-file.
"""
import bge
from bge import texture
from bge import logic
cont = logic.getCurrentController()
obj = cont.owner
# the creation of the texture must be done once: save the
# texture object in an attribute of bge.logic module makes it persistent
if not hasattr(logic, 'video'):
# identify a static texture by name
matID = texture.materialID(obj, 'IMvideo.png')
# create a dynamic texture that will replace the static texture
logic.video = texture.Texture(obj, matID)
# define a source of image for the texture, here a movie
movie = logic.expandPath('//trailer_400p.ogg')
logic.video.source = texture.VideoFFmpeg(movie)
logic.video.source.scale = True
# Note that we can change the ``Texture`` source at any time.
# Suppose we want to switch between two movies during the game:
logic.mySources[0] = texture.VideoFFmpeg('movie1.avi')
logic.mySources[1] = texture.VideoFFmpeg('movie2.avi')
# And then assign (and reassign) the source during the game
logic.video.source = logic.mySources[movieSel]
# quick off the movie, but it wont play in the background
logic.video.source.play()
# Video playback is not a background process: it happens only when we refresh the texture.
# So you need to call this function every frame to ensure update of the texture.
logic.video.refresh(True)

View File

@@ -15,6 +15,7 @@ font_info = {
"handler": None,
}
def init():
"""init function - runs once"""
import os

View File

@@ -10,22 +10,22 @@ bm = bmesh.new()
# Add a circle XXX, should return all geometry created, not just verts.
bmesh.ops.create_circle(
bm,
cap_ends=False,
radius=0.2,
segments=8)
bm,
cap_ends=False,
radius=0.2,
segments=8)
# Spin and deal with geometry on side 'a'
edges_start_a = bm.edges[:]
geom_start_a = bm.verts[:] + edges_start_a
ret = bmesh.ops.spin(
bm,
geom=geom_start_a,
angle=math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 0.0))
bm,
geom=geom_start_a,
angle=math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 0.0))
edges_end_a = [ele for ele in ret["geom_last"]
if isinstance(ele, bmesh.types.BMEdge)]
del ret
@@ -33,8 +33,8 @@ del ret
# Extrude and create geometry on side 'b'
ret = bmesh.ops.extrude_edge_only(
bm,
edges=edges_start_a)
bm,
edges=edges_start_a)
geom_extrude_mid = ret["geom"]
del ret
@@ -45,19 +45,19 @@ verts_extrude_b = [ele for ele in geom_extrude_mid
edges_extrude_b = [ele for ele in geom_extrude_mid
if isinstance(ele, bmesh.types.BMEdge) and ele.is_boundary]
bmesh.ops.translate(
bm,
verts=verts_extrude_b,
vec=(0.0, 0.0, 1.0))
bm,
verts=verts_extrude_b,
vec=(0.0, 0.0, 1.0))
# Create the circle on side 'b'
ret = bmesh.ops.spin(
bm,
geom=verts_extrude_b + edges_extrude_b,
angle=-math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 1.0))
bm,
geom=verts_extrude_b + edges_extrude_b,
angle=-math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 1.0))
edges_end_b = [ele for ele in ret["geom_last"]
if isinstance(ele, bmesh.types.BMEdge)]
del ret
@@ -65,30 +65,30 @@ del ret
# Bridge the resulting edge loops of both spins 'a & b'
bmesh.ops.bridge_loops(
bm,
edges=edges_end_a + edges_end_b)
bm,
edges=edges_end_a + edges_end_b)
# Now we have made a links of the chain, make a copy and rotate it
# (so this looks something like a chain)
ret = bmesh.ops.duplicate(
bm,
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
bm,
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
geom_dupe = ret["geom"]
verts_dupe = [ele for ele in geom_dupe if isinstance(ele, bmesh.types.BMVert)]
del ret
# position the new link
bmesh.ops.translate(
bm,
verts=verts_dupe,
vec=(0.0, 0.0, 2.0))
bm,
verts=verts_dupe,
vec=(0.0, 0.0, 2.0))
bmesh.ops.rotate(
bm,
verts=verts_dupe,
cent=(0.0, 1.0, 0.0),
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
bm,
verts=verts_dupe,
cent=(0.0, 1.0, 0.0),
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
# Done with creating the mesh, simply link it into the scene so we can see it

View File

@@ -17,4 +17,5 @@ from bpy.app.handlers import persistent
def load_handler(dummy):
print("Load Handler:", bpy.data.filepath)
bpy.app.handlers.load_post.append(load_handler)

View File

@@ -11,4 +11,5 @@ import bpy
def my_handler(scene):
print("Frame Change", scene.frame_current)
bpy.app.handlers.frame_change_pre.append(my_handler)

View File

@@ -54,19 +54,19 @@ translations_tuple = (
"Copyright (C) 2013 The Blender Foundation.",
"This file is distributed under the same license as the Blender package.",
"FIRST AUTHOR <EMAIL@ADDRESS>, YEAR."))),
),
),
(("Operator", "Render: Copy Settings"),
(("bpy.types.SCENE_OT_render_copy_settings",),
()),
("fr_FR", "Rendu : copier réglages",
(False, ())),
),
),
(("*", "Copy render settings from current scene to others"),
(("bpy.types.SCENE_OT_render_copy_settings",),
()),
("fr_FR", "Copier les réglages de rendu depuis la scène courante vers dautres",
(False, ())),
),
),
# ... etc, all messages from your addon.
)
@@ -81,6 +81,7 @@ for msg in translations_tuple:
# Define remaining addon (operators, UI...) here.
def register():
# Usual operator/UI/etc. registration...

View File

@@ -14,6 +14,7 @@ class MaterialSettings(bpy.types.PropertyGroup):
my_float = bpy.props.FloatProperty()
my_string = bpy.props.StringProperty()
bpy.utils.register_class(MaterialSettings)
bpy.types.Material.my_settings = \

View File

@@ -14,6 +14,7 @@ class SceneSettingItem(bpy.types.PropertyGroup):
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
value = bpy.props.IntProperty(name="Test Prop", default=22)
bpy.utils.register_class(SceneSettingItem)
bpy.types.Scene.my_settings = \

View File

@@ -14,6 +14,7 @@ import bpy
def update_func(self, context):
print("my test function", self)
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
bpy.context.scene.testprop = 11.0

View File

@@ -19,6 +19,7 @@ def get_float(self):
def set_float(self, value):
self["testprop"] = value
bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float)
@@ -27,6 +28,7 @@ def get_date(self):
import datetime
return str(datetime.datetime.now())
bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
@@ -40,6 +42,7 @@ def get_array(self):
def set_array(self, values):
self["somebool"] = values[0] and values[1]
bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array)
@@ -50,7 +53,7 @@ test_items = [
("GREEN", "Green", "", 2),
("BLUE", "Blue", "", 3),
("YELLOW", "Yellow", "", 4),
]
]
def get_enum(self):
@@ -61,6 +64,7 @@ def get_enum(self):
def set_enum(self, value):
print("setting value", value)
bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum)

View File

@@ -9,7 +9,7 @@ bl_info = {
"wiki_url": "",
"tracker_url": "",
"category": "Object",
}
}
import bpy
@@ -23,17 +23,17 @@ class ExampleAddonPreferences(AddonPreferences):
bl_idname = __name__
filepath = StringProperty(
name="Example File Path",
subtype='FILE_PATH',
)
name="Example File Path",
subtype='FILE_PATH',
)
number = IntProperty(
name="Example Number",
default=4,
)
name="Example Number",
default=4,
)
boolean = BoolProperty(
name="Example Boolean",
default=False,
)
name="Example Boolean",
default=False,
)
def draw(self, context):
layout = self.layout

View File

@@ -14,4 +14,5 @@ import bpy
def menu_draw(self, context):
self.layout.operator("wm.save_homefile")
bpy.types.INFO_MT_file.append(menu_draw)

View File

@@ -32,7 +32,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
# variable used for all preset values
preset_defines = [
"obj = bpy.context.object"
]
]
# properties to store in the preset
preset_values = [
@@ -42,7 +42,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
"obj.show_name",
"obj.show_axis",
"obj.show_wire",
]
]
# where to store the preset
preset_subdir = "object/draw"
@@ -61,7 +61,7 @@ def panel_func(self, context):
classes = (
OBJECT_MT_draw_presets,
AddPresetObjectDraw,
)
)
def register():

View File

@@ -60,6 +60,7 @@ def menu_func(self, context):
layout.separator()
layout.operator(WM_OT_button_context_test.bl_idname)
classes = (
WM_OT_button_context_test,
WM_MT_button_context,
@@ -77,5 +78,6 @@ def unregister():
bpy.utils.unregister_class(cls)
bpy.types.WM_MT_button_context.remove(menu_func)
if __name__ == "__main__":
register()

View File

@@ -21,4 +21,5 @@ class CyclesNodeTree(bpy.types.NodeTree):
def poll(cls, context):
return context.scene.render.engine == 'CYCLES'
bpy.utils.register_class(CyclesNodeTree)

View File

@@ -42,6 +42,7 @@ class SimpleMouseOperator(bpy.types.Operator):
self.y = event.mouse_y
return self.execute(context)
bpy.utils.register_class(SimpleMouseOperator)
# Test call to the newly defined operator.

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