Compare commits

..

1881 Commits

Author SHA1 Message Date
080cf9332b Merge branch 'gooseberry' into temp_motionpaths
Conflicts:
	source/blender/blenkernel/intern/object.c
2015-06-10 18:38:23 +02:00
9676642cc9 Super hacky hack (not for master for sure) to stop blender for crashing
with scene audio recursion in mattieu's gooseberry edit in sequencer.

Will probably cause something else to explode but let's just guard
against this in the audio lib for now.
2015-06-10 18:20:15 +02:00
09df0f0b77 Sequencer:
Add option to ommit strip name and info display.
2015-06-10 14:06:13 +02:00
d48e165edd Gooseberry: Use more proper flag for psys reconstruction after memory optimization 2015-06-09 19:04:53 +02:00
e73e5c9930 Gooseberry: Fix for flickering grass
The issue was caused by memory optimization marking particle system to recalc,
and because of the way how particle flags works it was possible that it'll
cause particle's re-distribution. Now this memory optimization will act the
same as loading the file.

Would need to review if this fix is to go to master/cycles_memory branches
but for now it'll be cool to figure out what to do with the farm.
2015-06-09 18:56:43 +02:00
313c958f43 More cosmetic stuff for the play button
Draw outer ring with quad strip instead of line
(line width would vary across the ring)
2015-06-09 18:15:32 +02:00
58f75e903a Small cheat for attract tool:
Draw overdrop on top of post-draw call back.
2015-06-09 16:38:48 +02:00
23d0af5031 Particles: Avoid bad memory access when calculating child weight
Not sure it's totally correct solution, but it's better than giving
unpredictable results.
2015-06-09 14:50:28 +02:00
ab742d302e Center the play gisom triangle more correctly. 2015-06-09 14:37:50 +02:00
a7a87e4ade Reset frame when stopping playing. 2015-06-09 14:07:29 +02:00
010e2a2b36 Add play gismos to collapsed image sequences. When clicking repeatedly
on the sequence they are toggled between play-pause.
2015-06-09 13:51:54 +02:00
a4ee50f52e Disable file collapse when user cancels after an operator.
Now file open operator also sets a temporary flag for collapse. This
allows the user to configure the option to always collapse files and the
editor will remember the setting and not reset it back after finishing a
collapsed file open.
2015-06-09 12:29:16 +02:00
dd346c5591 Never collapse directories 2015-06-08 18:47:54 +02:00
c5fc9ebfcb Animation support for collapsed image sequences.
Selected animation sequences will play back their thumbnails now.

We'll probably need a way to scrub here, will investigate that next.
2015-06-08 16:55:51 +02:00
dbb3e8da3e Gooseberry: Previous commit broke compilation of debug builds 2015-06-08 16:31:07 +02:00
f3a434c321 Merge branch 'cycles_memory_experiments' into gooseberry
Conflicts:
	intern/cycles/blender/blender_object.cpp
	intern/cycles/blender/blender_sync.h
2015-06-08 16:10:34 +02:00
77e18b8122 Gooseberry: Fix compilation error with strict compiler flags 2015-06-08 16:06:06 +02:00
ed20f7bfb0 Yet another weekly issue squashed, player did not display indicator with
image sequences.

Simple matter of storing the frame for image sequences too.
2015-06-08 16:03:43 +02:00
566f3cfb0b Sort files in collapsed sequences by frame number.
Now getting an "animation" preview should be pretty easy.
2015-06-08 15:51:44 +02:00
afe8eb3b59 Cycles: Merge density and color volume attributes if they both requested
This way we store quite reasonable amount of memory (density is stored as RGBA
textures, which ends up in gigabytes of RAM for hires smoke sims).

It's not really pretty implementation and we'll really need to support textures
with 1 and 3 channels instead of doing such packing, but we need to be able to
render some files here.
2015-06-08 15:48:11 +02:00
2485aa340b Merge branch 'fcurves-simplify' into gooseberry 2015-06-08 15:41:36 +02:00
b3259d51b4 Cycles: Free hires smoke data from blender side after scene was fully synchronized
This happens if all object's smokes are backed to files and rendering is either
happening from command line of with locked interface.

The idea behind this change is to make as much memory available for path tracing
as possible, so after heavy swapping during synchronization period there's loads
of free memory to put important data back to RAM.
2015-06-08 15:34:07 +02:00
7fe46cdecb Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/key.c
	source/blender/blenlib/intern/path_util.c
	source/blender/editors/object/object_shapekey.c
2015-06-08 15:28:25 +02:00
1ecfffeced Initial fcurve simplification code.
Notes:
* This is own coocking, since it seems hard to find papers on simplifying already existing bezier curves,
  and we do not really need the 'generic' least-square fitting of bezier in a set of points, here.
* It takes advantage of specificities of FCurves (e.g. only difference that matters here is Y value at same X frame,
  no vertical overlapping, etc.).
* It gives reasonably good results, but could most likely be enhanced quite a bit still.
* Only 'hooked' to bake action operator right now (needs more work to add it to graph editor too).
* Ultimately should probably be redone in C. Would keep it in Python until we have a real good
  cleanup behavior though, much easier to experiment in later language.
2015-06-08 15:09:07 +02:00
c5ea1d47e8 Clear previous collapsed data if needed. 2015-06-08 14:40:53 +02:00
a5f6fcde2e Refactor: move all collapsed image variables into a struct. 2015-06-08 14:34:10 +02:00
f1cd1e6503 Merge branch 'master' into cycles_memory_experiments
Conflicts:
	intern/cycles/blender/blender_object.cpp
	intern/cycles/blender/blender_sync.h
	intern/cycles/render/graph.h
	intern/cycles/render/mesh.cpp
2015-06-08 14:20:07 +02:00
309c66d4c3 Fix issue with collapsed images during last weekly.
We need to clear the collapsed flag when it does not apply anymore, so
files get displayed properly.
2015-06-08 12:54:32 +02:00
ae0612c2ac Do not show fps while scrubbing. 2015-06-05 16:47:01 +02:00
6ac3ebc052 Do not store frame change in undo stack (causes much waiting for
animators in heavy scenes)
2015-06-05 16:31:40 +02:00
06058c5feb Merge branch 'master' into gooseberry 2015-06-05 15:28:29 +02:00
3a3317ff39 Indicator for the player (togglable with I key).
Draws a green line where the current frame is in the movie.
2015-06-05 14:45:26 +02:00
12a77b7ac7 Collapsed images:
* Icon of collapsed images is same as a movie
* Size displayed is cummulative size of all images
* Frame range is displayed in the filename
2015-06-05 14:01:40 +02:00
7575ecadff Merge branch 'alembic' into gooseberry 2015-06-05 13:02:34 +02:00
f19f6da7c2 Fix outdated stub factory class for pointcache when Alembic is disabled. 2015-06-05 13:01:07 +02:00
7592e5dbf5 Disable collapse images option after operator ends. 2015-06-05 11:26:25 +02:00
a2a970cbdd Collapse image sequence feature now uses BLI_path_* functions to detect
filenames.
2015-06-04 21:15:54 +02:00
62e8708232 Fix stupid recent mistake 2015-06-04 20:55:30 +02:00
4f64596916 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/makesdna/DNA_object_types.h
2015-06-04 20:51:17 +02:00
fa147804b8 Make clamping able to return to exact previous values. 2015-06-04 17:51:21 +02:00
468c96c0fa Load image sequence collapsing for sequencer
Very dirty feature that will have to be reimplemented when the new asset engine makes it into blender.

This commit tweaks the filebrowser to detect sequences of images that form parts of a movie. The
files need to be in the format <number>filelame.ext or <number>.filename.ext

There is a new option next to hidden file option that makes it so this collapsing takes place.

When collapsing is on, any movie files that have the same filename will be collapsed to the first
detected file in the sequence. Selecting that file will select all files in the sequence.

There is a shortcut in the sequence editor in the Add menu, "Image Sequence" that enables collapsing
by default. Unfortunately, selecting multiple movies will not add multiple sequences to the sequencer,
at least for now, but it should make it quite easier for people to quickly select the whole range of
images for a movie. Importing the image sequence into the sequencer will use placeholders, so any missing images
will display as black.
2015-06-04 12:47:25 +02:00
343c4fb54a Merge branch 'master' into gooseberry
Conflicts:
	intern/cycles/kernel/svm/svm.h
2015-06-04 12:05:11 +02:00
44276743cf Merge branch 'alembic' into gooseberry 2015-06-03 12:11:15 +02:00
d392367782 Only use string properties from the cachelib for metadata.
Using ints and floats would require prefixing the Alembic metadata
keys, which becomes messy and ambiguous. Encoding other data types as
strings can be done on the python side as well.
2015-06-03 10:54:14 +02:00
7dee53c6df Have to use IDP_ReplaceInGroup to overwrite ID properties that already
exist.
2015-06-03 10:44:48 +02:00
65a73d62d8 Python UI fix for displaying int and float properties as labels. 2015-06-02 18:29:51 +02:00
222ff8f4b7 Added missing break statements. 2015-06-02 18:29:30 +02:00
7e17e0189c Display extra metadata for the cache input archive. 2015-06-02 18:17:51 +02:00
3019eff71e Use ID property groups for storing and loading metadata associated to
Alembic archives.

Two separate property groups for metadata are used (so that reading
caches does not overwrite metadata for output caches).
2015-06-02 17:59:47 +02:00
08667e616f Merge branch 'alembic' into gooseberry 2015-06-02 15:27:18 +02:00
1ae3ffb6c9 Write metadata to caches (application name, date of creation, user
description).

Cache library output archives now have a description string next to them
that gets written into the archive.
2015-06-02 15:25:13 +02:00
33d6e6ed42 Display basic metadata of a cache archive in the cache library input
settings.
2015-06-02 13:05:11 +02:00
f9ec2e706e Silence compiler errors by returning a default value for vector
interpolation.
2015-06-02 12:29:37 +02:00
9e140a2c39 Support for an optional semantics argument when interpolating cached
properties.

This is necessary to distinguish e.g. vector semantics (linear vs. slerp
interpolation for positional/normal vectors). It would be simpler to
do this based purely on types, but the typing of common Alembic
properties is not sufficiently unique. Semantics arguments are enum
values, that can be omitted if the default interpolation should be used.
2015-06-01 19:14:34 +02:00
e499f9d900 Interpolation code for reading Alembic cache samples on subframes.
This features is needed for motion blur. All properties with position
semantics (transform matrices, mesh and curve vertex locations, etc.)
need to be interpolated for fractions of full frames, in order to
reproduce the motion and deformation correctly.

Alternatively we could store subframe time sampling for this subset of
properties. However, this would increase the amount of data stored,
and it might actually show artifacts from subframe interpolation in
Blender which is not visible to animators otherwise and should be
ignored.
2015-05-30 15:57:19 +02:00
6d6db87ae7 Make use of the subframe value in Scene when reading from cache archives.
Subframes are necessary when interpolating values.
2015-05-30 13:28:21 +02:00
179acf028c Use the Alembic generic chrono_t type internally for reading from
archives, instead of Blender frame values.

This is easier to use for interpolation, the frame value is really only
required externally, before and after reading a sample.
2015-05-30 13:25:22 +02:00
f0d15a6798 Merge branch 'master' into gooseberry 2015-05-29 17:45:03 +02:00
1c66edc14d Gooseberry: Workaround stupidness of MSVC with strict flags 2015-05-29 13:53:02 +05:00
054a97698e Merge branch 'alembic' into gooseberry 2015-05-28 15:27:18 +02:00
f1bd802b11 Moved child strand deformation into the general cache processing
function.

Strands processing now has 3 main steps:
1) apply parent modifiers
2) deform child strands
3) apply child modifiers
2015-05-28 15:25:00 +02:00
4905de28e5 Merge branch 'alembic' into gooseberry 2015-05-28 12:52:10 +02:00
e233e5f2a8 Allow external object targets for the cache shrinkwrap modifier. 2015-05-28 12:51:32 +02:00
383c52bff2 Merge branch 'alembic' into gooseberry 2015-05-27 20:23:29 +02:00
076b65e677 Presets for cached hair simulations.
This requires some modifications to the existing preset python class.
Serializing curve mappings can not be done with a simple property
assignment.

Also the fact that operator confirm popups drop all layout context
pointers means that we have to store the modifier name in the operator
in order to apply the preset to the correct modifier.
2015-05-27 20:20:30 +02:00
443890fefe Merge branch 'master' into gooseberry
Conflicts:
	source/blender/windowmanager/intern/wm_playanim.c
2015-05-27 20:05:06 +02:00
ae2f50268b Blenderplayer:
* Add space key to easily start-stop the player.
* Keep old behaviour of stopping when scrubbing.
* Sound scrubbing can be heard now even when scrubbing after pausing.
2015-05-27 18:21:31 +02:00
1aad1a7601 Merge branch 'alembic' into gooseberry 2015-05-27 17:56:34 +02:00
e8fb1b3ecf Fix for incorrect update callback in haircut cache modifier, leading
to unrelated property changes.
2015-05-27 17:55:13 +02:00
cd8baf871b Merge branch 'alembic' into gooseberry 2015-05-27 16:47:53 +02:00
9c87f0f2c8 Fix for the hair strands cutting modifier for caches.
The cutoff value was off by 1.0, due to an invalid increment for the
first vertex.
2015-05-27 16:46:23 +02:00
b98c3efaa4 Cleanup and fix for the cache backend factory, due to changed API
functions.
2015-05-27 15:55:40 +02:00
96e878b6cc Merge branch 'alembic' into gooseberry 2015-05-27 15:22:57 +02:00
2aa75bb106 Simplified render/preview settings for cache baking.
The previous way of selecting preview ("realtime") and render settings
on the cache library level was complicated and confusing. Now there are
just 2 buttons for baking either the preview or render level.
Technically the cache still works the same way, so a 3rd button could be
added for baking both passes into the same cache, should the need arise.

The preview cache now also uses the preview frame range, which should
help in quick testing of hair simulation settings. Render always uses
the scene frame range, like render buttons do.

For display in the viewport and rendering the cache will now use
whatever data is available in the archive. If the cache contains only
render data, the viewport will also draw full render data. Vice versa,
if the cache contains only preview data, this will also be used for
rendering.

Hair toggles for children and motion now are only used for the viewport
display. This simplifies the settings a lot and removes one potential
button to be overlooked.
2015-05-27 15:16:40 +02:00
62fd4395ac Merge branch 'master' into gooseberry 2015-05-27 14:44:40 +02:00
322380999e Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/object/object_ops.c
2015-05-26 14:56:36 +02:00
2e70a29f9e Merge branch 'master' into alembic 2015-05-26 09:34:31 +02:00
650fdcd74f Merge branch 'alembic' into gooseberry 2015-05-24 12:46:48 +02:00
48d0dd9b3a Fix for cycles rendering of shortened hair curves.
The strands data can now contain more vertices than are supposed to be
rendered (if cutoff < numverts).
2015-05-24 12:44:51 +02:00
bac7573dc5 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/blenkernel/BKE_key.h
	source/blender/blenkernel/intern/key.c
	source/blender/bmesh/intern/bmesh_strands_conv.c
2015-05-22 18:04:44 +02:00
466d17cffd Support for cutoff parameters in Alembic files.
These are optional, so older alembic cache versions still work.
2015-05-22 17:52:56 +02:00
7125b76c9a Take transformation of the duplicator object into accound for hair
cutting.

When using a dupli object from the same group as a target it is
sufficient to calculate the relative transform in the shared duplicator
local space. When using an external object though we have to transform
into world space first.
2015-05-22 17:25:48 +02:00
bd027416c4 Fix for incorrect cutoff points with the haircut cache modifier. 2015-05-22 16:59:01 +02:00
7b66e7bdd1 Implemented hair cutting for cached strands, based on a cutoff parameter
for child hairs.

The algorithm works by finding the first intersection of each child
hair with the target mesh. The child hairs have to be deformed with
their parents first (this usually happens *after* modifiers).
2015-05-22 16:22:57 +02:00
0ee5fa7745 Clean keyframes:
Keep handles as they were (cleanup code could ever slightly tweak
animation handles, which was not so good)
2015-05-22 15:42:28 +02:00
434ae40d63 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/windowmanager/intern/wm_playanim.c
2015-05-22 12:49:26 +02:00
89f1778328 Option for the haircut cache modifier to either use a scene object or
an "internal" object from the group.
2015-05-22 12:30:55 +02:00
3b089c1b90 Initialize curve mappings once after creating, just to be sure. 2015-05-22 12:18:51 +02:00
29ed48cced New cache modifier "Haircut", for removing unwanted child hairs. 2015-05-22 12:18:51 +02:00
d8c1d2d843 Alembic: Update stubs file so building without alembic works fine 2015-05-22 12:56:51 +05:00
94e69a379e SCons: Hopefully fix for gooseberry branch compilation 2015-05-21 20:43:41 +05:00
02d6601657 Use a flag to explicitly apply shape keys to either the goal positions
or the motion state.
2015-05-21 17:35:40 +02:00
5b26c112d9 Use correct blending weights for hair shapekey references. 2015-05-21 16:15:29 +02:00
67c8eb148b Removed unused variable. 2015-05-21 15:21:50 +02:00
f4ea6b4424 Properly loop sound when reaching the end of a movie 2015-05-20 19:27:55 +02:00
e09464a26b Speed of sound would get reset when stopping and resuming. 2015-05-20 19:14:59 +02:00
ca69120326 Blenderplayer audio:
Start and pause support
2015-05-20 18:52:30 +02:00
a5461ffa64 Blenderplayer sound:
Support speed of sound based on how fps is different from the movie fps.
For high fps the picture thread can lag behind the sound still, need
some way to framedrop.
2015-05-20 18:33:57 +02:00
53cbbcbb21 Keep interpolation type of keyframes when cleaning
Not sure how well that will work in practice, but there's a
whole studio of people ready to test.
2015-05-20 16:23:55 +02:00
b6b219996d Squeakycleanlinator tool for Hwoozeberry.
Basically it's a clean tool, but also removes a channel if the only
remaining keyframe has the default value only and is not used by
drivers or generative modifiers.

It's supposed to help with performance of the heavy scenes in
gooseberry.

Field test in gooseberry for now, masterification later.
2015-05-20 15:30:33 +02:00
efb4f87b75 Use dedicated versions of shapekey eval functions for strands.
Strand shapekeys will be interpreted as delta keys without a basis,
since the basis would be animated and therefore useless for static keys.
To avoid complexity in the already overburdened shapekey functions and
to skip old legacy code, the strands shapekeys now have their own
functions.
2015-05-20 14:30:39 +02:00
0c83b9c129 Removed some useless old code. 2015-05-20 12:56:43 +02:00
dc4d03c519 Removed the complicated optional refdata handling from the generic
shape key eval function.

This now goes to a dedicated strands function which can be cleaned up
properly, all the old code can function as before.
2015-05-20 12:48:28 +02:00
5f195acd1e Merge branch 'master' into gooseberry 2015-05-20 12:42:23 +02:00
b75a56dcc1 Fixed shape key reference data usage, for applying shape keys on top
of an animated base.

This is necessary for strand shape keys. The basis of the data comes
from the cached animation or simulation results, i.e. we can't use the
fixed basis key or the result would always become static.
2015-05-20 12:14:55 +02:00
fe0025f2ab Merge branch 'master' into gooseberry 2015-05-19 18:34:43 +02:00
2496259714 Apply strand shape keys to both the base strand coordinates and the
motion state.

This means shape keys work on the goal positions for hair as well as
the simulation results (hair motion).

If the simulation is created before shape keys are applied, the
resulting sim will be mixed with the shape keys, becoming more rigid
with increased shape weights.

OTOH the shape keys can also be applied to the animation result, before
doing hair simulation. In that case the shape will only affect the goal
positions and the bending shape of the hair, but the hair is otherwise
free to move.
2015-05-19 17:31:31 +02:00
ebd7269a99 Set the 'from' pointer in Key directly in the init method, so it works
with NULL pointers too.
2015-05-19 15:42:11 +02:00
b2d5d53fc8 Added back the deprecated KeyFrom struct in Key, for backward
compatibility.
2015-05-19 15:19:06 +02:00
60cd118a46 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/blenkernel/BKE_key.h
	source/blender/blenkernel/intern/key.c
	source/blender/makesdna/DNA_key_types.h
2015-05-19 14:55:20 +02:00
fdd1dfb657 Unified code for identifying unconventional shapekey owners between
gooseberry and alembic branches.

The shapekey code has been modified in both branches, adding particle
shapekeys in gooseberry and cache library shapekeys in alembic. The
two approaches are slightly different, but based on the same idea of
extending the 'from' owner info in Key, so that keys can be used without
a 'from' ID and/or with an index for identification.

This patch unifies the approach in both branches to make it slightly
less messy and avoid merge conflicts.
2015-05-19 14:50:52 +02:00
a91ccbc790 Ported key owner type code from gooseberry, to better sync both branches.
The shapekey code has been modified in both branches, adding particle
shapekeys in gooseberry and cache library shapekeys in alembic. The
two approaches are slightly different, but based on the same idea of
extending the 'from' owner info in Key, so that keys can be used without
a 'from' ID and/or with an index for identification.
2015-05-19 14:26:56 +02:00
3600b9f6bd Fix building without FFMPEG
Note - seems fps for movies are only calculated with ffmpeg?
2015-05-19 13:15:42 +02:00
a975f970ce Merge branch 'alembic' into gooseberry 2015-05-19 12:02:06 +02:00
5fd5d3c8b2 Improved relaxation code for strand lengths in hair edit mode. 2015-05-19 12:00:35 +02:00
f0e00033d1 Fix for incorrect vertex loops when calculating strands.
This was using vprev from previous strands, leading to spurious changes
on untouched strands when combing.
2015-05-19 11:56:44 +02:00
8357040667 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/windowmanager/intern/wm_playanim.c
2015-05-19 11:20:54 +02:00
66d39ad417 Merge branch 'master' into alembic 2015-05-19 08:48:46 +02:00
8ef679b6fd Merge branch 'alembic' into gooseberry 2015-05-18 20:36:44 +02:00
6091d9afa0 Use the extended archive writer variant to set the correct start frame
for slices.

Also the time sampling for slice output properties must be passed down
from the output archive, since the input properties use the original
start frame and cycle times.
2015-05-18 20:34:34 +02:00
a085b4c9f6 Use fps and start frame settings for cache archives internally, rather
than relying on values from Scene.

This gives more flexibility when creating archives. A default variant
for opening archives using the scene settings is still available.
2015-05-18 19:59:30 +02:00
8c21b0a943 New operator for 'splicing' Alembic data, i.e. writing part of the frame
range to a new archive.

This feature is useful when cache size becomes to big and unwieldy.
For sending shots to a render farm a large cache can now be split into
smaller parts, which are spliced off and can be sent individually.
2015-05-18 19:43:01 +02:00
27fa4d3301 Scrubbing after movie has finished playing works now 2015-05-18 19:13:35 +02:00
d266ed5819 Initial support of audio scrubbing in blenderplayer.
Still lots of corner cases to check:

* sound FPS not changing with speed settings of player
* picture and video still not 100% in synch
* Haven't checked what happens when audio is finished.

Some changes were made to make things nicer:

* Scrub now initiates on mouse click instead of mouse motion, makes
things more predictable.
* When scrubbing a movie with sound, don't pause playing after
scrubbing.
2015-05-18 18:49:50 +02:00
8374cf4fb6 Merge branch 'alembic' into gooseberry 2015-05-18 13:10:37 +02:00
aa91aa8b9b Optional arguments for the cache baking operator to chose a frame range.
If these properties are left undefined the operator will use the scene
frame range as before.
2015-05-18 13:09:19 +02:00
735408c4e4 Merge branch 'alembic' into gooseberry 2015-05-18 12:40:22 +02:00
258d927147 Very basic printing of cache bake info to have some feedback in
background mode.
2015-05-18 12:38:56 +02:00
7543035ffe Test support for audio in internal player to showcase in weekly :) 2015-05-15 17:33:09 +02:00
adf1b932f0 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/animation/anim_draw.c
2015-05-15 17:32:45 +02:00
e1c1b546b5 Merge branch 'alembic' into gooseberry 2015-05-15 13:00:59 +02:00
849ea4b818 Removed redundant particle matrix calculation when writing hair caches.
This could give a significant improvement in cache baking speed. The
particle matrix is particularly costly to calculate for highly
subdivided meshes.
2015-05-15 12:13:52 +02:00
7629a78b2a Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/mesh.c
	source/blender/depsgraph/intern/depsgraph_build_relations.cc
2015-05-14 16:51:28 +02:00
1518fde97d Merge branch 'master' into alembic
Conflicts:
	build_files/scons/tools/Blender.py
	source/blender/blenkernel/intern/mesh.c
2015-05-14 16:35:33 +02:00
51325025ec Merge branch 'master' into gooseberry
Conflicts:
	build_files/scons/tools/Blender.py
	source/blender/blenkernel/intern/mesh.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/editors/interface/interface_handlers.c
2015-05-14 19:25:15 +05:00
67dd6243f2 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-05-14 13:26:56 +02:00
4376dfbf21 Fix for Drag force fields: was using inverted velocity. 2015-05-14 12:17:14 +02:00
e9263a8ee3 Zoom to frame options, requested by the Hwoozeberry (dutch translation)
team.

There are 3 options here:

1) Keep range (previous behaviour)
2) Seconds - allows a specified offset in seconds around current frame
3) keyframes - zoom to include a number of keyframes around the cursor

Options 2 and 3 have their own properties to tweak the behaviour and all
options can be found in User Preferences->Interface under the 2D
viewports section.

Number 3 will probably need some refinement so commiting here for the
hwoozeberry team to test first.
2015-05-13 20:31:03 +02:00
c98fb76b4e Fix for previous commit: the "goal deflect" feature wasn't actually
filtering effectors by type.
2015-05-13 18:13:50 +02:00
bab4d495dd Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-05-13 16:50:06 +02:00
d99620f296 Optional feature "Goal Deflect" to disable goal forces when hitting a
deflector object.
2015-05-13 16:49:12 +02:00
28669b4e42 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-05-12 12:48:51 +02:00
7335d6675e Revert "Disabled the goal spring that is supposed to stabilize roots."
This reverts commit 1b32ac9779.

The goal spring is not working as intended, but is better than having
no bending force at the roots at all. Needs a better solution (virtual
root vertex).
2015-05-12 12:47:03 +02:00
99734166b0 Fix for incorrect sub-stepping in the strands hair sim solver.
The code was copied from the old cloth solver, which used a while loop.
Ended up using double step increments, which screwed up some
calculations ...
2015-05-12 12:44:24 +02:00
ab7e9340ca Fix for initialization of effector velocities. 2015-05-11 19:49:23 +02:00
1b32ac9779 Disabled the goal spring that is supposed to stabilize roots.
There are larger bugs still roaming free which need to be solved first.
Goal springs also are inherently unstable because the solver can not
properly estimate their Jacobian.
2015-05-11 19:46:41 +02:00
7391480b66 Merge branch 'alembic' into gooseberry 2015-05-11 15:23:20 +02:00
215b9ae288 Fix for crash when using cache file paths without slashes in them. 2015-05-11 15:22:39 +02:00
9a6ea84acb Merge branch 'alembic' into gooseberry 2015-05-11 14:00:20 +02:00
aff1cfc013 Fix for potential NULL pointer access when looking up strands data from
caches.

The 'find' function was returning a bool value, but this does not
guarantee non-null pointers. Removed the return value to avoid
confusion, now callers should simply check the returned pointers.
2015-05-11 13:58:15 +02:00
bc4be56608 Change of cache filter group behavior to allow partial caching.
The filter group was used by omitting any object instances that were
not in the group. This reduces the cache size, but it also entirely
skips objects.

Now the filter group only prevents writing of the actual object data,
but still allows storing dupli instances and dummy entries in the cache.
Any objects from cached dupli lists that don't have cached data (mesh or
strands) will now use the original object data instead.
2015-05-11 13:51:22 +02:00
09ad591e1f Merge branch 'alembic' into gooseberry 2015-05-11 11:41:40 +02:00
a5392ad4aa Fix for running bake operator in background mode without a job.
The cache bake operator would always create a job in the window manager.
However, when running in background mode via a script, the operator can
not be modal and the script would return right after starting the job.
Then Blender is stopped and the baking job with it.

To prevent this the operator now only runs in a job when executed from
the invoke function (or when 'use_job' is set explicitly).
2015-05-11 11:37:31 +02:00
d5228eb992 Drag type force field for keeping hairs "stuck" to a mesh surface. 2015-05-10 14:04:05 +02:00
28d4538215 Merge branch 'alembic' into gooseberry 2015-05-08 17:55:18 +02:00
f89385b17c Merge branch 'master' into gooseberry 2015-05-08 17:17:47 +02:00
70e768b095 Hide regular strands when the duplicator object is in hair edit mode. 2015-05-08 15:25:53 +02:00
1e3e6e2f18 Don't use the refkey for calculating shape deltas, but only for the base
shape.

Shape keys distinguish between the base shape (shape without any keys)
and the individual reference shapes for each shape key (which define
the delta offsets). For strand shapes, which have to work on top of
animation, the base shape must be the original cache result rather than
a static shape, but the delta for each keyblock is still calculated
wrt. an explicit shape.
2015-05-08 15:04:17 +02:00
def79482c2 Merge branch 'alembic' into gooseberry 2015-05-08 13:00:50 +02:00
96bbbbd5ea Follow up fix for bend stiffness curve map versioning.
The DNA lookup for pointers is a bit weird, it expects "CurveMapping" as
the type name, but then the variable field becomes
"*bend_stiffness_mapping".
2015-05-08 12:59:27 +02:00
cc588eb1e4 Merge branch 'master' into gooseberry 2015-05-08 12:36:20 +02:00
b032c86a12 Handle transformation difference between a cached duplicator object and
group objects when editing shape keys.

The edit data (including CD_SHAPEKEY layers) is in the active object's
space, i.e. the duplicator. The original data however is cached strands
data, which is in the dupli object's space. All geometry data needs to
be transformed properly when entering/exiting edit mode.
2015-05-08 12:19:27 +02:00
d4cdac35f8 Merge branch 'master' into alembic 2015-05-08 11:24:43 +02:00
ef88d436c3 Merge branch 'alembic' into gooseberry 2015-05-08 11:16:11 +02:00
548102fcb8 Version fix for bend stiffness curve mapping. 2015-05-08 11:13:04 +02:00
0335a0507c Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-05-08 10:48:53 +02:00
158568e347 Another curve mapping to control bending stiffness along hair strands.
This already exists for goal springs. Bending stiffness, however, is
preferable to global goal springs for physical realism. Controlling
stiffness in this way allows using bending forces to also simulate
unconventional hair, such as clumpy strands that are thicker and stiffer
at the base.

Note that hair interaction can also be simulated with this tool in some
way, although eventually better methods may be needed for such effects.
2015-05-08 10:45:08 +02:00
b120755c21 Merge branch 'alembic' into gooseberry 2015-05-07 20:21:05 +02:00
345f68f7b9 Fix for uninitialized values in strand children, leading to random
crashes.
2015-05-07 20:20:11 +02:00
a8293335ba Avoid crashes in pie menus now that strand edit mode forces us to have
more than 8 object modes. We will have to support auto pie expansion at
some point...
2015-05-07 19:31:34 +02:00
87aaa8ecfb Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/implicit_blender.c
2015-05-07 17:02:36 +02:00
d17a52109e Fix for NaN error when using zero-length springs in the mass-spring
solver.

This happens when using goal springs, which are now defined as linear
springs between actual vertices and virtual goal vertices. The Jacobian
was not accounting for the possibility of zero rest length.
2015-05-07 17:01:26 +02:00
ddd48cc788 Cleanup: warnings 2015-05-08 00:22:30 +10:00
f33286c48f Merge branch 'alembic' into gooseberry 2015-05-08 00:15:43 +10:00
9ba112eb89 Cleanup: quiet warnings 2015-05-08 00:06:09 +10:00
06226b28cd Merge branch 'master' into alembic 2015-05-07 23:49:36 +10:00
8e9c7f70c8 Merge branch 'master' into gooseberry 2015-05-07 23:38:03 +10:00
13f0ec29ce Extended RNA update for shape keys to trigger re-reading of dupli caches. 2015-05-07 15:25:45 +02:00
ac0b89f656 Merge branch 'alembic' into gooseberry 2015-05-07 14:45:16 +02:00
93944e5249 Fix for missing lib-link of effector weights group pointer. 2015-05-07 14:44:19 +02:00
d2421cee51 Merge branch 'alembic' into gooseberry 2015-05-07 14:17:59 +02:00
1326240006 Fix for cache simulation force fields, these were not added up. 2015-05-07 14:16:41 +02:00
249b3cca61 Merge branch 'master' into gooseberry 2015-05-07 14:10:00 +02:00
52117a07cc Conversion for shape keys back to strands data from edit mode. 2015-05-07 13:01:28 +02:00
d4249df4f7 Strands edit data conversion wants the raw shape key number (starting
at 1), converts to index internally.
2015-05-07 10:55:21 +02:00
429741ac19 Gooseberry: Attempt to fix compilation error with scons 2015-05-07 13:01:42 +05:00
409988e3c3 Fix for own error in merging alembic branch, breaking shape keys.
Both the gooseberry and alembic branches contain extensions of the Key
DNA structure, in order to make it work for particles and caches
respectively. This was giving badly resolved conflicts on merge.
2015-05-06 19:23:02 +02:00
2b415683fd Merge branch 'master' into alembic 2015-05-06 18:58:32 +02:00
83fc255bc8 Merge branch 'master' into gooseberry 2015-05-06 18:44:13 +02:00
f5ae2e1bbc Moved the child deformation for strands out of the core cache reading
function.

This is a feature for display in the viewport and rendering, which has
nothing to do with the core cache reading functionality. In the general
case you'd want the child data to remain unmodified.
2015-05-06 16:44:24 +02:00
79c17aaad8 Support metadata display in sequencer overdrop
Getting a consistent look here is difficult since editors apply their
own scaling. ideally, here we would have a consistent look with constant
font size but this is still to be realized in master and needs some
extra thought.
2015-05-06 16:06:57 +02:00
a0c83f1754 Merge branch 'alembic' into gooseberry 2015-05-06 15:39:17 +02:00
1938fcac8e Fix fo 'simple' particle hair matrix calculation.
The parent matrix is used for single-parent children ('simple'), in
which case the pa->num_dmcache has to be used to get the correct
position on subdivided meshes.
2015-05-06 15:36:46 +02:00
f26b373cb9 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/object/object_shapekey.c
2015-05-06 15:31:57 +02:00
ebcb8223bd Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/blenkernel/BKE_key.h
	source/blender/blenkernel/intern/customdata.c
	source/blender/blenkernel/intern/key.c
	source/blender/editors/object/object_shapekey.c
	source/blender/makesdna/DNA_customdata_types.h
	source/blender/makesrna/intern/rna_key.c
2015-05-06 14:02:29 +02:00
af7fe835ff Store MSurfaceSample data in hair strands for mapping to a mesh.
This data is not strictly necessary for the strands drawing or rendering
or even hair simulation, because the hair root offset and rotation is
already cached explicitly. However, the strand edit mode needs this
information to correctly apply length constraints.
2015-05-06 11:13:36 +02:00
6534a7b9ed Fix for threaded dupli cache generation from groups.
Strands require a valid DerivedMesh for calculating their root matrix
and surface mapping. The scheduler tasks were created such that strands
would be calculated while the DM task was not finished yet, leading to
missing DM data.
2015-05-06 10:12:46 +02:00
264e800965 Alembic: Quick fixes for strict compiler flags 2015-05-05 21:54:43 +05:00
c685b9f30b Alembic support for MSurfaceSample customdata. 2015-05-05 16:59:49 +02:00
39ab4dab66 Take transformation into account between the duplicator and strands
object.

The strand edit mode uses the local space of the active object, which
is the duplicator (and dupli cache owner). The strands data is in local
space of the original particle system object however, so have to
convert. This is a very hackish solution, using the first instance of
the strands data, which only works for single instance data.
2015-05-05 15:37:00 +02:00
e0a780d9a7 Strand edit functions for storing edit data in the Cache Shape Key
modifier and editing in hair edit mode.
2015-05-05 14:41:04 +02:00
46b9180a0a Merge branch 'strand_editmode' into alembic 2015-05-05 14:29:42 +02:00
38d9301674 Another fix for mirror editing of strand data.
Currently strand edit mode tool use the object data 'x mirror' flag.
This flag is only available on mesh objects, but the strand editing
can be used for dupli override caches etc. as well. Eventually strand
editing should get it's own independent flag to avoid this problem.
2015-05-05 14:27:44 +02:00
017d505cac Merge branch 'strand_editmode' into alembic 2015-05-05 14:05:03 +02:00
fbc70fa51c Fix for call to mirror functions when mirroring is not enabled, giving
warnings.
2015-05-05 14:03:59 +02:00
ccfea77463 Merge branch 'strand_editmode' into alembic 2015-05-04 18:39:27 +02:00
d52bdb6d3d Moved particle related functions of the strands edit mode into a
separate file.

This may seem a bit like overkill, but it helps ensure that no particle
depedencies messes up the strand editing code. The same will be done for
other use cases of the strand editing code in the future.
2015-05-04 18:37:45 +02:00
f7e8171264 Merge branch 'strand_editmode' into alembic 2015-05-04 17:53:00 +02:00
16b6d6c676 Added missing CD layer type name for MSurfaceSample. 2015-05-04 17:52:13 +02:00
ff5fa0df18 Merge branch 'strand_editmode' into alembic
Conflicts:
	source/blender/editors/space_view3d/drawstrands.c
	source/blender/editors/space_view3d/view3d_intern.h
2015-05-04 17:37:11 +02:00
b97214a0ba Forgot this last merge 2015-05-04 17:35:23 +02:00
dc7d07753f Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_sequencer/sequencer_draw.c
2015-05-04 17:34:32 +02:00
62b139385a Merge branch 'master' into alembic 2015-05-04 17:15:00 +02:00
bf7e8b42fa Merge branch 'master' into strand_editmode
Conflicts:
	source/blender/bmesh/bmesh_class.h
	source/blender/bmesh/intern/bmesh_mesh_conv.h
2015-05-04 17:14:25 +02:00
556c25f145 Extended shape key evaluation for cached strands blending.
Now shape keys don't replace the cached base data entirely with the
static Basis shape. Instead the current state as coming from the cache
is interpreted as the variable refkey instead of the Basis key.

The Basis key is in fact redundant, but removing it would require
changing a lot of shared shapekey code, so it's left in for now.
2015-05-04 16:54:26 +02:00
ed5de2ba08 Consider an empty keyblocks list to be a new key, so a Basis shape is
added automatically.
2015-05-04 13:05:06 +02:00
1ea8324a71 Actual shape key evaluation in the shape key modifier for caches. 2015-05-04 13:04:41 +02:00
de125950f5 Make strand shapes relative by default. 2015-05-04 13:01:30 +02:00
2df6da20aa Unused variables. 2015-05-04 13:01:08 +02:00
1e6e44fd24 New 'fromtype' variable in Key to allow handling type-dependent pointer
size and stride.

This is terribly messy due to the legacy code. At some point should be
cleaned up to get rid of the 'from' backpointer and simplify.
2015-05-04 12:59:34 +02:00
51260cbe71 Create a dummy weights array for strand keys, otherwise the eval
function will exit early.
2015-05-04 12:57:26 +02:00
809d5d92d3 Fix for lib_link of cache shape keys, avoid discarding this, they are
expected to stay alive.
2015-05-04 12:54:29 +02:00
247de3f9db Fix for incorrect/unnecessary storage of Key data in readfile.
The Key struct in the cache strands shape modifier is in fact "owned"
by the modifier, but linked in the Main blenddata, so it does not have
to be written explicitly.
2015-05-03 19:25:54 +02:00
699c280a3f Added a new "Modifiers" display mode for cache libraries, which reads
the source cache and then applies modifiers afterward.

This only performs non-iterative modifiers, which don't require the
passage of time to work (e.g. shrinkwrap).
2015-05-03 19:19:43 +02:00
ba878a0880 Main shape key implementation for cached strand data.
This includes storage of the shape keys in a `Key` instance in the
modifier data, and accompanying operators for adding, removing, moving,
etc. shape keys, as well as the necessary UI code.
2015-05-03 18:24:43 +02:00
ed81c38c97 Extended 'add' function for shape keys that allows passing a NULL
pointer for 'from'.

The Key DNA has some very old and largely deprecated legacy code that
needs initializing, which requires either explicit info or deduction
from an ID. The cache modifier creates keys in a new environment without
an existing known ID type to deduce the data element settings from.
2015-05-03 13:46:38 +02:00
958e6b1f20 Some NULL pointer checks in shape key code to ensure the Key struct can
be used without a 'from' pointer.
2015-05-03 12:47:54 +02:00
dbc4be381d New cache modifier type "Strands Key" for implementing shape keys on
cached strands data.

This modifier acts as a container for shape key data (i.e. as part of
the cache library). Such shape data can be applied to cached strands
data, which allows tweaking of animated hair shapes.

This could work both as a shape for the strand goals (adding dynamics
on top) or as a final modification after dynamics. Both methods have
their advantages (pre-sim allows control and sim at the same time,
post-sim gives accurate shapes but becomes rigid).
2015-05-03 12:13:03 +02:00
de5952c3d6 Removed optimization by applying cache shrinkwrap modifier only in the
realtime pass.

As with hair sim, this would be preferable, but is causing too many
problems with the current cache archive layout.
2015-05-03 12:07:17 +02:00
920aa5e7d2 Merge branch 'master' into gooseberry 2015-05-01 17:43:49 +02:00
e51b2ea0b9 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-05-01 16:11:27 +02:00
909134270a Fix for memory leak when reading cached strands data with UV or vertex
color layers.

The layer data is added to the strands after creation, but can be
existing already. It should only be reallocated when the number of
layers changes, and must be freed cleanly in that case.
2015-05-01 16:09:32 +02:00
cbd0d7a6b4 Alternative implementation for goal spring targets as vertices.
When using external forces to implement goal springs to explicit
positions in space, the system cannot calculate a stable solution based
on the goal velocities. The new approach implements goals as vertices
in the simulation, which are constrained to their animated locations.
This way they are treated like regular vertices, but the springs only
affect their non-constrained counterpart (the actual vertices).
2015-05-01 15:51:14 +02:00
38e54a7060 Rotation randomization feature for the particle instance modifier.
When using the hair path deformation feature of the modifier, each copy
of the mesh can now be rotated around the path, in addition to changing
length and offset. This includes a constant phase angle as well as a
randomization factor.
2015-05-01 13:07:46 +02:00
7e2fc0d78a Merge branch 'alembic' into gooseberry 2015-05-01 10:28:23 +02:00
50a8b15f47 Fix for shifted sample-to-frame mapping in Alembic files with hair
simulation.

The hair sim skips the first frame (velocities are undefined there), but
still has to create the motion state data in order to have it written
as a sample. Otherwise the strands motion state samples start one sample
short and frames get mapped to one sample in the past. This then leads
to incorrect movement of all hair vertices other than the roots (which
are always clamped to the animated positions).
2015-05-01 10:24:32 +02:00
3247955492 Graph editor uses own function for setting frame, use scrub flag there
as well.
2015-04-30 17:47:56 +02:00
83e83c6de7 Bring back audio scrub after last commit 2015-04-30 17:27:14 +02:00
dc25505aea Make Hjalti happier commit.
Treat scrubbing as animation. This takes care of too many updates from
our armature system.
2015-04-30 16:48:10 +02:00
02a76aa765 Merge branch 'master' into gooseberry 2015-04-30 15:18:02 +02:00
b063b2e265 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-30 14:45:53 +02:00
afc6142b91 Fix for deflector force fields in cache simulation.
Make sure forces always push outward when not using "double sided"
deflectors (default).
2015-04-30 12:14:51 +02:00
a8cdd9dda7 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-04-29 21:41:02 +02:00
20c4b0d4a2 Merge branch 'master' into gooseberry 2015-04-29 18:50:19 +02:00
1c9985e015 Gooseberry: Fix crash of backdrop widget in graph space
This fix should actually happen in wiggly-widgets branch but it's now
has some commits which are not in gooseberry and merging them night
be not really safe.
2015-04-29 19:33:06 +05:00
303e9b4032 Fix really stupid own mistake that caused leakage of timers. 2015-04-29 16:21:21 +02:00
8fdfca67a5 Merge branch 'master' into gooseberry 2015-04-29 18:55:16 +05:00
7e3e624298 Tentative fix for flickering particle duplis, when using "pick random"
with a dupligroup and distributed rendering.

The particle duplis were generated using the global RNG (BLI_rand). This
is unstable once scenes become a bit more complex and objects are
evaluated in multiple threads.

This patch is not in master, because it changes the look of existing
particle setups.
2015-04-29 15:21:43 +02:00
9b4912ba9e New shrinkwrap modifier for cached hair data.
This is experimental. It might work for simple collision-like features,
by keeping goal positions for hair above the mesh surface. However, the
nature of nearest-point lookup on meshes means that the goal position
can flip to the other side of a mesh rapidly, which would lead to
strong forces and unstable behavior.

This code should be seen as an experiment.
2015-04-29 14:16:18 +02:00
b6aaa73953 Merge branch 'master' into gooseberry 2015-04-29 12:38:26 +02:00
90b3832c4d Merge branch 'alembic' into gooseberry
Conflicts:
	intern/cycles/blender/blender_sync.h
2015-04-29 14:48:37 +05:00
2b833c7ae8 Alembic: Fix compilation error after recent task/threads changes
For some reason CMake worked just fine, but SCons was giving issues.
2015-04-29 14:41:32 +05:00
fe052ca1ff Merge branch 'master' into gooseberry 2015-04-29 14:19:15 +05:00
adf4d0e3e3 Merge branch 'master' into alembic
Conflicts:
	intern/cycles/blender/blender_sync.h
2015-04-29 14:00:07 +05:00
0a94fbbf23 Merge branch 'alembic' into gooseberry 2015-04-28 19:26:03 +02:00
b4e5161b02 Fix for own bug in rB6d1fecc15254381420fdb1290eb611ed14cddaae.
The UV and vertex color attribute export function expects the curve data
arrays to contain only a single attribute at a time. They must be
cleared before filling in data for each UV/vcol attribute.
2015-04-28 19:18:15 +02:00
b3bdb23088 Merge branch 'alembic' into gooseberry 2015-04-28 16:53:14 +02:00
bc2055e7b7 Merge branch 'master' into gooseberry
Conflicts:
	intern/cycles/blender/blender_object.cpp
	intern/cycles/blender/blender_sync.h
	source/blender/editors/interface/interface_utils.c
2015-04-28 16:44:17 +02:00
e4758d3dfb Use quaternions instead of 3x3 matrices to store rotation of strand
roots in Alembic caches.

This kind of data is a big chunk of massive hair systems. Test files
could be reduced this way by almost 30%.
2015-04-28 11:34:02 +02:00
55ad6a99f6 Merge branch 'alembic' into gooseberry 2015-04-28 10:04:27 +02:00
6465cc7ef9 Accidentally deleted a return statement in previous commit. 2015-04-28 10:03:20 +02:00
22b35d7217 Fixed minor memory leak when the bake operator exits early without
freeing allocated data.
2015-04-28 10:01:50 +02:00
b539039d19 Optional filter group pointer in Cache Library for limiting cache
content.

This group is only used for the baking operator (like the datatypes
filter), but has no effect when reading caches. The UI now uses a box
layout to reflect this.
2015-04-28 09:43:33 +02:00
e9ae916750 Removed unused function for constructing a list of objects used by a
cache library.

This was no longer how cache libraries are used anyway, they now cache
based on duplilists, which can be more than recursive groups.
2015-04-27 19:24:31 +02:00
6d1fecc152 Support for UV and vertex color attributes of cached strands data.
Unlike particles, the Strands data stores UV coordinates and vertex
colors explicitly as a per-strand (const) property. This means Cycles
does not have to know the details of how particles map themselves to
a changing mesh surfaces (which is very complicated and fraught with
broken use cases and bugs). The UVs and colors are stored once for each
strand, since they are not expected to change over time (strands being
fixed to the mesh surface).
2015-04-27 15:18:30 +02:00
211afbabc7 Alembic: Make group's write_sample() threaded
The idea is to evaluate derived meshes in multiple threads, which will
reduce overall write_sample() time. We can't make all routines threaded
in there because alembic's file IO can't be threaded.

In any case, this change gives 2x speedup of exporting render resolution
version of Franck here.
2015-04-27 17:58:13 +05:00
3c0d111267 Alembic: Add utilities for task pool and scoped lock
Currently unused, but handy for some further development.
2015-04-27 15:34:03 +05:00
970f7feed4 Alembic: Minor tweak to disabling hdf5 if alembic does not support it
Mainly just suppresses meaningless message if hdf5 is already disabled in cmake.
2015-04-27 14:51:16 +05:00
Julian Eisel
e4b1b17925 Merge branch 'master' into gooseberry 2015-04-25 14:07:18 +02:00
757b5249d4 Alembic: Solve compilation error with strict compiler flags 2015-04-25 14:12:33 +05:00
3c5476e7f2 Do the actual frame change on timer events, not mouse move - those can
be buffered and choke the operator.
2015-04-24 17:47:35 +02:00
53441b8027 Merge branch 'alembic' into gooseberry 2015-04-24 17:37:22 +02:00
544f6dd9b6 Animation scrubbing - optimization attempt
Experiment for animators to try - only do full notification of scene at
end of scrubbing, do only manual area update instead like we do for
animation. Also skip audio update unless we do audio scrubbing.
2015-04-24 16:58:59 +02:00
8dcffc0f05 Use a wrapper around alembic read_sample function calls, to catch
Alembic exceptions and prevent crashing.

Alembic can throw exceptions on relatively common and uncritical errors,
such as mismatching properties in files which don't fit the expected
schema. These cases should now be handled gracefully and simple reject
the cache file with an error message.
2015-04-24 14:30:21 +02:00
00c69c9171 Support CD_MTFACE as a dummy layer in Alembic exports.
Customdata layers also store some base information, such as "active"
layer for rendering. This information is needed currently for syncing
particle UV and MCol data in cycles, even though the MTFACE layer type
itself is pretty much deprecated.
2015-04-24 14:29:13 +02:00
8c5a9cc8df Fix compilation issue 2015-04-24 11:41:58 +02:00
5eea19da4f Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/view3d_edit.c
2015-04-24 11:38:40 +02:00
c9e22c6ea9 Support for Loop UV and vertex color customdata attributes.
The exclusion mask for meshes in Alembic caches now is a bit more
specific as well, to not bluntly exclude all bmesh attributes.
2015-04-24 11:02:45 +02:00
84cbaf6f77 Fixed missing increment of when writing out CD_ORIGSPACE_MLOOP data. 2015-04-24 10:51:28 +02:00
290188c7fb Merge branch 'alembic' into gooseberry 2015-04-23 18:46:04 +02:00
c836cbab11 Don't disable hair sim during the render pass.
This otherwise prevents hair simulation motion showing up in renders.

The Alembic structure will have to be redesigned anyway. The current
concept of storing two separate entire scenes for viewport/render will
be replaced by a per-object detail level system. This allows performing
hair simulation only once and still use different resolutions etc.
where appropriate.
2015-04-23 18:43:20 +02:00
0b0b350e21 Merge branch 'alembic' into gooseberry 2015-04-23 16:10:48 +02:00
80126d8cf8 Merge branch 'master' into gooseberry 2015-04-23 16:10:22 +02:00
bc4347a73c Merge branch 'master' into alembic 2015-04-23 16:09:34 +02:00
0b026fd6ef Alembic: Use task pool for calculating DM for dupli object data 2015-04-23 18:49:22 +05:00
55c2330aeb Alembic: Typo sneaked in last moment before previous commit 2015-04-23 18:48:34 +05:00
5982a57f02 Alembic: Limit frame update to only group which we're interested in
The idea is simple: make it so scene_update_for_newframe is only doing updates
of the stuff which is really needed for the currently baking group.

Implementation is a bit tricky since we don't have parent relations after the
DAG is built, so doing some graph traversal there.

This code is also now using simplified version of scene_update_for_newframe()
which means in theory we can try de-duplicating some pieces of code, but that
can be done later.

Additionally, the same approach can be used to optimize motion path calculation.
2015-04-23 17:04:21 +05:00
0293378aa4 Test to check accuracy of claims about openalsoft being fixable by a
better config.
2015-04-23 13:01:03 +02:00
14653ab241 Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-23 14:53:38 +05:00
8b9d1818a5 Smoke: Fix crash when auto-sim happens outside of the backed frame range
Apparently, even if the smoke is backed to an external files it still could be
tried to be simulated at the frames outside of the baked range.

Kinda weird feature which isn't really safe, but better not to crash here.

Not totally happy with the code yet, will check with Lukas or Daniel how it
could be improved further.
2015-04-23 14:51:21 +05:00
66f7253aae Merge branch 'master' into alembic 2015-04-23 09:14:35 +02:00
cd5ab215e3 Allow the dupli override simulation to specify layers of effector
influence explicitly.

The previous code would only allow using the layers of the given object.
This is not useful for dupli overrides, because even finding which
layers an object in a dupligroup is in is cumbersome. It makes more
sense to use the layers of the duplicator instead.

There is an '_ex' version of the pdInitEffectors function now, with
an explicit layers argument. The simple version now also skips the
'precalc' argument, because this was true in every case except the
depsgraph dependency building anyway.
2015-04-23 09:09:06 +02:00
e2eb097491 Merge branch 'alembic' into gooseberry 2015-04-23 08:42:17 +02:00
38a28ce636 Fix for potentially uninitialized variable. 2015-04-23 08:41:28 +02:00
8a168e24cc Merge branch 'alembic' into gooseberry 2015-04-23 08:39:19 +02:00
adc0300bb9 Fix for incorrect index in strands normal calculation. 2015-04-23 08:38:03 +02:00
9e9a3cb7b6 Git missed those last commit 2015-04-22 19:40:11 +02:00
a6167306a2 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/interface/interface_handlers.c
	source/blender/editors/space_sequencer/sequencer_draw.c
2015-04-22 19:34:37 +02:00
d794ce627f Merge branch 'alembic' into gooseberry 2015-04-22 15:58:55 +02:00
523ea570e7 Make size calculation in cache archive info operators an optional extra
step.

This calculate can take a bit of time (some seconds to a minute in
tests), due to having to loop through all array samples. In many cases
only the basic structure is wanted.
2015-04-22 15:50:19 +02:00
9cfff67158 Merge branch 'alembic' into gooseberry 2015-04-22 14:25:38 +02:00
dbbc7b465d Alembic: Fix wrong detection in Cycles whether cache is to be used for meshes 2015-04-22 17:06:02 +05:00
dada265e2f Alembic: Fix crash of viewport render with strands read from alembic cache
The issue was caused by RNA passing ownership from the cache data used by Blender
to Cycles. This lead to situations when all of a sudden blender looses data it
was expecting to have.

Now instead of passing ownership we're just copying strands from the data, so both
Blender and Cycles are having it's own local data.

Ideally this data will be shared between viewport and Cycles, but that's a bit
more tricky to do without modifying RNA API. Would happen eventually tho.
2015-04-22 16:07:27 +05:00
adb7299dea Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-22 12:11:47 +02:00
ffbb48b064 Enabled air drag forces in cached hair sim. 2015-04-22 12:10:52 +02:00
39990d8eec Use mass parameter for setting gravity forces in cached hair sim. 2015-04-22 12:10:52 +02:00
d0f8995129 Alembic: Fixes for strict compiler flags 2015-04-22 13:14:24 +05:00
d5ed706674 Alembic: Code cleanup, space around unused pointer function argument 2015-04-22 13:05:39 +05:00
456515b59d Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-22 12:18:35 +05:00
edb7a6819d Cycles: Typo in triangle storage tooltip 2015-04-22 12:17:31 +05:00
8bd84d8ec9 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/drawvolume.c
2015-04-21 17:31:55 +02:00
33e515671a Estimation for overall data size of Alembic components.
This is not accurate, but should give some indication about the most
expensive parts of a cache, so it can be optimized efficiently.
2015-04-21 17:26:33 +02:00
af12668c28 Improved Alembic archive examination tool for cache libraries.
A new panel is added for showing the structure and contents of archives
of a cache library (instead of simply dumping on the terminal). The
archive structure is stored in a lightweight tree structure, mirroring
the hierarchy of objects and properties in Alembic. These
object/property nodes can be expanded individually for easier navigation
through the archive.
2015-04-21 13:35:25 +02:00
6caba7bba2 Use a dedicated panel for cache library UI instead of appending to the
duplication UI.
2015-04-21 11:51:04 +02:00
d739889cb9 Alembic: Make alembic's HDF5 library optional
This way blender will be happy about alembic compiled without HDF5 support.
2015-04-21 13:39:52 +05:00
944ac62ad1 Fix alembic-cached dupli not updating in Render mode in 3DViews.
Probably a typo? Objects/parents sent to sync_mesh in case of dupli were meaningless...
2015-04-20 21:01:38 +02:00
72794d9e01 ShapeKey propagate operator for hair edit mode.
This implements roughly the same functionality as the equivalent mesh
shape propagate operator, with some tweaks specific to hair editing.

The operator copies selected points to all the shape keys. Unlike meshes
these points may be shifted afterward to achieve consistent segment
length (this can be avoided by selected entire strands before using the
operator).
2015-04-20 20:21:02 +02:00
734ee5a43a Merge branch 'master' into alembic 2015-04-20 19:34:26 +02:00
3e305dcaee Fix for particle shape key editing to prevent losing shape data
when switching the active key.

Particle shapes were always using the relative blending of keys when
evaluating hair data. This works ok for meshes, because their edit data
is entirely separate from the mesh data (using bmesh). For particles,
however, the edit mode is hardwired to the hair data, so when switching
keys in edit mode we must take care to replace everything with the
shape. Otherwise the hair data will be using blender shapes and the edit
data will overwrite any shape keys with that.
2015-04-20 18:58:07 +02:00
eb73721a23 Placeholder image strips feedback session changes no.2:
Change paths operator can also have the same placeholder logic now
2015-04-20 18:07:34 +02:00
a7880dd5c8 Fix 'Children' draw option showing nothing when no children in hairsim/cache
If number of children is zero, even if we do have "valid" children cache, do
not generate children strands from cache...
2015-04-20 17:56:35 +02:00
3a8958cb18 Placeholder image strips feedback session changes no.1:
Autodetect range of strips.
2015-04-20 17:35:09 +02:00
afcdb207c2 Placeholders for sequencer take one.
Placeholder images, means that the image sequence reserves a range for
images, displaying black while we wait for them to finish rendering.

This is meant as a feature to not break the layout of gooseberry
sequence edits while we wait for those frames to arrive.
2015-04-20 16:33:44 +02:00
8a9dc8451d Merge branch 'master' into alembic 2015-04-20 15:45:17 +02:00
4cecbf42cc Merge branch 'master' into gooseberry 2015-04-20 17:45:16 +05:00
227be153e9 Merge branch 'master' into alembic 2015-04-20 13:58:16 +02:00
2db121704b Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-20 16:38:31 +05:00
5edf8a8a5b Cycles: Fix threading issue caused by several nodes sharing the same image 2015-04-20 16:36:08 +05:00
dbd873380f Cycles: Replace name-based node matching with type-based
This commit replaces name-based node matching in the mesh device update
with check of special type. It is more robust approach for adding new
nodes which could use image slots for storage. it's also adds updates
of environment texture nodes used in bump shader (this was missing in
the original image sync reshuffle commit).
2015-04-20 16:27:20 +05:00
20e960215a Particle shapekey code is only in the gooseberry branch, disabled here. 2015-04-20 12:59:01 +02:00
9cafd3ae56 SimDebugData is now global, for easier usage and less intrusive code. 2015-04-20 12:58:16 +02:00
0dccffb7aa Fix for CustomDataType syntax error from merging. 2015-04-20 12:37:21 +02:00
7719a6365a Use the X mirror option in new strand edit stroke brush tools.
Note that currently this has virtually no effect, because the mirror
option relies on exact positions of vertices, which does not happen with
random hair placement (the add brush has no mirror option yet).

Eventually topological mirroring should help with this case, but is not
implemented for either old or new strand edit yet.
2015-04-20 12:25:18 +02:00
3a3327dcd5 Cleanup: rename function argument for consistency. 2015-04-20 12:25:18 +02:00
8ffcd1f434 Utility methods for mirrored strand editing.
These are a modified version of their BMEditMesh counterparts.

use_topology is not yet implemented for strands. Native strand topology
is not very useful for this. Instead, the topology of the scalp mesh
should be used for finding mirrored strand roots, then the arc- or
parametric length of a vertex from the root to find mirrored verts.

Conflicts:
	source/blender/blenkernel/BKE_editstrands.h
2015-04-20 12:25:15 +02:00
ed1dc43657 Fix for strands undo creating an invalid BMesh.
When copying mesh data to bmesh the MVERT and similar customdata types
have to be omitted. Otherwise the bmesh instance ends up with NULL
pointers in customdata layers, but entries in the typemap != -1. The
effect was that when storing new steps after one or more undo, the
resulting original data would be copied, and subsequent undo steps
are ignored.
2015-04-20 12:24:34 +02:00
5b9b779cab Minor code reshuffling. 2015-04-20 12:24:34 +02:00
4798464e8b Extended Mesh <-> BMesh copy function versions for specifying custom
data masks explicitly.

A dummy mesh is used for strand edit undo storage like in mesh edit
to prevent unnecessary code duplication. However, when copying from/to
BMesh only the mesh data layers are copied by default, omitting the new
data layers for strands (currently only MSurfaceSample hair root data).
2015-04-20 12:24:33 +02:00
299859e40b Sanity check: if there is no edited/active object for an undo step,
consider it invalid and clean up.
2015-04-20 12:24:33 +02:00
5e42aff397 Basic undo support in the new strand edit mode.
This uses the generalized undo stack system which is also used for
object data edit. An extension is necessary to tell the undo functions
which object is specifically used for generating undo data and
identifying the stack, since strand editing does not edit the obdata
itself.
2015-04-20 12:24:33 +02:00
3f539c987f Removed deprecated UI button for the hair debug flag. 2015-04-20 12:24:33 +02:00
6146b90312 Select Linked operator for hair edit mode (select all vertices of a
strand).
2015-04-20 12:24:03 +02:00
8b2ec99f57 Lasso Select operator for hair edit mode. 2015-04-20 12:24:03 +02:00
410998cdc6 Border Select operator for hair edit mode. 2015-04-20 12:24:03 +02:00
b6f4e0932d Mouse Select operator for hair edit mode. 2015-04-20 12:24:03 +02:00
62fa5c4a84 Select/Deselect All operator for hair edit mode. 2015-04-20 12:24:03 +02:00
2cddc3cda8 Disabled the partial IK strand relaxation for the time being.
First goal is to reproduce current particle edit tools in the strand
edit mode, then make improvements.
2015-04-20 12:24:03 +02:00
9120df6cb3 Missing bmesh include path in scons files. 2015-04-20 12:24:02 +02:00
48a86af388 IK solver for hair strands that provides a better solution for keeping
consistent segment lengths when transforming vertices.

Warning: The implementation is not correct yet, but all the steps should
be there.

The main idea is to treat strands as a sequence of joints that are
displaced out of their original locations by a transform or other tool.
The solver then tries to find a global per-strand solution that keeps
the segment lengths unmodified, with a minimum change in angles from
the original starting shape. Such a solution is much more usable and
efficient than the current O(n^2) attempt of "spreading the error"
across the strand.

The inverse kinematics method is very flexible. It can also include
stretching, which would be very welcome for features like the length
tool. Different parts of the strand could be weighted separately using
scaling factors for the angle/stretch parameters.

Conflicts:
	source/blender/physics/intern/implicit.h
2015-04-20 12:24:00 +02:00
eacc24ccf1 Ported over the relaxation method for hair vertices from particle edit
mode.

This method is simple, but not really very usable. It works by
successively relaxing segments that are too long or too short, moving
both vertices along the edge between them. This is repeated N^2 times
(N: number of vertices on the strand).

A true IK solver could give a lot better results, as well as providing
many opportunities to apply weighting for targets (e.g. preferring to
move non-selected over selected vertices). Many different methods for
simple IK solvers exist, so there should be one that works well for
large number of simple strands. See e.g.
http://www.math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf
2015-04-20 12:23:49 +02:00
ac54ded29b Primitive transform operator support for strand vertices.
This does not yet prevent root transforms and/or length changes.
2015-04-20 12:23:49 +02:00
f7511b3d01 Improved hair combing tool, adjusting edge directions instead of
vertex positions.

This works a lot better with strokes perpendicular to the general hair
strand direction. With the previous comb tool such strokes would only
make a small dent in the hair curve and then vertices would slip out
of the tool circle. The edge combing affects the local direction of
strands, which acts as a kind of grabbing functionality by moving
further vertices in front of the tool circle. The result is that
drawing a curvy hair shape with the comb becomes much easier.

In addition, the new tool also uses edge filtering and weighting rather
than vertices. This means that small brushes also work well, instead
of having no effect when hitting the edge segments between vertices.

Further improvement could be achieved later by using a global strand
solver, which adjusts vertex positions based on an error metric along
the whole of the strand.
2015-04-20 12:23:48 +02:00
208ddcde2c Use a simple low-pass filter to generate a smoother, more stable
direction vector for the hair stroke tool.

This is necessary for directional tools such as combing, where the
stroke direction can lead to unwanted results if it changes too
abruptly.
2015-04-20 12:23:48 +02:00
f3b22c5769 Support for sim_debug drawing in hair edit mode (dev feature). 2015-04-20 12:23:48 +02:00
b70c815ac2 Renamed the edithair files in BKE to editstrands.
The rationale behind this is that the BKE code could be used for
modeling hair and fur as well as a number of other features such as
grass. The primary addition to BMesh is the limitation to strand-like
topology (simple vertex chains, optionally rooted on a mesh surface).

The editor code OTOH is quite hair specific, since the result should
be suitable for hair simulation, and the workflow should mimick actual
hair grooming intuitively. Eventually the hair edit mode could become
a generalized strand edit mode with slightly different tool sets for
various purposes, but for now it is quite specifically built for hair.

Conflicts:
	source/blender/blenkernel/CMakeLists.txt
	source/blender/blenkernel/intern/particle.c
2015-04-20 12:23:46 +02:00
d0a1fc8bb0 Sanity check for strand root/tip checks, now supports single vertices. 2015-04-20 12:23:23 +02:00
2d1d909817 MSVC compiler cannot handle standard C code.
Conflicts:
	source/blender/editors/physics/particle_edit.c
2015-04-20 12:23:20 +02:00
e9737da5f2 Fix scons build files for new hair edit code parts. 2015-04-20 12:23:16 +02:00
1e047231c6 Fix for hair-to-particle export: need to set weight=1.0 for hair roots,
since the particle system uses this for pinning them to the mesh.
2015-04-20 12:23:16 +02:00
142ef0b2e9 Fixed lib-linking for hair edit settings brush and object pointers. 2015-04-20 12:23:15 +02:00
56a09434c5 Basic Add tool for creating new strands in hair edit mode. 2015-04-20 12:23:15 +02:00
8672304e30 Fix for uninitialized return value. 2015-04-20 12:23:15 +02:00
f95dde244e Better feedback about valid sample from mesh sampling methods.
Conflicts:
	source/blender/editors/object/object_shapekey.c
2015-04-20 12:23:15 +02:00
79e649a3bf New simple storage method for single sample values. 2015-04-20 12:23:15 +02:00
e5b25e3c07 Generic raycast method for generating mesh surface samples.
Conflicts:
	source/blender/blenkernel/intern/mesh_sample.c
2015-04-20 12:23:15 +02:00
a4664ef88d New mesh sample evaluation function for shape key data. 2015-04-20 12:23:15 +02:00
be312b1399 First selection operator implementation for hair edit: circle select. 2015-04-20 12:23:14 +02:00
3edc512888 Show selection state of hair vertices with the usual theme colors. 2015-04-20 12:23:14 +02:00
b2ea8c1022 Added back different selection modes (strands, verts, tips) for hair
editing.
2015-04-20 12:23:14 +02:00
339a8b7521 Fix for OpenlGL state restoration after strand drawing, disable color
material option.
2015-04-20 12:23:14 +02:00
77da317cb1 Apply the same weight profile in the comb tool as in particle edit mode.
The comb tool will likely get a complete overhaul, but until then it
should just behave like the old tool.
2015-04-20 12:23:14 +02:00
2c0616b034 Support for common operators, keymap entries and radial controls for
hair brush settings.
2015-04-20 12:23:14 +02:00
a9fbd3b23b Fix for brush radius, the Brush.size property is actually the radius and
not the diameter.
2015-04-20 12:23:14 +02:00
687b5a1ec0 Implemented basic cursor drawing for hair edit mode brushes. 2015-04-20 12:23:13 +02:00
59efe23830 Primitive hair lighting in OpenGL solid shading, cleanup of strands
drawing code for edit mode.

The lighting uses the same method as the particle hair, interpreting
strand direction as the normal. This is nowhere near realistic hair
shading, but doing this with line shading alone in the fixed-function
pipeline is probably not possible. A GLSL shader could be used instead
for a more realistic alternative as part of the viewport project. At
least this simple shading mode gives some orientation feedback while
editing hair.
2015-04-20 12:23:13 +02:00
d16599ea04 Display basic brush properties in the toolbar for hair edit mode. 2015-04-20 12:23:13 +02:00
37d3a3331e Use the "official" brush size calculated by blenkernel and subdivide
the stroke step to avoid tunneling.
2015-04-20 12:23:13 +02:00
5254df30ba Filter affected hair vertices in edit mode based on the brush size and
z depth.
2015-04-20 12:23:13 +02:00
2590231315 Constrain hair root vertices to their mesh location after applying tools.
Conflicts:
	source/blender/bmesh/intern/bmesh_interp.c
	source/blender/bmesh/intern/bmesh_interp.h
2015-04-20 12:23:11 +02:00
83b20c7ddf Enforce hair constraints (constant segment length) after applying a tool.
Currently uses the same approach as old particle edit mode (rescale
hair segments from the root on). A more sophisticated approach using
least-square error minimization of the displacement could yield better
results.
2015-04-20 12:22:10 +02:00
0e06a60168 Make sure tool input data is in object space. 2015-04-20 12:22:10 +02:00
121677d7c8 Nicer vector math for mouse coordinates. 2015-04-20 12:22:10 +02:00
1615da133f Simplified first version of the hair stroke combing functionality.
Stroke tools will be categorized by the hair elements they operate on:
vertices, segments or strands (roots). In addition to that a filter
function defines the influence of the brush. This should be defined by
the other brush settings and be largely independent of the main tool
mode.
2015-04-20 12:22:10 +02:00
7ae6492c85 Lots of small fixes for paint system quirks to make hair brushes work
in the UI.

Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
	source/blender/editors/transform/manipulator_widget.c
2015-04-20 12:21:58 +02:00
7779166313 Define hair edit settings and brush types in the RNA, similar to paint
and sculpt settings.

Conflicts:
	source/blender/makesdna/DNA_brush_types.h
2015-04-20 12:19:28 +02:00
833a11f891 New image file icons for hair brush tools and an according tool enum in
the Brush RNA.
2015-04-20 12:17:16 +02:00
79959152e6 Calculate some basic info about mouse strokes and context and pass it
on to a general hair tool function.
2015-04-20 12:17:16 +02:00
4fd6a7a696 Revert previous hair edit operator scaffolding and port over the old
operator for strokes instead.

The paint system is much too complicated and does not add any real
advantage at this point.
2015-04-20 12:17:16 +02:00
98b15d9a7c Copied high-level operator code from the paint/sculpt system as a basis
for brush-stroke operators in hair edit mode.

Hopefully this can help avoid some redundant code and ensure consistent
keymapping etc.
2015-04-20 12:17:16 +02:00
a889a1458c Missing bmesh include folder for hair editor in scons. 2015-04-20 12:17:16 +02:00
7b6332f634 Apply the hair matrices when converting from particle keys to bmesh,
so the edit data is consistently in object space.
2015-04-20 12:17:16 +02:00
0a27e97fb7 Fix for GL buffer size for edges, needs to 2x for two vertex indices. 2015-04-20 12:17:16 +02:00
eb5257002b New drawing code for hair edit mode.
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_intern.h
2015-04-20 12:17:14 +02:00
23b284348b Removed deprecated code. 2015-04-20 12:15:17 +02:00
2d79994e39 Free strand edit memory after use. 2015-04-20 12:15:17 +02:00
fd34e3efbc Fix for verts-of-strand iterator: This requires a second pointer in
addition to the edge, otherwise the last point is omitted.
2015-04-20 12:15:17 +02:00
dc43df89cd CustomData layer for storing hair root locations as MSurfaceSamples.
This requires converting the old messy particle num/num_dmcache/fuv/foffset
data into the new mesh samples, which can potentially introduce floating
point errors and inaccuracies due to lack of face index mapping in the
new system. However, in any well-constructed particle system the hair
roots should be nearest to their num face, so mapping would be accurate
enough. If necessary face index data could be added to samples as a
legacy code hack, but probably it's best to eventually replace the
hair system as a whole anyway.
2015-04-20 12:15:17 +02:00
4e47239de2 Store the hair key weight in edit mode.
Currently particles only have a single weight value, controlling
pinning in the simulation (for root and virtual root verts) and goal
force scaling. This will be replaced by a full vertex group weight
system eventually.
2015-04-20 12:15:17 +02:00
991ee8a570 First customdata layer for particle mass.
This is more for testing purposes, since currently there is only a
single mass property for the psys as a whole. This should change in the
future though, to allow variable mass per strand or vertex.

Conflicts:
	source/blender/bmesh/intern/bmesh_interp.c
2015-04-20 12:15:15 +02:00
e43ef55e7f Basic particle data reconstruction when exiting edit mode. 2015-04-20 12:14:34 +02:00
1afd5be044 Fix for verts-of-strand iterator: After last edge step has to set the
edge to NULL to avoid infinite looping over the same edge (1-elem disk).
2015-04-20 12:14:34 +02:00
d550a29558 Fix for particle-to-bmesh: only was looping over totvert instead of
pa->totkey.
2015-04-20 12:14:34 +02:00
5f44f4a2ff Intermediate commit: switching strand edit data to BMesh.
Hair/Strand editing will only use a subset of the bmesh topology and
expect a specific topology that needs to be verified and enforced.
However, this extra requirement is much less work than reimplementing a
whole edit data system with the same feature set as bmesh and avoids
much redundant code.

Conflicts:
	source/blender/blenkernel/intern/customdata.c
	source/blender/makesdna/DNA_customdata_types.h
2015-04-20 12:14:30 +02:00
b0a9e48a19 New customdata type for mesh surface samples.
Conflicts:
	source/blender/makesdna/DNA_customdata_types.h
2015-04-20 12:14:23 +02:00
afb947c00c Switched the hair edit data to a bmesh-like structure for consistency.
This means using mempools to store curve and vertex data, which allows
arbitrary addition and removal of data more easily. Also this includes
an iterator system similar to bmesh iterators (although the simpler
topology makes it a lot less complex).

Conflicts:
	source/blender/blenkernel/intern/customdata.c
	source/blender/makesdna/DNA_customdata_types.h
2015-04-20 12:13:35 +02:00
f1e4d35489 Reconstruct most basic particle data when applying the hair edit, so
particle hairs remain visible.

Note that currently the hair root location (num/num_dmcache, fuv, foffset)
is not stored from edit data, so all hairs end up in a default location.
2015-04-20 12:12:01 +02:00
1c7053f7a0 Store hair edit data in particle systems and manage it in the operator
for entering/exiting the edit mode.

Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-04-20 12:11:59 +02:00
7bb90a06e1 Moved code for the hair edit data structures to blenkernel.
This makes it work more like editmesh, and avoid the awkward and
basically bad-level approach in particles, where the edit data is an
anonymous pointer in particle systems together with a callback for
freeing.

Conflicts:
	source/blender/blenkernel/CMakeLists.txt
2015-04-20 12:11:44 +02:00
a9001adbb4 New edit mode for hair.
Conflicts:
	source/blender/blenloader/intern/readfile.c
2015-04-20 12:11:05 +02:00
dd69a3dbcf Finished the particle-to-edit conversion function. 2015-04-20 12:10:33 +02:00
c65f1b2e15 More work on particle conversion methods for hair edit mode. 2015-04-20 12:10:33 +02:00
09a7dbc29a New editor library for hair edit mode. 2015-04-20 12:10:33 +02:00
6078e79cea Minor syntax fix. 2015-04-20 12:10:33 +02:00
6783b15453 Shifted the dispatch from the algorithm side to the storage side of the
sampling system to keep the code simple.

Now there is a MSurfaceSampleStorage struct that encodes the storage
details, which the algorithms don't have to care about.
2015-04-20 12:10:33 +02:00
82132fc5b0 Added generalized method for creating an array of mesh samples with
arbitrary stride.
2015-04-20 12:10:32 +02:00
4b4f24607e Changed mesh sample definition to use 3 vertex weights instead of a
face index. This is easier to sample uniformly and avoids the need for
tesselation for evaluating.
2015-04-20 12:10:32 +02:00
fe48c353f1 Normalize the normal vector after sample eval to account for
interpolation.
2015-04-20 12:10:32 +02:00
308af3bfb3 Added a bool return to the eval function to give feedback on invalid
samples.
2015-04-20 12:10:32 +02:00
3f7d66ece4 Added a basic RNA definition for the mesh sampling system. 2015-04-20 12:10:32 +02:00
a952800ffc Eval function to get a location and normal vector from mesh samples. 2015-04-20 12:10:32 +02:00
71e34dad2b Usable random distribution algorithm.
Does not include area weighting yet.
2015-04-20 12:10:32 +02:00
24b77359ae Skeleton code for sampling meshes.
Conflicts:
	source/blender/blenkernel/CMakeLists.txt
2015-04-20 12:10:29 +02:00
386e1a1c94 Merge branch 'master' into cycles_memory_experiments 2015-04-20 15:07:15 +05:00
c9c207f093 Merge branch 'master' into gooseberry 2015-04-20 15:06:26 +05:00
d516158bb3 Merge branch 'master' into alembic 2015-04-20 11:55:36 +02:00
a2d5380f62 Merge branch 'alembic' into gooseberry 2015-04-20 10:38:12 +02:00
bd5f946f39 Fix for stupid MSVC, does not allow const expression as array size. 2015-04-20 10:37:01 +02:00
10df745d21 Revert 0d3da1343c
Disabling group -> duplicator dependencies would in theory make caches
more attractive because the invisible objects don't have to be updated
just because of the group.

However, the viewport and render starts to behave unpredictably without
these updates, because the dupli cache relies in many ways on the
objects it is supposed to override.
2015-04-20 09:39:08 +02:00
77a5443c60 Merge branch 'master' into gooseberry 2015-04-18 15:03:13 +02:00
ee04d04c0c Some minor fixes needed to build alembic with install_deps.sh. 2015-04-18 13:06:43 +02:00
47baee761e Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-17 23:36:42 +05:00
638b979895 Cycles: Add debug option to disable pre-aligned triangles storage
This option makes it so BVH does not use pre-aligned storage for triangle vertex
coordinates which was originally needed for faster coordinate lookup when doing
triangle intersection test. This array gives up to 10% performance comparing to
fetching individual coordinates but it also used 12 floats per BVH primitive,
which might translate to quite huge array in a complex scene.

Intention of this option is to investigate if this is a right direction to make
gooseberry files being able to render on local farm which is not totally great
in memory.

Current approach is not totally cheap, meaning even the case with the storage
enabled might be slower, but currently it's within 1%.
2015-04-17 23:34:54 +05:00
84f7f3d4b8 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-17 17:47:49 +02:00
e3a0345d8d Merge branch 'master' into gooseberry 2015-04-17 19:11:42 +05:00
e229f431ed "Deflector" force modifier for cache simulation.
This works like the existing effectors when using "surface" mode: It
selects the closest point on the mesh surface and creates a force based
on distance and falloff.

Unlike the old effectors it also supports signed distance, based on
the surface normal, which gives more control over the allowable distance
of strands to the mesh surface.
2015-04-17 09:47:58 +02:00
0faee07971 New cache modifier type for creating force fields on duplis of the
cached group itself.

This allows using the dupli group objects themselves as force fields,
in particular for collision objects in strand simulation. Without this
feature only the original objects of are recognized by the effectors
system, and even if duplis worked properly their settings would not be
accessible due to linking and dupli group hiding. The cache modifier
circumvents this issue by providing a new force field system, separate
from the current effectors.
2015-04-16 21:16:49 +02:00
26d74de2cd Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-16 16:24:24 +02:00
c412e7aca0 Merge branch 'alembic' into gooseberry 2015-04-16 16:08:53 +02:00
bda3e21e95 Revert recent commits, no time to improve things now. 2015-04-16 15:50:06 +02:00
78f8c3eb31 Merge branch 'master' into cycles_memory_experiments 2015-04-16 17:42:11 +05:00
91161dc983 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2015-04-16 13:03:26 +02:00
ea189ce26e Don't write dupli instances to caches in the Render pass.
Duplilists are always generated for viewport/realtime settings, render
settings only affect the mesh geometry but not the duplis.
2015-04-16 12:52:42 +02:00
36aad476dc Cleanup: Removed unused writer/reader classes for Alembic.
These classes were used previously to write parts of the Blender DNA
directly to Alembic. Their code is shared with other classes that are
still in use, so none of the really substantial parts have been deleted.
2015-04-16 12:07:28 +02:00
3538ebf443 Cleanup: Removed unused parts of the C API for caching.
This only removes trivial C function wrappers for parts of the C++ code
that are not used directly any more from outside the bl_pointcache
library. Some internal parts may be removed later, this cleanup is
mostly to reduce code noise.
2015-04-16 11:57:16 +02:00
e39d9960fb Renamed passes for cache writing to reflect their origin with mesh
modifier evaluation.
2015-04-16 11:51:15 +02:00
f5d5ffd335 Smoke: Fix compilation error with smoke disabled 2015-04-16 14:32:37 +05:00
a7846047a1 Remove the dual "root" object at the top of Alembic archives.
Using two full scene nodes for render/realtime data creates a lot of
duplication in both storage and processing time. Instead storing
specific data types like meshes in different versions keeps duplication
to the necessary minimum and allows easier fallback where available.
2015-04-16 10:42:48 +02:00
4a868954c5 Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-16 00:12:30 +05:00
d5c40c704f Smoke: Fix another crash caused by recent changes
Didn't notice initFie and so are called from constructor for some reason..
2015-04-16 00:11:35 +05:00
461e9a25eb Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-15 23:11:46 +05:00
465e59ac7d Smoke: Fix wrong bit test in previous commit 2015-04-15 22:50:39 +05:00
551a1b7c28 Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-15 20:41:57 +05:00
a1c1b32e4e Merge branch 'master' into cycles_memory_experiments 2015-04-15 20:41:25 +05:00
650915595c Draw modifiers as inactive when channel modifiers are deactivated. 2015-04-15 17:39:39 +02:00
4b04fad0a9 Smoke: Don't allocate arrays needed for hi-res simulation if smoke is baked to file
There used to be quite huge 3D arrays stored in memory which are only needed for
simulation steps and not used at all if the smoke is baked to file. That memory
is unmanaged by blender and not visible in the info space header and in practice
they could easily be gigabytes for hires smoke.

This commit only addressed hires smoke since it's the more important at this
point, and non-hires smoke wouldn't have such noticeable benefit.

In the case of tornado file it gives around 20% memory saving (which is about
26GB vs. 33GB on later frames of 01.03.02.A3 shot.
2015-04-15 20:35:02 +05:00
ebc94798de Make icon use a dim version instead for modifier muting 2015-04-15 16:31:46 +02:00
62eec5ab8e Add toggle that disables modifiers on fcurves. Gooseberry request, not
sure how useful it would be on master + it misses an icon, so commiting
here first.
2015-04-15 16:00:17 +02:00
77cbc67328 Removed the unused particle writer/reader code from Alembic.
We only use particles to initialize strands export now.
2015-04-15 12:47:44 +02:00
a67658dddc Only process hair simulation in "realtime" mode.
This means no motion state data is generated for render mode, this
requires some larger changes to the way render/realtime data is stored
in the caches.
2015-04-15 12:29:17 +02:00
c634edf4b1 Merge branch 'alembic' into gooseberry 2015-04-15 11:04:12 +02:00
88387ffa59 Object and particle system selection in the cache hair sim modifier.
Before this the hair sim would be applied indiscriminately to all the
strands in the cache data. Now an object/psys combination from the dupli
cache must be selected. Note that this is not the actual target of the
hair simulation, which still operates on the cache overrides instead.
The Object/Psys only functions as a selectable key, if no matching data
is found in the cache no hairsim will be applied.
2015-04-15 11:00:17 +02:00
0b30c9db2a Merge branch 'alembic' into gooseberry 2015-04-14 16:09:06 +02:00
53b5099e27 Another fix for child deformation.
Needs the parent base shape in the rotated deformed root space, or the
child gets additional deformation from the root rotations.
2015-04-14 15:28:48 +02:00
638e159de2 Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-14 17:32:14 +05:00
5155c165b5 Cycles leaf nodes split: Fix crash when rendering scene without inner nodes 2015-04-14 17:26:53 +05:00
f0035cdbbf Merge branch 'cycles_memory_experiments' into gooseberry 2015-04-14 16:26:25 +05:00
cb69152ad5 Merge branch 'master' into cycles_memory_experiments 2015-04-14 16:19:13 +05:00
e0bbdd9704 Cycles: Split BVH nodes storage into inner and leaf nodes
This way we can get rid of inefficient memory usage caused by BVH boundbox
part being unused by leaf nodes but still being allocated for them. Doing
such split allows to save 6 of float4 values for QBVH per leaf node and 3
of float4 values for regular BVH per leaf node.

This translates into following memory save using 01.01.01.G rendered
without hair:

                   Device memory size   Device memory peak   Global memory peak
Before the patch:  4957                 5051                 7668
With the patch:    4467                 4562                 7332

The measurements are done against current master. Still need to run speed tests
and it's hard to predict if it's faster or not: on the one hand leaf nodes are
now much more coherent in cache, on the other hand they're not so much coherent
with regular nodes anymore.

Reviewers: brecht, juicyfruit

Subscribers: venomgfx, eyecandy

Differential Revision: https://developer.blender.org/D1236
2015-04-14 16:19:10 +05:00
ea8fb0953c AnimSys utility function was renamed in master. 2015-04-14 12:46:02 +02:00
4a3e22a34c Merge branch 'alembic' into gooseberry
Conflicts:
	source/blenderplayer/bad_level_call_stubs/stubs.c
2015-04-14 12:34:05 +02:00
12dd009356 Merge branch 'master' into alembic
Conflicts:
	source/blender/blenkernel/intern/object_dupli.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2015-04-14 12:25:17 +02:00
280dc1163b Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-14 12:24:21 +02:00
c4e0d09e2d Fix for missing child data when the pathcache is not calculated.
The child strand root matrix and position still need to be stored, so
the writer must not exit early based on existence of the pathcache.
2015-04-14 12:21:19 +02:00
a8487f7f62 Optimization for particle baking to caches, skip evaluation of pathcache
when not needed.

The pathcache data is only required in the first frame to construct the
child strand shapes. For subsequent frames the children are calculated
using the initial shape and parent deformation, so particles don't need
to recalculate all the time.

This gives a significant performance increase of the baking process when
using a lot of complicated child hairs.
2015-04-14 11:50:53 +02:00
24caf4f98f Major optimization for cache size when storing child strands.
The basis for this optimization is that child strands have a shape that
does not actually change over time: the particle code does not enforce
this formally, but in fact all the clump/kink/roughness algorithms take
great care to not introduce changes of shape over time.

The final look of child hairs is achieved only by following the parent
hair deformation, i.e. by applying the offset of the matching parametric
position on the parent strand.

This means that for caching child strands it is sufficient to store the
full vertex data only in the first sample, and then apply the parent
deformation on subsequent frames using only the animated root matrices.

In test cases this seems to reduce the cache size to something between
10-20 % of the original size (down to some hundred MB from some 10 GB).
Further optimizations could be achieved by using smaller data types,
such as quaternions instead of 3x3 or 4x4 matrices for the remaining
child data.
2015-04-14 11:06:14 +02:00
09701e0ccc Apply child strand deformation only when using the cache result for
viewport or render display.

This way the strands can be cleanly written to subsequent output caches
without accumulating deformations.
2015-04-14 11:06:14 +02:00
da2bf129a4 Ignore the display/render settings of the cachelibrary when doing
simulations.

Otherwise the child strands and/or motion state can be missing and lead
to incomplete output caches.
2015-04-14 11:06:14 +02:00
Julian Eisel
1bccbbc04c Merge branch 'master' into gooseberry 2015-04-13 20:36:07 +02:00
7c28ee9c4a Merge branch 'master' into gooseberry 2015-04-13 18:38:21 +02:00
4c4673ce7f Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-04-13 19:18:27 +05:00
1f75229237 Merge branch 'master' into gooseberry 2015-04-13 15:58:18 +02:00
04d9e28621 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-04-13 14:31:36 +02:00
eeb3ccad48 Merge branch 'alembic' into gooseberry 2015-04-13 15:49:45 +05:00
7de6ed780d Alembic: Fix compilation error with alembic disabled
Was a mismatch in stub factory methods, presumably after some recent
changes in hair/strands.
2015-04-13 15:48:47 +05:00
bfb8788b64 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-12 14:41:34 +02:00
bf34249912 Fix for broken and messy particle time values to get consistent caches.
Particles use 0..100 range for parent particle "times" (curve parameter)
and 0..1 for children. For caches this is now uniformly calculated in
the 0..1 range to avoid breaking child interpolation.
2015-04-12 14:39:03 +02:00
8f6fd382a1 Used the mass parameter for hair simulation. 2015-04-11 21:51:44 +02:00
3ad7e5c1f2 Optional force and jacobian return values from angular bending springs,
for occasional debugging.
2015-04-11 21:50:03 +02:00
d0de201abd Merge branch 'alembic' into gooseberry 2015-04-11 17:32:38 +02:00
3c817d664e Fix for install_deps script: declare "skip-alembic" as a formal
parameter or it won't be parsed at all.
2015-04-11 17:31:20 +02:00
0ffe8be5e9 Fix for missing function argument commented out during cleanup. 2015-04-11 14:04:03 +02:00
9210f39112 Child strand deformation based on parent motion states when reading from
caches.

This allows child strands to follow the motion of parent strands as
calculated by the hair simulation. Unlike the particle system path
caching, this method does not regenerate all the children every frame.
Instead, it relies on an initial child setup that defines the base
shape, then applies the parent motion as a weighted linear deformation.

The result is in fact the same as with regular particle clumping, kink,
roughness etc.. Particles also take care to not change the child shape
when the parent moves, but this is not formalized anywhere (which makes
changing particle code quite difficult). So ignoring the particle code
is both permissible and efficient.
2015-04-11 12:44:01 +02:00
7d520f64a6 Fix for stupid particle times.
Normalize particle 'time' values to 0..1 range when writing to cache,
anything else is useless.
2015-04-11 12:38:23 +02:00
ac6038e991 Cycles: free mesh BVH after packing the scene BVH
The idea is to avoid having original BVH and BVH packed into scene BVH and hence
reduce memory footprint.

This change doesn't give any measurable differences on it's own, but together
with D1215 and D1217 it gives quite nice results.

Reviewers: campbellbarton, brecht, juicyfruit

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D1218
2015-04-10 23:20:34 +05:00
90c18b422d Cycles: Synchronize images after building mesh BVH
This way memory overhead caused by the BVH building is not so visible and peak
memory usage will be reduced.

Implementing this idea is not so straightforward actually, because we need to
synchronize images used for true displacement before meshes. Detecting whether
image is used for true displacement is not so striaghtforward, so for now all
all displacement types will synchronize images used for them.

Such change brings memory usage from 4.1G to 4.0G with the 01_01_01_D scene
from gooseberry. With 01_01_01_G scene it's 7.6G vs. 6.8G (before and after
the patch).

Reviewers: campbellbarton, juicyfruit, brecht

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D1217
2015-04-10 23:19:38 +05:00
a13952e84e Merge branch 'cycles_memory_experiments' into gooseberry
Conflicts:
	intern/cycles/blender/blender_sync.h
2015-04-10 20:56:44 +05:00
45ea4c8dbe Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-10 17:56:01 +02:00
bf2856c758 Cycles: Experiment with culling objects based on the camera frustum
The idea is to give artists a simplier way to control memory usage in such
scenes as grass fields by doing automatic object culling based on whether
they're visible in the frame or not.

This is controlled on per-object level. In order to use this option few
steps are required:

- Allow renderer to use camera culling (Performance panel of render settings)
- Set camera cull margin (measured in relative value to the render resolution)
- Enable Camera Cull for objects which are desired to be culled
  (object culling option could be found in Option panel in object buttons).

Interface decisions are not final for sure and to be refined if this
option is considered good enough for production.

Reviewers: juicyfruit, brecht, campbellbarton

Subscribers: venomgfx, eyecandy

Differential Revision: https://developer.blender.org/D1230
2015-04-10 20:55:44 +05:00
d0276014f9 Small fix for uninitialized variable (currently unused). 2015-04-10 13:53:20 +02:00
5ca4b182eb Implemented alembic archive info as a stream callback and disabled
popup and clipboard output.

For a production-size archive the info string can become really large,
and putting it into a buffer takes a long time. As a debugging tool the
stdout printing is sufficient for now and can be done as a stringstream.
2015-04-10 13:48:46 +02:00
0d2826d86b Merge branch 'master' into gooseberry 2015-04-10 13:06:00 +02:00
c2d6d6d824 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/drawvolume.c
2015-04-10 12:47:50 +02:00
a6b9fc6f22 Use depsgraph tagging and notifiers to enforce dupli cache updates
in the viewport.
2015-04-10 12:34:25 +02:00
b3faf5a4ea Explicit flags for toggling motion (from simulation) and child strands
in both display and render of caches.
2015-04-10 11:55:09 +02:00
702ae54436 External forces in strand hair simulation.
Arbitrary wind force "density" factor has been moved out of the force
function now, so cloth simulation can do this on it's own without
affecting the strand sim.
2015-04-10 10:03:48 +02:00
bb043dbef3 Goal springs for cached strand simulation.
In addition to the original particle hair sim settings the parameters
for strand sim have a curve to define the strength of goal springs along
strands. This useful because currently there is no way to override the
weights of strands. This would require a new particle edit mode that can
work with non-particle data in a sane way ...
2015-04-10 09:15:11 +02:00
59940c3b68 Disable the UI for drawing objects of cache libraries.
This takes an arbitrarily large amount of space in the UI and does
currently not have a good purpose.

Eventually this information could be displayed in a dedicated part of
the UI, with proper scrolling.
2015-04-09 21:10:00 +02:00
6abb0eaa8a Added visibility attribute for dupli objects in Alembic caches.
This combines the DupliObject.no_draw flag with the instanced object's
visibility.
2015-04-09 18:50:26 +02:00
ee110680fd Merge branch 'master' into gooseberry 2015-04-09 18:30:40 +02:00
8c34de9918 Fix for potential memory corruption in selection drawing code.
This code works much like the main object drawing code and has to take
the same precautions regarding replacing the derivedFinal pointer in
Objects. This pointer may be replaced during drawing calls, regardless
of the "ownership" indicated by needsFree.
2015-04-09 17:34:41 +02:00
3a38ba68c6 Check for empty schemas more consistently before trying to read.
Reading from an empty object in Alembic will throw an exception, which
is not easily handled yet. So rather avoid annoying crashes the clumsy
way for now.
2015-04-09 15:35:04 +02:00
871a29eeac Writer for child strand data.
Cache chains now support child strands too, instead of dropping
child data when writing out from strand data.
2015-04-09 14:45:16 +02:00
73796bb884 Merge branch 'alembic' into gooseberry 2015-04-09 13:06:47 +02:00
e6f41832c0 Extra changes to make strict flags happy 2015-04-09 15:51:02 +05:00
216a0993cd Merge branch 'master' into gooseberry 2015-04-09 12:49:45 +02:00
6ee460f299 Fix compilation with strict compiler flags 2015-04-09 15:47:13 +05:00
bfe9fc218d Extended Cycles to support both parent and child strands.
The code for syncing Strands and StrandsChildren data to Cycles curves
is almost identical, so to avoid code duplication a little templated
traits type has been defined, which provides the appropriate accessors
for both cases. This is very local and should not be too confusing.
2015-04-09 12:11:37 +02:00
cf1f78cc40 Cache reader for child strands.
This creates child strands along with the parents. These are not yet
deformed by parents or simulation, and are also not written back into
subsequent caches yet.
2015-04-09 10:44:32 +02:00
c8a7cd4266 Store child strand curves alongside the parent strands in dupli object
data.

Child strands have their own struct type for vertices and curves to
avoid unnecessary overhead (parent curves store a full 3x3 matrix after
all).

Child strands may be constructed from particle pathcaches, or read from
curves data in alembic files.
2015-04-09 09:57:20 +02:00
6142df649f Nominal support for UVs and Vcols with cached strand data.
These are dummy values currently. The UV and vcol values will be stored
in strands directly, unlike particles which evaluate them every time;
this is a much safer and more efficient approach that makes strand data
truely independent from the "emitter" mesh. Such data will be made
available later, primarily for child curves.
2015-04-09 09:03:54 +02:00
6564405d61 Merge branch 'alembic' into gooseberry 2015-04-08 22:36:41 +02:00
8699a0ba77 Fix for object matrix sampling with the default 1-second rate. 2015-04-08 22:35:38 +02:00
70c588bc3f Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-08 22:03:23 +02:00
d1c7efd73f Applying the inverse object transform for strand data is not necessary.
Particle pathcache data is in world space, but strands are stored in
object space already.
2015-04-08 20:02:42 +02:00
e0b9f82dcb Basic cache overrides for strand render data in Cycles.
Still buggy, but the basic workflow is there:
When a cache library is used in conjunction with a group duplicator and
it has strands that match the particle systems, Cycles will use the
new Strands structure to construct its internal curves.
2015-04-08 19:19:01 +02:00
d65c48e9a8 DNA file for strands types.
This is not strictly needed because the strands data is only created
at runtime at this point. However, it might be useful to later include
this in blend files.

Also the C++ RNA API has a bug that makes non-DNA collection properties
difficult (the length function is not implemented properly).
2015-04-08 18:49:18 +02:00
780d257e6e Merge branch 'master' into gooseberry 2015-04-08 20:21:02 +05:00
Julian Eisel
82a4d19a6b Merge branch 'wiggly-widgets' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/include/ED_transform.h
	source/blender/windowmanager/intern/wm_operators.c
2015-04-08 16:32:22 +02:00
Julian Eisel
715c57f3b0 Merge branch 'master' into gooseberry 2015-04-08 16:27:31 +02:00
38269a93c2 Yet another writer class for storing child strand data generated by
particles.

This is currently the same as the ParticlePathcache writer class, but
will be modified somewhat later to store additional information such as
parent weights. The purpose of this cache object is not to populate the
particle child caches, but to store renderable data associated to dupli
cache strands.
2015-04-08 13:45:13 +02:00
aee5f39e10 Child strands structure for storing renderable child hairs efficiently.
This is a separate struct to avoid storing unnecessary data (this means
a bit of code duplication for iterators). The child strands can be used
as the actual render data, while the parent strands usually would be
used only for simulation/deformation purposes.
2015-04-08 13:43:01 +02:00
d4c002d537 Merge branch 'master' into gooseberry 2015-04-08 12:50:39 +02:00
079f1aa64a Bending forces in strand hair simulation. 2015-04-08 11:44:37 +02:00
bdeb9cd7ea Store root orientation matrix in strand curves as well as caches.
This matrix is needed to create a stable and smooth coordinate system
along the strands, for things such as bending forces and child hair
deformation. The base matrix is defined on the "scalp" mesh and should
be stable wrt. deformation and animation of the mesh. For any point on
the strand a matrix is then calculated using parallel transport, i.e.
by rotating the base matrix successively along each curve corner.
2015-04-07 19:16:30 +02:00
676f742a6c Yet another iterator for looping over strands, this time for triples
of consecutive vertices ("bends").

This will be useful for calculating bending forces, without making basic
iteration a big headache.
2015-04-07 18:17:21 +02:00
d5be72b05f Nicer iterator for looping over strand edges directly.
Avoids the ugly construct with vertex iterators that have to drag an
extra 'prev' iterator along.
2015-04-07 18:12:04 +02:00
41447d212b Use the dupli object's obmat for world space simulation.
The overall world space matrix for dupli sims has to be the combined
obmat of the cached object as well as the duplicator for the dupligroup
instance. The cached strand data is generally in object space, so the
matrix has to be applied to get all the forces and interactions right.
2015-04-07 17:45:09 +02:00
ce47924c7e World transform for simulation of caches.
This compensates the transformation of the dupli instance being cached,
so that forces such as gravity are in the correct reference frame.

Note that this does not yet generate fictitious forces resulting from
a moving and/or accelerated frame of reference. For this we would also
have to calculate linear/angular velocity and acceleration of the dupli
object.
2015-04-07 17:22:45 +02:00
1873771940 Make sure the frame values for cache modifier evaluation are initialized
correctly.

Also skip empty frames in hair simulation (this includes the first
frame).
2015-04-07 16:37:57 +02:00
c29d7a2c2b Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-04-07 16:17:16 +02:00
e4f37a50ca Small fix for smoke display thickness, setting was not initialized for
new smoke domains.
2015-04-07 16:14:09 +02:00
2ab422506b Thickness setting for smoke drawing in the OpenGL viewport.
This is the first actual drawing/display setting for smoke, so a new
panel "Display" has been added to give it a home in the UI.

The name "thickness" has been chosen deliberately to distinguish it from
density, since the parameter only affects OpenGL drawing but not the
actual physical density values.
2015-04-07 16:00:20 +02:00
c253ef851c Use matching defaults and ranges in RNA/BKE for hairsim parameters. 2015-04-07 14:51:31 +02:00
59d236c21d Unused line, the strand array offset is provided by the iterator now. 2015-04-07 14:46:08 +02:00
4fdda03150 Better defaults for stretch stiffness and damping.
The strong stretch forces lead to awkward lengthening of segments when
the damping factor is too high.

In fact, in a natural hair strand the stretching usually means the hair
itself is curly and stretches as a helical spring. In that case
the damping is quite small compared to the stiffness, and little energy
is lost to the stretching (the hair becomes "bouncy"). When the hair is
very stiff the damping should also be small in order to avoid extreme
forces resulting from the hair root location constraint.
2015-04-07 14:41:48 +02:00
e5a47562eb Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/image.c
	source/blender/blenkernel/intern/object_dupli.c
	source/blender/blenkernel/intern/sequencer.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/space_view3d/view3d_ops.c
	source/blender/makesdna/DNA_sequence_types.h
	source/blender/makesdna/DNA_view3d_types.h
	source/blender/windowmanager/CMakeLists.txt
	source/blender/windowmanager/intern/wm_operators.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2015-04-07 14:19:16 +02:00
648dbb23f9 Fix for stretch forces being defined wrt. the root vertex.
Was not advancing the iterator for the previous vertex correctly.
2015-04-07 12:56:36 +02:00
1ab8999f14 Moved root animation calculation into the solver code.
The solver can calculate the de-facto velocity of the root using the
difference of the already-updated vertex location and the state from the
previous step.
2015-04-07 12:26:52 +02:00
8b9d5fd1eb Fix for simdebug data cache reading.
Data pointers were not advanced, so only the first debug element would
show up properly.
2015-04-07 12:09:46 +02:00
dc6d51c555 Take strand bounds into account when calculating bounding boxes for
dupli overrides.
2015-04-07 11:17:19 +02:00
f24153bcbc Apply sim debug data from caches back to the global hash table.
Note that this is quite messy atm, it will override debug data if
different caches are used, and does not discriminate when writing to
caches either.
2015-04-05 17:10:14 +02:00
8c055802a2 Write out sim debug data along with dupli caches, if the global sim
debug flag is enabled.
2015-04-05 16:02:41 +02:00
7ffdbecdbf Merge branch 'cycles_point_density' into gooseberry 2015-04-05 15:04:31 +02:00
c324136028 Fix for undefined psmd field in when evaluating particle textures. 2015-04-05 15:03:56 +02:00
a4bc9cd0bd SimDebugData writer/reader for Alembic caches.
This will allow debug visualization data to be stored inside caches
along the actual simulation state.

While the regular simulation allows examining simulation data on-the-fly
by stepping through the regular timeline, the new baking mechanism used
for caches does not easily allow simulation data to be visualized frame
by frame. Caching this data will allow adding it to the global sim debug
data.

This would also still be very handy if the baking process itself becomes
more interactive again. Unlike the current simulation progression, the
cached data can be accessed randomly, so scrubbing throught the timeline
becomes possible.
2015-04-05 14:47:56 +02:00
04d604648a Fixed unused parameter warnings in Alembic customdata code. 2015-04-05 11:54:43 +02:00
2681b66c1d Merge branch 'cycles_point_density' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/particle.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/makesdna/DNA_particle_types.h
	source/blender/makesdna/DNA_texture_types.h
	source/blender/makesrna/intern/rna_particle.c
2015-04-04 14:30:54 +02:00
bd503353bb Support for particle texture color in point density textures.
This works for all pointdensity use cases, BI as well as Cycles.
2015-04-04 14:23:14 +02:00
aa43c13c3e Particle color influence option for particle textures.
This color is currently only displayed in the viewport (when enabling
"Texture" color mode in the Display settings). It will be used for
controlling the smoke color when using particles for smoke emission.

Conflicts:
	source/blender/blenkernel/intern/particle.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/makesdna/DNA_particle_types.h
	source/blender/makesdna/DNA_texture_types.h
	source/blender/makesrna/intern/rna_particle.c
2015-04-04 13:35:48 +02:00
11cb027ac4 Merge branch 'cycles_point_density' into gooseberry 2015-04-03 19:57:19 +02:00
f48e3cf6bf Color support for point density texture in Cycles.
This extends the point density evaluation to also store RGB color values
in the array provided by Cycles.

Since internally all Cycles textures are 4-float RGBA textures anyway,
it does not make a lot of sense to store density and color separately.
This could eventually be preferable to avoid unnecessary storage.
2015-04-03 19:49:02 +02:00
3c5be38c9f Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-03 17:32:46 +02:00
3cbdb31255 Added the major parameters for the hair simulation.
This is basically copied from existing cloth sim settings, with a good
deal of cleanup and sanitization.

Unlike cloth parameters, the damping values are described as relative
to their associated stiffness values for springs. This is much easier
to use in practice and less prone to lead to unstable simulations.
Damping simply works best when the force is in the same order of
magnitude as the stiffness, so having a relative factor requires much
less adjustment on the user side.
2015-04-03 15:18:52 +02:00
0ab2bb586e Added effector weights for cache hair simulation. 2015-04-03 14:20:33 +02:00
93c49605fd RNA for modifier struct subtypes.
Also renamed StrandSimParams to HairSimParams, since strands are only
the agnostic data structure, while these parameters are specifically
used to simulate hair-like behavior. Other simulations could use strands
but implement completely different kinds of physics (e.g. grass, ropes).
2015-04-03 14:18:46 +02:00
49890a8119 Smaller strips not working for files with sequencer 2015-04-03 14:13:41 +02:00
1550f092ba "Structural" spring forces for strands.
These connect strand points to ensure constant length and form the main
spring system in strand simulation.

Note that parameters are still hardcoded.
2015-04-03 12:32:50 +02:00
bff8ea5cd7 Fix unfreed motion state memory when freeing strand data. 2015-04-03 12:04:40 +02:00
f1234c6335 Scalp animation support: copy strand root locations from the rest pose
before performing a time step.
2015-04-03 12:00:36 +02:00
3509cb3c60 Pinning for strand roots.
Note that roots are currently not animated.
2015-04-03 11:38:34 +02:00
f0ea8a19c1 Use FPS value to sync the strand simulation time with the render time.
Additionally the time can be scaled using the timescale parameter.
2015-04-03 11:28:15 +02:00
f19a416b36 Correct progression handling of the strands motion state through cache
baking.

For now this simply applies gravity and applies the basic hair solver
for velocities and positions.
2015-04-03 11:21:40 +02:00
1e8b62476b Make mattieu happy - allow smaller strips vertically.
Allows mattieu's masterplan to keep overdrop at higher sequencer space
and all strips lower.

This won't align text so well though, but will leave it simple and he
can give feedback later.
2015-04-02 20:54:17 +02:00
38d8abb3c3 Cycles point density: Fix using double semicolon at the end of line 2015-04-02 22:35:36 +05:00
5156c283dd Fix for wrong pointer used in the modifier cache copy function. 2015-04-02 16:39:10 +02:00
a6998f132a Force calculation function for strands (only gravity atm). 2015-04-02 15:03:06 +02:00
6c832657cc Sanity check and nicer substep loop for strands simulation. 2015-04-02 13:57:34 +02:00
daca75d8e1 Fixed writing code for cache modifiers to include extra DNA fields of
subtypes.
2015-04-02 13:54:08 +02:00
366fc83f6d Fixed DupliCache writers/readers to support subsequent stages of
cache manipulation.

Strand data in caches is now stored in a named list, so we can avoid
adding strand data in every frame.
2015-04-02 13:36:50 +02:00
335b495196 Merge branch 'master' into gooseberry 2015-04-02 12:37:22 +02:00
274bb10a36 Merge branch 'master' into gooseberry 2015-04-02 21:30:10 +11:00
f0e8334d1a Merge branch 'master' into alembic 2015-04-02 21:24:57 +11:00
049dec083a cleanup: warning 2015-04-02 21:24:50 +11:00
ebf079c004 Disallow deleting of files by the point cache in the clear function.
This function is used in every part of the code, and has been causing
great pain when deleting 15 hours worth of baking in an instant.
The complexity of the code makes it unfeasible to fix this selectively,
so for now simply disallow the code from deleting any of the files.

For selected well-defined cases the deleting can be reenabled later,
e.g. when the user presses the `Bake` button and confirms deletion in
a popup.
2015-04-02 11:04:36 +02:00
9cfe6aae91 Removed unused BKE_ptcache_remove function, one less potential place
where cache files might get deleted.
2015-04-02 11:04:36 +02:00
615c57ec31 Clear duplilist instances when reading from a dupli cache, to avoid
generating a new dupli instance on every frame.
2015-04-01 20:31:28 +02:00
e0d90141b0 Made the duplicache clear function public.
It's a common operation that may be useful later, no reason to keep this
hidden.
2015-04-01 20:27:01 +02:00
644b68ac6e Basic strand processing in the hair sim cache modifier. 2015-04-01 20:03:46 +02:00
Julian Eisel
55280eecad Revert "Always display full data paths in tooltips"
Seems like there is currently now way to get the full data path
reliably. So instead of the old "..." this patch just displays
(null) which also isn't really useful.
2015-04-01 16:46:27 +02:00
83e8b3a51e Clean up vertex/normal client state after drawing strands.
This should hopefully prevent some random crashes.
2015-04-01 16:11:57 +02:00
Julian Eisel
30d72d682a Always display full data paths in tooltips
Another experiment for gooseberry. We should make Blender smarter
here in general, but it's a start.
2015-04-01 15:57:21 +02:00
Julian Eisel
5baff6246f Reorganized RMB menu and new entry "Copy Full Data Path"
D763 ready for testing from the sheepy people.
2015-04-01 13:41:38 +02:00
30ea4349c9 Merge branch 'alembic' into gooseberry 2015-04-01 13:08:30 +02:00
295b28c7b1 Clean up: Avoid unused variable warnings. 2015-04-01 13:07:38 +02:00
afddaf1188 Added missing stub function when Alembic is disabled. 2015-04-01 13:02:25 +02:00
aa9f8d32fd Merge branch 'alembic' into gooseberry 2015-04-01 12:32:29 +02:00
f428fcd23d Merge branch 'cycles_point_density' into gooseberry 2015-04-01 15:31:52 +05:00
99b10373db Cycles point density: Particle state coordinates are actually in the world space
Code was assuming they're in the object space which caused wrong
texture sampling and translation to the world location.
2015-04-01 15:30:56 +05:00
08e39a5bfb Override the init function for DupliObjectReader, so Cycles gets the
cache result when constructing render meshes.
2015-04-01 12:21:41 +02:00
6b4ea6da17 Merge branch 'cycles_point_density' into gooseberry 2015-04-01 14:38:39 +05:00
49a608aaec Cycles point density: Fix crash when source object is not set 2015-04-01 14:37:34 +05:00
9c269243db Added writers for DupliCache data to allow truely successive cache
modification.

The bake operator will now generate output based on the 'source_mode'
setting:
* When the source is SCENE it uses the basic object data as stored in
  the Object ID datablocks (DerivedMesh, particle hair strands etc.)
* When the source is CACHE it fills a temporary DupliCache with data
  from the cache archive (like it would for the display dupli_cache,
  but also supporting render data). This dupli cache is carried over
  between frames during baking, which allows modifiers to act as
  simulations and sequentially advance motion states.
2015-04-01 11:31:41 +02:00
23447ce3b9 Merge branch 'master' into gooseberry 2015-04-01 11:25:25 +02:00
dc172108f2 Merge branch 'master' into cycles_point_density 2015-04-01 14:23:02 +05:00
9e39cfe16d Merge branch 'alembic' into gooseberry 2015-04-01 10:01:25 +02:00
8ac00ec76a Merge branch 'cycles_point_density' into gooseberry 2015-03-31 22:36:50 +05:00
22fa9d3448 Fix compilation error of blender player 2015-03-31 22:36:12 +05:00
83620641d2 Merge branch 'master' into gooseberry 2015-03-31 22:23:10 +05:00
d391ab8d4a GHash iterator wrapper for DupliCache, so cache modifiers can access
all components in the cache.
2015-03-31 18:46:01 +02:00
f8e623e0b8 Removed unused "object cache" iterator code. 2015-03-31 18:12:10 +02:00
806a338090 Merge branch 'cycles_point_density' into gooseberry 2015-03-31 21:10:52 +05:00
1d32a23c78 Added transient DupliCache data baking modifiers/simulations and
writing into the output cache archive.
2015-03-31 18:06:48 +02:00
3c0e15c81a Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/view3d_intern.h
	source/blender/makesrna/intern/rna_modifier.c
2015-03-31 17:49:54 +02:00
866537d001 Removed the Cache modifier because it is unused now and causes some
merge conflicts with master.
2015-03-31 17:44:05 +02:00
3c6c33be98 Merge branch 'master' into alembic
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/space_view3d/view3d_intern.h
	source/blender/makesdna/DNA_modifier_types.h
	source/blender/makesrna/intern/rna_modifier.c
	source/blender/modifiers/MOD_modifiertypes.h
	source/blender/modifiers/intern/MOD_util.c
2015-03-31 16:59:19 +02:00
c8b831d742 Cycles: Point density texture experiment
This commit implements point density texture for Cycles shading nodes.

It's done via creating voxel texture at shader compilation time, Not
totally memory efficient, but avoids adding sampling code to kernel
(which keeps render time as low as possible), In the future this will
be compensated by using OpenVDB for more efficient storage of sparse
volume data.

Sampling of the voxel texture is happening at blender side and the
same code is used as for Blender Internal's renderer.

This texture is controlled by only object, particle system and radius.
Linear falloff is used and there's no turbulence. This is because
falloff is expected to happen using Curve Mapping node. Turbulence
will be done as a distortion on the input coordinate. It's already
possible to fake it using nose textures and in the future we can add
more proper turbulence distortion node, which then could also be used
for 2D texture mapping.

OSL is not currently supported. There's no actual stoppers for support
it, but so far it's not really a priority at this point.

Reviewers: campbellbarton, juicyfruit, brecht

Subscribers: campbellbarton, dingto, eyecandy

Differential Revision: https://developer.blender.org/D1208
2015-03-31 19:52:48 +05:00
54c2e625e5 Removed the redundant cache exporter class from the pointcache lib.
Writing in C++ is a little bit more convenient, but this functionality
does not require the additional level of complexity.
2015-03-31 14:25:10 +02:00
6bcc28b8ab Support for shading "normals" in strand rendering.
Note that the fixed-function OpenGL pipeline does not support true
strand normals. The shading model used copies the method implemented for
particles, using the edge directions as normals. This is totally
unphysical but at least gives some indication of direction. Viewport
refactor and programmable shaders are needed to make this work nicer.
2015-03-31 12:21:49 +02:00
297563286e Store the overall result of cache reading in the DupliCache.
This is used to prevent empty dupli lists when reading the cache fails.
In that case the duplilist function will now revert to default scene
evaluation.
2015-03-31 11:49:41 +02:00
1700c4c6fb Extend the cache reading function to take the result archive into account. 2015-03-31 11:26:17 +02:00
fc1d50f1e7 Reorganization of file paths and input/output workflow in cache
libraries.

Having a cache archive output in each modifier is not really practical.

Now the cache library has at most 2 file paths. These are used based on
2 associated settings: source mode/path and display mode/path.

* The SOURCE mode determines whether the original scene data is used as
input or a cache archive. If the scene input is used the dupli group
objects will be evaluated as usual with Mesh data, modifiers, proxy
armatures, etc.. With cache input the data stored in a cache is used to
override the scene data instead.
* The DISPLAY mode is essentially a toggle for the whole cache modifier
stack. If it is set to 'source' the respective source data is used
without further modification. If set to 'result' the data from the
output cache archive is used, which can be generated using the bake
operator. During baking the data will be passed through the cache
modifiers to create a variation of the original source data.
2015-03-31 10:33:33 +02:00
1740fedb64 Merge branch 'master' into gooseberry 2015-03-31 00:27:22 +05:00
b1a8b9806b Simplification of the cache library filtering mechanism.
Now the filtering is simply based on the data types that should go into
the cache, instead of selecting each object and component individually.

This is slightly more limited and may need to be revisited again later,
but for the time being it is much less confusing and clumsy. Filtering
by objects can be accomplished by creating groups accordingly. Making
groups specifically for caching is totally acceptable.
2015-03-30 18:43:31 +02:00
6d0fe090c2 Merge branch 'alembic' into gooseberry 2015-03-30 18:36:17 +02:00
3a5cd5f4d4 Fix for crash on dupli drawing, due to check of ob.transflag after it
is already restored.
2015-03-30 18:34:10 +02:00
2a032a2f6e Merge branch 'alembic' into gooseberry 2015-03-30 14:16:03 +02:00
3b4d464d1a Fix for crashes when changing draw types that affect dupli objects.
The draw code was restoring the derivedFinal mesh unconditionally after
drawing duplis. However, the drawing code can in some cases replace the
derivedFinal pointer during drawing (bad!). This then leads to invalid
pointer access.

Fix is to only touch the derivedFinal when it's actually a dupli cache
mesh.
2015-03-30 14:11:58 +02:00
0255e37a3d Merge branch 'alembic' into gooseberry 2015-03-30 12:42:54 +02:00
e0cf04c6d4 cachelibrary.modifier_bake operator has been removed in favor of
`cachelibrary.bake`.
2015-03-30 12:41:29 +02:00
892644a44c Preliminary fix for bad level calls to WM job functions from BKE.
The job invocation should happen only in editors/. Also it makes sense
to modify the bake operator such that it supports both the basic cache
library and an optional modifier output.

The design for this area is in progress anyway, probably the cache
library archive paths will be changed so that there is always one input
and optionally an output path, with all the modifiers working in
sequence.
2015-03-30 12:39:06 +02:00
ccb51e6db4 Removed unused code for ill-defined "cache objects".
The cache libraries now work based on dupli objects instead of
recursive group content, so this concept is no longer needed.
2015-03-30 12:39:06 +02:00
297bbc316a Simplified functions for generating absolute file paths from the base
cache library and modifiers.
2015-03-30 12:39:06 +02:00
2a12013600 Sanity check: motion state data in curves is optional. 2015-03-30 12:39:06 +02:00
aff4e02df2 Write out the complete dupli group in cache modifiers.
Theoretically we could write a stitcher that writes only the parts of
the data affected by a modifier and simply copies the rest, but this
is much more involved and not necessary at this point.
2015-03-30 12:39:06 +02:00
d694058fcf Merge branch 'master' into gooseberry 2015-03-30 15:07:24 +05:00
df714d0144 Merge branch 'alembic' into gooseberry 2015-03-30 14:15:19 +05:00
66e6fe54ac Merge branch 'master' into gooseberry 2015-03-30 14:00:28 +05:00
d7ddffdcce Merge branch 'master' into gooseberry
Conflicts:
	release/scripts/startup/bl_ui/properties_physics_smoke.py
	source/blender/editors/include/ED_transform.h
	source/blender/editors/space_view3d/view3d_intern.h
2015-03-30 13:50:59 +05:00
f1f51c07f4 Alebic: Fix compilation error of blenderplayer target on buildbot 2015-03-30 13:43:14 +05:00
803ff1a2f9 Writer for strand data and extension for the new motion state data.
Unlike the particle hair writer this one does not work with the particle
system data but the new Strands data. This will allow successive
manipulations of cached hair data by first storing the initial particle
grooming data ("hair edit"), read this data from the cache into a
Strands instance, then apply hair simulation and write the result back
into a second Strands cache.
2015-03-29 20:25:40 +02:00
a54ce3d26a Added optional motion state data to Strands.
This implements the distinction between the strand goal position
(grooming data, shape keys) and the result of dynamics simulation.
2015-03-29 20:23:54 +02:00
cf7b4e3054 Baking API for cache modifiers.
Cache baking means the cache modifier should read input caches over the
given frame range and produce the correct output for writing into the
output cache file.

Cache modifiers can optionally implement a 'bake' function. This is used
through a bake operator from the cache modifier panel. Baking is
executed in a job, which will help with cancelling bakes and displaying
status info.
2015-03-29 18:23:11 +02:00
a5180abde0 Merge branch 'alembic' into gooseberry 2015-03-27 17:27:11 +01:00
5fb18b1e00 Avoid clearing the record of cached frames when doing particle trails.
This is implemented badly: when using disk caches i reads the *entire*
cache from the disk to create the trail. In the process it also clears
the cached_frames array, which makes it look like the cache was deleted.
2015-03-27 14:55:25 +01:00
a93d4da344 Merge branch 'master' into gooseberry 2015-03-27 11:39:53 +01:00
e9df0e53d1 Use the last valid cache modifier output file for reading into the
dupli cache.

This makes the cache modifier stack work more like actual modifiers:
Each will take the previous result and write it into its own output
file. The last output is the final result used for viewport display.
2015-03-27 11:20:55 +01:00
89ea3e73ee New modifier system for cache libraries.
This system imitates the modifier stack for mesh objects. It will be
used to handle simulations and similar processing of cached data.
2015-03-27 11:20:55 +01:00
49cf27d39e Smoke sim option for emitting color based on particle textures.
When using a particle inflow object, there is now an option "Set Color"
which uses particle texture color to override the uniform smoke emission
color.

Particles must have one or more textures with the "Color" influence
enabled (the resulting color can be visualized in the viewport using the
"Texture" display option). The color will then replace the default smoke
flow setting and allows variable color per particle.

Combined with "Strand/Particle" texture mapping this can also be used
to change the particle emission color over the lifetime of particles or
make variable colors for each particle in the system.

Note that this currently does not work with child particles.
2015-03-27 10:36:48 +01:00
db92aac478 Particle color influence option for particle textures.
This color is currently only displayed in the viewport (when enabling
"Texture" color mode in the Display settings). It will be used for
controlling the smoke color when using particles for smoke emission.
2015-03-27 10:36:48 +01:00
3dd78fc48f quiet warnings (increase int size for bitshift) 2015-03-27 04:32:08 +11:00
ef7755bacb Merge branch 'master' into gooseberry 2015-03-26 17:54:47 +01:00
8362dd7c36 Cleanup: style 2015-03-27 03:40:10 +11:00
207bccef45 Merge branch 'master' into alembic 2015-03-27 03:27:11 +11:00
a4a74ca143 Merge branch 'alembic' into gooseberry 2015-03-26 14:55:15 +01:00
7a9492db9f Merge branch 'master' into gooseberry 2015-03-26 14:50:50 +01:00
567b78944e Minor naming conflict fix. 2015-03-26 14:45:32 +01:00
06f1b66175 Alembic: correct last commit 2015-03-26 14:13:43 +01:00
0a9b21b76c Alembic: cleanup warnings 2015-03-26 14:13:43 +01:00
def2be6be5 Alembic: expose CMake var ALEMBIC_INCLUDE_DIR
The include path could be cached to a stale value, with no obvious way to reset.
2015-03-26 14:13:43 +01:00
fb2b9ea3b4 Customdata caching for CD_ORIGSPACE_MLOOP. 2015-03-26 14:13:43 +01:00
786af9d7d9 Customdata caching for CD_ORCO. 2015-03-26 14:13:43 +01:00
475a6bdb36 Basic drawing code for strands loaded from caches.
This is entirely separate from particle systems and their insane
drawing function.
2015-03-26 14:13:43 +01:00
ecc28ae46d Simplified data structure and reading code for strands in Alembic
caches.
2015-03-26 14:13:43 +01:00
ec4e32fdea Fix wrong time sampling in customdata array properties.
The time sampling should be specified explicitly when creating
properties.
2015-03-26 14:13:43 +01:00
a0697b9b0f Explicit CD type masks for each element.
Avoid storing redundant normals for vertices.
2015-03-26 14:13:43 +01:00
64f1532f55 Fix for crash when deleting an object that was used in a dupli cache.
Object-unlink was clearing the linked object's dupli cache instead of
the duplicator.
2015-03-26 14:13:43 +01:00
aa8c33e6ab Make sure normals are correct before writing mesh data to caches.
Normal data layers might not be updated during cache baking
automatically.
2015-03-26 14:13:43 +01:00
b8d7b55726 New data structure for restoring strand data originating from particles.
The rationale here is that we don't try to replace particle data
temporarily like we do with DerivedMesh. This would be needed for
drawing cached data overrides in the viewport and pass them to renderers
(unless these read Alembic directly) and later for performing dupli
simulation.
2015-03-26 14:13:43 +01:00
abcdb0f7e4 Renamed the cache_dm to simply dm.
The fact that this is used for caching is only apparent on the higher
levels of the Object struct.
2015-03-26 14:13:43 +01:00
4dc7114e43 Write basic hair curves to caches for dupli groups.
This data will be used for dupli simulations later on. Child path
generation could also be done based on this data without involvement of
particle systems.
2015-03-26 14:13:42 +01:00
44d1c19f82 More compact sample writing code for particle pathcache caching. 2015-03-26 14:13:42 +01:00
962739281e Make the nested DM writer in Object writers a pointer, instead of using
the do_mesh flag.

This will be more in line with how optional particle system writer will
be created.
2015-03-26 14:13:42 +01:00
2a10d77a22 Revert "Avoid conflicting unordered_map definition in cycles"
This seems to break windows builds and should not be necessary.

This reverts commit 12384d564f.
2015-03-26 14:13:42 +01:00
2eaf0fd723 Fix for use of non-portable function snprintf. 2015-03-26 14:13:42 +01:00
44b516fa6a Fix for use of unknown uint type instead of unsigned int. 2015-03-26 14:13:42 +01:00
b2a004ddaf Use a stub factory when Alembic is disabled to avoid invalid pointer
access.
2015-03-26 14:13:42 +01:00
590fa47360 Fix for linking order in scons preventing correct initialization of
the Alembic caching implementation.
2015-03-26 14:13:42 +01:00
e715de6394 Added Alembic dependency config to the linux x86_64 player buildbot file. 2015-03-26 14:13:42 +01:00
f354fa56b5 Fix for bf_pointcache lib missing in the blenderplayer and fix for link
order.
2015-03-26 14:13:42 +01:00
1e93189351 Missing include path for scons build files of the gameengine player. 2015-03-26 14:13:42 +01:00
66b25f72c4 Missing library linking in the blenderplayer. 2015-03-26 14:13:42 +01:00
b41ffbea51 Stub function for Alembic init when Alembic is not enabled. 2015-03-26 14:13:42 +01:00
22309a0be6 Use dupli overrides also for the selection drawing code.
Now clicking a cached dupli instance also selects the duplicator object
as expected.
2015-03-26 14:13:41 +01:00
b122777ce7 Use dupli cache in bounding box calculations involving duplis.
This feature is mostly useful for the "view selected" operator. It is
also used in the "set origin to geometry" operator, but since the
cache overrides the object geometry anyway the effect may not be what
users expect (which is acceptable).
2015-03-26 14:13:41 +01:00
d4f48ffc63 Simple mesh import from Alembic files in Cycles standalone.
Note that Cycles currently only supports tessellated triangle/quad
meshes. Alembic PolyMesh generally has ngons, so external tessellation
is required until cycles gets a proper tessellation implementation of
its own.
2015-03-26 14:13:41 +01:00
ad85c05ae2 More control over verbosity with Alembic archive info printing. 2015-03-26 14:13:41 +01:00
902a747f60 Simple inclusion of alembic files from inside xml files for cycles
standalone.

The cycles XML files now can refer to Alembic (.abc) files. This will
call the default alembic reader to read in scene data. Currently it
simply prints the Alembic file structure.

Eventually a proper schema needs to be defined for both xml and abc.
Also care has to be taken to handle potential conflicts between settings
both within xml/abc and between them.
2015-03-26 14:13:41 +01:00
0742817088 Basic Alembic integration in the Cycles standalone.
This adds Alembic to the standalone application version of cycles.
Files can be specified as XML or Alembic, or use automatic detection
based on the filename extension.

Currently the Alembic reader just dumps the file structure to stdout
as a test.
2015-03-26 14:13:41 +01:00
d1d98c23ee Fix for cycles cmake missing GLEW library variable when building without
the GUI.
2015-03-26 14:13:41 +01:00
64a7d76bd8 Avoid conflicting unordered_map definition in cycles by using a general
include path instead of the boost one.

For explanation see http://stackoverflow.com/questions/3973659/c-unordered-map-compiling-issue-with-g
2015-03-26 14:13:41 +01:00
fc5858b320 Fix for corruption of the item hash table in cache libraries on copy. 2015-03-26 14:13:41 +01:00
84ccc6a3c0 Take cache library items into account when baking caches.
This means we don't bluntly store all the data in a group, but use the
selection from the cache library. It also helps to avoid issues with
object visibility which is not yet stored in the cache.
2015-03-26 14:13:41 +01:00
bb2fd946ec Working implementation of cache reading for dupli data during renders. 2015-03-26 14:13:41 +01:00
fce1a01f7b Use the temporary 'is_dupli' flag to prevent objects from freeing
overriden data that is owned by the cache.

This is not at all nice ... Hopefully it doesn't get too complicated to
work around all these drawing code and depsgraph issues, so the code
can be understood and replaced at some point in the future.
2015-03-26 14:13:41 +01:00
da44371fdf Replacing boundbox temporarily during drawing is dangerous, since it
can be freed at any point.

Luckily we only need the boundbox locally for testing dupli visibility.
2015-03-26 14:13:40 +01:00
7a771a6c34 Fully reset the OB_FROM_DUPLI flag for each dupli instance, in case
later duplis can not be found in the cache.
2015-03-26 14:13:40 +01:00
dccc3e62e7 Distinguish realtime/render setting in the Object writer.
Now the derived_render mesh version is created locally when writing
render results.
2015-03-26 14:13:40 +01:00
1ad78297ca Combined storage of render and realtime data in caches.
Caches now create 2 new roots below the main 'top' object of Alembic:
root and root_render for realtime and render data respectively.
This makes it easy to switch the whole archive to either of the modes
during baking and for constructing dupli caches.

Alternatively individual objects could store hires versions of their
data. This would also be more efficient if the cache contains many
simple objects which don't have 2 different variants. However, such
design decisions are difficult to make at this point and the
implementation can be modifier later.
2015-03-26 14:13:40 +01:00
b8c29051f9 Make sure the cache baking job cancels properly when interrupted in the
first stage.
2015-03-26 14:13:40 +01:00
14d401ac12 Allow cache libraries to store both render and realtime (viewport) data.
This is the default now. It should make workflow a lot more foolproof
and convenient, since having only one of these modes active at a time
very easily leads to broken renders and confusing situations.

The problem is mostly due to the complicated way the depsgraph layer
feature is used to handle duplicator visibility. The duplicator is
declared as a child of its group's objects (even though no real
dependency exists!), so that a visible duplicator triggers updates of
invisible group objects, making instances of hidden groups possible.

However, dupli caches have to disable this dependency in order to avoid
unnecessary costly updates in hidden layers which are overridden by
cached data anyway. At the point where these dependencies are created
the evaluation context is unknown though, which means we cannot
distinguish between render and realtime evaluation for the purpose of
cache reading ...
2015-03-26 14:13:40 +01:00
17ccf6387c Removed deprecated code. 2015-03-26 14:13:40 +01:00
fe1ec0100d Make sure mesh data is really stored and reconstructed from the cache
entirely.

Also the code is much better structured now, moving toward a more
standardized sample/schema class definition.
2015-03-26 14:13:40 +01:00
e0f3d9250a CD_NORMAL support for mesh customdata caching. 2015-03-26 14:13:40 +01:00
640e3fd365 Fix for use of wrong CustomData for tessfaces. 2015-03-26 14:13:40 +01:00
b4f62f7866 Copy rgba components of MCol explicitly to the Alembic C4f type to avoid
potentially different ordering.
2015-03-26 14:13:40 +01:00
aeb4384d5a MCol customdata caching. 2015-03-26 14:13:40 +01:00
aef3dc4938 MTFACE customdata is not suitable or necessary for caching, so disable
it.
2015-03-26 14:13:40 +01:00
3a38ed914a Added customdata writers/readers for missing mesh edge, poly and loop
data.
2015-03-26 14:13:39 +01:00
f65b7c8377 UI cleanup and a bit nicer workflow by treating read/write mode like
an enum toggle.
2015-03-26 14:13:39 +01:00
84411eb190 Disable the bake operator if cache reading is enabled.
Re-baking cache results is not technically prohibited, but not useful
and allowing only read or write selectively gives a nicer workflow.
2015-03-26 14:13:39 +01:00
c5d1d174f2 Cycles support for dupli caches.
If a cache is read-enabled cycles will now use the cached mesh data
instead of dupli results.
2015-03-26 14:13:39 +01:00
aebc98e061 Skip drawing of particle systems (including hair) when using cache
duplis.

Particle systems can not be overridden from caches easily, there are too
many strings attached to the data and code to make this reliable.
Instead, a new simplified data structure for reading hair from caches
will be added, which replaces drawing and rendering of particle data.
The original particle data is not updated through duplis, so is usually
out of sync and should not be displayed.
2015-03-26 14:13:39 +01:00
cf5a4256a8 Main argument is no longer needed for cache reading, the cachelib is
now given explicitly.
2015-03-26 14:13:39 +01:00
ca8b8d9309 Removed unused variable. 2015-03-26 14:13:39 +01:00
b4295d1c8f Calculate bounding boxes for cached DMs to avoid visual popping when
using the original Object's bb.
2015-03-26 14:13:39 +01:00
850c47b5a8 Test for NULL archive pointer when writing as well.
This should not usually happen because the operator asks for permission
to delete the file prior to writing, but should be checked nevertheless.
2015-03-26 14:13:39 +01:00
0e70ddfe14 Safeguard against crashes from invalid Alembic file paths by returning
NULL archive pointers.

This allows writer/reader code to test against obvious archive errors
easily and is unmistakable.
2015-03-26 14:13:39 +01:00
f5b360b4da Fix for wrong ID code used in RNA->idcode mapping. 2015-03-26 14:13:39 +01:00
6589a564c9 Removed group pointer from cache libraries and use object->cachelib
pointer instead.

This change makes it possible to have group duplicators using different
versions of a cache.
2015-03-26 14:13:39 +01:00
790f8d935a Added a cache library pointer to objects as a replacement for CL->GR
pointers.

Relationship between CacheLibrary, duplicator Objects and Groups is
difficult. There are a number of somewhat conflicting goals:
- CacheLibraries write out data for objects and dupli groups. Multiple
  objects can be stored in the same cache: CL *->* GR
- Objects can override a dupli group with different caches: OB *->1 CL
- As before, each object can be the duplicator for one group: OB *->1 GR

To combine these requirements, the first relationship will be made
indirect. Only the Object -> Group/CacheLib relations are explicit
pointers in the DNA. For finding all objects contained in a cache
library the usual recursive DNA tagging system must then be used.
2015-03-26 14:13:38 +01:00
4950ea97dc Removed the now redundant "Read" toggle from cache libraries.
At this point the reading is toggled on the side of group duplicators.
2015-03-26 14:13:38 +01:00
4f91f81e02 Removed the explicit duplicache rebuild operator.
The cache is now updated on frame changes automatically, the operator
should no longer be needed.
2015-03-26 14:13:38 +01:00
ea5c140926 Removed unused deprecated functions for cache library. 2015-03-26 14:13:38 +01:00
869e11ef5a Sanity check for dupligroup caching functions. 2015-03-26 14:13:38 +01:00
0d3da1343c Use a new flag in duplicator objects to enable cache reading and avoid
unnecessary dependencies.

This flag will replace the current "read" mode on cache libraries.

Beside enabling cache reading, it also disables the current "fake"
dependencies between duplicators and their group objects. This is
exploiting the layer visibility mechanism in depsgraph to ensure that
animated group objects get evaluated when used by a visible duplicator,
even when they are not themselves visible. These dependencies cause
group object updates even if the duplicator is using cached results.
To avoid this unnecessary overhead and make caching worthwhile we
rebuild depsgraph without these relations when using the cache instead.
2015-03-26 14:13:38 +01:00
26b58bd151 Enable frame updates of duplicache through use of an invalidation flag. 2015-03-26 14:13:38 +01:00
124e00bf8a Disable additional depsgraph tagging through cache libraries.
This code is outdated due to changes in reading code and obscures some
genuine depsgraph behavior.
2015-03-26 14:13:38 +01:00
03ffed6fb1 Mesh overrides for duplis from cached Alembic data.
If a duplicator has cached data it will now replace the derivedFinal
mesh of objects with the cached version for drawing.

This is a compromise atm: It would be better to actually draw derived
meshes directly, so that we don't have to modify objects. Then we could
also have multiple different instances of the same orignal object
(in whatever way these might be defined). DNA Objects would then be
totally separate from duplis, but at this point the drawing and render
code makes this unfeasible.
2015-03-26 14:13:38 +01:00
9683f7aae1 Mesh storage and reading in child objects for dupligroups.
The layout of the Alembic files resembles the DNA structure in Blender:
- On the top level (under the top/root node) there are Abc::Objects for
  Blender ID datablocks (currently Object and Group)
- Objects store final data (DerivedMesh) and later simulation results
  etc.
- Groups store their full duplilists for instancing. Currently there is
  no recursive nesting of groups, since this would limit duplis to
  dupligroups and exclude e.g. duplifaces.

On reading the duplilist gets reconstructed and stored in the DupliCache
for a duplicator empty (the group instance). DerivedMesh data is stored
in a hash table for each instanciated object and can later replace
finalDM in drawing and rendering.
2015-03-26 14:13:38 +01:00
8db0e2b8c2 Simplification of the archive init functions in writers and readers.
Now the base types for readers/writers are not nominally forming the
interface any more (they may be removed entirely later). This makes
possible a cleaner init method directly in the Abc Writer/Reader
classes.

Further work may be required in this area.
2015-03-26 14:13:38 +01:00
ad2a8e7fd8 Moved the dupli cache reading code into a AbcDupligroupReader class.
This is more in line with how readers work in the Blender Alembic
implementation elsewhere.

Generally, readers are less persistent than writers: they are created
whenever cache results need to be updated (e.g. on frame changes) and
discarded afterward. Writers OTOH stay alive during the whole baking
job, since they keep the references to Alembic Writer instances and can
only be deleted once the writing for that part is done.
2015-03-26 14:13:37 +01:00
401b720531 Store and apply dupli object transforms in the Alembic cache.
Note that the cache stores dupli matrices without the final parent
transform, since it only knows about the group itself. The duplicator
obmat is applied to the duplis after reading the cache.
2015-03-26 14:13:37 +01:00
bdedd88d92 Handle dupli cache on object copy and freeing. 2015-03-26 14:13:37 +01:00
cc1ce64b02 Updated cache reading function for the new duplilist structure.
Now we store duplilists entirely inside a single alembic object for the
group. This allows using all the generated duplis, which would be
difficult if the alembic file had to define all the possible recursive
dupli relations that Blender allows, beside straightforward Group duplis.
2015-03-26 14:13:37 +01:00
e5940d0515 Use a nested Object writer to store the Object ID blocks used by dupli
lists.
2015-03-26 14:13:37 +01:00
75d83d954a Better dupligroup Alembic writer.
Uses the duplilist generated by Blender to define instances, instead of
recreating the group layout. This omits some information about actual
structure of the DNA, which might be useful later on. The main problem
is that the duplilist itself does not encode this, so it's a tradeoff
between either including the Group structure or omitting the other
dupli types, like face, vertex, particle duplis.
2015-03-26 14:13:37 +01:00
1a4f89029f Alternative dupli generator function for creating duplis in a group
without a specific parent.
2015-03-26 14:13:37 +01:00
b691dfdaa9 Some disabled code to enable automatic cache updates on every duplilist
creation call.

This is executed *a lot* (even for simple things such as viewport
panning), so the code is probably not suitable in this form. At least
it could do a frame comparison to avoid unnecessary updates.
2015-03-26 14:13:37 +01:00
31009f8919 Use a cached group only when a CacheLibrary is actually available.
Otherwise the regular duplilist generator is used.
2015-03-26 14:13:37 +01:00
da7a970e3b Replace usage of the procedural duplilist generation by cached duplilist. 2015-03-26 14:13:37 +01:00
4fd3943696 Store object pointers for the dupli objects we generate from caches.
This is necessary for the current viewport drawing and rendering code,
which expected each dupli instance to represent a copy of data in the
DNA.

The code maps base-level objects in the cache to DNA Objects inside the
dupligroup by name. Only objects that can be found in the blend data
will be allowed for DupliObjects.
2015-03-26 14:13:37 +01:00
607e0f0d52 Moved the DupliCache struct into DNA, it will be needed for drawing and
RNA access later.
2015-03-26 14:13:37 +01:00
b592669097 Simple operator to force rebuilding of a dupligroup cache.
This is a placeholder for proper depsgraph integration. Eventually frame
changes and some other updates should rebuild dupligroup caches
automatically using the depsgraph. Until then this operator is a quick
way to test the IO from caches and the further drawing and rendering
(TODO).
2015-03-26 14:13:37 +01:00
39af6d71cf Cache reading functions for constructing a nested dupligroup list based
on Alembic cache data.
2015-03-26 14:13:36 +01:00
c61c039f21 Include mesh writers in the cache writers list. 2015-03-26 14:13:36 +01:00
018f613c90 Removed unused code. 2015-03-26 14:13:36 +01:00
0fbad24bf2 Removed current implementation of cache reading from various parts of
BKE (DerivedMesh, particles, cloth).

The new cache implementation will be used for constructing dupli data
instead, bypassing the complexities of the modifier stack.

Conflicts:
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenkernel/intern/particle_system.c

Conflicts:
	source/blender/blenkernel/intern/particle.c
	source/blender/blenkernel/intern/particle_system.c
2015-03-26 14:13:34 +01:00
ad65238df7 Initial code to support dupli group instancing and overrides through
Alembic caches.

This creates representations (Abc::Object) for Blender Object and Group
datablocks in the Alembic files and uses Alembic instancing to define
the dupligroup hierarchy. This leads to a relatively flat hierarchy in
Alembic files:

Top -> Object/Group -> DerivedMesh/Particles/Hair/Cloth/Smoke/...

The dupligroup structure can not be represented by a hierarchical
structure such as the Alembic object nesting, because of the
many-to-many relationship between objects and groups (a group can
contain multiple objects, multiple objects can instance the same group).
Instead we use the instancing feature of Alembic to represent
dupligroups. This is created in 2 stages to ensure all the main ID
blocks have been serialized before creating references.
2015-03-26 14:13:08 +01:00
b82bf93000 Nicer info printing support for instances in Alembic files.
This now avoids repetition of internal instance structure.
2015-03-26 14:13:08 +01:00
e7a9635ed3 Fix for invalid ob->data access in case non-mesh objects are in the
cached group.
2015-03-26 14:13:08 +01:00
3c733e8eda Improved edge attribute caching.
Now edges should be fully restored from cache, fixing edge display.
2015-03-26 14:13:08 +01:00
e92c7ea9bb Omit hair path lengths for anything but the first sample.
We can safely assume that paths don't change their lengths. This might
safe some cache space.
2015-03-26 14:13:08 +01:00
1930d4b364 Fix for particle pathcache caching: have to check the psys->renderdata
pointer to figure out if we are evaluating with render settings.
2015-03-26 14:13:08 +01:00
d76746acde Fix for some archive checks to make sure we don't access invalid data.
This can happen if the archive file cannot be opened for some reason.
2015-03-26 14:13:08 +01:00
a60b289809 Implementation of MDeformVert customdata layers in Alembic. 2015-03-26 14:13:08 +01:00
07fbb0e25e Fix for name collisions in compound properties when writing CustomData.
This is not clearly documented for Alembic, but apparently properties
inside compounds still need to be name uniquely for the whole object.
This is somewhat involved for Blender's CustomData, because we have
5 different customdata elements for meshes (vert, edge, face, poly,
loop) and each of these can have the same types and multiple layers of
the same type ...
2015-03-26 14:13:08 +01:00
e6e058289d Fix for Alembic info printer printing to std::cout instead of the
internal stringstream.
2015-03-26 14:13:08 +01:00
2d3261754a Fix for potential size issue: need 64 bits for CustomDataMask types. 2015-03-26 14:13:08 +01:00
b17fdec19c Nicer error handling for unimplemented CustomData layer types.
Instead of failing an assert, simply print an error message and return
gracefully. We don't want Blender crashing because of this.
2015-03-26 14:13:08 +01:00
5d044d62e2 Ugly hack for caching code to deal with quirky modifier stack behavior.
CustomData layers are pruned by the CDDM_copy function when they have
CD_FLAG_NOCOPY set. This is based on later modifiers in the stack, which
can specify that they require certain data layers - but the caching
modifier itself should store only what is needed by later modifiers.
It means we cannot easily keep a full copy of the DM in the cache
modifier to writing into caches later.

For now the hackish solution is to temporarily disable NOCOPY flags when
copying the DM. This is really not nice and needs a better solution.
2015-03-26 14:13:08 +01:00
80e541e581 Support CD_ORIGSPACE layer caching.
This is needed by particles for distributions on meshes with changed
topology (which is of course broken).
2015-03-26 14:13:07 +01:00
78d00e5eeb Tessface customdata for derived mesh caching. 2015-03-26 14:13:07 +01:00
c409adf4c8 Support for CustomData in Alembic caches.
This is a skeleton feature that provides a general way of storing
CustomData types. Currently only ORIGINDEX layers are implemented, the
code is designed to make extension easy.

Storing CustomData layers in Alembic is a bit involved because the
complex structs often used as customdata need to be de-interleaved for
Alembic into a set of POD (plain-old-datatype) array properties.

In addition the property names should be unique, so that mapping abc
properties back to customdata layers is safe. This works by using 2
levels of compound properties: the first level stored per CD type
properties, with a number of properties for each layer of this type,
using either a name or index (for unnamed layers). The internal
properties can then in turn be compounds, if structs need to be
serialized into PODs.

Abc property readers/writers are created dynamically for the CustomData
compounds. This is necessary because we don't know in advance what kind
of data layers a DerivedMesh or other CD user will have, and this can
change each frame in theory. Alembic is easier with state data schemes,
but using it this way is possible (if somewhat cumbersome).
2015-03-26 14:13:07 +01:00
4f326e5987 Fix for cache item filtering: items can be part of the cache library
but disabled, in that case hide them as well.
2015-03-26 14:13:07 +01:00
d49c83eebf Fixed test for "render" eval mode for hair dynamics.
This is totally weird and convoluted, no idea if correct.

Conflicts:
	source/blender/blenkernel/intern/particle_system.c

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
2015-03-26 14:13:04 +01:00
98e0de16ab Removed the DM writer/reader from hair dynamics again, this is part of
the particle stuff and does not work.
2015-03-26 14:12:49 +01:00
eed8674c17 Archive Info operator for Cache Library archives.
This creates a string with information about all the objects and
properties contained within a (Alembic) archive, used by a cache
library.

The operator has 3 modes of presenting the info string:
- stdout, ie. printing to the terminal
- popup window (not very useful usually due to size limits and lack of
  scrolling)
- clipboard copy
2015-03-26 14:12:48 +01:00
38b0940a54 Use a combined class for hair dynamics for cloth and mesh data.
Particles store a copy of the DM internally as the emitter.
2015-03-26 14:12:48 +01:00
15e3298d54 Alembic: Fixes for linux buildbot and scons 2015-03-26 14:12:48 +01:00
ce6a8188c0 Depsgraph tagging function for cached objects.
This is necessary to trigger object data updates for indirectly linked
objects, which would otherwise not be evaluated.
2015-03-26 14:12:48 +01:00
9787f4bbaa Convenience feature: When linking a cache library, always default it to
'read' mode locally.

Linking a cache library is meant to be used for getting existing cache
data into a file.
2015-03-26 14:12:48 +01:00
43093f141a Left a comment in DerivedMesh.c explaining why the caching system has
to use the cumbersome cachedm pointer instead of virtual modifiers.
2015-03-26 14:12:48 +01:00
75e146f8a2 Use a dedicated input_dm pointer in the cache modifier to provide a mesh
result read from the cache.

Mixing this with the output_dm used for writing leads to undefined
situations where the DM was released but should actually be passed on.
2015-03-26 14:12:48 +01:00
8b67c63274 Use correct flag enums for checking render/viewport eval mode when
writing derived mesh caches.
2015-03-26 14:12:48 +01:00
a8a5785cc2 Fix for meaningless build error (no return value, can never happen). 2015-03-26 14:12:48 +01:00
39c4c37599 Minor fix for UI code showing cache items. 2015-03-26 14:12:48 +01:00
91ec385a0d Render/Viewport evaluation mode for cache libraries.
This designates a cache library to be used either for the viewport or
for renders. A "Render" cache library will evaluate modifiers with
render settings and a "Viewport" cache library will use viewport
(realtime) settings.

When reading the cache, the library will only be
used for the assigned purpose, i.e. a Render cache does not work for
viewport caching and vice-versa (although a cache can be baked for one
setting and then switched afterward).

Note that render results will never be visible in the realtime viewport
due to the way object evaluation is handled in Blender at this point
(render settings are only evaluated explicitly during renderer sync).

Conflicts:
	source/blender/blenkernel/intern/particle_system.c

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
2015-03-26 14:12:45 +01:00
81c720f76e Allow the cache bake operator to overwrite existing files, using a
confirm dialog.
2015-03-26 14:12:39 +01:00
359b3f7011 Removed now-unused util_path files from the pointcache lib.
Paths are constructed outside this module now. A valid absolute path
should always be provided through the API calls.
2015-03-26 14:12:39 +01:00
e46cce7fe9 Record and display the last result of cache reading in the cache library
items.
2015-03-26 14:12:39 +01:00
920ff67dea Free readers properly after applying cached data. 2015-03-26 14:12:39 +01:00
c4fe4b71ef Set reader/writer archive as a separate step outside the constructors.
This allows nicer creation of readers/writers //before// actually
opening the archive. This in turns can simplify code quite a bit.
2015-03-26 14:12:39 +01:00
76b999949d Moved functions for constructing readers/writers based on cache library
out of pointcache into blenkernel.

This is quite simple and repetitive and there is not need to have this
in the main pointcache/Alembic API. The code is mostly concerned with
logic of DNA data, so pointcache shouldn't have to deal with it.
2015-03-26 14:12:39 +01:00
0db1e01089 Ported archive filename constructor from pointcache library to BKE.
The pointcache library is now pretty much independent from ID blocks and
should not be responsible for handling file paths. The path construction
is also fairly straightforward now compared to the old point cache
system, with only basic conversion of relative to absolute paths for
loading archive files.
2015-03-26 14:12:39 +01:00
730e38279a Cache read result enum in DNA mirroring the internal pointcache results.
This can be stored in cache library items as an indicator of cache
reading state.
2015-03-26 14:12:39 +01:00
70a5fccfb4 Use a uiTemplate function for showing cache library items instead of
python code to unify symbols.

This is necessary because the operator for adding new items (as opposed
to the enable/disable button) cannot be shown with the same checkbox
button. The UI template function can display a custom button for the
operator, so the look becomes less confusing.
2015-03-26 14:12:38 +01:00
3e4cf67ef4 Nicer default filename for cache library paths.
This now appends a default extension based on the cache backend used.
At this point this is always Alembic (.abc) but would allow other
backend formats in the future.
2015-03-26 14:12:38 +01:00
03ac4af650 Improved filtering for cache library content.
In addition to the object name filtering, items in cache library groups
can now be filtered by type as well.

Existing items in the cache are always displayed, so as to not hide
important information (what gets stored in the cache). The filtering
is primarily a utility to simplify searching inside the group for things
that should be added to the cache.
2015-03-26 14:12:38 +01:00
8eeb5382d9 Use a generator in the python code to iterate over all the potential
cache library items.

This should ideally happen on the RNA side, but making the equivalent of
python generators in the RNA is really difficult.
2015-03-26 14:12:38 +01:00
07e7cdad8d Don't show mesh cache items for non-mesh objects. 2015-03-26 14:12:38 +01:00
9848f404fb Disabled collection properties for 'virtual' cache items in RNA.
This requires a better design and is not so easy to implement properly
within the limits of RNA definition. These collections don't physically
exist in the DNA, they are mainly utilities for looping over
//potential// items in a cache library. For now the python code has to
be adapted to only show valid items, until the RNA provides a good
solution.
2015-03-26 14:12:38 +01:00
89e0abb3e6 Generic validation function to help ensure that we don't add meaningless
items to a cache library.
2015-03-26 14:12:38 +01:00
4302580af9 Replaced use of the HDF5 Alembic backend by Ogawa.
Ogawa is replacing HDF5 as the new de-facto standard. Selecting either
should be more formalized and a user option, for now it's just hardcoded.
2015-03-26 14:12:38 +01:00
e1a17cea89 Filter utility for finding objects in a cache group faster.
This is a preliminary feature and implemented purely in python, to be
replaced later.
2015-03-26 14:12:38 +01:00
303997ea71 New 'read' flag to toggle reading of the CacheLibrary as a whole.
This is also used during the bake process to avoid confusion: The read
flag gets disabled for the baking cachelib, so that objects don't try
to read cache data that is supposed to be generated.
2015-03-26 14:12:38 +01:00
aa36820fa2 Delete operator for cache library datablocks.
CacheLibrary datablock has a generic unlink function now, but currently
nothing actually links to cache libs themselves, so it's empty. Still
good to keep this in mind for the future.
2015-03-26 14:12:38 +01:00
26bb16c833 Reader/Writer API functions for basic particles.
Also slightly renamed pathcache functions for consistency (use plural
'particles' instead of 'particle').
2015-03-26 14:12:38 +01:00
d20d2d78ee Removed deprecated and unused alembic API functions.
These are now implemented as virtual functions in the Factor class.
2015-03-26 14:12:38 +01:00
a593d05733 Fixes for scons build files. 2015-03-26 14:12:37 +01:00
0a2d0fb667 Fix for circular linker dependency with cache code library.
The `bf_pointcache_alembic` code is a separate library, to avoid
muddling up core code with alembic includes and preprocessor defines.
Alembic stuff only belongs strictly into alembic code and can be
disabled cleanly.

The `bf_pointcache` and `bf_pointcache_alembic` libraries had a circular
dependency, because the alembic implementation functions were called
directly. Now there is a "Factory" class to abstract the creation of
concrete implementations for readers and writers.
`bf_pointcache_alembic` defines this factory and is registered
//outside// of the core `bf_pointcache` lib, so there is no linker
circularity.
2015-03-26 14:12:37 +01:00
d50aa3b019 Removed unused thread mutex file from pointcache lib. 2015-03-26 14:12:37 +01:00
188cc9b12c Removed deprecated rna_pointcache.c file.
Scons was still compilling this, since it's source files are not
explicit.
2015-03-26 14:12:37 +01:00
2abbfea29f Fix for indirectly linked object pointers in cache libraries.
These must be made "extern" to avoid losing links on loading.
2015-03-26 14:12:37 +01:00
4fa4f54e00 Removed remaining 1 frame difference in archive storage.
This was an artifact from the previous way of mapping non-0 start frame
to time 0.0. Now we start at times > 0.0 to match with the start frame.
Both ways are possible, can be changed later if needed.
2015-03-26 14:12:37 +01:00
7a84204449 Fixed start frame mapping in Alembic archives.
Writers were always starting at time 0.0, which means that for start
frames > 1 the readers would always be off. Now match the writer start
frame to the actual Blender start frame.
2015-03-26 14:12:37 +01:00
1168ec39c7 Added poll function for the cache manager panel to prevent hiding in
Cycles render engine.

The "compat_engines" thingy really gets in the way here ...
2015-03-26 14:12:37 +01:00
61d6e50444 Cache reading for particle paths.
Conflicts:
	source/blender/blenkernel/intern/particle.c

Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-03-26 14:12:33 +01:00
49485305d1 Fix for cache modifier linking and handling of the default case (no
cachd modifier).
2015-03-26 14:11:17 +01:00
b61334cc84 Changed implementation of the Cache modifier to work in tandem with the
cache library system.

The Cache modifier is now an optional "break point" of the modifier
stack:
- Without a cache modifier the stack works as before. Baking will write
  the final stack result. After baking the cache replaces the whole
  stack.
- With a cache modifier the stack result at the modifier's position is
  stored. The cache is then applied as the output of that modifier,
  skipping preceding modifiers. That way additional modifiers can be
  applied on top of the cache.
- When using multiple cache modifiers, only the last (active) one will
  be used, since all previous cache results would be discarded anyway.
2015-03-26 14:11:17 +01:00
29bf328e41 Replaced point cache in cloth modifiers (also hair) with the new caching
system.

Conflicts:
	source/blender/blenkernel/intern/cloth.c

Conflicts:
	source/blender/blenkernel/intern/cloth.c
2015-03-26 14:11:12 +01:00
e1e8b6e57e 'expand' function for cache libraries, so link/append makes it load the
group and objects too.
2015-03-26 14:10:35 +01:00
a5e717f1d4 Make cache libraries a linkable data block. 2015-03-26 14:10:35 +01:00
dc655c4ee6 Take NULL object pointers in cache items into account.
This can happen if an object gets deleted or isn't loaded for some
reason. The item should just be ignored in that case and removed at the
next opportunity (cleanup function).
2015-03-26 14:10:35 +01:00
87bf9ee25e When using the "new cache library" operator, enable fake user by
default.

Nothing actually links to a cache library at this point (and probably
won't in the future), so fake user is necessary to avoid losing data.
2015-03-26 14:10:35 +01:00
083597eb69 Display cache library name and fake user button, imitating template_ID. 2015-03-26 14:10:35 +01:00
5ada4a5502 Importing of caches into Blender data.
Currently only implemented for DerivedMesh.
This replaces the `final_dm` calculation of the modifier stack with the
result from cache loading.
2015-03-26 14:10:35 +01:00
228a3fd4dc UI fixes, draw bake operator button only once at the top. 2015-03-26 14:10:35 +01:00
45a1bd8054 Hair path writer needs 2 different variants for parent/child hairs. 2015-03-26 14:10:35 +01:00
8dce165500 Added writers for derived mesh result and hair paths. 2015-03-26 14:10:35 +01:00
490a775fa7 Use explicit name strings for all readers/writers in the cache instead
of constructing names internally.

This helps prevent name collisions and guarantees a consistent naming
scheme for putting multiple items in the same cache.
2015-03-26 14:10:35 +01:00
46f15b3ea9 New reader/writer for DerivedMesh.
Used as a base for existing PointCacheModifier classes, but can be used
on its own.
2015-03-26 14:10:35 +01:00
0eaff16da8 General support for export to/import from Alembic files based on Cache
Libraries.
2015-03-26 14:10:34 +01:00
2146d7b9c9 Deleted unimplemented parts of the previous pointcache system, to make
refactoring simpler.

Since the new approach is not tied to the old set of point cache data
types there is really no need to carry their empty husks around. Once
the new caching system is defined in detail we can add back whatever
makes sense.
2015-03-26 14:10:34 +01:00
ae4f0c33c6 Disabled specialized Point Cache modifier handling in the modifier
stack, this will be replaced and is not correct anyway.
2015-03-26 14:10:34 +01:00
01a1c34d91 Refactoring of archive handling in readers/writers.
Now instead of each reader/writer creating its own archive, the archive
is created by the caller in advance and passed as a constructor
argument. This means that multiple items can be stored together in the
same archive.
2015-03-26 14:10:34 +01:00
6ca19d7aa9 Removed unused Scene pointer from the base Reader/Writer classes. 2015-03-26 14:10:34 +01:00
9bf48ec3cd Operator skeleton for a cache bake operator, using the job system. 2015-03-26 14:10:34 +01:00
3113f5cfe5 Fix for undefined return value. 2015-03-26 14:10:34 +01:00
babf2ca5d9 Removed unused line. 2015-03-26 14:10:34 +01:00
25d5856683 Unlink and cleanup functions when objects or the cached group get
unlinked or changed.
2015-03-26 14:10:34 +01:00
eb79cb0c84 Make sure cache item pointers are lib-linked correctly. 2015-03-26 14:10:34 +01:00
1c14dccb5e Name string construction for cache items, to use as a unique identifier
in the cache library.
2015-03-26 14:10:34 +01:00
efa3b04ddf Draw some UI buttons for all the current cache item types. 2015-03-26 14:10:33 +01:00
8393bb1f41 Updated hash table for lookup of enabled cache items and added basic
UI support.
2015-03-26 14:10:33 +01:00
8afec0b6d6 Improved collections in RNA for looping over potential caching items
in the object group.
2015-03-26 14:10:33 +01:00
bb86cdb738 Define a collection of "object_caches" in the CacheLibrary RNA for
iterating over all objects eligible for caching in the group.

This allows for nested dupligroup instances as well. All objects that
are instantiated at least once by any group can be included in the
respective cache, but get represented only once because the cached data
is the same anyway.
2015-03-26 14:10:33 +01:00
095403be92 Link main CacheLibrary pointers in readfile. 2015-03-26 14:10:33 +01:00
b2b8cbf2b6 Simplified cache item path description, based on plain ID blocks with
subtype/index.

This omits possible instancing and recursion by dupli groups, but since
the data of instances is always the same in Blender at this point, there
is little need to take them into account for caching.

At some point in the future it may become desirable to store full dupli
hierarchies in the cache, but it doesn't make sense to try to design a
fully-fledged path descriptor for this hypothetical case now.
2015-03-26 14:10:33 +01:00
6b3a64b81b BKE functions for managing cache content based on a group.
This uses a complete hierarchy of group instances, based on a path
hierarchy (object names).

Putting
2015-03-26 14:10:33 +01:00
4f13290574 Simple cache manager panel UI in the scene buttons.
This is mostly a simple and unintrusive placeholder to have some way of
making caches accessible, but needs some more thought.
2015-03-26 14:10:33 +01:00
f8612bccf3 Group pointer property for cache libraries to associate them with an
object group.

This is somewhat experimental, eventually we may want to link to Objects
instead, or allow multiple cache targets for the same cache, etc.
2015-03-26 14:10:33 +01:00
505fe4ff8c Missing include. 2015-03-26 14:10:33 +01:00
983ef57353 Removed meaningless comment. 2015-03-26 14:10:33 +01:00
e9efdae466 New operator for adding cache libraries.
Conflicts:
	release/scripts/startup/bl_ui/properties_physics_common.py
	source/blender/blenkernel/BKE_pointcache.h
	source/blender/blenkernel/intern/pointcache.c
	source/blender/editors/physics/physics_ops.c
	source/blender/editors/physics/physics_pointcache.c
2015-03-26 14:10:33 +01:00
51bd9beb1b New ID datablock 'CacheLibrary', for managing physical cache archives
and files.

At it's core this is just a file path, but many different cache users
may refer to this, so having a dedicated ID block helps. It can be
compared to Image datablocks, which also primarily are used for data
on storage, but can be packed with the blend file, and carry some
additional information that would be cumbersome to keep sync'ed
otherwise.

The name 'CacheLibrary' deliberately resembles the 'Library' datablock:
just as a Library stores ID blocks in a physical file, a CacheLibrary
stores cached data (in Alembic HDF5/Ogawa or other formats).

Conflicts:
	source/blender/blenkernel/BKE_pointcache.h
	source/blender/blenkernel/intern/pointcache.c
	source/blender/makesdna/DNA_pointcache_types.h

Conflicts:
	source/blender/makesrna/intern/rna_main_api.c
2015-03-26 14:10:33 +01:00
2483e50093 Fix for remaining PointCache references in the alembic code.
Now, for the time being, uses a simple relative "//blendcache/" folder
path again. This will be adressed later.
2015-03-26 14:10:32 +01:00
9e3c7ca085 PointCache modifier to act as a terminator in modifier stacks.
When writing DerivedMesh data, the modifier result at the point of the
modifier will be used for writing to the cache. If this modifier is not
used the derivedFinal mesh is used instead.
2015-03-26 14:10:32 +01:00
b91059f7a1 Cache API for export/import of Blender data to/from Alembic files.
The pointcache API is designed to keep the general concept of caching
separate from the concrete Alembic implementation. Other types of file
export/import would be possible, e.g. for OpenVDB data.
2015-03-26 14:10:32 +01:00
d402042a77 Initial Alembic library integration for Blender.
Adds Alembic as a dependency and build support in cmake and scons.

Also extends the install_deps.sh script with a temporary installation
procedure for the Alembic libraries. This is still very hackish and
needs to be improved.
2015-03-26 14:10:32 +01:00
71bd43a589 Merge branch 'master' into gooseberry 2015-03-26 14:01:43 +01:00
7c08e7fcdf Revert "Better fix for animation returning negative values when AVsynch is on,"
This reverts commit 459b1a907c.
2015-03-26 14:01:22 +01:00
7d035bcba1 Alembic: correct last commit 2015-03-26 21:06:40 +11:00
88218c4d44 Alembic: cleanup warnings 2015-03-26 21:04:52 +11:00
c34e4d57fd Alembic: expose CMake var ALEMBIC_INCLUDE_DIR
The include path could be cached to a stale value, with no obvious way to reset.
2015-03-26 21:00:24 +11:00
ad3e6ecfb4 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/render/render_opengl.c
2015-03-25 20:10:02 +01:00
465819af4f Customdata caching for CD_ORIGSPACE_MLOOP. 2015-03-25 18:57:52 +01:00
e1273f7d79 Customdata caching for CD_ORCO. 2015-03-25 18:44:56 +01:00
b690f220e2 Basic drawing code for strands loaded from caches.
This is entirely separate from particle systems and their insane
drawing function.
2015-03-25 18:07:03 +01:00
aebc04ec1f Smoke cache offset (start frame) feature.
This lets users set a start frame at which a cached smoke simulation
starts. This offset is simply subtracted from the current scene frame
for evaluating the cache.
2015-03-25 15:58:47 +01:00
be72ad615a Simplified data structure and reading code for strands in Alembic
caches.
2015-03-25 15:08:02 +01:00
d92b6cba67 Revert "Disable cuda binaries on the buildbot for the gooseberry branch."
This reverts commit 83da7b1edb.
2015-03-25 14:46:30 +01:00
83da7b1edb Disable cuda binaries on the buildbot for the gooseberry branch.
Doing this increases build times too much for fast updates.
2015-03-25 14:44:47 +01:00
2891298ad2 Fix wrong time sampling in customdata array properties.
The time sampling should be specified explicitly when creating
properties.
2015-03-25 13:35:52 +01:00
7f822bb4dd Merge branch 'master' into gooseberry
Conflicts:
	source/blender/gpu/intern/gpu_buffers.c
2015-03-25 12:39:38 +01:00
0561e18f81 Explicit CD type masks for each element.
Avoid storing redundant normals for vertices.
2015-03-25 10:32:57 +01:00
c86606eeba Fix for crash when deleting an object that was used in a dupli cache.
Object-unlink was clearing the linked object's dupli cache instead of
the duplicator.
2015-03-24 18:17:22 +01:00
0113a3c27c Make sure normals are correct before writing mesh data to caches.
Normal data layers might not be updated during cache baking
automatically.
2015-03-24 18:02:36 +01:00
53ac275ace New data structure for restoring strand data originating from particles.
The rationale here is that we don't try to replace particle data
temporarily like we do with DerivedMesh. This would be needed for
drawing cached data overrides in the viewport and pass them to renderers
(unless these read Alembic directly) and later for performing dupli
simulation.
2015-03-24 17:50:46 +01:00
4be32cf007 Renamed the cache_dm to simply dm.
The fact that this is used for caching is only apparent on the higher
levels of the Object struct.
2015-03-24 15:28:12 +01:00
bf047cb850 Write basic hair curves to caches for dupli groups.
This data will be used for dupli simulations later on. Child path
generation could also be done based on this data without involvement of
particle systems.
2015-03-24 12:57:30 +01:00
d82be1df11 More compact sample writing code for particle pathcache caching. 2015-03-24 12:19:08 +01:00
972e9fd23e Make the nested DM writer in Object writers a pointer, instead of using
the do_mesh flag.

This will be more in line with how optional particle system writer will
be created.
2015-03-24 11:26:07 +01:00
5f392bbad3 Revert "Avoid conflicting unordered_map definition in cycles"
This seems to break windows builds and should not be necessary.

This reverts commit 12384d564f.
2015-03-24 11:03:38 +01:00
fe457ddbee Fix for use of non-portable function snprintf. 2015-03-24 09:40:42 +01:00
dedc0c5d0f Fix for use of unknown uint type instead of unsigned int. 2015-03-24 09:29:53 +01:00
c4fe6fe945 Use a stub factory when Alembic is disabled to avoid invalid pointer
access.
2015-03-23 18:11:28 +01:00
876c8e2267 Fix for linking order in scons preventing correct initialization of
the Alembic caching implementation.
2015-03-23 18:04:19 +01:00
a06cb41772 Added Alembic dependency config to the linux x86_64 player buildbot file. 2015-03-23 16:01:56 +01:00
f8bde3c0a3 Fix for bf_pointcache lib missing in the blenderplayer and fix for link
order.
2015-03-23 16:00:57 +01:00
4d5e41280e Missing include path for scons build files of the gameengine player. 2015-03-23 15:04:47 +01:00
0febcc745a Missing library linking in the blenderplayer. 2015-03-23 14:09:05 +01:00
5f2e5ffd18 Merge branch 'master' into gooseberry 2015-03-23 13:59:50 +01:00
d54f93463f Stub function for Alembic init when Alembic is not enabled. 2015-03-23 13:31:16 +01:00
da89029856 Use dupli overrides also for the selection drawing code.
Now clicking a cached dupli instance also selects the duplicator object
as expected.
2015-03-23 12:46:34 +01:00
8d76a2f418 Use dupli cache in bounding box calculations involving duplis.
This feature is mostly useful for the "view selected" operator. It is
also used in the "set origin to geometry" operator, but since the
cache overrides the object geometry anyway the effect may not be what
users expect (which is acceptable).
2015-03-23 12:46:33 +01:00
379e54b818 Simple mesh import from Alembic files in Cycles standalone.
Note that Cycles currently only supports tessellated triangle/quad
meshes. Alembic PolyMesh generally has ngons, so external tessellation
is required until cycles gets a proper tessellation implementation of
its own.
2015-03-23 12:46:33 +01:00
c7c9fd5218 More control over verbosity with Alembic archive info printing. 2015-03-23 12:46:33 +01:00
4ef7ad13fa Simple inclusion of alembic files from inside xml files for cycles
standalone.

The cycles XML files now can refer to Alembic (.abc) files. This will
call the default alembic reader to read in scene data. Currently it
simply prints the Alembic file structure.

Eventually a proper schema needs to be defined for both xml and abc.
Also care has to be taken to handle potential conflicts between settings
both within xml/abc and between them.
2015-03-23 12:46:33 +01:00
351f1e1ebf Basic Alembic integration in the Cycles standalone.
This adds Alembic to the standalone application version of cycles.
Files can be specified as XML or Alembic, or use automatic detection
based on the filename extension.

Currently the Alembic reader just dumps the file structure to stdout
as a test.
2015-03-23 12:46:33 +01:00
8d68336344 Fix for cycles cmake missing GLEW library variable when building without
the GUI.
2015-03-23 12:46:33 +01:00
12384d564f Avoid conflicting unordered_map definition in cycles by using a general
include path instead of the boost one.

For explanation see http://stackoverflow.com/questions/3973659/c-unordered-map-compiling-issue-with-g
2015-03-23 12:46:33 +01:00
d91a144305 Fix for corruption of the item hash table in cache libraries on copy. 2015-03-23 12:46:33 +01:00
7335a20091 Take cache library items into account when baking caches.
This means we don't bluntly store all the data in a group, but use the
selection from the cache library. It also helps to avoid issues with
object visibility which is not yet stored in the cache.
2015-03-23 12:46:33 +01:00
40b817c7d4 Working implementation of cache reading for dupli data during renders. 2015-03-23 12:46:33 +01:00
129ab67f2e Use the temporary 'is_dupli' flag to prevent objects from freeing
overriden data that is owned by the cache.

This is not at all nice ... Hopefully it doesn't get too complicated to
work around all these drawing code and depsgraph issues, so the code
can be understood and replaced at some point in the future.
2015-03-23 12:46:33 +01:00
d3eb022b10 Replacing boundbox temporarily during drawing is dangerous, since it
can be freed at any point.

Luckily we only need the boundbox locally for testing dupli visibility.
2015-03-23 12:46:32 +01:00
26bd70ed8c Fully reset the OB_FROM_DUPLI flag for each dupli instance, in case
later duplis can not be found in the cache.
2015-03-23 12:46:32 +01:00
f092792284 Distinguish realtime/render setting in the Object writer.
Now the derived_render mesh version is created locally when writing
render results.
2015-03-23 12:46:32 +01:00
88718c7252 Combined storage of render and realtime data in caches.
Caches now create 2 new roots below the main 'top' object of Alembic:
root and root_render for realtime and render data respectively.
This makes it easy to switch the whole archive to either of the modes
during baking and for constructing dupli caches.

Alternatively individual objects could store hires versions of their
data. This would also be more efficient if the cache contains many
simple objects which don't have 2 different variants. However, such
design decisions are difficult to make at this point and the
implementation can be modifier later.
2015-03-23 12:46:32 +01:00
168867f3b0 Make sure the cache baking job cancels properly when interrupted in the
first stage.
2015-03-23 12:46:32 +01:00
4a6e331915 Allow cache libraries to store both render and realtime (viewport) data.
This is the default now. It should make workflow a lot more foolproof
and convenient, since having only one of these modes active at a time
very easily leads to broken renders and confusing situations.

The problem is mostly due to the complicated way the depsgraph layer
feature is used to handle duplicator visibility. The duplicator is
declared as a child of its group's objects (even though no real
dependency exists!), so that a visible duplicator triggers updates of
invisible group objects, making instances of hidden groups possible.

However, dupli caches have to disable this dependency in order to avoid
unnecessary costly updates in hidden layers which are overridden by
cached data anyway. At the point where these dependencies are created
the evaluation context is unknown though, which means we cannot
distinguish between render and realtime evaluation for the purpose of
cache reading ...
2015-03-23 12:46:32 +01:00
0dd01668b4 Removed deprecated code. 2015-03-23 12:46:32 +01:00
834ac256f4 Make sure mesh data is really stored and reconstructed from the cache
entirely.

Also the code is much better structured now, moving toward a more
standardized sample/schema class definition.
2015-03-23 12:46:32 +01:00
be72e44548 CD_NORMAL support for mesh customdata caching. 2015-03-23 12:46:32 +01:00
9adbeed82c Fix for use of wrong CustomData for tessfaces. 2015-03-23 12:46:32 +01:00
7343aa5e0e Copy rgba components of MCol explicitly to the Alembic C4f type to avoid
potentially different ordering.
2015-03-23 12:46:32 +01:00
a30be4c277 MCol customdata caching. 2015-03-23 12:46:32 +01:00
9baf925d2b MTFACE customdata is not suitable or necessary for caching, so disable
it.
2015-03-23 12:46:31 +01:00
266c99334d Added customdata writers/readers for missing mesh edge, poly and loop
data.
2015-03-23 12:46:31 +01:00
c053f0a53d UI cleanup and a bit nicer workflow by treating read/write mode like
an enum toggle.
2015-03-23 12:46:31 +01:00
19c5b3c61c Disable the bake operator if cache reading is enabled.
Re-baking cache results is not technically prohibited, but not useful
and allowing only read or write selectively gives a nicer workflow.
2015-03-23 12:46:31 +01:00
edf089a572 Cycles support for dupli caches.
If a cache is read-enabled cycles will now use the cached mesh data
instead of dupli results.
2015-03-23 12:46:31 +01:00
a86067888e Skip drawing of particle systems (including hair) when using cache
duplis.

Particle systems can not be overridden from caches easily, there are too
many strings attached to the data and code to make this reliable.
Instead, a new simplified data structure for reading hair from caches
will be added, which replaces drawing and rendering of particle data.
The original particle data is not updated through duplis, so is usually
out of sync and should not be displayed.
2015-03-23 12:46:31 +01:00
657cc3575a Main argument is no longer needed for cache reading, the cachelib is
now given explicitly.
2015-03-23 12:46:31 +01:00
ca0fcba43d Removed unused variable. 2015-03-23 12:46:31 +01:00
f161bb5912 Calculate bounding boxes for cached DMs to avoid visual popping when
using the original Object's bb.
2015-03-23 12:46:31 +01:00
542b40ae73 Test for NULL archive pointer when writing as well.
This should not usually happen because the operator asks for permission
to delete the file prior to writing, but should be checked nevertheless.
2015-03-23 12:46:31 +01:00
a85928466f Safeguard against crashes from invalid Alembic file paths by returning
NULL archive pointers.

This allows writer/reader code to test against obvious archive errors
easily and is unmistakable.
2015-03-23 12:46:31 +01:00
d0128f7c7c Fix for wrong ID code used in RNA->idcode mapping. 2015-03-23 12:46:30 +01:00
c9d7056f76 Removed group pointer from cache libraries and use object->cachelib
pointer instead.

This change makes it possible to have group duplicators using different
versions of a cache.
2015-03-23 12:46:30 +01:00
4959b2b30a Added a cache library pointer to objects as a replacement for CL->GR
pointers.

Relationship between CacheLibrary, duplicator Objects and Groups is
difficult. There are a number of somewhat conflicting goals:
- CacheLibraries write out data for objects and dupli groups. Multiple
  objects can be stored in the same cache: CL *->* GR
- Objects can override a dupli group with different caches: OB *->1 CL
- As before, each object can be the duplicator for one group: OB *->1 GR

To combine these requirements, the first relationship will be made
indirect. Only the Object -> Group/CacheLib relations are explicit
pointers in the DNA. For finding all objects contained in a cache
library the usual recursive DNA tagging system must then be used.
2015-03-23 12:46:30 +01:00
6f3e220d58 Removed the now redundant "Read" toggle from cache libraries.
At this point the reading is toggled on the side of group duplicators.
2015-03-23 12:46:30 +01:00
eb37ae59f2 Removed the explicit duplicache rebuild operator.
The cache is now updated on frame changes automatically, the operator
should no longer be needed.
2015-03-23 12:46:30 +01:00
f1b4f4900b Removed unused deprecated functions for cache library. 2015-03-23 12:46:30 +01:00
6860bfbe35 Sanity check for dupligroup caching functions. 2015-03-23 12:46:30 +01:00
0142bdb1ad Use a new flag in duplicator objects to enable cache reading and avoid
unnecessary dependencies.

This flag will replace the current "read" mode on cache libraries.

Beside enabling cache reading, it also disables the current "fake"
dependencies between duplicators and their group objects. This is
exploiting the layer visibility mechanism in depsgraph to ensure that
animated group objects get evaluated when used by a visible duplicator,
even when they are not themselves visible. These dependencies cause
group object updates even if the duplicator is using cached results.
To avoid this unnecessary overhead and make caching worthwhile we
rebuild depsgraph without these relations when using the cache instead.
2015-03-23 12:46:30 +01:00
c2012a68b8 Enable frame updates of duplicache through use of an invalidation flag. 2015-03-23 12:46:30 +01:00
78709abd10 Disable additional depsgraph tagging through cache libraries.
This code is outdated due to changes in reading code and obscures some
genuine depsgraph behavior.
2015-03-23 12:46:30 +01:00
667fcac696 Mesh overrides for duplis from cached Alembic data.
If a duplicator has cached data it will now replace the derivedFinal
mesh of objects with the cached version for drawing.

This is a compromise atm: It would be better to actually draw derived
meshes directly, so that we don't have to modify objects. Then we could
also have multiple different instances of the same orignal object
(in whatever way these might be defined). DNA Objects would then be
totally separate from duplis, but at this point the drawing and render
code makes this unfeasible.
2015-03-23 12:46:30 +01:00
bcca4e5676 Mesh storage and reading in child objects for dupligroups.
The layout of the Alembic files resembles the DNA structure in Blender:
- On the top level (under the top/root node) there are Abc::Objects for
  Blender ID datablocks (currently Object and Group)
- Objects store final data (DerivedMesh) and later simulation results
  etc.
- Groups store their full duplilists for instancing. Currently there is
  no recursive nesting of groups, since this would limit duplis to
  dupligroups and exclude e.g. duplifaces.

On reading the duplilist gets reconstructed and stored in the DupliCache
for a duplicator empty (the group instance). DerivedMesh data is stored
in a hash table for each instanciated object and can later replace
finalDM in drawing and rendering.
2015-03-23 12:46:30 +01:00
fe143aaeb3 Simplification of the archive init functions in writers and readers.
Now the base types for readers/writers are not nominally forming the
interface any more (they may be removed entirely later). This makes
possible a cleaner init method directly in the Abc Writer/Reader
classes.

Further work may be required in this area.
2015-03-23 12:46:29 +01:00
f3e5bd94db Moved the dupli cache reading code into a AbcDupligroupReader class.
This is more in line with how readers work in the Blender Alembic
implementation elsewhere.

Generally, readers are less persistent than writers: they are created
whenever cache results need to be updated (e.g. on frame changes) and
discarded afterward. Writers OTOH stay alive during the whole baking
job, since they keep the references to Alembic Writer instances and can
only be deleted once the writing for that part is done.
2015-03-23 12:46:29 +01:00
3b83c585e2 Store and apply dupli object transforms in the Alembic cache.
Note that the cache stores dupli matrices without the final parent
transform, since it only knows about the group itself. The duplicator
obmat is applied to the duplis after reading the cache.
2015-03-23 12:46:29 +01:00
da381bb948 Handle dupli cache on object copy and freeing. 2015-03-23 12:46:29 +01:00
ca2756dbc3 Updated cache reading function for the new duplilist structure.
Now we store duplilists entirely inside a single alembic object for the
group. This allows using all the generated duplis, which would be
difficult if the alembic file had to define all the possible recursive
dupli relations that Blender allows, beside straightforward Group duplis.
2015-03-23 12:46:29 +01:00
bdcf91615d Use a nested Object writer to store the Object ID blocks used by dupli
lists.
2015-03-23 12:46:29 +01:00
f1fde1f4fb Better dupligroup Alembic writer.
Uses the duplilist generated by Blender to define instances, instead of
recreating the group layout. This omits some information about actual
structure of the DNA, which might be useful later on. The main problem
is that the duplilist itself does not encode this, so it's a tradeoff
between either including the Group structure or omitting the other
dupli types, like face, vertex, particle duplis.
2015-03-23 12:46:29 +01:00
c71768d864 Alternative dupli generator function for creating duplis in a group
without a specific parent.
2015-03-23 12:46:29 +01:00
a40efb7810 Some disabled code to enable automatic cache updates on every duplilist
creation call.

This is executed *a lot* (even for simple things such as viewport
panning), so the code is probably not suitable in this form. At least
it could do a frame comparison to avoid unnecessary updates.
2015-03-23 12:46:29 +01:00
11828eb1e5 Use a cached group only when a CacheLibrary is actually available.
Otherwise the regular duplilist generator is used.
2015-03-23 12:46:29 +01:00
57bd99124d Replace usage of the procedural duplilist generation by cached duplilist. 2015-03-23 12:46:29 +01:00
64b6bf3a26 Store object pointers for the dupli objects we generate from caches.
This is necessary for the current viewport drawing and rendering code,
which expected each dupli instance to represent a copy of data in the
DNA.

The code maps base-level objects in the cache to DNA Objects inside the
dupligroup by name. Only objects that can be found in the blend data
will be allowed for DupliObjects.
2015-03-23 12:46:28 +01:00
caaf794642 Moved the DupliCache struct into DNA, it will be needed for drawing and
RNA access later.
2015-03-23 12:46:28 +01:00
5bc204d8f4 Simple operator to force rebuilding of a dupligroup cache.
This is a placeholder for proper depsgraph integration. Eventually frame
changes and some other updates should rebuild dupligroup caches
automatically using the depsgraph. Until then this operator is a quick
way to test the IO from caches and the further drawing and rendering
(TODO).
2015-03-23 12:46:28 +01:00
0ff8990e13 Cache reading functions for constructing a nested dupligroup list based
on Alembic cache data.
2015-03-23 12:46:28 +01:00
70b56ec378 Include mesh writers in the cache writers list. 2015-03-23 12:46:28 +01:00
2786cb8c13 Removed unused code. 2015-03-23 12:46:28 +01:00
6ff214d938 Removed current implementation of cache reading from various parts of
BKE (DerivedMesh, particles, cloth).

The new cache implementation will be used for constructing dupli data
instead, bypassing the complexities of the modifier stack.

Conflicts:
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenkernel/intern/particle_system.c
2015-03-23 12:45:48 +01:00
9146dcfda7 Initial code to support dupli group instancing and overrides through
Alembic caches.

This creates representations (Abc::Object) for Blender Object and Group
datablocks in the Alembic files and uses Alembic instancing to define
the dupligroup hierarchy. This leads to a relatively flat hierarchy in
Alembic files:

Top -> Object/Group -> DerivedMesh/Particles/Hair/Cloth/Smoke/...

The dupligroup structure can not be represented by a hierarchical
structure such as the Alembic object nesting, because of the
many-to-many relationship between objects and groups (a group can
contain multiple objects, multiple objects can instance the same group).
Instead we use the instancing feature of Alembic to represent
dupligroups. This is created in 2 stages to ensure all the main ID
blocks have been serialized before creating references.
2015-03-23 12:23:38 +01:00
62ec8251e4 Nicer info printing support for instances in Alembic files.
This now avoids repetition of internal instance structure.
2015-03-23 12:23:38 +01:00
becc6432b5 Fix for invalid ob->data access in case non-mesh objects are in the
cached group.
2015-03-23 12:23:38 +01:00
a17db9b8c1 Improved edge attribute caching.
Now edges should be fully restored from cache, fixing edge display.
2015-03-23 12:23:38 +01:00
c761b512d4 Omit hair path lengths for anything but the first sample.
We can safely assume that paths don't change their lengths. This might
safe some cache space.
2015-03-23 12:23:38 +01:00
daef0f0d00 Fix for particle pathcache caching: have to check the psys->renderdata
pointer to figure out if we are evaluating with render settings.
2015-03-23 12:23:38 +01:00
467a19c6ef Fix for some archive checks to make sure we don't access invalid data.
This can happen if the archive file cannot be opened for some reason.
2015-03-23 12:23:37 +01:00
1b7ff83152 Implementation of MDeformVert customdata layers in Alembic. 2015-03-23 12:23:37 +01:00
fc22692394 Fix for name collisions in compound properties when writing CustomData.
This is not clearly documented for Alembic, but apparently properties
inside compounds still need to be name uniquely for the whole object.
This is somewhat involved for Blender's CustomData, because we have
5 different customdata elements for meshes (vert, edge, face, poly,
loop) and each of these can have the same types and multiple layers of
the same type ...
2015-03-23 12:23:37 +01:00
8519ec96d7 Fix for Alembic info printer printing to std::cout instead of the
internal stringstream.
2015-03-23 12:23:37 +01:00
12497e457c Fix for potential size issue: need 64 bits for CustomDataMask types. 2015-03-23 12:23:37 +01:00
d483a5b1db Nicer error handling for unimplemented CustomData layer types.
Instead of failing an assert, simply print an error message and return
gracefully. We don't want Blender crashing because of this.
2015-03-23 12:23:37 +01:00
e39af0806d Ugly hack for caching code to deal with quirky modifier stack behavior.
CustomData layers are pruned by the CDDM_copy function when they have
CD_FLAG_NOCOPY set. This is based on later modifiers in the stack, which
can specify that they require certain data layers - but the caching
modifier itself should store only what is needed by later modifiers.
It means we cannot easily keep a full copy of the DM in the cache
modifier to writing into caches later.

For now the hackish solution is to temporarily disable NOCOPY flags when
copying the DM. This is really not nice and needs a better solution.
2015-03-23 12:23:37 +01:00
43a09876e9 Support CD_ORIGSPACE layer caching.
This is needed by particles for distributions on meshes with changed
topology (which is of course broken).
2015-03-23 12:23:37 +01:00
f5de2c6693 Tessface customdata for derived mesh caching. 2015-03-23 12:23:37 +01:00
ec998c9cf5 Support for CustomData in Alembic caches.
This is a skeleton feature that provides a general way of storing
CustomData types. Currently only ORIGINDEX layers are implemented, the
code is designed to make extension easy.

Storing CustomData layers in Alembic is a bit involved because the
complex structs often used as customdata need to be de-interleaved for
Alembic into a set of POD (plain-old-datatype) array properties.

In addition the property names should be unique, so that mapping abc
properties back to customdata layers is safe. This works by using 2
levels of compound properties: the first level stored per CD type
properties, with a number of properties for each layer of this type,
using either a name or index (for unnamed layers). The internal
properties can then in turn be compounds, if structs need to be
serialized into PODs.

Abc property readers/writers are created dynamically for the CustomData
compounds. This is necessary because we don't know in advance what kind
of data layers a DerivedMesh or other CD user will have, and this can
change each frame in theory. Alembic is easier with state data schemes,
but using it this way is possible (if somewhat cumbersome).
2015-03-23 12:23:37 +01:00
00edf75a62 Fix for cache item filtering: items can be part of the cache library
but disabled, in that case hide them as well.
2015-03-23 12:23:37 +01:00
1d0b6c6e7c Fixed test for "render" eval mode for hair dynamics.
This is totally weird and convoluted, no idea if correct.

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
2015-03-23 12:23:33 +01:00
99231fb9c3 Removed the DM writer/reader from hair dynamics again, this is part of
the particle stuff and does not work.
2015-03-23 12:23:22 +01:00
01bf0f37a7 Archive Info operator for Cache Library archives.
This creates a string with information about all the objects and
properties contained within a (Alembic) archive, used by a cache
library.

The operator has 3 modes of presenting the info string:
- stdout, ie. printing to the terminal
- popup window (not very useful usually due to size limits and lack of
  scrolling)
- clipboard copy
2015-03-23 12:23:22 +01:00
03fddef28a Use a combined class for hair dynamics for cloth and mesh data.
Particles store a copy of the DM internally as the emitter.
2015-03-23 12:23:21 +01:00
a9e1e240f4 Alembic: Fixes for linux buildbot and scons 2015-03-23 12:23:21 +01:00
61ee7c96d1 Depsgraph tagging function for cached objects.
This is necessary to trigger object data updates for indirectly linked
objects, which would otherwise not be evaluated.
2015-03-23 12:23:21 +01:00
8794a167a6 Convenience feature: When linking a cache library, always default it to
'read' mode locally.

Linking a cache library is meant to be used for getting existing cache
data into a file.
2015-03-23 12:23:21 +01:00
4a399119f3 Left a comment in DerivedMesh.c explaining why the caching system has
to use the cumbersome cachedm pointer instead of virtual modifiers.
2015-03-23 12:23:21 +01:00
46cd930df7 Use a dedicated input_dm pointer in the cache modifier to provide a mesh
result read from the cache.

Mixing this with the output_dm used for writing leads to undefined
situations where the DM was released but should actually be passed on.
2015-03-23 12:23:21 +01:00
028085e856 Use correct flag enums for checking render/viewport eval mode when
writing derived mesh caches.
2015-03-23 12:23:21 +01:00
1bfcc2d0de Fix for meaningless build error (no return value, can never happen). 2015-03-23 12:23:21 +01:00
f7d04e0d6a Minor fix for UI code showing cache items. 2015-03-23 12:23:21 +01:00
f63a70c6b0 Render/Viewport evaluation mode for cache libraries.
This designates a cache library to be used either for the viewport or
for renders. A "Render" cache library will evaluate modifiers with
render settings and a "Viewport" cache library will use viewport
(realtime) settings.

When reading the cache, the library will only be
used for the assigned purpose, i.e. a Render cache does not work for
viewport caching and vice-versa (although a cache can be baked for one
setting and then switched afterward).

Note that render results will never be visible in the realtime viewport
due to the way object evaluation is handled in Blender at this point
(render settings are only evaluated explicitly during renderer sync).

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
2015-03-23 12:23:18 +01:00
cc0cabaa95 Allow the cache bake operator to overwrite existing files, using a
confirm dialog.
2015-03-23 12:23:12 +01:00
d70519b284 Removed now-unused util_path files from the pointcache lib.
Paths are constructed outside this module now. A valid absolute path
should always be provided through the API calls.
2015-03-23 12:23:12 +01:00
90b97cfdc8 Record and display the last result of cache reading in the cache library
items.
2015-03-23 12:23:12 +01:00
92f6fb7650 Free readers properly after applying cached data. 2015-03-23 12:23:12 +01:00
f2a1508a86 Set reader/writer archive as a separate step outside the constructors.
This allows nicer creation of readers/writers //before// actually
opening the archive. This in turns can simplify code quite a bit.
2015-03-23 12:23:12 +01:00
2b9a4ca54e Moved functions for constructing readers/writers based on cache library
out of pointcache into blenkernel.

This is quite simple and repetitive and there is not need to have this
in the main pointcache/Alembic API. The code is mostly concerned with
logic of DNA data, so pointcache shouldn't have to deal with it.
2015-03-23 12:23:12 +01:00
7cb320ee61 Ported archive filename constructor from pointcache library to BKE.
The pointcache library is now pretty much independent from ID blocks and
should not be responsible for handling file paths. The path construction
is also fairly straightforward now compared to the old point cache
system, with only basic conversion of relative to absolute paths for
loading archive files.
2015-03-23 12:23:12 +01:00
d28353e9e2 Cache read result enum in DNA mirroring the internal pointcache results.
This can be stored in cache library items as an indicator of cache
reading state.
2015-03-23 12:23:12 +01:00
ee4c862926 Use a uiTemplate function for showing cache library items instead of
python code to unify symbols.

This is necessary because the operator for adding new items (as opposed
to the enable/disable button) cannot be shown with the same checkbox
button. The UI template function can display a custom button for the
operator, so the look becomes less confusing.
2015-03-23 12:23:12 +01:00
f000702532 Nicer default filename for cache library paths.
This now appends a default extension based on the cache backend used.
At this point this is always Alembic (.abc) but would allow other
backend formats in the future.
2015-03-23 12:23:12 +01:00
bc5cdd60d4 Improved filtering for cache library content.
In addition to the object name filtering, items in cache library groups
can now be filtered by type as well.

Existing items in the cache are always displayed, so as to not hide
important information (what gets stored in the cache). The filtering
is primarily a utility to simplify searching inside the group for things
that should be added to the cache.
2015-03-23 12:23:12 +01:00
f15e5d3e89 Use a generator in the python code to iterate over all the potential
cache library items.

This should ideally happen on the RNA side, but making the equivalent of
python generators in the RNA is really difficult.
2015-03-23 12:23:12 +01:00
bdc9a7d7f7 Don't show mesh cache items for non-mesh objects. 2015-03-23 12:23:11 +01:00
ad1fda1823 Disabled collection properties for 'virtual' cache items in RNA.
This requires a better design and is not so easy to implement properly
within the limits of RNA definition. These collections don't physically
exist in the DNA, they are mainly utilities for looping over
//potential// items in a cache library. For now the python code has to
be adapted to only show valid items, until the RNA provides a good
solution.
2015-03-23 12:23:11 +01:00
e9d947860a Generic validation function to help ensure that we don't add meaningless
items to a cache library.
2015-03-23 12:23:11 +01:00
15ce114a3b Replaced use of the HDF5 Alembic backend by Ogawa.
Ogawa is replacing HDF5 as the new de-facto standard. Selecting either
should be more formalized and a user option, for now it's just hardcoded.
2015-03-23 12:23:11 +01:00
b41c208e87 Filter utility for finding objects in a cache group faster.
This is a preliminary feature and implemented purely in python, to be
replaced later.
2015-03-23 12:23:11 +01:00
b94d8c93e7 New 'read' flag to toggle reading of the CacheLibrary as a whole.
This is also used during the bake process to avoid confusion: The read
flag gets disabled for the baking cachelib, so that objects don't try
to read cache data that is supposed to be generated.
2015-03-23 12:23:11 +01:00
8e76ac4744 Delete operator for cache library datablocks.
CacheLibrary datablock has a generic unlink function now, but currently
nothing actually links to cache libs themselves, so it's empty. Still
good to keep this in mind for the future.
2015-03-23 12:23:11 +01:00
4cec4d9d3c Reader/Writer API functions for basic particles.
Also slightly renamed pathcache functions for consistency (use plural
'particles' instead of 'particle').
2015-03-23 12:23:11 +01:00
4484761714 Removed deprecated and unused alembic API functions.
These are now implemented as virtual functions in the Factor class.
2015-03-23 12:23:11 +01:00
03f2e329bb Fixes for scons build files. 2015-03-23 12:23:11 +01:00
4f7bc3a7aa Fix for circular linker dependency with cache code library.
The `bf_pointcache_alembic` code is a separate library, to avoid
muddling up core code with alembic includes and preprocessor defines.
Alembic stuff only belongs strictly into alembic code and can be
disabled cleanly.

The `bf_pointcache` and `bf_pointcache_alembic` libraries had a circular
dependency, because the alembic implementation functions were called
directly. Now there is a "Factory" class to abstract the creation of
concrete implementations for readers and writers.
`bf_pointcache_alembic` defines this factory and is registered
//outside// of the core `bf_pointcache` lib, so there is no linker
circularity.
2015-03-23 12:23:11 +01:00
8618cd39d6 Removed unused thread mutex file from pointcache lib. 2015-03-23 12:23:10 +01:00
51d7c80a00 Removed deprecated rna_pointcache.c file.
Scons was still compilling this, since it's source files are not
explicit.
2015-03-23 12:23:10 +01:00
1106645500 Fix for indirectly linked object pointers in cache libraries.
These must be made "extern" to avoid losing links on loading.
2015-03-23 12:23:10 +01:00
a8a00074c1 Removed remaining 1 frame difference in archive storage.
This was an artifact from the previous way of mapping non-0 start frame
to time 0.0. Now we start at times > 0.0 to match with the start frame.
Both ways are possible, can be changed later if needed.
2015-03-23 12:23:10 +01:00
dc703cefbf Fixed start frame mapping in Alembic archives.
Writers were always starting at time 0.0, which means that for start
frames > 1 the readers would always be off. Now match the writer start
frame to the actual Blender start frame.
2015-03-23 12:23:10 +01:00
609ce89688 Added poll function for the cache manager panel to prevent hiding in
Cycles render engine.

The "compat_engines" thingy really gets in the way here ...
2015-03-23 12:23:10 +01:00
66f9cda5b3 Cache reading for particle paths.
Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-03-23 12:23:07 +01:00
f0d8395191 Fix for cache modifier linking and handling of the default case (no
cachd modifier).
2015-03-23 12:22:59 +01:00
fccc665162 Changed implementation of the Cache modifier to work in tandem with the
cache library system.

The Cache modifier is now an optional "break point" of the modifier
stack:
- Without a cache modifier the stack works as before. Baking will write
  the final stack result. After baking the cache replaces the whole
  stack.
- With a cache modifier the stack result at the modifier's position is
  stored. The cache is then applied as the output of that modifier,
  skipping preceding modifiers. That way additional modifiers can be
  applied on top of the cache.
- When using multiple cache modifiers, only the last (active) one will
  be used, since all previous cache results would be discarded anyway.
2015-03-23 12:22:59 +01:00
b321526888 Replaced point cache in cloth modifiers (also hair) with the new caching
system.

Conflicts:
	source/blender/blenkernel/intern/cloth.c
2015-03-23 12:22:56 +01:00
267d37ce51 'expand' function for cache libraries, so link/append makes it load the
group and objects too.
2015-03-23 12:21:58 +01:00
ab6c48b935 Make cache libraries a linkable data block. 2015-03-23 12:21:58 +01:00
9e336362d8 Take NULL object pointers in cache items into account.
This can happen if an object gets deleted or isn't loaded for some
reason. The item should just be ignored in that case and removed at the
next opportunity (cleanup function).
2015-03-23 12:21:57 +01:00
c32587c103 When using the "new cache library" operator, enable fake user by
default.

Nothing actually links to a cache library at this point (and probably
won't in the future), so fake user is necessary to avoid losing data.
2015-03-23 12:21:57 +01:00
af671df3e1 Display cache library name and fake user button, imitating template_ID. 2015-03-23 12:21:57 +01:00
9bb0f55e3c Importing of caches into Blender data.
Currently only implemented for DerivedMesh.
This replaces the `final_dm` calculation of the modifier stack with the
result from cache loading.
2015-03-23 12:21:57 +01:00
982ea69660 UI fixes, draw bake operator button only once at the top. 2015-03-23 12:21:57 +01:00
173a104335 Hair path writer needs 2 different variants for parent/child hairs. 2015-03-23 12:21:57 +01:00
59db306770 Added writers for derived mesh result and hair paths. 2015-03-23 12:21:57 +01:00
8696000dd1 Use explicit name strings for all readers/writers in the cache instead
of constructing names internally.

This helps prevent name collisions and guarantees a consistent naming
scheme for putting multiple items in the same cache.
2015-03-23 12:21:57 +01:00
da1c8006f2 New reader/writer for DerivedMesh.
Used as a base for existing PointCacheModifier classes, but can be used
on its own.
2015-03-23 12:21:57 +01:00
df36ca1ff7 General support for export to/import from Alembic files based on Cache
Libraries.
2015-03-23 12:21:56 +01:00
3ddf2c232f Deleted unimplemented parts of the previous pointcache system, to make
refactoring simpler.

Since the new approach is not tied to the old set of point cache data
types there is really no need to carry their empty husks around. Once
the new caching system is defined in detail we can add back whatever
makes sense.
2015-03-23 12:21:56 +01:00
08e06cdaf7 Disabled specialized Point Cache modifier handling in the modifier
stack, this will be replaced and is not correct anyway.
2015-03-23 12:21:56 +01:00
a47ce4b04d Refactoring of archive handling in readers/writers.
Now instead of each reader/writer creating its own archive, the archive
is created by the caller in advance and passed as a constructor
argument. This means that multiple items can be stored together in the
same archive.
2015-03-23 12:21:56 +01:00
e0c8daa160 Removed unused Scene pointer from the base Reader/Writer classes. 2015-03-23 12:21:56 +01:00
091dc4ec7e Operator skeleton for a cache bake operator, using the job system. 2015-03-23 12:21:56 +01:00
ee550b2fc7 Fix for undefined return value. 2015-03-23 12:21:56 +01:00
e675d415d6 Removed unused line. 2015-03-23 12:21:29 +01:00
a73fa2e02c Unlink and cleanup functions when objects or the cached group get
unlinked or changed.
2015-03-23 12:21:29 +01:00
a12f53ab83 Make sure cache item pointers are lib-linked correctly. 2015-03-23 12:21:29 +01:00
eb6785112b Name string construction for cache items, to use as a unique identifier
in the cache library.
2015-03-23 12:21:29 +01:00
14f9a277ab Draw some UI buttons for all the current cache item types. 2015-03-23 12:21:29 +01:00
87dc360d7e Updated hash table for lookup of enabled cache items and added basic
UI support.
2015-03-23 12:21:28 +01:00
4683478db8 Improved collections in RNA for looping over potential caching items
in the object group.
2015-03-23 12:21:28 +01:00
6df11cdd3f Define a collection of "object_caches" in the CacheLibrary RNA for
iterating over all objects eligible for caching in the group.

This allows for nested dupligroup instances as well. All objects that
are instantiated at least once by any group can be included in the
respective cache, but get represented only once because the cached data
is the same anyway.
2015-03-23 12:21:28 +01:00
4e9d0af4af Link main CacheLibrary pointers in readfile. 2015-03-23 12:21:28 +01:00
c4d998ecad Simplified cache item path description, based on plain ID blocks with
subtype/index.

This omits possible instancing and recursion by dupli groups, but since
the data of instances is always the same in Blender at this point, there
is little need to take them into account for caching.

At some point in the future it may become desirable to store full dupli
hierarchies in the cache, but it doesn't make sense to try to design a
fully-fledged path descriptor for this hypothetical case now.
2015-03-23 12:21:28 +01:00
55b4652885 BKE functions for managing cache content based on a group.
This uses a complete hierarchy of group instances, based on a path
hierarchy (object names).

Putting
2015-03-23 12:21:28 +01:00
472d5b964a Simple cache manager panel UI in the scene buttons.
This is mostly a simple and unintrusive placeholder to have some way of
making caches accessible, but needs some more thought.
2015-03-23 12:21:28 +01:00
e6a6e5d17a Group pointer property for cache libraries to associate them with an
object group.

This is somewhat experimental, eventually we may want to link to Objects
instead, or allow multiple cache targets for the same cache, etc.
2015-03-23 12:21:28 +01:00
eec3e90cdb Missing include. 2015-03-23 12:21:28 +01:00
2fc6bdbd63 Removed meaningless comment. 2015-03-23 12:21:28 +01:00
ecd576e689 New operator for adding cache libraries.
Conflicts:
	release/scripts/startup/bl_ui/properties_physics_common.py
	source/blender/blenkernel/BKE_pointcache.h
	source/blender/blenkernel/intern/pointcache.c
	source/blender/editors/physics/physics_ops.c
	source/blender/editors/physics/physics_pointcache.c
2015-03-23 12:21:27 +01:00
03ecd1760a New ID datablock 'CacheLibrary', for managing physical cache archives
and files.

At it's core this is just a file path, but many different cache users
may refer to this, so having a dedicated ID block helps. It can be
compared to Image datablocks, which also primarily are used for data
on storage, but can be packed with the blend file, and carry some
additional information that would be cumbersome to keep sync'ed
otherwise.

The name 'CacheLibrary' deliberately resembles the 'Library' datablock:
just as a Library stores ID blocks in a physical file, a CacheLibrary
stores cached data (in Alembic HDF5/Ogawa or other formats).

Conflicts:
	source/blender/blenkernel/BKE_pointcache.h
	source/blender/blenkernel/intern/pointcache.c
	source/blender/makesdna/DNA_pointcache_types.h

Conflicts:
	source/blender/makesrna/intern/rna_main_api.c
2015-03-23 12:21:21 +01:00
bc56a3797e Fix for remaining PointCache references in the alembic code.
Now, for the time being, uses a simple relative "//blendcache/" folder
path again. This will be adressed later.
2015-03-23 12:20:22 +01:00
ab027c9a34 PointCache modifier to act as a terminator in modifier stacks.
When writing DerivedMesh data, the modifier result at the point of the
modifier will be used for writing to the cache. If this modifier is not
used the derivedFinal mesh is used instead.
2015-03-23 12:12:07 +01:00
6d94c2f57a Cache API for export/import of Blender data to/from Alembic files.
The pointcache API is designed to keep the general concept of caching
separate from the concrete Alembic implementation. Other types of file
export/import would be possible, e.g. for OpenVDB data.
2015-03-23 11:53:56 +01:00
0c6df47e7b Initial Alembic library integration for Blender.
Adds Alembic as a dependency and build support in cmake and scons.

Also extends the install_deps.sh script with a temporary installation
procedure for the Alembic libraries. This is still very hackish and
needs to be improved.
2015-03-23 11:53:05 +01:00
6d495cc4ef WIP Commit 2015-03-20 17:27:25 +01:00
b999ed2efd Merge branch 'master' into gooseberry 2015-03-20 16:36:34 +01:00
7e79651a56 Get rid of old panel for GPU depth of field settings 2015-03-20 15:56:49 +01:00
a568de8a83 Merge branch 'master' into gooseberry 2015-03-20 15:45:11 +01:00
004429761d Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/include/ED_view3d.h
2015-03-17 11:07:03 +01:00
459b1a907c Better fix for animation returning negative values when AVsynch is on,
patch by Nexyon, thanks!
2015-03-16 11:50:17 +01:00
c3c2a3bbe8 Revert "Attempted fix for OpenAL synchronization."
This reverts commit d10e80fe79.
2015-03-16 11:45:59 +01:00
fc09d58127 Cleanup fcurve tags properly. 2015-03-13 16:47:45 +01:00
5d94e2d40b Stub API to add an object to motionpath processing job. 2015-03-13 16:12:23 +01:00
accfe0d3ed Object now also support proper undo 2015-03-13 15:17:11 +01:00
44f77072d6 Armatures support proper undo now. 2015-03-13 15:03:25 +01:00
779cf534af Keep keyframes on undo
WIP code to tag fcurves with existing keyframes on current frame so they
can be restored (inserted into) after cancelling tranform.
2015-03-13 14:44:26 +01:00
e1815ce69e Merge branch 'master' into gooseberry 2015-03-13 17:47:41 +05:00
d164634cc0 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-03-13 13:41:37 +01:00
07a29084a1 Cleanup: unused var 2015-03-13 02:04:03 +11:00
7a9428e110 Merge branch 'master' into gooseberry 2015-03-13 02:01:11 +11:00
0b3a652cd5 Only insert/delete keyframes automatically if the real time motionpath
update is on.
2015-03-12 11:27:24 +01:00
09d0516b4d Revert "Fix blenderplayer not compiling after modifier d&d commit"
This reverts commit 1a0e6336d6.
2015-03-11 19:08:30 +01:00
3f5b1e7989 Revert "Modifier Drag&Drop"
This reverts commit 91d0f6f113.

Artists here seem to dislike the interface being stuck after a change to
modifiers, reverting until an interactive solution is coded.
2015-03-11 19:07:40 +01:00
20d4047d22 Minor stuff 2015-03-09 18:17:28 +01:00
e4e62880d7 Remove inserted keyframes if transform was cancelled 2015-03-09 15:43:27 +01:00
8662dbee63 Merge branch 'gooseberry' into temp_motionpaths 2015-03-09 14:44:48 +01:00
6610bcb697 Don't push merge without building first fix. 2015-03-09 12:46:22 +01:00
3272c3a7a0 Merge branch 'wiggly-widgets' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/include/ED_view3d.h
	source/blender/editors/space_sequencer/sequencer_draw.c
2015-03-09 12:44:04 +01:00
8cad3e3581 Transform widget: Don't highlight rectangle (cursor should be enough
indication)
2015-03-09 12:41:54 +01:00
02c142e582 Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/include/ED_view3d.h
	source/blender/editors/space_sequencer/sequencer_draw.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/makesdna/DNA_view3d_types.h
2015-03-09 12:40:59 +01:00
Julian Eisel
1a0e6336d6 Fix blenderplayer not compiling after modifier d&d commit 2015-03-08 16:23:56 +01:00
Julian Eisel
91d0f6f113 Modifier Drag&Drop
**Warning: WIP!** Basic functionality works fine and there shouldn't be any crashes, however, if you occur issues, feel free to report them to me (not in the bug tracker!)

Some more effort is needed to get this ready for master, but I thought it would be nice as a little present for the Gooseberry-team (I heard some of you were requesting this?) and the ones using the Gooseberry-builds :)

Oh, and better not look at that code, it's ugly and a lot of changes are planned, I just wanted to get something working before getting into details.
2015-03-06 17:24:11 +01:00
7b426d2384 Fix issue reported on irc by Sebastian, crash when undoing and changing
screen.

Apparently the screen on the given file did not have a scene attached.

Not sure how this is possible exactly, but for now just guard against it
at load time by assigning default scene in that case.
2015-03-06 17:24:11 +01:00
d1794b897c Fix broken "force setting multisamples only once", introduced in b5b359b48f 2015-03-06 17:24:11 +01:00
a15b239adc Fix metaball->mesh removing all metas in the scene
Assumed the entire scene used the one motherball.
2015-03-06 17:24:11 +01:00
76c215249e Fix access freed memory when doing constraints ID counter on main free
Basically just made constraints free function aware of possible do_id_users
argument, same as we've got for objects, object data and so on.
2015-03-06 17:24:11 +01:00
77c70d4495 Fix T43905: Crash happens when press Create Plane Track
It was only happening on 32bit platforms because of alignment
differences when allocating class.

Now got rid of copy of eigen matricies stored by value in the
residual block which solves aligment issues and should also
give some unmeasurable speedup.
2015-03-06 17:24:11 +01:00
8be2775367 PyAPI: clarify fallback docstring 2015-03-06 17:24:10 +01:00
720599e7a8 Fix T43904: calc_vert_angle returns wrong value
This was mis-named, rename to `calc_edge_angle`
and allow a fallback value in the case when the vert doesn't have 2-edges.
2015-03-06 17:24:10 +01:00
c12ae10487 BMesh: Add extended BM_vert_calc_edge_angle that takes a fallback value 2015-03-06 17:24:10 +01:00
7acf48d2fe Cleanup: quiet minilzo warnings 2015-03-06 17:24:10 +01:00
f64ba6abfa Cleanup: unused warnings 2015-03-06 17:24:10 +01:00
b2d6443ed0 Cleanup: unused macro warning 2015-03-06 17:24:10 +01:00
14d30210eb Fix typo in "Add" and "Subtract" mode of Vector Math node.
Differential Revision: https://developer.blender.org/D1003
2015-03-06 17:24:10 +01:00
Julian Eisel
0d3ad6ef63 Correction to previous commit
Calling ensure_lookup_table for each face is stupid! :/
(Noted by Sergey - thx)
2015-03-06 17:24:10 +01:00
Julian Eisel
14298b2e7d Fix T43900: "Operator Mesh Add" template fails
Another script that was missing the lookup_table call.
2015-03-06 17:24:09 +01:00
7c61f548d6 Revert "COLLADA - support for shadeless material (SHADER_CONSTANT)"
This reverts commit 04b0a9f4b8.
2015-03-06 17:24:09 +01:00
d10e80fe79 Attempted fix for OpenAL synchronization.
This hit animators already, basically when using sound sync we can
hit negative frames. This happens because we always subtracted the full
range of the triple buffer size from the timing, even when buffers were
flushed.

Also, old code read the offset from the offset of the reader. The
problem here, is that due to threading there is a time offset between
the when this offset is set and when it is offloaded to the buffers,
which means that we could get quite some variance between time
reporting.

Now sounds keep a private byte offset which is incremented right before
invalidating old buffers. This should make the combination of OpenAL
time report + byte offset more accurate. For even more accuracy we might
spinlock while updating those values but for now left it as is for fear
of the lock interfering with frame update performance. We can try to be
smarter here, storing old value while update is happening, and use
trylock and the old values if it fails but for now commit the simple
version.
2015-03-06 17:22:54 +01:00
d9e703ef5d Merge branch 'master' into temp_motionpaths 2015-03-06 11:57:59 +01:00
bd56eca825 Merge branch 'master' into gooseberry 2015-03-05 19:15:31 +01:00
6c317fbcb9 Don't re-typedef structure in wm_types.h
This makes strict compilers to give quite a few of warnings.
2015-03-04 18:13:58 +05:00
02685aca52 Fix T43878: Applying non-constructive modifiers crashing blender
The issue was caused by recent DM to mesh conversion which was taking ownership,
and it was failing if there are any referenced layers in the custom data.

Now disable passing ownership if there are any referenced layers.
2015-03-04 18:06:21 +05:00
6ae390decc Merge branch 'gooseberry' into temp_motionpaths 2015-03-03 11:37:58 +01:00
3224749763 Merge branch 'master' into gooseberry 2015-03-03 23:09:31 +13:00
df33afff86 Enable motion curve update for armatures as well.
This is currently brute force updating, also disabled object copies
but it's likely that we'll need those to do threaded update of the
motionpaths.
2015-03-02 19:28:53 +01:00
cde74b2d5a Motion Paths real time update WIP 2015-03-02 17:53:00 +01:00
2cacb22422 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-03-01 15:41:10 +01:00
f5c9df75ad Merge branch 'master' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-03-01 12:42:35 +01:00
41d05dbf30 Merge branch 'cycles_memory' into gooseberry 2015-02-27 15:07:03 +01:00
d4386ee615 Fix blenderplayer 2015-02-27 15:06:45 +01:00
02acdead96 Merge branch 'cycles_memory' into gooseberry 2015-02-27 16:36:48 +05:00
136c8d1ae0 Add argument to DM_to_mesh() function to take ownership over the DM
The idea is pretty simple: instead of making temporary copy of all the
related custom data layers just pass the ownership from the DM to the
mesh.

This is really handy in cases when you've got DM which you need to
convert to Mesh datablock and wouldn't need that DM after conversion
anyway.

Foe example, render database conversion, exporters and even Modifier
Apply will benefit from this option.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1127
2015-02-27 16:27:56 +05:00
0ef8993fdc Merge branch 'cycles_memory' into gooseberry 2015-02-27 12:46:19 +05:00
30a324013a Merge branch 'master' into gooseberry 2015-02-27 12:00:48 +05:00
6320749361 Add an option to mesh.calc_tessface() to get rid of polygons and loops
The purpose of this change is to add extra possibility to render engines and
export scripts to reduce peak memory footprint during their operation.

This new argument should be used with care since it'll leave mesh in not really
compatible with blender format, but it's ok to be used on temp meshes.

Unfortunately, it's hard to get scene where it'll show huge benefit because
in my tests with cycles peak memory is reached in MEM_printmemlist_stats().

However, in the file with sintel dragon it gives around 1gig of memory benefit
after removing the polys which would allow other heavy to compute stuff such as
hair (or even pointiness calculation) to not be a peak memory usage.

In any case, this change is nice to have IMO, and only means more parts of
scene export code should be optimized memory-wise.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1125
2015-02-27 01:07:59 +05:00
79a5c97064 Cycles: Free caches used by the synchronized objects
Issue this commit is addressed to is that particle system and particle modifier
will contain caches once derived mesh was requested and this cached data will
never be freed.

This could easily lead to unwanted memory peaks during synchronization stage
of rendering.

The idea is to have RNA function in object which would free caches which can't
be freed otherwise. This function is not intended to deal with derived final
since it might be used by other objects (for example by object with boolean
modifier).

This cache freeing is only happening in the background rendering and locked
interface rendering.

From quick tests with victor file this change reduces peak memory usage by
command line rendering by around 6% (1780MB vs. 1883MB). For rendering from
the interface it's about 12% (1763MB vs. 1998MB).

Reviewers: campbellbarton, lukastoenne

Differential Revision: https://developer.blender.org/D1121
2015-02-27 01:01:07 +05:00
faf612f113 Fix for child particle clumping noise, using the orco parent location
for clumping instead of deformed location.

The orco location must be used for roughness to ensure a stable shape,
but for moving child keys toward the parent (clumping) the deformed
location must be used.
2015-02-26 12:40:14 +01:00
466c532ba6 RNA: correct limits 2015-02-26 15:53:28 +11:00
eb25547a84 Pointer property for selecting particle systems in the particle instance
modifier.

Internally the property is still an integer index, but using a pointer
with a dropdown is much more convenient.
2015-02-24 19:17:38 +01:00
d22699be69 Removed stupid limit of 10 on particle instance modifier psys index. 2015-02-24 18:49:48 +01:00
cfa92fcc6f Fix for clumping noise randomness being unstable under deformation.
This randomisation was using the deformed parent coordinates for
calculating noise vectors, which causes unwanted movement as the parent
hair deforms. Instead the `orco` coordinates must be used for all noise
vectors, since these are from the undeformed mesh.
2015-02-24 16:36:15 +01:00
5de381ce5b Merge branch 'master' into gooseberry 2015-02-23 18:50:10 +01:00
4887d4c52a Fix T43770, we were doing multiplication with object matrix and not
reverting the GL state.
2015-02-23 10:45:54 +01:00
e93ec66dd0 Experimental hair shape key control with textures.
Rationale for this feature goes like this:

In meshes the influence of shape keys can be limited to certain vertex
groups. This allows shapes to be applied selectively on parts of the
mesh and possibly even be animated by changing vertex group weights over
time.

With hair shape keys there is no equivalent feature to vertex groups
(defining a vertex group on hair keys would be rather tedious anyway).
It would be possible to use the emitter mesh vgroups to assign a
per-strand blending weight, but since hairs usually are much more dense
than mesh vertices this would sacrifice accuracy.

A better option is to allow textures to influence the hair shape key
blending. For this purpose there is now a new texture influence.
A shape key name needs to be assigned to the MTex in addition to a
factor. It will then act as a multiplier for the shape key weight,
i.e. the base shapekey value still works as an overall control.
2015-02-23 10:03:46 +01:00
bdf39274cd Disallow duplis when drawing motion paths, also make it so draw option
is on by default
2015-02-20 16:06:01 +01:00
bcf88bf242 Merge branch 'master' into gooseberry 2015-02-21 00:10:38 +11:00
a605d93128 Use new motionpath flag exlusively to draw motionpaths for objects 2015-02-19 19:00:51 +01:00
a44112a552 Don't draw motion paths for armatures in edit mode. Results in nice
crashes
2015-02-19 18:56:38 +01:00
bd1af1dc8e Hjalti's Motion Path commit series no 2.
Draw motionpaths after scene. They are not really XRays since they don't
require any depth info so add separate list for them. Feature could be a
little more polished to avoid too many state changes but for now just
commit something that works (tm)
2015-02-19 18:44:23 +01:00
78fb421f4b Merge branch 'master' into gooseberry 2015-02-19 22:20:12 +05:00
a9c3fb718f Hjalti's Motion Path commit series no 1.
Introduce global flag to draw motion paths. Always. Even in render only
mode :)
2015-02-19 18:09:45 +01:00
efe4f99a10 Projective painting: Only dither if factor is more than zero 2015-02-19 16:46:05 +01:00
1329843744 Fix T43735 painting on perpendicular to the screen polygons is
problematic (still!)

It seems due to floating point precision issues we have to account for
even more cases.

Added colinear check for one more triangle edge-vertex and assumed that
if no collision test is found then triangle is completely inside box.

Such cases are mostly from float precision not catching triangle just
outside bucket. Now tests are much better for simple tests (paint/flood
fill cube from ortho view, paint sphere), however there are still some
rare cases of stray pixels.
2015-02-19 16:38:56 +01:00
a199460495 Merge branch 'master' into gooseberry 2015-02-19 13:28:18 +01:00
3cb9ec1844 New option "use signed distance" for force fields with "surface" shape.
By default a surface-based force will push things away from the surface
in both directions, regardless of whether a point is "inside" or
"outside" (judging by the surface normal). The new option makes a force
field always push things away in the direction of the normal, so that
it becomes less likely to get points "trapped" inside a mesh object.
2015-02-18 12:22:59 +01:00
58ffd8beb3 Always make sure the surface modifier has tessfaces available for
building the BVH.

A long long time ago (rB3816554cbc1a40dc5199c8e56e45817ec09128d5) it
was coded such that edges would be used instead of faces for surface
distance calculation. This is pretty much never what you actually want.
2015-02-18 11:51:47 +01:00
17a4f326b0 Merge branch 'master' into gooseberry 2015-02-18 02:26:48 +05:00
fd0732b5fa Merge branch 'master' into gooseberry 2015-02-18 00:59:50 +05:00
d0da158ad5 Merge branch 'master' into gooseberry
Conflicts:
	intern/cycles/blender/blender_mesh.cpp
	source/blender/editors/space_view3d/view3d_draw.c
2015-02-17 15:24:23 +01:00
64e3661434 Store particle index and randomized value from particle instance
modifiers, for use in shaders.

The particle instance modifier can now store 2 custom data layers:
- Index: the integer index of the particle
- Value: a randomized floating point number for shader variation

These layers have user-defined names, so multiple particle instance
modifiers can be used without overwriting customdata layers. In Cycles
the data can be accessed using an Attribute node with the same names.
2015-02-16 14:30:07 +01:00
5a14dd7476 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_sequencer/sequencer_draw.c
2015-02-16 13:02:00 +01:00
84ea48d58b Painstakingly merge branch 'master' into gooseberry
Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
	source/blender/blenkernel/BKE_camera.h
	source/blender/blenkernel/BKE_screen.h
	source/blender/blenkernel/intern/camera.c
	source/blender/blenkernel/intern/screen.c
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/blenloader/intern/writefile.c
	source/blender/editors/include/ED_view3d.h
	source/blender/editors/render/render_opengl.c
	source/blender/editors/space_view3d/space_view3d.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/gpu/CMakeLists.txt
	source/blender/gpu/GPU_compositing.h
	source/blender/gpu/GPU_extensions.h
	source/blender/gpu/intern/gpu_compositing.c
	source/blender/gpu/intern/gpu_extensions.c
	source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl
	source/blender/gpu/shaders/gpu_shader_fx_dof_vert.glsl
	source/blender/gpu/shaders/gpu_shader_fx_lib.glsl
	source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl
	source/blender/gpu/shaders/gpu_shader_fx_vert.glsl
	source/blender/makesdna/DNA_camera_types.h
	source/blender/makesdna/DNA_gpu_types.h
	source/blender/makesdna/DNA_view3d_types.h
	source/blender/makesdna/intern/makesdna.c
	source/blender/makesrna/intern/rna_camera.c
	source/blender/makesrna/intern/rna_scene.c
	source/blender/makesrna/intern/rna_space.c
2015-02-13 12:48:36 +01:00
80ce3516cc Partial instancing feature for the ParticleInstance modifier.
This allows using the same particle system for multiple objects without
creating too much repetitiveness. Each instance object can select a
range of the particles to actually use for instancing (default 1.0 means
all particles are used). To further avoid overlap with multiple
instancing objects, the offset value can be used to make each system
use a specific range of particles.
2015-02-12 20:20:55 +01:00
ced2f75554 Merge branch 'master' into gooseberry 2015-02-11 20:01:51 +01:00
ab4eb7a714 Merge branch 'master' into gooseberry 2015-02-11 17:27:08 +01:00
ae7d197c93 Merge branch 'master' into gooseberry 2015-02-11 18:29:11 +05:00
9adb6daa8c Merge branch 'master' into gooseberry 2015-02-11 11:19:13 +01:00
81c56d15c7 Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-02-11 11:07:08 +01:00
54a8e50dea Merge branch 'master' into gooseberry 2015-02-11 10:46:33 +11:00
88fc1a5c50 Minor optimization for mask modifier
- don't resize ghash buckets (reserve maximum size)
- get vert, edge arrays instead of DM getVert, getEdge
- calloc -> malloc
2015-02-11 10:46:17 +11:00
ca04eef4f2 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-02-11 00:29:31 +01:00
5cef36e6e2 Merge branch 'master' into gooseberry 2015-02-10 20:24:35 +01:00
fe610b7437 Merge branch 'master' into gooseberry 2015-02-10 17:40:46 +01:00
6f9982a13c Merge branch 'master' into gooseberry 2015-02-10 21:01:22 +05:00
1dba2cd025 Add second widget call in-scene 2015-02-10 16:12:26 +01:00
26a74c8e11 Fix error in last commit 2015-02-10 12:53:36 +01:00
748d9eca90 Separate widget drawing to update and draw phase to make in-scene widget
drawing possible (need to update once, draw twice).
2015-02-10 12:52:29 +01:00
1a33fb983b Support dupli transparency pass.
Only for gooseberry for now, since it's slightly hacky and adds extra
cost to duplis.
2015-02-10 10:57:39 +01:00
258c2286cd Merge branch 'master' into gooseberry 2015-02-10 13:19:17 +05:00
60927ae2e0 WIP code to use in scene drawing for widgets. 2015-02-09 17:52:39 +01:00
f1462c759f Fix warning in py code. 2015-02-09 14:47:45 +01:00
606de82218 Merge branch 'wiggly-widgets' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/customdata.c
	source/blender/makesdna/DNA_customdata_types.h
2015-02-09 14:30:12 +01:00
59dd3735bf Merge branch 'GPU_subsurf' into wiggly-widgets
Conflicts:
	source/blender/blenkernel/intern/subsurf_ccg.c
	source/blender/gpu/GPU_buffers.h
	source/blender/gpu/intern/gpu_buffers.c
2015-02-09 14:28:07 +01:00
d67d29035a Fix some ordering issues, remove leftover glBegin/glEnd 2015-02-09 14:23:58 +01:00
f07ca03185 Initial VBO code for GPU subsurf.
This commit adds a few generalizations to the VBO
code so that modifiers can create and populate their own GPU objects.

The VBO code originally supported CDDerivedMesh only. The design moves slightly
towards the viewport refactor where the rendering system requests data from the
modifiers.

In this commit only basic support for vertices and normals is provided and
some features from blender's VBO system, suchs as mapping to original faces,
unique element indices for vertices and loose vertex/edge support are missing.
Also, the quick navigation feature of the subsurf modifier won't be supported
for now.

What we do have is full support for solid shading with multiple materials,
flat/smooth shading and a big performance boost.
2015-02-09 14:19:03 +01:00
5186062d58 Integration of particle shapekeys with the depsgraph and driver eval.
It's a bit messy, but that is to be expected: all of the areas involved
(particles, shapekeys, depsgraph, drivers) are badly designed and
supposed to get major refactoring ...
2015-02-09 13:58:24 +01:00
a8b00f679a Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/blenkernel/intern/customdata.c
	source/blender/makesdna/DNA_customdata_types.h
2015-02-09 11:57:34 +01:00
017e2fb284 Merge branch 'master' into gooseberry 2015-02-06 17:41:15 +01:00
56e2469030 Cleanup 2015-02-06 17:22:08 +01:00
93549d4225 Tabbing into (but not out of) scene strips is supported now 2015-02-06 17:08:51 +01:00
6794e4a8bf Bring back yet again no scaling for proxies (squashing to a merge commit is bad) 2015-02-06 16:45:03 +01:00
3de0722234 Merge branch 'master' into gooseberry 2015-02-06 16:44:03 +01:00
264e830a7d bring back no scaling for proxies 2015-02-06 16:43:05 +01:00
88e07b1397 Slip tool accepts numerical input. 2015-02-06 16:43:05 +01:00
0a02c15dbc Get rid of no scaling for proxies for master, it causes FX to crash,
will code another workaround for gooseberry.
2015-02-06 16:43:05 +01:00
julianeisel
840ec37b33 Graph Editor: Auto View
Auto View automatically adjusts the view based on selection, so that the view is
always focused on the current selection.
A checkbox in the header is used to access it and it works for the following
selection methods: Toggle All, Border, Circle, Lasso, Left, Right, More, Less,
Linked, Column (so all except of single selection, in which this can be a bit
annoying)

Reviewed by @Aligorith (thanks for that :) )
2015-02-06 16:43:05 +01:00
7263fbd7a6 Fix T43578: Beauty Triangulation would hang in infinite loop, due to float rpecision issue.
Only recompute if cost is below -FLT_EPSILON, we can get cases where both cases generate
very tiny negative costs (see 'Cylinder.004' mesh in .blend attached to report).
2015-02-06 16:43:04 +01:00
722894ee1b Speed hack for gooseberry:
Proxies get no effects for speed (since they haven't been scaled)
2015-02-06 16:01:09 +01:00
28587f9134 Merge branch 'master' into gooseberry 2015-02-06 14:31:20 +01:00
3efbb8777a Gooseberry: fix multires sculpting not updating normals
Looks like just a refactoring mistake in the Gooseberry branch.
2015-02-06 14:14:40 +01:00
12cb3a78f2 Merge branch 'master' into gooseberry 2015-02-06 12:57:04 +01:00
94e9742453 Print actual changed paths in the "make paths absolute" operator. 2015-02-06 12:18:32 +01:00
2fb86d80fc Add more info to the "make paths relative" operator to show which paths
where actually changed.
2015-02-06 12:09:22 +01:00
ef555380ba Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/customdata.c
	source/blender/makesdna/DNA_customdata_types.h
2015-02-05 15:32:36 +01:00
a9c3ddc617 Merge branch 'wiggly-widgets' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/object/object_intern.h
	source/blender/editors/object/object_ops.c
	source/blender/editors/space_sequencer/sequencer_draw.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/makesrna/intern/rna_object.c
2015-02-05 12:38:50 +01:00
bffa829b40 Move priority of widget handler back for node editor. Still not very
clean but should allow gooseberrians to work a little better
2015-02-05 12:29:37 +01:00
97053e034a Initialize dropboxes and widgets together before opening the homefile,
makes sure areas get their proper handlers registered
2015-02-05 12:15:23 +01:00
7414464e23 Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/object/object_intern.h
	source/blender/editors/object/object_ops.c
	source/blender/editors/space_sequencer/sequencer_draw.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/makesdna/DNA_customdata_types.h
	source/blender/makesrna/intern/rna_object.c
2015-02-05 12:08:55 +01:00
6a0e403a17 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/BKE_image.h
	source/blender/blenkernel/intern/sequencer.c
	source/blender/imbuf/intern/anim_movie.c
2015-02-04 20:46:03 +01:00
bdb372338b Sequencer: Implement priority queue based on frame number instead of
memory size (Thanks to sergey for suggestion)
2015-02-04 18:14:31 +01:00
8f51baff85 Possibly dangerous feature - don't scale images if they come from a
proxy.
2015-02-04 18:14:31 +01:00
c8d5206082 New space enum option for the particle instance modifier, to chose which
space the particle data should be interpreted in.

By default the space will now be `Local`, meaning that copies of the
mesh are made with the offset of the respective particle in the particle
object's local space, rather than using the world space offset of the
particle //inside the modified object space//. This behavior is much
more intuitive and consistent with true duplicators, such as face duplis.
Old files will still have `World` setting, so existing blend files are
not changed.
2015-02-04 17:41:15 +01:00
f27389cd01 Better implementation for cache disable - do not store or retrieve cache
ever if debug value is 314
2015-02-04 13:56:57 +01:00
1ec9604b70 Merge branch 'master' into gooseberry 2015-02-04 13:40:21 +01:00
48954596d1 Disable sequencer preprocess cache if 314 debug value is set 2015-02-04 13:35:56 +01:00
becce54286 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/image.c
2015-02-04 07:19:16 +11:00
322cf7cf4e More roughness options for offsetting child clumping.
This is obviously total madness, this feature is totally unusable when
the coder is not sitting next to you ... But so are the rest of particle
settings, the only solution is a future node system.
2015-02-03 18:33:22 +01:00
7e4e99c294 Merge branch 'master' into gooseberry 2015-02-02 14:48:13 +01:00
92fdd1efdf Merge branch 'master' into gooseberry 2015-02-02 14:23:35 +01:00
3637371c96 Fix for unfreed effector weights in hair dynamics.
The internal cloth modifier effector weights get replaced temporarily
to make the cloth sim use the particle weight settings instead. But
the particle sim was not putting back the original weights, which can be
non-NULL in case the cloth sim allocated these already. Messy design ...
2015-02-02 14:09:02 +01:00
5dac6e6129 Fix for unfreed memory due to unnecessary early exit in the free
function.
2015-02-02 13:37:35 +01:00
783b41a55d Fix for unfreed memory of internal hair cloth modifier pointcache. 2015-02-02 12:51:22 +01:00
253cb97862 Cleanup: Moved particle interpolation code into own file. 2015-02-01 18:25:46 +01:00
b0c5622a97 Merge branch 'master' into gooseberry 2015-01-30 16:03:39 +01:00
f095fbc6be New option for the particle Add brush: use_add_stroke to toggle
between stroke and single-add mode.

This was requested especially for use with tablets. With a pen it is
difficult to set a precise point and the tool ends up making multiple
hairs close together all the time. Disabling the stroke option helps
adding individual hairs.
2015-01-30 15:17:55 +01:00
2a3ced0308 Merge branch 'master' into gooseberry 2015-01-30 15:14:24 +01:00
cb6c0663e1 Merge branch 'master' into gooseberry 2015-01-30 14:30:57 +01:00
9c3e41b4f6 Ultra hacky fix for sequencer:
Avoid opening the file when doing uncached reading because ffmpeg takes
quite a long time to read the first frame. Instead, avi jpeg is almost
instantaneous here.
This will leave the anim struct without an Imbuf and that can cause
other unexpected issues elsewhere so commiting on gooseberry first
to try.
Speedup is quite impressive though.

Needless to say, code here quickly becomes a mess and the proxy system
should be made saner but for now just commit to keep things working at
the studio.
2015-01-30 12:25:22 +01:00
06aae6789f Added missing blenderplayer stubs for new particle edit shapekey
functions used in RNA.
2015-01-30 11:31:15 +01:00
b3ca0e21a5 Merge branch 'master' into gooseberry 2015-01-29 19:35:43 +01:00
eee7918c37 Disabled the child hair hull drawing feature.
This is incompatible with particle data structures in their current form.
Hull drawing requires sorting child particles based on the distance from
their primary parent. However, this changes the order of children, which
is the main method of generating random numbers for them. In the
viewport this is not a problem, but when rendering the children are
constantly recreated, using the respective deformed emitter mesh each
time. This leads to changing child orders when using the convex hull
sorting, and therefore different randomisation values.

To properly implement child hull drawing we would have to generate a
stable parent-child offset metric as well as avoiding any resorting in
the actual data arrays. This in turn requires terribly inefficient
drawing iteration, which could become a bottleneck by itself even before
taking cache coherence or OpenGL optimization requirements into account
(collecting child data into a dedicated buffer for drawing).
2015-01-29 17:00:51 +01:00
76e7528cb1 Comment out the proxy fix to test if it makes things better, 2015-01-29 14:40:49 +01:00
46024a14bb Merge branch 'master' into gooseberry 2015-01-29 16:58:49 +05:00
4f47a8b240 Quick test to figure out performance bottleneck in gooseberry.
Failed proxies will now attempt to fetch a smaller proxy first before
fetching the full resolution. This might allow us to see if we are
hitting a bandwidth issue (due to high res) or a file query issue (due
to more file queries)
2015-01-29 12:53:06 +01:00
bb4a0a9c05 Merge branch 'master' into gooseberry 2015-01-29 12:42:36 +01:00
c602fada48 Merge branch 'master' into gooseberry 2015-01-29 22:05:51 +11:00
3482b33f9b Wire-color was accidentally broken in a merge
Adding back changes to background needed for auto-contrast.
2015-01-29 14:16:46 +11:00
615330a16b Support for the (still experimental) parent coloring mode in regular
strand drawing.

Parent coloring is currently still entirely random, but can be improved
for all use-cases later.
2015-01-28 18:13:47 +01:00
b7abaf151f Apply shape keys directly to the hair key data, instead of only applying
to the hair dynamics input DM.

Also this calculation has to happen before caching paths, otherwise
there is a 1-update lag because parent paths still use old values.
2015-01-28 17:34:46 +01:00
d2219f871c After editing hair, apply the changes back to the active hair shape key.
This makes shape keys for hair actually usable by completing basic edit
mode integration.
2015-01-28 16:18:21 +01:00
d045fd79d6 Apply hair shape keys to the particle base data when entering edit mode
and when switching the active key during edit mode.

This is different from how shape key editing works on meshes: there the
edit data (BMEditMesh) stores customdata layers for shape keys, then
writes them back to the mesh. The hair edit mode is a lot more messy and
confusing, it has to update the base data immeditately (with potential
consequences for undo ...)
2015-01-28 15:44:31 +01:00
b2ca6a2d8e Merge branch 'master' into gooseberry 2015-01-28 15:34:37 +01:00
b52530f104 Merge branch 'master' into gooseberry 2015-01-28 14:44:12 +01:00
4ad69e11e8 Initialize new hair shape keys with data from the current particle keys. 2015-01-28 14:38:52 +01:00
307c7667e4 Merge branch 'master' into gooseberry 2015-01-28 17:33:00 +05:00
6dc4664efb Merge branch 'master' into gooseberry 2015-01-28 11:49:39 +01:00
420d381037 Requiring COMPAT_ENGINES for particle panels is stupid. 2015-01-28 11:09:56 +01:00
d92f5918b1 Merge branch 'master' into gooseberry 2015-01-27 18:19:51 +01:00
e4b7084bf6 Merge branch 'master' into gooseberry 2015-01-27 16:19:14 +05:00
3a6e8ec938 Merge branch 'master' into gooseberry 2015-01-27 13:47:15 +05:00
f202dab0f2 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/makesdna/DNA_customdata_types.h
2015-01-26 17:43:02 +01:00
f71847159d Experimental: random colors for child hulls. 2015-01-23 17:47:52 +01:00
b33c55ddee Fix for invalid cache index -1 in some cases, like virtual parents.
The code was assuming that child 0 is always valid, but in fact has to
be treated like all others that can be disable due to preview percentage,
virtual parents, etc.
2015-01-23 17:10:15 +01:00
d79197d9a8 Use the particle system material for OpenGL drawing.
This is probably not correct yet, the code is terribly confusing ...
2015-01-23 16:44:59 +01:00
b26825646b Implemented caps for the convex hair bundle hulls.
The current algorithm generates a triangle strip to fill the end of
each child bundle. This is not quite ideal, because even though the
base child groups are constructed to be convex, the resulting child
paths can become concave again by clumping, roughness, hair dynamics
etc.. This can create face inversion as well as ugly shading artifacts,
so a nicer algorithm may be desirable.
2015-01-23 16:10:32 +01:00
526edf8411 Only perform the inner loop over one group of connected paths in macros.
This allows more customized handling of path drawing in the outer loop
(needed for drawing end caps).
2015-01-23 12:06:31 +01:00
9b6f30e060 Nicer iterating over pairs of connected neighboring child paths. 2015-01-23 11:57:05 +01:00
892eb413f5 Removed parent path drawing code for hulls, this is never used anyway. 2015-01-23 09:47:28 +01:00
f919c5c700 Calculate normals and use smooth shading in the strand direction for
child hulls.

Note that the perpendicular direction around the hair bundles is not
smooth-shaded. Smooth shading doesn't make as much sense there because
large angles are common in this direction and give awkward shading
results.
2015-01-22 19:50:40 +01:00
07a49a9367 Disabled fallback path drawing for now, is currently nested inside the
OpenGL immediate mode calls.
2015-01-22 19:50:40 +01:00
46ab5bbb58 Don't draw 2-sided flat hulls, this just gives ugly Z fighting. 2015-01-22 19:50:40 +01:00
10bf7f6d3d Ignore paths with segments == -1, this is used to indicated hidden
children.
2015-01-22 19:50:40 +01:00
01ec68f457 Completed the convex hull calculation for child paths.
Parent index is only stored for hull children as a means of identifying
them in the drawing code.
2015-01-22 19:50:40 +01:00
1422f0d6cf Use line drawing as a fallback if only one child is assigned to a parent. 2015-01-22 19:50:40 +01:00
d64c5b0d30 Simple immediate-mode OpenGL drawing for convex child hair hulls. 2015-01-22 19:50:40 +01:00
2aaf1dc22a Fix for recent particle drawing commit, need to update the local draw
data variable after changing the buffer.
2015-01-22 19:50:40 +01:00
d57bd6e71b Sorting of child particles by primary parent and offset in hair space.
This is a prerequisite for constructing the convex hull of child paths
around a parent.
2015-01-22 19:50:40 +01:00
f143953ff1 More code cleanup to avoid crazy huge and messy particle functions. 2015-01-22 19:50:40 +01:00
68d80478af New draw mode 'HULL' for hair drawing.
Not implemented yet, currently uses just the child path drawing.
2015-01-22 19:50:39 +01:00
4478300c95 Cleanup: Make path update flag tests a little bit more understandable. 2015-01-22 19:50:39 +01:00
8142e13d1a quiet py exception 2015-01-22 22:14:04 +11:00
47618d0393 Merge branch 'master' into gooseberry 2015-01-22 00:53:29 +05:00
5662864e5b Merge branch 'master' into gooseberry 2015-01-21 14:05:35 +01:00
0f26b5d2f5 Removed the solver_index from cloth vertices.
This was used as part of the "sim preview" feature, where some amount of
vertices were tagged as disabled in the particle system. Due to the
mind twisting complexity of using the nested cloth modifier to simulate
hair strands indirectly it became necessary to still store all the
vertices, but then disable them again on the solver level ... If this
ever gets reimplemented it must be done in a sane way, avoiding the
cloth step altogether.
2015-01-21 10:38:54 +01:00
6681a6e838 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/physics/intern/BPH_mass_spring.cpp
	source/blender/physics/intern/implicit_blender.c
2015-01-21 10:13:47 +01:00
9a5f80e103 Merge branch 'master' into gooseberry
Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 11:50:56 +01:00
00d4bf4ce8 Merge branch 'master' into gooseberry
Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	source/blender/blenkernel/BKE_cloth.h
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/collision.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/physics/particle_edit.c
	source/blender/makesdna/DNA_particle_types.h
	source/blender/physics/BPH_mass_spring.h
	source/blender/physics/intern/BPH_mass_spring.cpp
	source/blender/physics/intern/implicit_blender.c
2015-01-20 11:10:39 +01:00
6f7ef81bb4 Fix for incorrect DNA field name in versioning, causes constant
resetting of clump noise size on reload.
2015-01-19 15:09:44 +01:00
c55d20b301 Use separate flags to enable/disable clump and roughness curves for
child hairs.

This allows disabling the curves temporarily without losing the setup.
2015-01-19 13:32:53 +01:00
6e5b21f808 Merge branch 'master' into gooseberry 2015-01-18 18:51:08 +01:00
4dec17b48c Merge branch 'master' into gooseberry 2015-01-16 17:34:19 +01:00
e52f280f1f Fix for slow deformation-motionblur in Cycles using the new spiral kink
mode.

This was caused by variation of the number of keys on child hairs due
to shortening of hair curves based on euclidian distances. The other
kink modes also shorten hairs, but use the parametric distance instead,
which does not vary with deformation of hairs.
2015-01-16 16:04:10 +01:00
b60e52f7cc Merge branch 'master' into gooseberry 2015-01-16 16:41:56 +05:00
3c2e313ad2 Second variant of the copy-to-select operator for particles to only
copy the active particle system (and not remove existing in the process).
2015-01-16 11:42:13 +01:00
5a830bbb01 Make removal of existing particle systems on copying optional.
This will be most useful when copying individual particle systems
one-by-one (to be implemented).
2015-01-16 11:12:04 +01:00
fd2ac986c8 Merge branch 'master' into gooseberry 2015-01-16 15:06:10 +05:00
e5c1f28372 Merge branch 'master' into gooseberry 2015-01-16 02:29:32 +05:00
b48b8938c3 Merge branch 'master' into gooseberry 2015-01-16 01:45:20 +05:00
d926a25765 Added space selection option to the particle system copy operator.
By default this now copies from one object's local space to another
object's local space (instead of the previous world space). This is
more useful when transferring particles between objects, because it
doesn't require moving objects on top of each other, as long as they
have similar shapes.
2015-01-15 20:38:35 +01:00
8793d9dac5 Merge branch 'master' into gooseberry 2015-01-15 22:36:26 +05:00
d7c1798a23 Removed debugging code. 2015-01-15 18:18:03 +01:00
355b289625 Fix for particle system copy: This has to make sure the ORIGSPACE data
layer is available.

Otherwise particle mapping to the new mesh cannot work with subdivided
and constructively-modified meshes.
2015-01-15 18:15:52 +01:00
9bdefd5b01 Added a "specials" menu button next to the particle systems list for
accessing the copy operator.
2015-01-15 12:53:28 +01:00
57f69a5d8f Changed the workflow for the particle system copy operator to the common
active-to-selected pattern.
2015-01-15 12:35:19 +01:00
a3b8538e89 New operator for copying (hair) particle systems from one object to
another, including edit data (grooming).

This uses basically the same method as the existing connect/disconnect
feature. The main difference is that it allows working with multiple
objects and transferring the //particle/hair data// instead of the
//mesh// data (which is what connect/disconnect expects). This is a much
more realistic workflow when rigging, topology etc. changes and
groomed hair has to be transferred to the changed model.
2015-01-15 11:55:26 +01:00
f62b9d874a Removed unused particles pointer from particle edit data. 2015-01-15 11:55:26 +01:00
305af3ebbe Fix T43254: Camera required for rendering sequencer scene 2015-01-15 07:07:35 +11:00
7086e0fb50 warning: unused var 2015-01-15 07:06:02 +11:00
5fe11d4c40 Merge branch 'master' into gooseberry 2015-01-15 06:43:24 +11:00
1c8c53767d New texture influence option for particle kink amplitude (as opposed to
frequency).
2015-01-14 12:29:19 +01:00
6e5044867f Renaming "Kink" texture influence to "Kink Frequency" to be more
specific.
2015-01-14 12:03:55 +01:00
15490d4685 Spiral rotation axis was not always fully normalized, avoid an assert. 2015-01-14 11:48:51 +01:00
c84bd7fb0e Make random child length work again with the spiral kink mode. 2015-01-14 10:09:16 +01:00
e408277d13 Add missing stub to the player, so buildbot keeps delivering gooseberry builds 2015-01-14 13:05:13 +05:00
400bade662 Merge branch 'master' into gooseberry 2015-01-14 12:58:30 +05:00
4a8eb2a5c2 Allow clumping and roughness in Spiral kink mode as well.
This requires interpolating the parent key properties, because no single
parent key can be mapped to each key on the children any more.
2015-01-13 20:58:28 +01:00
9e95e65be8 Optional randomization factors for the spiral radius and axis orientation. 2015-01-13 19:41:25 +01:00
fa0a2d8127 Support in Cycles for the extra spiral keys in hair paths. 2015-01-13 19:18:46 +01:00
d79c6d8af3 Nicer calculation of the kink axis and result of the spiraling for
negative radius.
2015-01-13 18:37:24 +01:00
679c90a360 Removed unused old code. 2015-01-13 18:03:47 +01:00
00b7010b76 Disable the path length check for spiral kink mode.
This test is terribly expensive for some reason and not necessary for
for the spiral mode anyway.
2015-01-13 17:59:41 +01:00
e3325ad73e Fix for calculation of the key velocity on the last child hair segment. 2015-01-13 17:28:53 +01:00
99611fc38b Another crappy approach to spirals on hairs, crazy expensive though. 2015-01-13 17:24:20 +01:00
bdae59ac84 Spiral kink mode for particles.
This is BAD code, but the particle kinking does not make it easy to
write a non-local modifier that requires neighboring positions,
curvature, etc. The feature is needed for Gooseberry.
2015-01-12 20:24:50 +01:00
c0888fa7c1 Optional clumping noise feature for simulating twisted hair strands.
This adds another level of clumping on child hairs. When enabled, child
hairs chose a secondary clumping target using a Voronoi pattern. This
adds visual detail on a smaller scale, which is useful particularly when
the number of parents is relatively small.

Natural fibres behave in a similar way when they become sticky and
intertwined. Hairs close to each other form a first twisted strand, then
combine into larger strands. Similar features can be found in ropes:
http://en.wikipedia.org/wiki/Hair_twists
http://en.wikipedia.org/wiki/Rope
2015-01-12 16:03:12 +01:00
3b1186addd Disable scope updates in texture and image paint modes.
Scope update is very slow for high resolutions, and currently blocks
the UI thread(!). This is especially terrible in paint modes, where
each stroke causes a scope update and unacceptable freezing.

The scopes update method tries to avoid this somewhat by skipping if the
toolbar is disabled, but this doesn't help when painting where brush
tools etc. are frequently needed. It's also a bad-level poll, with the
core system accessing a UI element.

Eventually scope updates should become a low-priority background job,
as well as becoming threaded. Until then this polling provides a usable
workaround to the most outrageous cases.
2015-01-12 14:27:41 +01:00
5a535bb5b0 Merge branch 'master' into gooseberry 2015-01-11 18:51:01 +01:00
7bb53800ba Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/object/object_intern.h
	source/blender/editors/object/object_ops.c
	source/blender/makesrna/intern/rna_modifier.c
2015-01-10 10:26:11 +01:00
e61a707869 Merge branch 'master' into gooseberry 2015-01-09 18:08:20 +01:00
326d7fd5fd Curve-based control for "roughness" (noise displacement) of child hair. 2015-01-09 15:58:18 +01:00
62fae2b981 Merge branch 'hair_clumping' into gooseberry 2015-01-09 14:27:18 +01:00
9f835cc10e Curve-based control for child path tapering.
This is an alternative method to the current fixed function with a
clump factor and "shape" parameter. This function is quite limited and
does not give the desired result in many cases (e.g. long, parallel
rasta strands are problematic). So rather than trying to add more
parameters there is now a fully user-defined optional curve for setting
the tapering shape.
2015-01-09 14:24:19 +01:00
32acaf1bc5 Merge branch 'master' into gooseberry 2015-01-09 13:28:15 +01:00
8c99bf9ed9 Moved kink, clump and roughness functions into the dedicated source file. 2015-01-09 11:44:05 +01:00
ac4d90fda4 Reorganizing hair child code a little bit to make it not totally insane.
This contains a few pieces of code for a future "modifier" system that
would allow more flexible combination of effects. Eventually a node
system is the way to go, but the current code makes that impossible.
2015-01-09 11:31:00 +01:00
ba4e7d95db Paste flipped bones:
* Simplify logic for bone detection on copy (no need to do mirrored
naming then)
* Add shortcuts ctrl(cmd)-shift-V for copying flipped
2015-01-08 13:01:48 +01:00
b62c0315fa Merge branch 'master' into gooseberry 2015-01-08 12:48:18 +01:00
64d39b7378 Separate context freeing from task freeing in threaded particle updates
to prevent double-freeing/invalid mem access.

This can happen with the "virtual parents" feature, which generates both
parent and child paths. Each task free function also freed the shared
context, leading to double freeing.
2015-01-08 12:41:55 +01:00
4137ef10da Gooseberry animation request: Paste flipped pose in action
and graph editor.

This was a tricky commit that was not so straightforward to make work.
The information for bones is not easy to come by in the animation curves,
however we do have some string manipulation tricks to make it happen.
For now committing to gooseberry branch for testing, it will be ported
to master after most usual use cases have been confirmed as working.

(Current test with all rotation modes and translation seems to work, but
Not sure how well this will hold up with drivers etc)
2015-01-07 22:25:33 +01:00
70eee6a0ed Merge branch 'master' into gooseberry 2015-01-07 16:17:16 +01:00
4f338dfdea Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/BKE_key.h
	source/blender/blenkernel/intern/key.c
2015-01-07 14:52:08 +01:00
66d03f8405 Merge branch 'master' into gooseberry 2015-01-06 15:50:37 +01:00
ba0d452357 Merge branch 'master' into gooseberry 2015-01-06 23:11:54 +11:00
7c28022dc2 Merge branch 'master' into gooseberry 2015-01-06 12:17:47 +01:00
c5ede37a9e Merge branch 'wiggly-widgets' into gooseberry
Conflicts:
	source/blender/makesrna/intern/rna_object.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2015-01-05 12:24:47 +01:00
f902bbad83 Cleanup the file mess with facemaps, make correct BKE/ED files for all
functions. Blenderplayer compiles again
2015-01-05 12:16:44 +01:00
f929c03791 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/camera.c
	source/blender/editors/space_sequencer/sequencer_draw.c
2015-01-05 12:00:17 +01:00
df877cc991 Merge branch 'master' into gooseberry 2015-01-03 00:11:50 +05:00
b8c2f58f1c Gooseberry: Fix stubs for player, so buildbot can deliver builds again
Please note, that this commit doesn't fix issues with functions declared
in BKE header and implemented in editor/. This is to be fixed separately.
2014-12-31 14:02:22 +05:00
532a03c232 Properly register the mathutils.interpolate submodule. 2014-12-31 09:58:47 +01:00
cc67f8e492 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/makesrna/intern/rna_modifier.c
2014-12-30 12:29:34 +01:00
eca3250c89 Little experiment: hook up a transform operator to a bone facemap. For
now moves the mesh only, doesn't set the bone as selected.
2014-12-22 12:04:45 +01:00
d9b7655bbd Fix for invalid access to undefined hair data in edge-only cloth meshes.
Cloth data is used both for hair and actual cloth, which makes things
really difficult. The face number was used for distinguishing the two
types (no faces == hair mesh), but the extra hair data necessary for
hair sim is generated by particles and not available for edge-only cloth
meshes. This really needs to be sanitized ...
2014-12-22 11:54:24 +01:00
f9cedb4896 Facemap widgets:
* Only draw on mouse over
* Fix crash with highlighted widgets.
2014-12-22 11:28:41 +01:00
b68a951e91 Modify facemaps mapping to bones.
Now simply add a flag to the armature modifier to use facemaps. Facemaps
on the mesh object with the same name as the armature bones will get
displayed as widgets.
2014-12-19 16:11:04 +01:00
bffe48f12c Presets for hair dynamics.
This is necessary because the hair dynamics settings are not part of the
ParticleSettings datablock, but part of the convoluted cloth modifier
inside the particle system struct. In the future this will be recoded
properly, but in the meantime presets provide a simple an unobtrusive
way to have reusable dynamics settings for hair.
2014-12-19 14:56:02 +01:00
16478df500 Merge branch 'master' into wiggly-widgets 2014-12-19 14:44:35 +01:00
1fd375fd30 Merge branch 'master' into gooseberry 2014-12-19 13:37:38 +01:00
61bba5e66f Radical simplification of the wind effect on hair, since the previous
approach does not work very well.

Using a cross section estimate still causes large oscillations due to
varying hair force based on angles. It also requires a sensible hair
thickness value (particle radius) which is difficult to control and
visualize at this point.

The new model is based purely on per-vertex forces, which seems to be
much more stable. It's also somewhat justified by the fact that each
hair vertex represents a certain mass.
2014-12-18 13:52:31 +01:00
b0c0505624 Facemap bones now draw properly. It's not possible yet to select the
bones so use with caution.
2014-12-17 18:51:49 +01:00
018593b75a Fix more crashes when removing facemaps. Indices of leftover facemaps
above the deleted one could become invalid
2014-12-17 18:33:33 +01:00
a1e28859c7 More silly mistakes in widget move code. 2014-12-17 18:16:32 +01:00
380a32581f Stubs for new facemap widget, fixes for facemaps.
Move/remove facemap not working well (probably was never working but by
displaying them has actually made the issue apparent)
2014-12-17 18:08:30 +01:00
8ffd46d139 Fix crash with decimate modifier on zero. 2014-12-17 16:53:05 +01:00
4887f7b48c Fixes to facemaps:
* Test display code that displays the active facemap. Will not work on
subsurf modifier yet (crash)
* Fix loading of files with facemaps
* Facemap data now reside on polys instead of tessfaces.
2014-12-17 16:42:36 +01:00
ad23e225c9 Merge branch 'master' into wiggly-widgets 2014-12-17 12:00:00 +01:00
00fe49de83 Code that will draw a transparent overlay of a facemap over the mesh
(crashes atm).
2014-12-16 20:14:10 +01:00
3a7b5bdeb0 Improved force field effects on hair strands.
The previous calculation was modulated with the angle between the wind
direction and the segments, which leads to very oscillating behavior.

Now the formula includes an estimate for the geometric cross section
of a hair segment based on the incident angle and the hair thickness
(currently just the particle size). This gives a more stable behavior
and more realistic response to wind.
2014-12-16 19:40:29 +01:00
bc99082e45 Add code that copies sorted per facemap vertex indices to a VBO buffer 2014-12-16 19:35:57 +01:00
3d74e55dd7 Initial VBO code for GPU subsurf.
This commit adds a few generalizations to the VBO
code so that modifiers can create and populate their own GPU objects.

The VBO code originally supported CDDerivedMesh only. The design moves
slightly towards the viewport refactor where the rendering system
requests data from modifiers.

What we do have is support for solid shading with multiple
materials, flat/smooth shading and a big performance boost.
Performance could

In this commit only basic support for vertices and normals is provided
and some features from blender's VBO system, such as mapping to
original faces, unique element indices for vertices and loose vertex/
and can be added later. The one feature that is missing now is the quick
navigation feature of the multires modifier (which uses the same code).

- Why this commit is made on the widget branch -

Facemap widgets need to avoid drawing the whole mesh when we do
collision detection on them. For subsurf drawing we need to iterate
through the whole mesh every time. What we need instead is sort
indexed elemet drawing according to the facemap each face belongs to.
This screams VBOs but since I was going to add that, I thought that
I could push it a bit further and add proper solid shading support.
2014-12-16 18:26:14 +01:00
c32ac24d41 Revert "Initial VBO code for GPU subsurf."
This reverts commit 7163ddf53e.
2014-12-16 18:18:57 +01:00
7163ddf53e Initial VBO code for GPU subsurf.
This commit adds a few generalizations to the VBO
code so that modifiers can create and populate their own GPU objects.

The VBO code originally supported CDDerivedMesh only. The design moves
slightly towards the viewport refactor where the rendering system
requests data from modifiers.

In this commit only basic support for vertices and normals is provided
and some features from blender's VBO system, such as mapping to
original faces, unique element indices for vertices and loose vertex/
and can be added later. The one feature that is missing now is the quick
navigation feature of the multires modifier (which uses the same code).

What we do have is full support for solid shading with multiple
materials, flat/smooth shading and a big performance boost.
Performance could

- Why this commit is made on the widget branch -

Facemap widgets need to avoid drawing the whole mesh when we do
collision detection on them. For subsurf drawing we need to iterate
through the whole mesh every time. What we need instead is sort
indexed elemet drawing according to the facemap each face belongs to.
This screams VBOs but since I was going to add that, I thought that
I could push it a bit further and add proper solid shading support.
2014-12-16 17:05:11 +01:00
c2d22f79ad New python submodule mathutils.interpolate for various mesh interpolation and weighting methods.
This module will contain mirrored functions for calculating and applying
weights for points on a mesh. This includes barycentric and UV weighting
and possibly more advanced global weighting such as harmonic weights.

The naming should follow this scheme:
<type>_{2d,3d}_{calc,apply}

e.g.
poly_2d_calc
poly_2d_apply
uv_3d_calc
...

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D939
2014-12-15 20:05:17 +01:00
1740ee2d3d Merge branch 'master' into wiggly-widgets 2014-12-15 17:10:53 +01:00
91ed7c270c Placeholder GPU functions to get GPU facemap index buffer. API should
allow a widget to draw a specific facemap bound to a mesh quickly.
2014-12-15 17:08:10 +01:00
1a366cb02a Fix selection id not getting incremented in face-map bones 2014-12-15 14:01:53 +01:00
935fa0670e Merge branch 'wiggly-widgets' into gooseberry 2014-12-15 12:11:41 +01:00
bffde905b6 Deactivate irritating shapekey widget while it's still under
development.
2014-12-15 12:11:09 +01:00
6b8ebd6bd6 Hook up facemap property to bones.
A bone using a facemap will not be displayed at all, rather it will use
the facemap of the mesh as an interaction area. The facemap still does
nothing since it's not yet hooked up to the customdata and widget code.
That will come next.
2014-12-15 12:09:54 +01:00
8c069258df Merge branch 'master' into gooseberry 2014-12-12 16:32:47 +01:00
3ac798261f Merge branch 'wiggly-widgets' into gooseberry 2014-12-12 16:27:31 +01:00
74308df3f0 Support for custom cursors for widgets.
They are set when a highlighted widget intersection is detected and on
area level.

There's a discussion about using owners and a stack or array for cursors
but that needs some more thought and design.
2014-12-12 16:27:06 +01:00
9880af5779 More changes to overdrop transform operator.
* Calling key press confirms
* Change name of operator accordingly.
2014-12-12 14:17:38 +01:00
7b4fdfbfd9 Merge branch 'wiggly-widgets' into gooseberry 2014-12-12 13:04:06 +01:00
9a9347eb8d Gooseberry request draw sequencer backdrop on -top- of everything.
Due to this we -obviously- rename this to overdrop

I am not sure if others would agree here, but it's pretty safe to do
this on a branch first. Rationale is that it's much nicer to work on
full screen with this.
2014-12-12 13:02:23 +01:00
90bbe335fc Merge branch 'wiggly-widgets' into gooseberry 2014-12-12 12:35:03 +01:00
443ef39203 Minor adjustments to the cage transform widget and sequencer operator.
* Bigger scale handler for widget.
* Operator has description on area
* Cancelling resets position.
2014-12-12 12:34:31 +01:00
472abc4669 Merge branch 'master' into gooseberry 2014-12-11 14:43:37 +01:00
d445330c53 Merge branch 'wiggly-widgets' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/intern/wm_event_system.c
2014-12-11 14:06:58 +01:00
58fedf3b67 Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/makesrna/intern/rna_space.c
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/intern/wm_event_system.c
2014-12-11 14:00:23 +01:00
4380a92c05 Sequencer operator that uses widgets and controls the placement of the
backdrop is now functional.

The widget could communicate with the sequencer properties directly, but
here we set it to control the operator properties as a demonstration.

After some minor stress testing, time to give this to gooseberry team.
2014-12-10 21:00:59 +01:00
a6a6c49398 Fix some registration issues, also add scale property for sequencer
backdrop widget.
2014-12-10 19:24:28 +01:00
6da4973e8e Something draws now in sequencer when we register the widget for the
operator.
2014-12-10 18:55:03 +01:00
f64e323e2b Yet more refactoring:
Areas support more than one widgetmap - will be useful to partition area
in different transform regions like data, pixel, 3D (will be done in a
separate refactor).

Also get rid of the context widget hack in favour of adding the
widgetmap handler to the operator handler itself, so handling will
be unified when the widget controls a property or spawns an operator
2014-12-10 18:23:00 +01:00
dc0b8f291b Merge branch 'master' into gooseberry 2014-12-10 17:26:59 +01:00
fac8a0c4f9 Privatize registration function for individual widgets.
Handle events for widgetmap first when and pass to operator when
operator is active.

This is still a pretty confusing design, working on a simpler one now.
2014-12-10 15:57:27 +01:00
b8e88c1821 Sequencer: optionally use scenes nested strips (like meta strips)
This commit makes it possible to use scenes as a kind of
multi-user metastrip (with their own time).

Currently this supports rendering & drawing nested strips,
but no convenient way to tab-enter into a scene strip.
2014-12-10 15:26:41 +01:00
3347195ba1 Merge branch 'master' into gooseberry 2014-12-10 15:24:13 +01:00
182545c820 Create sequencer widget handlers 2014-12-10 12:57:09 +01:00
0fb37c710f Add back idnames to the widgetmaps, we could well need to define both
for different transform areas.
2014-12-10 12:46:15 +01:00
ef8a3d65f1 Big refactor commit.
* Minor cleanup - propname does not need to be stored anymore.
* Code to support modal widgetmap registration for operators - still
untested, but will be tested soon on sequencer cage widget
* Widgets take parameters to initialize property slots that are used for
feedback or control.
Cage now uses this to feed offset/scale to different properties.
* Initialize common properties during widget registration.
2014-12-09 21:01:51 +01:00
6496051251 Merge branch 'master' into gooseberry 2014-12-09 16:55:38 +01:00
04671df15f Code for runtime registration of widgets that should make it possible to
remove and add widgetgroup types from the system.

Start operator that will control sequencer backdrop. Architecture here
still needs a little work so good compatibility with Add-ons can be
ensured.
2014-12-08 15:48:09 +01:00
5d2f1a9466 Make resizer widgets smaller, express them in pixels. 2014-12-08 13:16:01 +01:00
ab46b5ed62 Clamp during rectangle interaction to make sure widget stays big enough
to interact with (also handles negative case). 15 pixels threshold was
chosen.
2014-12-08 12:48:26 +01:00
5feafed611 Correct backdrop fit operator for compositor. 2014-12-08 12:30:50 +01:00
09d18fb74d Scale handlers for the rectangle transform working 2014-12-08 12:25:30 +01:00
900e3eacd7 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/windowmanager/WM_api.h
	source/blender/windowmanager/intern/wm_event_system.c
2014-12-08 11:14:23 +01:00
b51ee540ae Initial Python API for Widgets
Note this is only the initial Python API structure & isn't usable in its current state.

Work by Psy-fi & myself.
2014-12-06 20:55:57 +01:00
7d79196698 minor corrections to last commit 2014-12-06 15:37:46 +01:00
81e2e1be41 Widget API: remove unused identifier member
also comment some of the code.
2014-12-06 15:06:24 +01:00
d4c9ff8a21 Add facemaps panel to the supported cycles panels 2014-12-05 17:59:27 +01:00
787743b1ed Add back an extra paramater to the intersection function to determine
the highlighted part of the widget.
2014-12-05 16:42:59 +01:00
0a7eb30cee Cleanup leftover code. 2014-12-05 15:59:53 +01:00
b0f53133c1 Hook up the new DNA data to the node edtior. Now the backdrop supports
2D interaction (scale still pending)
2014-12-05 15:18:49 +01:00
8abeeafcb6 Rename Cage to RectTransform, add DNA for struct that will be used for
interaction with the widget.
2014-12-05 12:55:33 +01:00
cb2f1eb3eb Merge branch 'master' into wiggly-widgets 2014-12-05 11:45:40 +01:00
f2a7c2ffc1 Merge branch 'master' into gooseberry 2014-12-04 12:48:22 +01:00
aad164978c Get rid of operator, and use facemap name field on shapekey. 2014-12-03 17:15:21 +01:00
e01e074276 Face maps initial data structure, rna types and save/load
commit and operators to set faces in a group in edit mode.

Face maps are groupings of faces, similar to vertex groups, however,
each face can only belong to one face map.

They will be used for widget interaction, but there will possibly be
more uses for them in the future.

Code needs some cleanup still here, will apply as work is being done.

There is some code here for object mode interaction but it hasn't been
tested yet. This will probably be done with the widgets themselves.
2014-12-03 16:30:39 +01:00
de94752d8e Revert "Add space for facegroup storage"
This reverts commit 687cb3ab86.
2014-12-03 16:27:35 +01:00
a6adbc968f Left this in last merge 2014-12-03 16:23:25 +01:00
1138a296cb Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/blenkernel/BKE_context.h
	source/blender/editors/include/ED_transform.h
	source/blender/editors/transform/transform_ops.c
2014-12-03 16:20:40 +01:00
9720402fca Placeholder operator 2014-12-03 16:08:53 +01:00
e7d0c58bc9 Merge branch 'master' into gooseberry 2014-12-02 18:00:48 +01:00
c51ca1b7de Fix for missing library linking in blenderplayer. 2014-12-01 18:15:53 +01:00
8ccdf15ace Forgot this last merge 2014-12-01 14:59:18 +01:00
b57d67dfb9 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/BKE_context.h
	source/blender/editors/include/ED_transform.h
	source/blender/editors/transform/transform_ops.c
2014-12-01 14:54:28 +01:00
73efb36091 Shapekey widget is correctly bound to the shapekey property and controls
it.
2014-12-01 12:54:40 +01:00
1f501db162 More cleanup to the widget API.
Now with RNA pointer copy we don't need to allocate RNA pointers
anymore. The API is much more streamlined and is almost like the panel
API.
2014-12-01 12:28:39 +01:00
af74cba653 Widgets: Cleanup, no draw flag now, widgets are fully dynamic. Also
calculate scale always to make sure interaction happens correctly.
2014-12-01 11:57:52 +01:00
2b1bdb5412 Refactor widgets to always be recreated on redraw - like buttons.
This allows us to spawn a different number of widgets per frame, which
will be needed for shapekey doritos. Also added a widgetgroup for the
shapekeys
2014-11-28 23:02:42 +01:00
0b443c8a23 Merge branch 'master' into gooseberry 2014-11-28 22:21:00 +01:00
a99f5a7463 Add stub operator for widget operation so it is blocking and events do not get
lost when region changes.
2014-11-28 16:35:07 +01:00
6336b215a9 Merge branch 'master' into gooseberry 2014-11-28 16:26:44 +01:00
f74e4d9dfe Merge branch 'viewport_experiments' into gooseberry
Conflicts:
	source/blender/gpu/intern/gpu_buffers.c
2014-11-28 16:21:45 +01:00
5467064777 Merge branch 'master' into viewport_experiments
Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/gpu/GPU_buffers.h
	source/blender/gpu/intern/gpu_buffers.c
2014-11-28 16:15:13 +01:00
bd434b92b6 Revert "Hook up flags to request a specific sorting scheme from GPU buffer setup"
This reverts commit 827ad6075d.
2014-11-28 16:10:25 +01:00
7e9eb8b83b Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2014-11-28 11:47:16 +01:00
9768480a7b Merge branch 'master' into gooseberry 2014-11-27 21:40:41 +01:00
8ce8a4edb3 Merge branch 'master' into gooseberry 2014-11-27 19:12:40 +01:00
2a3d6efa96 Merge branch 'master' into wiggly-widgets 2014-11-26 19:28:24 +01:00
d898581b52 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/gpu/intern/gpu_extensions.c
2014-11-26 15:09:57 +01:00
5373b4a8b1 Merge branch 'master' into viewport_experiments
Conflicts:
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/gpu/intern/gpu_extensions.c
2014-11-25 16:31:55 +01:00
c0d8ed55e4 Merge branch 'master' into gooseberry
Conflicts:
	release/scripts/startup/bl_ui/space_sequencer.py
	source/blender/blenkernel/BKE_sequencer.h
	source/blender/blenkernel/intern/sequencer.c
	source/blender/blenkernel/intern/sound.c
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/animation/anim_ops.c
	source/blender/editors/space_sequencer/sequencer_draw.c
	source/blender/editors/space_sequencer/sequencer_edit.c
	source/blender/editors/space_sequencer/sequencer_intern.h
	source/blender/editors/space_sequencer/sequencer_preview.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_ops.c
	source/blender/editors/transform/transform.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/editors/transform/transform_snap.c
	source/blender/makesdna/DNA_space_types.h
	source/blender/makesdna/DNA_view3d_types.h
	source/blender/makesrna/intern/rna_space.c
2014-11-25 14:25:27 +01:00
aae1162945 Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_ops.c
2014-11-24 19:22:15 +01:00
8aed4bb1d6 Fix compilation error with SCons
The file wasn't being comiling by CMake, remove it from SCons compilation as well.
Not sure if the same is required in original branch, maybe it'll be redone anyway.

For now let's make it so gooseberry branch is compiling nicely on the buildbot.
2014-11-24 14:09:52 +05:00
dd43f9c056 Cage widget now does something useful (tm). Basically, we can now
transform the x direction of the backdrop in sequencer when a viewer
node is active.

There are still some issues with property transform not being a proper
operator, but we can fix that easily.

To make full 2D transform work we need positions stored in one property.
2014-11-21 18:05:39 +01:00
ff50cd9740 2D widgets Cleanup:
* Get rid of invalid flag (we avoid drawing widgets by dereferencing RNA
now so it should be OK)

* Add intersect function for 2D widgets (still needs correct mapping to
be any useful though)
2014-11-21 17:07:26 +01:00
44b4ced395 Correctly center the widget in node space 2014-11-21 16:48:33 +01:00
82401df4b2 Merge branch 'master' into gooseberry 2014-11-21 16:30:10 +01:00
261c0a5282 Merge branch 'wiggly-widgets' into gooseberry 2014-11-21 16:25:48 +01:00
bfa17440eb Cage actually now draws something, also change widget, will be modified
to control placement of backdrop.
2014-11-21 16:24:05 +01:00
3e8367037f Another fix for particle instance child lookups, was not subtracting
parent amount.
2014-11-21 16:01:21 +01:00
007eaf34dc Fix for invalid particle pointer access in mixed particle/child loop. 2014-11-21 16:01:21 +01:00
1068021523 Better update function for particle settings affecting nested cloth
modifier.
2014-11-21 16:01:21 +01:00
af8c0c84f6 Fix for applying the bending randomness factor.
A stupid hack is needed here, changing the way the factor is applied to
angular bending springs. In cloth sim the bending factor of individual
springs is applied as a mix value between the bending stiffness and a
max value, but this max value isn't even used in hair sim so that
approach becomes useless.
2014-11-21 16:01:20 +01:00
bc637d0e1a Randomness factor for hair bending stiffness.
This helps to create some variation in a hair system, which can
otherwise become very uniform and boring. It's yet another confusing
setting in a system that should have been nodified, but only option for
now (broken windows ...)
2014-11-21 16:01:20 +01:00
e8ddfb1fe2 Fix for particle instance initial frames.
These were not orthonormal and tended to flip with changing hair
direction, now use the particle hair matrix which is stable wrt. the
mesh surface.
2014-11-21 16:01:20 +01:00
eb3d1e3e4f Merge branch 'master' into wiggly-widgets 2014-11-21 11:24:52 +01:00
7c078f97df Fix T42639, editcurve flags not getting restored on undo.
Error here could be reproduced by tweaking curve properties such as
2d-3d or fill type and undoing.
2014-11-20 18:58:59 +01:00
bcd78c9311 Initialize the snaping aspect just once. 2014-11-20 18:39:26 +01:00
0853c0109c Merge branch 'master' into gooseberry 2014-11-20 18:21:39 +01:00
a014b8f1c1 Merge branch 'wiggly-widgets' into gooseberry 2014-11-20 18:19:31 +01:00
6279dde2f2 Fix crash with widgetgroup 2014-11-20 18:16:58 +01:00
3102ced864 Merge branch 'wiggly-widgets' into gooseberry
Conflicts:
	source/blender/editors/include/ED_view3d.h
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/transform/transform_manipulator.c
2014-11-19 16:48:04 +01:00
ef310b2ae1 lost instance of transform manipulator 2014-11-19 16:13:15 +01:00
bfa6b80b8b Merge branch 'master' into wiggly-widgets 2014-11-19 16:08:05 +01:00
fee102e818 Bring back the old manipulator code, it works better with the transform
system for now. Backup the old code in a new file
2014-11-19 16:07:56 +01:00
896ee44ed6 Borrow transform system interaction: When arrow direction has direction
close to view direction, use up/down movement of mouse to calculate
offset.
2014-11-19 15:28:10 +01:00
ca65c70ce1 warnings 2014-11-19 15:27:56 +01:00
13b196f460 Merge branch 'master' into gooseberry 2014-11-19 15:23:38 +01:00
134d69582c More refinement to the widget system. Now camera widget should be
indistinguishable than the displayed widget (might probably be worth
deleting the original)
2014-11-19 14:48:02 +01:00
6ce5174301 Arrow Widget:
Create a cross style widget, with wireframe cross.

Allows setting a custom scale for the arrow widget also, an up
orientation.
2014-11-19 14:24:29 +01:00
58f7e89e39 Add flag so widgets only draw on mouse over.
Camera widget now uses this, also now they only draw if limits is on.
2014-11-19 13:03:30 +01:00
36f18cd35c Arrow widget interaction:
Fix interaction when pivot is beside the camera. basically we now do all
calculations in 3D space and we do not scale correct the offset in 3D -
this creates a nasty dependency loop between drawing and calculation for
widgets bound to properties - ie offset depends on scale but scale
depends on screen position - ie offset.

Also added an extra callback to get the final position of the widget in
3d space and use that to calculate the scale. This takes care of
bringing a close to the camera widget to the background and the widget
keeping its initial size. The final position can be different from the
initial position, especially when the widget is offset from the original
position.
2014-11-19 12:32:21 +01:00
681ea5d187 Merge branch 'viewport_experiments' into gooseberry 2014-11-18 17:48:13 +01:00
ec69df6147 Merge branch 'master' into viewport_experiments 2014-11-18 17:47:56 +01:00
40b1d29ec7 Merge branch 'master' into viewport_experiments
Conflicts:
	source/blender/gpu/intern/gpu_extensions.c
2014-11-18 13:49:57 +01:00
d7fa0fcaae More info for widget undo push string 2014-11-17 18:48:37 +01:00
275a26353e Add widget for focus of camera. There are some general issues with
widget scale that I'll fix later.
2014-11-17 17:27:45 +01:00
2dd9e41d93 Merge branch 'master' into wiggly-widgets
Conflicts:
	source/blender/editors/transform/transform_manipulator.c
2014-11-17 16:30:52 +01:00
195788a24a Add flag so offset is applied in world, not screen space. 2014-11-17 15:39:21 +01:00
9880574aaa Fixed overlooked function name change in game engine code. 2014-11-17 15:20:29 +01:00
7fe2e945bd Merge branch 'gooseberry' into hair_immediate_fixes 2014-11-17 14:54:51 +01:00
54ae1e90d7 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/BKE_key.h
	source/blender/editors/transform/transform_manipulator.c
2014-11-17 14:52:53 +01:00
def2bb7644 Fix for particle instance modifier: use a stable parallel-transport
framing method instead of the Frenet frame.

The Frenet frame is very succeptible to sudden twists along straight
sections of a curve where the second derivative (curvature) becomes 0.
2014-11-17 14:16:35 +01:00
141f2c1d5c Use better algorithm for arrow widget back transform.
We now use plane/line intersection which seems to work quite well and
agrees to great extent with the transform system as well. There still
some small discrepancy but may also be related to scaling.
2014-11-17 12:31:42 +01:00
2114f49750 WIP cage transform.
This also includes code for the node editor but probably
will try a different use case first.
2014-11-16 19:40:13 +01:00
d03ceb2a15 Nicer hashing functionality for sim debugging using a variadic macro
to support multiple hash identifiers.

Using explicit hashing functions for every sim debug call defeats the
purpose of having a quick feedback system. Now this can be done simply
by passing an arbitrary number of hash inputs (integers) at the end of
the function calls, which are then combined by a system of variadic
macros (based on the ELEM feature). Up to 8 identifiers are supported
currently, but more could be added easily if needed.
2014-11-16 14:59:33 +01:00
67e48a5b04 Merge branch 'master' into gooseberry 2014-11-15 20:52:11 +01:00
b30019fabe Merge branch 'hair_immediate_fixes' into gooseberry
Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	source/blender/editors/physics/particle_edit.c
	source/blender/makesdna/DNA_modifier_types.h
	source/blender/physics/intern/BPH_mass_spring.cpp
	source/blender/physics/intern/hair_volume.cpp
	source/blender/physics/intern/implicit.h
	source/blender/physics/intern/implicit_blender.c
	source/blender/physics/intern/implicit_eigen.cpp
2014-11-15 15:07:06 +01:00
9f1ad068e9 Merge branch 'master' into hair_immediate_fixes
Conflicts:
	source/blender/blenkernel/intern/implicit.c
2014-11-15 14:40:23 +01:00
95c5c39e5d Merge branch 'master' into gooseberry 2014-11-15 14:15:30 +01:00
5aaef09702 Some tweaking of value ranges for hair target density and removed
density factor (already included in grid velocity).
2014-11-15 12:40:34 +01:00
3021399869 Ensure View3D fx when using them, prevents some crashes with old files 2014-11-14 23:52:41 +01:00
ace38bdc82 Fix SSAO not being constant in camera view. 2014-11-14 19:55:30 +01:00
5a7f8f8ef8 Inverted effect of target density was unstable, the divergence term
needs to be substracted instead.
2014-11-14 17:11:33 +01:00
7289f36a59 Use dedicated debug values in cloth settings instead of abusing unused
other values.
2014-11-14 16:48:01 +01:00
f5e1be8532 Fixed wrong stride values used for offsetting the index of Eigen values.
The Eigen solver for hair grids uses an extra margin of 1, which means
greater stride values.
2014-11-14 15:51:23 +01:00
1103abdb86 Merge branch 'terrible_consequencer' into gooseberry
Conflicts:
	source/blender/editors/space_sequencer/sequencer_draw.c
2014-11-14 15:36:24 +01:00
e346911943 Gooseberry request, snap frame marker during frame setting by holding
ctrl key
2014-11-14 15:35:30 +01:00
f5c2b1c2f6 Merge branch 'master' into terrible_consequencer
Conflicts:
	source/blender/editors/space_sequencer/sequencer_draw.c
2014-11-14 15:07:10 +01:00
d1bfb48216 Hair grid code was using an invalid hair segment at each hair end with
zero vectors, leading to bad density values.
2014-11-14 14:55:56 +01:00
0655c4931c Merge branch 'viewport_experiments' into gooseberry 2014-11-14 14:46:02 +01:00
63663f00dc A bunch of debug drawing changes. 2014-11-14 14:45:46 +01:00
cb94f59f71 Fix T42596 crash with DOF on MacOS.
Compiler failed on last shader and failure was not detected. However
compiler error also revealed a blurring error as well :)
2014-11-14 14:45:20 +01:00
ee3b3f7669 Corrected the divergence and gradient calculation for the hair grid
solver input and output.

This uses the central difference method (instead of combined forward/
backward difference), which makes it easier to correctly account for
grid borders.
2014-11-14 14:41:55 +01:00
d7fcab7e25 Merge branch 'master' into gooseberry 2014-11-14 14:34:59 +01:00
63d7d8e1e5 Merge branch 'master' into viewport_experiments 2014-11-14 14:07:47 +01:00
f79cf18848 Fallback method for defining density in the hair grid using discrete
samples.

This is just an intermediate method to make sure the density is valid.
Eventually the closest-point method should be used, but for testing
the poisson solver this is easier to debug.
2014-11-14 11:10:45 +01:00
be9fbfd92f Added a margin to the number of cells used in the poisson grid solver,
to ensure we always have one layer of empty cells around the fluid.
2014-11-14 10:42:09 +01:00
3cf9c897ee Merge branch 'master' into gooseberry 2014-11-14 10:05:19 +01:00
c77eefb1f0 Merge branch 'master' into gooseberry 2014-11-13 17:44:10 +01:00
644848fab7 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/implicit.c
2014-11-13 17:40:06 +01:00
746b93497f fixes for last merge 2014-11-13 17:35:21 +01:00
024645d8e0 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_sequencer/sequencer_draw.c
2014-11-13 17:23:19 +01:00
316a3e830c Merge branch 'master' into gooseberry 2014-11-13 17:15:24 +01:00
4dc9ca29de Merge branch 'master' into gooseberry 2014-11-13 17:14:35 +01:00
7a53563c98 Implementation of a target density feature for the hair simulation.
This allows setting a target density which the fluid simulation will
take into account as an additional term in the pressure Poisson
equation. Based on two papers
"Detail Preserving Continuum Simulation of Straight Hair" (McAdams et al. 2009)
and
"Two-way Coupled SPH and Particle Level Set Fluid Simulation" (Losasso et al. 2008)

Currently the target pressure is specified directly, but it will be
a lot more convenient to define this in terms of a geometric value such
as "number of hairs per area" (combined with hair "thickness").
2014-11-13 16:06:39 +01:00
debe72a243 Another fix for off-by-one hair grid resolution errors. 2014-11-13 16:05:17 +01:00
de30eddf82 Rewriting the grid rasterization function for hair segments. 2014-11-13 16:04:31 +01:00
120d78d6d5 Draw actual hair keys when the "Guide Hair" setting is enabled.
Without this certain debug tasks become very hard to visualize.
2014-11-13 15:15:02 +01:00
6e56dcdc79 Change widget interaction slightly so transform works immediately.
It may be better to use transform code for widgets but this will cause
nested operators for widget/operator and needs some consideration.

For transform e.g. we would have one transform operator taking care of
transformation of the widget, then feeding this back to regular object
transform.
2014-11-12 15:41:24 +01:00
01a37d8b03 Fix incorrect wrapping of lamp to RNA for widget. 2014-11-12 14:37:50 +01:00
f2db6b227c Remove magic numbers 2014-11-12 13:41:13 +01:00
aa22fa21f9 Widgets: inverted/constrained to property range working for properties
(not operators yet).

Now "umbrella" widget type works correctly.

Includes minor cleanup of view3d widgetgroup routines.
2014-11-12 12:00:12 +01:00
dfaddba86c correct offset for scaled widgets during interaction 2014-11-12 11:06:25 +01:00
4d3c1325d6 Merge branch 'terrible_consequencer' into gooseberry 2014-11-11 18:41:50 +01:00
500bac8225 Snap to left-right based on position of mouse relative to selection. 2014-11-11 18:41:09 +01:00
6101bdaf70 Support endpoint snapping correctly. 2014-11-11 18:13:00 +01:00
ec0c58823d First iteration of snapping based on strips - will be improved based on
imput from Mathieu.
2014-11-11 18:00:47 +01:00
b089332a4d WidgetMaps:
Now widgetmaps get created and destroyed with the area. Not sure if it's
the best design but it avoids too many creations and recreations.

arrow offset now calculated at property binding time - no RNA access
during interaction means no chance of crash during undo.
2014-11-10 15:48:02 +01:00
6968547b80 Bound properties/operators to widgets at draw time. This fits our design
much better (is the same as the way panels work) and will help avoiding
some crashes on undo.
2014-11-10 14:55:07 +01:00
5015864b68 Fix for grid drawing in 3D view, was using one less grid cell. 2014-11-10 11:34:36 +01:00
6c999f6ca4 Merge branch 'master' into wiggly-widgets 2014-11-10 11:10:45 +01:00
a659027d91 Merge branch 'hair_immediate_fixes' into gooseberry 2014-11-09 13:16:47 +01:00
7f7a63fb11 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/implicit.c
2014-11-09 17:10:15 +05:00
9f47e5d6eb Merge branch 'master' into hair_immediate_fixes 2014-11-09 12:13:43 +01:00
ca66f4444d Fix for color-wire auto-contrast 2014-11-09 01:01:26 +01:00
e6d6cbccc8 Merge branch 'master' into gooseberry 2014-11-08 22:31:28 +01:00
7f2f9f0acd Exposing customdata mask layer (CD_PAINT_MASK) to Python API
There are several more or less new customdata layers that currently cannot be accessed via Python (or some are exposed via BMesh API but not via Mesh API). This patch aims to expose one of those layers - CD_PAINT_MASK.
It'd be pretty useful for existing and future addons targeting sculpt workflow. Currently to get some access to the mask we employ a hackish approach via hiding/revealing masked vertices, this adds mode switches and doesn't allow to get actual mask values which could be useful if converted into vertex group weights for later use in e.g. modifiers. With this patch we'd be able to access mask data directly.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Subscribers: radcapricorn

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D782
2014-11-08 19:51:30 +01:00
3c0aed7dbc Implemented PIC and FLIP methods for combining the fluid grid simulation
with the Lagrangian hair model.
2014-11-08 19:34:16 +01:00
66f5f6770c Main solver step for generating a divergence-free hair velocity field
on the grid.

This uses the Eigen conjugate-gradient solver to solve the implicit
Poisson equation for the pressure Laplacian:

    div(grad(p)) = div(v)

As described in "Detail Preserving Continuum Simulation of Straight Hair"
(McAdams, Selle, 2009).
2014-11-08 18:45:28 +01:00
016168652f Allow separate widget data per editor.
To make this work, we need separate type/instance for the widgets. This
is a bit ugly but it is necessary if we want widgets on each editor to
depend of per editor-options or visibility state.
2014-11-07 18:12:32 +01:00
4e4c1a0ea0 Support undo. Scale stays same for non-3D widgets 2014-11-07 12:52:46 +01:00
70423fa275 Pampering the stupid MSVC compiler again, it fails to build valid C code. 2014-11-07 11:43:25 +01:00
c68eb204b5 Merge branch 'master' into gooseberry 2014-11-06 15:36:16 +01:00
b69314c620 Added new header for Eigen utility classes.
These make passing data between Eigen vector and matrix types and plain
C arrays more convenient.
2014-11-06 15:14:43 +01:00
68d835301e Updated a few comments. 2014-11-06 15:08:25 +01:00
a50706e07d Compile hair volumetrics code as C++, so we can use Eigen easier. 2014-11-06 15:05:42 +01:00
16bb70a1a4 Minor debug code fix. 2014-11-06 14:57:31 +01:00
29543afa4e Use a fixed, uniform cell size for hair continuum grids.
This is a bit more awkward for artists to use, but necessary for
a stable solution of the hair continuum calculation. The grid size is
defined by the user, the extent of the grid is then calculated based on
the hair geometry. A hard upper limit prevents bad memory allocation
in case too small values are entered.
2014-11-06 14:12:01 +01:00
08c477a6aa Removed unused voxel_filter_size DNA property.
This is an artifact of earlier attempts to implement velocity smoothing,
but doesn't work anyway.
2014-11-06 12:36:49 +01:00
cf28448364 Renamed HairVertexGrid to HairGrid, since it's not actually storing
hair vertex data.
2014-11-06 12:32:35 +01:00
439c7e089a Removed unused "collider grid" struct from hair volumetrics.
This is a leftover from previous approach of hair collisions (with
insufficient results). The hair volumetrics actually implements
"collision" with solid objects as well, but uses a Neumann boundary
condition on the main grid for this purpose.
2014-11-06 12:28:13 +01:00
7432efd9d7 Better grid rasterization method for hair volumetric grids.
This is based on the paper
"Detail Preserving Continuum Simulation of Straight Hair"
(McAdams, Selle, Ward, 2009)

The main difference is that hair line segments are used rather than only
rasterizing velocity at the vertices. This gives a much better coverage
of the hair volume grid, otherwise gaps can be produced at smaller grid
cell sizes and the distribution is uneven along the hair curve.

The algorithm for rasterizing is a variation of Bresenham's algorithm
extended onto 3D grids.
2014-11-06 12:17:09 +01:00
2a18501562 Add mapping to properties for widgets.
Still pretty much exploring the best way to move here but currently this
works by wrapping objects in RNA pointers, pretty much like buttons do.

Also modified the arrow widget for lamps to use the new code. The new
"unmbrella" widget works now as expected for lamps - of course fine
tuning is also needed.
2014-11-05 19:41:19 +01:00
04cb1b097a New debug element "circle" for simulations, which is quite useful for
visualizing scalar fields.
2014-11-05 19:17:39 +01:00
4b11cf171a Resurrection of 2.49 feature:
Ghosting of original arrow position while we are interacting with an
arrow widget.
2014-11-05 18:23:53 +01:00
71f1a3b1e2 Make projection code for arrow widget better. Also add some code to
allow tweaking of properties
2014-11-05 18:09:56 +01:00
49b972c43c Debug grid drawing for hair volume was drawing one subdivision too many. 2014-11-05 17:25:50 +01:00
e51d7a7a85 Merge branch 'master' into wiggly-widgets 2014-11-05 11:41:16 +01:00
5d42ab2ad0 Warnings 2014-11-04 17:58:50 +01:00
94d0fb0344 Merge branch 'master' into gooseberry 2014-11-04 17:10:33 +01:00
43d4a56d8d Support animation of camera dof properties.
Also minor cleanup
2014-11-04 17:02:08 +01:00
975e2580a8 Support animation of camera dof properties.
Also minor cleanup
2014-11-04 16:47:40 +01:00
5e8abc5afe Merge branch 'viewport_experiments' into gooseberry
Conflicts:
	release/scripts/startup/bl_ui/properties_data_camera.py
	release/scripts/startup/bl_ui/space_view3d.py
2014-11-04 15:29:46 +01:00
7b0031b187 Avoid freeing and reading/writing NULL pointers. Should not happen often
but better guard against it.
2014-11-04 15:26:25 +01:00
4322085f4f Only show properties if not in camera view, else direct user to camera
properties
2014-11-04 15:25:55 +01:00
9480cede0f Avoid freeing and reading/writing NULL pointers. Should not happen often
but better guard against it.
2014-11-04 14:48:33 +01:00
4aad147fe4 Support camera GPU parameters when looking/rendering through camera in
the viewport.
2014-11-04 14:30:19 +01:00
b550e788f2 Use own file for GPU option types.
* Add gpu options for depth of field to camera - still inactive.
* GPUFXOptions now passed to the compositing system startup
so users can swap options if they wish to

This commit changes read-write data again, people should reset their
values again (sorry for that but this is still WIP)
2014-11-04 14:30:19 +01:00
3a87fb5508 Support camera GPU parameters when looking/rendering through camera in
the viewport.
2014-11-04 14:28:25 +01:00
f89fab339e Use own file for GPU option types.
* Add gpu options for depth of field to camera - still inactive.
* GPUFXOptions now passed to the compositing system startup
so users can swap options if they wish to

This commit changes read-write data again, people should reset their
values again (sorry for that but this is still WIP)
2014-11-04 13:02:30 +01:00
ca0a0abf57 Merge branch 'terrible_consequencer' into gooseberry 2014-11-04 11:24:22 +01:00
46b787bd6e Merge branch 'viewport_experiments' into gooseberry
Conflicts:
	source/blender/makesdna/DNA_view3d_types.h
2014-11-04 11:12:08 +01:00
c73b7a6790 Merge branch 'master' into gooseberry 2014-11-04 09:23:23 +01:00
46cc844f43 Offscreen rendering for viewport FX.
This is working mostly from the 3D viewport currently, rendering from
the render buttons or the sequencer will not use the FX yet. Still it's
a solid step towards that direction. Also moved options out of the v3d
struct. Old options will be lost and people may get some warnings,
however simply enableing and disabling one of the compositing settings
will bring the controls back.
2014-11-03 20:20:32 +01:00
038c0d5466 fix some errors 2014-11-03 15:51:19 +01:00
4139deab00 Merge branch 'master' into terrible_consequencer
Conflicts:
	source/blender/editors/include/UI_view2d.h
	source/blender/editors/space_sequencer/sequencer_edit.c
2014-11-03 15:45:20 +01:00
7798ecd743 Add another level of small blur to bridge between no/medium blurring.
Algorithm used is now a full implementation of

"Practical Post-Process depth of field", presented here [1],
with a few modifications as to how circle of confusion is
applied at the final pass.

[1] http://http.developer.nvidia.com/GPUGems3/gpugems3_ch28.html
2014-11-03 14:06:47 +01:00
78d42f7885 Merge branch 'master' into viewport_experiments 2014-11-03 09:56:49 +01:00
fbb2c79618 Color Wire: improve method of tinting colors
also improve method to ensure contrast with background
2014-11-01 20:27:52 +01:00
eb8a09d567 DOF effect works :) 2014-10-31 21:23:57 +01:00
b455f80367 Unused leftover debug variable. 2014-10-31 21:20:38 +01:00
6a2ea7eb4e Reimplemented the voxel texture type for displaying hair continuum grids. 2014-10-31 20:29:51 +01:00
12657f7ef6 Expose hair grid info in the RNA (read-only); it can be useful for
debugging purposes.
2014-10-31 17:10:34 +01:00
adcdb4334b Debug visualization code of a slice of the hair velocity vector field. 2014-10-31 16:33:35 +01:00
2f1192d302 Removed arbitrary factor 2.0 on volumetric hair friction factor.
This was introducing energy into the system for any factor beyond 0.5
and caused major instability.
2014-10-31 16:30:54 +01:00
ff15a79cbd Fill the hair volume grid with the _new_ velocities from the first
solver step, instead of using the previous step's velocities.
2014-10-31 15:20:45 +01:00
2a5556b426 Merge branch 'master' into viewport_experiments 2014-10-31 14:45:00 +01:00
bcc5c1b4e1 Debug drawing feature to visualize the hair continuum grid. 2014-10-31 14:23:32 +01:00
53e624cd71 Perform grid-based velocity smoothing for hair outside of the implicit
solver step.

Calculating forces and jacobians from linearly interpolated grid values
is problematic due to discontinuities at the grid boundaries. The new
approach of modifying velocities after the backward euler solver step
was suggested in a newer paper

"Detail Preserving Continuum Simulation of Straight Hair"
(McAdams, Selle 2009)
2014-10-31 11:59:14 +01:00
a3b9dbf17c Merge branch 'master' into gooseberry 2014-10-30 22:34:08 +01:00
20ae92b352 Experimental color wire-frame (for testing in the studio) 2014-10-30 16:26:39 +01:00
82f30be425 Fix for warnings/errors 2014-10-30 16:17:30 +01:00
ad47b5a9d2 Merge branch 'master' into hair_immediate_fixes 2014-10-30 16:02:10 +01:00
1556753281 Reorganizing hair dynamics UI layout a bit to make settings slightly
more intuitive.

Also removed a couple of unused or useless features from the UI:
* collider friction is unused and replaced in favor of true collision
* spring damping refers to structural springs (stretch), which is
  not noticable in hair due to extreme stiffness atm.
* pressure factors are not sure since this feature is too unstable atm.
2014-10-30 15:59:13 +01:00
356ed34ba5 Disabled the hair preview feature in the code, due to limited usefulness.
Interpolating hairs in a meaningful way is a quite difficult problem.
It works ok-ish for child hairs as long as they don't move, but with
motion the direction of interpolated hairs can become quite nonsensical
quickly.

Probably a better way to create simulation previews is to limit
simulation to a particular well-defined area (like render preview
borders), but run it in full detail in that area. The error from
omitting some interaction should still be much less than orientation
errors from interpolation.
2014-10-30 15:59:13 +01:00
2f1631f747 Moved render simplification function for particle distribution into the
distribution code.
2014-10-30 15:59:13 +01:00
00151430fc Removed unused variable. 2014-10-30 15:59:13 +01:00
ec476a168b A little bit of code sanity by splitting particle distribution function
by type.

Instead of squashing totally unrelated code into the same monster
function.
2014-10-30 15:59:13 +01:00
d4823812fa Moved particle code for distributions into own file to make hacking
easier.

This code is badly broken and needs to be replaced, but at least having
a workable code structure might help with quick hacks to fix the worst
cases.
2014-10-30 15:59:13 +01:00
7a59a58990 Removed unused line. 2014-10-30 15:59:13 +01:00
bbddc2c033 New hair editing feature "Shape Cut", for cutting hair based on a mesh
shape instead of a brush tool.

The brush cutting tool for hair, while useful, is not very accurate and
often requires rotating the model constantly to get the right trimming
on every side. This makes adjustments to a hair shape a very tedious
process.

On the other hand, making proxy meshes for hair shapes is a common
workflow. The new operator allows using such rough meshes as boundaries
for hair. All hairs that are outside the shape mesh are removed, while
those cutting it at some length are shortened accordingly.

The operator can be accessed in the particle edit mode toolbar via the
"Shape Cut" button. The "Shape Object" must be set first and stays
selected as a tool setting for repeatedly applying the shape.
2014-10-30 15:59:13 +01:00
d1be54886e Switched back to blender implicit solver for merge. 2014-10-30 15:59:13 +01:00
2224220d20 Unified the main Eigen solver function a bit for constrained/unconstrained
solver variants.
2014-10-30 15:59:13 +01:00
e57d3af847 Ported the remaining implicit solver functions for Eigen.
Also added a couple of utility wrapper functions for Eigen types to make
interfacing with plain float arrays and blenlib math easier.
2014-10-30 15:59:13 +01:00
4e38d9df9e Updating Eigen implicit dynamics solver implementation to adhere to the
new mass-spring solver API.
2014-10-30 15:59:13 +01:00
4dd4145fee Merge branch 'master' into gooseberry 2014-10-30 15:31:47 +01:00
f63ce02a63 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenlib/BLI_math_matrix.h
	source/blender/blenlib/intern/math_matrix.c
	source/blender/editors/object/object_bake_api.c
2014-10-30 15:24:40 +01:00
b6393da835 Reorganizing hair dynamics UI layout a bit to make settings slightly
more intuitive.

Also removed a couple of unused or useless features from the UI:
* collider friction is unused and replaced in favor of true collision
* spring damping refers to structural springs (stretch), which is
  not noticable in hair due to extreme stiffness atm.
* pressure factors are not sure since this feature is too unstable atm.
2014-10-30 15:10:34 +01:00
3e5627ec57 Disabled the hair preview feature in the code, due to limited usefulness.
Interpolating hairs in a meaningful way is a quite difficult problem.
It works ok-ish for child hairs as long as they don't move, but with
motion the direction of interpolated hairs can become quite nonsensical
quickly.

Probably a better way to create simulation previews is to limit
simulation to a particular well-defined area (like render preview
borders), but run it in full detail in that area. The error from
omitting some interaction should still be much less than orientation
errors from interpolation.
2014-10-30 14:41:14 +01:00
de27811177 Correctly downsample circles of confusion and use parallelism to do it
more efficient.
2014-10-29 19:41:12 +01:00
6484056cc1 Second pass, blurs the downsampled buffer once. 2014-10-29 18:31:15 +01:00
a4f35de026 Use the correct shaders and varyings 2014-10-29 18:08:22 +01:00
ba2f0ad779 Viewport DOF:
* Scons builds correctly
* Separate vertex shader file for DOF, will make handling main easier
* Downsample color buffer + blur it. Circle of confusion is calculated
from zplane instead of length of distance from camera.
2014-10-29 16:18:19 +01:00
e0cba973e7 First ping pong between low resolution buffers working. Nice landmark
for working code.

Also cleanup unused variables and do not bind the same texture to two slots
(blurred texture is going to be different anyway)
2014-10-29 12:46:25 +01:00
c6292918a3 Framebuffer compositing:
* Cleanup compositing buffers better when not needed.

* Support passes for the dof effect through defines in main - easy
solution to allow not having too many files for one shader effect.
2014-10-29 12:01:13 +01:00
518f794a6f SSAO and DOF work well together now. 2014-10-29 11:12:41 +01:00
dc22a50488 Code that enables simultaneous DOF-SSAO effect. There's some sort of
texture coordinate offset still.
2014-10-28 21:24:38 +01:00
d2d3bd35c1 Use optimized view space reconstruction for ortho case as well. 2014-10-28 19:44:05 +01:00
0782c680a6 Add a library file for projection shader code, should enable us to use
optimized position calculation again - relevant for both SSAO and DOF
2014-10-28 19:07:58 +01:00
8f25b6d6c8 More attempts to synchronize viewport and camera dof - probably will
need fixes in the rendering systems. Reserve textures for the dof
effect.
2014-10-28 18:28:58 +01:00
d86c686e41 Moved render simplification function for particle distribution into the
distribution code.
2014-10-28 17:16:59 +01:00
97caee6c46 Removed unused variable. 2014-10-28 17:09:45 +01:00
e43ecb1201 A little bit of code sanity by splitting particle distribution function
by type.

Instead of squashing totally unrelated code into the same monster
function.
2014-10-28 16:45:23 +01:00
d6e93d9dfe Moved particle code for distributions into own file to make hacking
easier.

This code is badly broken and needs to be replaced, but at least having
a workable code structure might help with quick hacks to fix the worst
cases.
2014-10-28 16:29:33 +01:00
6e8ba2f3f5 DOF calculation shader. 2014-10-27 20:45:51 +01:00
c48abbb090 Merge branch 'master' into viewport_experiments 2014-10-27 11:10:49 +01:00
5efa0e03b5 Add separate file for DOF effect and cleanup the parameter passing a little. 2014-10-27 10:06:56 +01:00
d54c249a7b Separate SSAO pass - it's unlikely we'll be able to reuse this with
depth of field in one pass, so better separate the shaders as well
2014-10-23 22:42:48 +02:00
3967f5659d Fix irritating issue with self shadowing.
Issue here was position reconstruction could use depths from pixels off
the initial position. Using linear filtering here eliminates the issue.

Usually this is not correct however given that for depth discontinuities
we will get different depths anyway, the cases where we get smooth
interpolation of depths helps a lot in image quality.
2014-10-23 20:12:39 +02:00
1082a2f125 Add some pedantic GLSL casts to make shader compile in OSX 2014-10-23 17:01:19 +02:00
ddb33a3181 SSAO introduce quality settings
Basically change the way SSAO samples the screen by using a circular
filter instead. This is inspired by HBAO though we still don't use this.

The quality settings change the number and density of samples. We can
definitely improve things here though.

We also jitter the sampling locations per pixel. Generally this adds a
kind of noise. Some banding is, unfortunately still apparent and small
distances will introduce noise. This can be fixed but I will have to see
if it can be done without much of a cost.
2014-10-22 19:27:43 +02:00
f19fcf7aad Merge branch 'master' into hair_immediate_fixes
Conflicts:
	source/blender/blenkernel/intern/key.c
2014-10-22 18:12:42 +02:00
cfd13b6dd2 Removed unused line. 2014-10-22 18:11:12 +02:00
529c287260 New hair editing feature "Shape Cut", for cutting hair based on a mesh
shape instead of a brush tool.

The brush cutting tool for hair, while useful, is not very accurate and
often requires rotating the model constantly to get the right trimming
on every side. This makes adjustments to a hair shape a very tedious
process.

On the other hand, making proxy meshes for hair shapes is a common
workflow. The new operator allows using such rough meshes as boundaries
for hair. All hairs that are outside the shape mesh are removed, while
those cutting it at some length are shortened accordingly.

The operator can be accessed in the particle edit mode toolbar via the
"Shape Cut" button. The "Shape Object" must be set first and stays
selected as a tool setting for repeatedly applying the shape.
2014-10-22 16:42:32 +02:00
33e7e1ddb2 SSAO works again. Unfortunately it's unavoidable to have it work without
explicit attenuation control (by using just max distance).

Also it now supports orthographic cameras properly. The maximum distance is
now defined in world space units so it should be slightly easier to understand
and uniform across perspective and orthographic cameras.

The optimizations can be generalized for orthographic cameras but the code is
more complex and the runtime advantage is questionable in that case
(in the end a matrix transform is 4 dot products which are not that terrible)
so commented out the code there for now.
2014-10-22 16:33:33 +02:00
c7e85ca92c Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/key.c
	source/blender/blenloader/intern/versioning_270.c
2014-10-22 11:20:43 +02:00
0c8469c440 Correct normal reconstruction with optimized formula.
This needed some adjustments from the formula I found on the article on
view space reconstruction, since OpenGL makes different assumptions about its
projection matrix.

SSAO does not work yet correctly under new model assumptions but we are going
to substitute with nice horizon based ambient occlusion.
2014-10-22 01:14:25 +02:00
30be0f0977 Refactoring of SSAO code. Uses some optimizations but result is different
still test file here to help with debugging.
2014-10-21 20:33:09 +02:00
e1755158c0 Merge branch 'master' into viewport_experiments 2014-10-21 16:54:24 +02:00
e963efcd19 Normalize the depth to the -1.0 to 1.0 range as well. 2014-10-20 21:46:29 +02:00
5b4b83d7e3 Add shader files to the source tree. It helps by displaying them in the
IDE
2014-10-20 20:38:50 +02:00
5c31594ab7 Merge branch 'master' into viewport_experiments 2014-10-20 18:56:00 +02:00
f7c5a231d5 Merge branch 'master' into terrible_consequencer
Conflicts:
	source/blender/editors/space_sequencer/sequencer_edit.c
	source/blender/editors/space_sequencer/sequencer_ops.c
2014-10-20 15:49:54 +02:00
18bc829e5e Trim tool:
Support metastrips and multiple strips at once.
2014-10-20 15:01:34 +02:00
c99b02b047 WIP support for meta trimming 2014-10-20 11:04:14 +02:00
09180f7ca8 Merge branch 'master' into terrible_consequencer 2014-10-20 10:55:34 +02:00
388dc24330 Hook widget event to the lamp operator. 2014-10-17 19:17:05 +02:00
97bb7d0a5b Hook calling widget to operator event system. Alpha alpha code still.
Transform/lamp still don't process those.
2014-10-17 17:11:14 +02:00
ffac46c30c Store the active widget in the context. This allows us to first call the
widget handler if needed.
2014-10-17 16:45:26 +02:00
1f9f58938d Arrow handler that does something useful (tm). However still not hooked
up to operators.
2014-10-17 16:11:23 +02:00
585204bd61 Dummy handler for arrows, take care of some allocation issues for
operators.
2014-10-17 15:09:51 +02:00
80c9a971f9 Add callbacks for operator initialization. Now a widget will directly
call an operator and have its own handlers for input.

No handlers implemented yet.
2014-10-17 14:48:58 +02:00
28599523fc Classic fix linking of the widget library. 2014-10-17 11:23:07 +02:00
057c7fd6cb Merge branch 'master' into wiggly-widgets 2014-10-17 10:45:48 +02:00
050bc3f3c4 More API reorganization 2014-10-15 19:49:21 +02:00
c56b812f76 WIP commit, basically introducing a few things here:
* highlighted vs active widget.

Active widget takes all input and basically highjacks drawing of all
other widgets in the widgetmap.

* operator names for widgets. Now widgets will spawn operators based on
names that are passed on them. They will also modify a named property of
the operator and pass it on, after which operator can process it.
2014-10-15 19:16:09 +02:00
814fb1e775 Manipulator:
* Fix error in plane manipulator handling.
* Don't show manipulator widgets on paint modes.
2014-10-15 16:56:31 +02:00
4581091fc4 Only detect active widget on mousemoves. Now handler operates on
mouseclick (bound to change)
2014-10-15 16:37:46 +02:00
a4bb56f9ba Merge branch 'master' into wiggly-widgets 2014-10-15 15:51:52 +02:00
8b90c081b0 Ring widgets:
Add a clipping style, just like manipulator
2014-10-15 15:45:17 +02:00
9a6719a314 Undo previous changes to sound.
The sound system really needs better design for the sequencer and
patching it up now won't really help us in the long run.

Also the sequencer kept leaking file descriptors when preserving
the audio handlles on undo making the branch unusable on mac and
windows.

It's almost certain patching over this will lead to more trouble, better
handle it separately and keep the system working for now.

Kept threaded loading of waveforms since we control the file input
directly there and leads to nice speedup, but we still clear the whole
sound + the waveform on undo, which is pretty bad.
2014-10-15 14:20:44 +02:00
d2fd772374 Merge branch 'master' into terrible_consequencer 2014-10-15 11:40:21 +02:00
687cb3ab86 Add space for facegroup storage 2014-10-15 10:49:58 +02:00
9c5e1a0ea5 Widgets:
* Move lamp operators to a proper place
* Store a list of widgets to avoid polling too many times
* Fix wrong indices when widgetgroup was not used.
* Lamp widget now uses an arrow widget. This will be refined to make a
nice prototype for operator/widget interaction.
2014-10-14 18:37:28 +02:00
ebfad36a22 Use a property to make the transform operator widget driven.
Design is still pending here, but for now just use to not remove widget
display.
2014-10-14 16:20:20 +02:00
1b936e8ce6 Change dial to something that resembles current rotation widget better. 2014-10-14 13:03:30 +02:00
20fc027690 Merge branch 'master' into hair_immediate_fixes
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2014-10-14 12:54:12 +02:00
e7da5a2d8f Merge branch 'master' into hair_immediate_fixes 2014-10-14 09:07:58 +02:00
35d504d136 Merge branch 'master' into gooseberry 2014-10-13 20:00:53 +02:00
c5a9add370 Dial widget, used in rotation manipulator code.
The widget can still change in the future, also widget styles can always
be used to create new widget visualizations.
2014-10-13 18:16:09 +02:00
14686a3677 Implement non-3D drawing per widget.
Basically, 3D widgets stay the same size whatever the zoom is in 3D
view. Ported over from manipulator code.
2014-10-13 16:43:35 +02:00
543dfc2a6a Merge branch 'master' into wiggly-widgets 2014-10-13 16:13:19 +02:00
41f1bb1096 Switched back to blender implicit solver for merge. 2014-10-12 17:13:08 +02:00
75ca718d8f Unified the main Eigen solver function a bit for constrained/unconstrained
solver variants.
2014-10-12 17:04:04 +02:00
5b1bfacfe2 Ported the remaining implicit solver functions for Eigen.
Also added a couple of utility wrapper functions for Eigen types to make
interfacing with plain float arrays and blenlib math easier.
2014-10-12 16:14:15 +02:00
dbe2f67ca5 Updating Eigen implicit dynamics solver implementation to adhere to the
new mass-spring solver API.
2014-10-12 12:45:07 +02:00
a0ac1c8b5c Merge branch 'hair_immediate_fixes' into gooseberry 2014-10-11 11:23:24 +02:00
afa23b3919 Compatibility fix for shape keys.
Avoid moving the 'from' pointer around in DNA. This way files stay back-
as well as forward-compatible. Only the additional type enum and
sub-index is stored in a new from_extra struct in shape keys now.
2014-10-11 11:21:31 +02:00
c2765bd99f Fix for invalid ID access during versioning.
For now is fixed by doing a versioning hack in the lib_link function,
but would be nicer to avoid this altogether for forward compatibility.
2014-10-10 14:55:20 +02:00
5739db16eb Merge branch 'hair_immediate_fixes' into gooseberry 2014-10-10 10:37:29 +02:00
ed19740751 Merge branch 'master' into hair_immediate_fixes 2014-10-10 10:33:09 +02:00
af0de1c646 Interpolation for non-simulated hairs in preview.
This generates a somewhat believable overall look for the hair system
by blending simulated hairs. For small number of hairs and small
preview ratios this can get quite inaccurate, but that's the tradeoff
for getting preview functionality ...
2014-10-10 10:29:02 +02:00
7cd6d9aada Calculate blending weights for preview hairs by constructing a kd-tree
of simulated hairs and using nearest neighbors.
2014-10-09 12:52:52 +02:00
06a854cddb Removed debug prints. 2014-10-09 12:18:04 +02:00
0d2dfcb212 Solved various update issues with the hair preview factor.
This is still terribly messy, especially because every change of the
particle system has to be piped through the dummy cloth modifier somehow.
The automatic caching system also tends to get in the way a lot; after
changing the preview factor one basically always has to start at frame 1
currently because the cloth modifier has to be reconstructed and forgets
about all caching.
2014-10-09 12:14:36 +02:00
face9721d8 Widgets:
* Add option for shaded/non shaded widgets
* Normalize arrow widget size to 1.0 so size is predictable. Probably
will use the same scheme for other widgets as well
2014-10-08 22:51:54 +02:00
e8d49c06c0 All translation axis now drawn and operated through the widget system. 2014-10-08 20:11:19 +02:00
334b25a226 * Manipulator Y 3D arrow moved and rotated correctly.
* Light manipulator doing undo now
* Scons should be fixed.
2014-10-08 19:34:16 +02:00
e15819daf3 Green widget handles y translation properly. 2014-10-08 18:32:06 +02:00
c1ffa9d0e0 ManipulatorGroup customdata.
Make WidgetGroup data private.
2014-10-08 18:13:12 +02:00
3a55705044 WidgetGroup now handles updating the manipulator properties.
Still not hooked new arrow widget to the system
2014-10-08 16:56:15 +02:00
02b81b3bca Add python exporter that exports a mesh in a C file in a renderer-ready
format (vertices + normals + triangle vertex indices)

This will allow us to create widgets in blender instead of defining them
programmatically.

May also support facegroups for different colors in the future though
they must be somehow tied to the UI colors.
2014-10-08 15:50:30 +02:00
671a508ae3 Enable depth testing for widgets.
Especially if we have many widgets on screen, sorting them will be
difficult and for mesh-armature widgets it will be unavoidable if we
want to avoid tweaking "back" surfaces.
2014-10-08 12:45:54 +02:00
e2c5839114 Merge branch 'master' into wiggly-widgets 2014-10-08 12:31:05 +02:00
237d7f3188 Complete shaded arrow widget code. It will need sorting if keep the
shading.
2014-10-07 20:29:40 +02:00
b9b0495de9 WIP redesign of the system. Nothing functional (not even manipulator).
There is first code for display of an arrow widget. The manipulator will
use those when they are ready.

Basically the manipulator is now a WidgetGroup. WidgetGroups are a new entity and
they manage a group of related widgets. They should be responsible for state update,
drawing and polling of their widgets and can be bound to specific rules.

There is a big design plan on a whiteboard beside me, it will take a few
big commits still to take shape though. One thing at a time, I am first making
reusable arrow widgets that will allow us replace the translate widgets properly.

There are a few reusable widgets planned, more to come later.
2014-10-07 19:09:45 +02:00
dd9f957ccb Preliminary commit for simulation preview. 2014-10-07 17:27:04 +02:00
6f0602ca17 Dragging the light handle will now point the lamp to the point in 3D
where user is dragging over.
2014-10-07 12:48:29 +02:00
2fa1dfacda Merge branch 'master' into wiggly-widgets 2014-10-07 11:14:47 +02:00
854db0f0ae enum instead of #define for cloth vertex flags. 2014-10-07 10:12:42 +02:00
635ce0e9ed Removed accidentally committed debug print. 2014-10-06 19:10:07 +02:00
860a27d00d Removed accidentally committed debug print. 2014-10-06 19:09:18 +02:00
cdca6e7be4 Merge branch 'hair_immediate_fixes' into gooseberry 2014-10-06 19:02:57 +02:00
2d09ebb5b6 Use the generic task scheduler for threaded particle tasks, i.e.
distribution and path caching for child particles.

This gives a significant improvement of viewport playback performance
with higher child particle counts. Particles previously used their own
threads and had a rather high limit for threading. Also threading
apparently was disabled because only 1 thread was being used ...
2014-10-06 18:58:41 +02:00
1383661488 Merge branch 'master' into hair_immediate_fixes 2014-10-06 11:48:19 +02:00
5731472612 Removed block matrix indices storage from ClothSpring struct.
This is not necessary: the implicit solver data can keep track instead
of how many off-diagonal matrix blocks are in use (provided the
allocation limit is calculated correctly). Every time a spring is
created it then simply increments this counter and uses the block index
locally - no need to store this persistently.
2014-10-04 16:14:40 +02:00
a44e944c99 Removed unused force arguments for angular bending springs and avoid
redundant calculation for counterforces.
2014-10-04 15:56:06 +02:00
5b52e4b1f6 Fix for brackets lost in merge. 2014-10-04 11:50:13 +02:00
2976eb598a Merge branch 'master' into hair_immediate_fixes
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2014-10-04 11:19:01 +02:00
f8b19d1d6e Logic for light position operator. 2014-10-03 19:51:26 +02:00
ce9603e382 WIP, operator to tweak the lamp "focus", driven through widgets. 2014-10-03 19:11:24 +02:00
8f86174ea5 Use the hair shape keys as goal positions (xconst) in the hair solver.
Note that this does not change the natural bending shape of the hair so
far, but only affects the global goal position for now.
2014-10-03 17:32:58 +02:00
37a7421e10 Lamp widget:
* Make a lamp widget design for the active lamp.
* Fix some handler errors for widgets + autoupdate for different widget
handles.
2014-10-03 17:11:01 +02:00
71dd6e2ada Guide hair drawing for hair particles.
Without this the particle system only shows the actual non-simulated
hairs ("guide hairs") during edit mode. These hairs are used for goals
as well, so showing them in the regular viewport is pretty important.

Also the usual hair curves are interpolated along the entire length,
which makes it very difficult to see exact vertex positions, unless
using exact powers of 2 for the segment number and match the display
steps.
2014-10-03 16:46:08 +02:00
98caf9331d Fixed RNA update callbacks to ensure the hair path cache is rebuilt. 2014-10-03 14:54:21 +02:00
1b8781b40e Fix for hair shape key ui script. 2014-10-03 14:19:32 +02:00
b69cf65893 Fixed some ui script errors. 2014-10-03 14:06:29 +02:00
6db28d51b6 Fixed some uses of ob->shapenr instead of psys->shapenr. 2014-10-03 14:05:59 +02:00
f208502fb3 Replaced the single ID *from pointer in shape keys with a more
detailed `owner` struct.

This allows distinction of classic ID block shape keys from particle
system keys.
2014-10-03 14:04:42 +02:00
639ff6e94d Evaluate shape keys when building the particle path cache. 2014-10-03 12:16:24 +02:00
007974899f Placeholder widget code for spotlamps 2014-10-03 12:15:57 +02:00
0b104fa5c5 Shape key "specials" menu for particle shape keys. 2014-10-03 09:49:10 +02:00
94512106f5 Renamed file to make it consistent with object shapekey operators. 2014-10-03 09:09:04 +02:00
8c92b530dd Fix for RNA using ptr->id.data instead of ptr->data for ParticleSystem. 2014-10-03 09:06:34 +02:00
88105788ac Merge branch 'master' into wiggly-widgets 2014-10-02 20:34:26 +02:00
6c09f016de Move widget drawing at a higher level - try drawing on top of rendering
too.

Rationale - widgets might be useful to have even on rendered scenes -
we'll have to see about how this will work

Also use area initialization code to register region specific widgets once.

lala
2014-10-02 20:33:59 +02:00
0b6e2aa6d2 Conversion functions from/to hair shape keys to particle data. 2014-10-02 19:20:16 +02:00
d9b7f7305a Shape key infrastructure for hair. 2014-10-02 19:04:59 +02:00
2ee254e1a8 Merge branch 'master' into wiggly-widgets 2014-10-01 19:18:15 +02:00
b1f3383eec Merge branch 'wiggly-widgets' into gooseberry 2014-10-01 19:02:54 +02:00
392e9e18f1 Fix release comfirm for central widget in transform operator 2014-10-01 19:01:18 +02:00
d928155df1 Fixes to highlight code, now widgetmaps remember last active widget and
reset accordingly.
2014-10-01 18:44:40 +02:00
43c2e17289 Merge branch 'hair_immediate_fixes' into gooseberry 2014-10-01 18:33:04 +02:00
7aee4e2997 Improved child hair curling for interpolated child particles.
The curl radius for children in interpolated mode was calculated using
the total offset from the parent particle. This leads to very large
radii when the distance is large due to sparse parents. Such behavior is
also very unrealistic because the curl radius is mostly constant and
defined by the material properties.

All the child hairs are roughly parallel by default. To simulate the
agglomeration of children into hair wisps the "flatness" parameter is
now used to clump them together.
2014-10-01 18:25:17 +02:00
7e2dd7d3e1 Highlighting for manipulator widget.
This should use an "active" system, similar to buttons to detect if last
widget has changed and act accordingly. Currently, when the active
widget changes, there is no change in highlights.
2014-10-01 17:43:33 +02:00
2b7f356442 Tidy up the widget API, only do 3d intersection on widgetmaps that
support it (determined during creation)
2014-10-01 15:37:45 +02:00
8e1208c974 Widget API:
Code that handles 3D object intersection via GPU selection. We might
want to use raycasting here, but leaving that for when we have it.

Manipulator code now uses this API to do intersection testing
2014-10-01 14:59:09 +02:00
4ce4f57acf Refactoring of manipulator code to use selection evaluation and codes
that can be shared with other widgets.
2014-10-01 12:44:17 +02:00
d2e148f2de Cloth solver data for edit mode is unused, removed it. 2014-10-01 11:25:45 +02:00
76dc35fcde Merge branch 'hair_immediate_fixes' into gooseberry 2014-10-01 11:16:04 +02:00
182535b296 Merge branch 'master' into hair_immediate_fixes 2014-10-01 10:06:00 +02:00
18cffd6fbf WIP code reshuffling for widgets 2014-09-30 18:33:23 +02:00
088ff210a9 Manipulator now uses the widget system (no operators used).
Widgets use a similar notification system as operators. It might be
worth using WM_BREAK messages like the rest of the handlers. For now
this should do.
2014-09-29 19:48:38 +02:00
10a3ca0189 Move manipulator handler to the widget system. 2014-09-29 18:51:00 +02:00
60e77c50ee Draw manipulator from widget callback (handling still done separately) 2014-09-29 16:36:08 +02:00
3982f9daf0 Merge branch 'master' into wiggly-widgets 2014-09-29 14:16:19 +02:00
c7ccbc9e75 Fix for scons files missing physics include folder. 2014-09-26 23:38:42 +02:00
07dac94618 Yet another attempt to solve OSX issues, restore sequence sounds too, or
sounds get added to two sequence and file descriptors leak
2014-09-26 19:47:21 +02:00
ebf005e32b Added separate damping for bending springs.
The bend damping factor was hardcoded to the same value as the stiffness.
Now it has its own factor in the settings and button in hair dynamics.
2014-09-26 17:25:21 +02:00
06871e6fbc Minor corrections to the types 2014-09-26 13:57:05 +02:00
ac97720734 New data types for sequencer.
Uses struct hierarchies to reduce the data used per strip.

Also changed sequence -> strip. Might be better to use NSequence for
editing as well.
2014-09-26 12:17:12 +02:00
56719625fc Merge branch 'master' into terrible_consequencer 2014-09-26 10:32:06 +02:00
e239912c06 Set the length threshold for hair simulation to 10% again (from 1%).
With the default 5 substeps the simulation can otherwise still become
unstable. This is just a preliminary measure anyway until the length
variance can be fixed properly.
2014-09-26 10:08:56 +02:00
b89a1a64c5 Fix for outdated root array size when changing the particle amount
during simulation.
2014-09-26 09:33:51 +02:00
408837ed1b Fix for hair chain testing in the cloth modifier.
Bending springs are en-bloc and not interleaved with other springs, so
this can't be used as a test for hair roots. Use consecutive indices
instead.
2014-09-26 09:26:08 +02:00
2682ea830a Completed the implementation of bent rest shapes for hair.
Basically follows the Pixar approach from "Artistic Simulation of Curly
Hair".
2014-09-25 23:19:20 +02:00
0717da3ac5 Gooseberry request: Backdrop for sequencer. 2014-09-25 23:09:38 +02:00
7c83650fb3 Add missing notification for trimming to stop showing the extensions 2014-09-25 18:10:39 +02:00
36607080bd Gooseberry request, hide the extensions except when trimming. 2014-09-25 18:00:00 +02:00
ca7219ddff Get rid of temporary flags when loading the sound. 2014-09-25 16:59:34 +02:00
d366d8e028 Attempt to fix OSX issues (again): cleanup the loading flag for files
that are loading when interrupted.
2014-09-25 16:26:52 +02:00
d0ac4e1c60 Target calculation for local non-straight rest shapes.
This is more involved than using simple straight bending targets
constructed from the neighboring segments, but necessary for restoring
groomed rest shapes.

The targets are defined by parallel-transporting a coordinate frame
along the hair, which smoothly rotates to avoid sudden twisting (Frenet
frame problem). The rest positions of hair vertices defines the target
vectors relative to the frame. In the deformed motion state the frame
is then recalculated and the targets constructed in world/root space.
2014-09-25 15:42:08 +02:00
26a906d53c Have to include BLI_utildefines before BKE_collision now to have bool
defined.
2014-09-25 11:03:31 +02:00
6dcc3f0b91 change widget code, area now just stores a pointer to the widget list
corresponidng to it.
2014-09-24 19:09:07 +02:00
5dfb07ab43 Merge branch 'master' into hair_immediate_fixes
Conflicts:
	source/blender/blenkernel/intern/implicit.c
2014-09-24 19:02:58 +02:00
2bb6d18f41 Merge branch 'master' into wiggly-widgets 2014-09-24 18:30:56 +02:00
467da3ce16 Store the waveforms between undo steps when they exist. 2014-09-24 17:03:35 +02:00
0684d0fe9f Fix compilation in MacOSX 2014-09-24 16:28:50 +02:00
8e95eae192 More undo issue solving.
This commit moves sound loading out of library linking. The approach
chosen here is to do lazy initialization by basically validating the
sound before attaching to the scene.

Loading the sound buffer requires a valid Main pointer, which means we
have to pass this around in many places. We might also consider caching
the waveforms in this way too, but for now we're still using the
threaded update.

We'll have to test this somewhat to see if it behaves well..There are
corner cases which might not be covered. Sounds are muted if we undo
during an animation, but this bug existed in master as well.
2014-09-24 16:21:49 +02:00
aebcb6a860 Merge branch 'master' into terrible_consequencer 2014-09-24 10:23:37 +02:00
c95c25e29e Merge branch 'master' into hair_immediate_fixes
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2014-09-24 10:05:04 +02:00
f3f741b3a4 Clear forces and constraints together at the start of the time step,
easier to verify.
2014-09-24 08:55:29 +02:00
9aa7fcd588 Threaded sound strip display data loading.
Sound loading can take too much so move it to a job and continue. This makes
interaction much better. A similar system should be usable for movie previews.
2014-09-23 17:37:19 +02:00
2788b38e38 Fix for missing initialization of local cloth modifier inside particle
systems.
2014-09-22 21:20:22 +02:00
ee323fc61d Proper implementation of angular bending springs including jacobian
derivatives for stabilization.

The bending forces are based on a simplified torsion model where each
neighboring point of a vertex creates a force toward a local goal. This
can be extended later by defining the goals in a local curve frame, so
that natural hair shapes other than perfectly straight hair are
supported.

Calculating the jacobians for the bending forces analytically proved
quite difficult and doesn't work yet, so the fallback method for now
is a straightforward finite difference method. This works very well and
is not too costly. Even the original paper ("Artistic Simulation of
Curly Hair") suggests this approach.
2014-09-22 19:27:41 +02:00
bf996074bb Gooseberry request, option to turn all waveform display on/off. 2014-09-22 15:29:22 +02:00
c4b6d60af3 Attempt to fix shader compilation in OSX. strict compilation does not
allow dividing float by integer.
2014-09-22 14:20:30 +02:00
f0fb58afe3 Unused function declaration. 2014-09-21 11:48:27 +02:00
caf81de33c Basic solver result feedback from the mass-spring (cloth/hair) solver.
This returns a general status (success/no-convergence/other) along with
basic statistics (min/max/average) for the error value and the number
of iterations. It allows some general estimation of the simulation
quality and detection of critical settings that could become a problem.
Better visualization and extended feedback can follow later.
2014-09-20 21:05:46 +02:00
9b1f109c89 Hack to make undo/redo faster in sequencer when using strips with
waveform display.

Basically, we store the waveform. This is not really recommended but
until we have nice threaded creation for the strips that doesn't block
the interface it's a nice solution for gooseverry.

May be wise to limit the undo memory for people who use that because
basically each operation will store a copy of the waveform in the file.
2014-09-19 19:51:01 +02:00
0f62717edb Merge branch 'master' into terrible_consequencer 2014-09-19 19:15:35 +02:00
1760d7566a Calculate bending targets based on the direction of previous segments.
This makes the bending a truely local effect. Eventually target
directions should be based in a local coordinate frame that gets
parallel transported along the curve. This will allow non-straight
rest shapes for hairs as well as supporting twist forces. However,
calculating locally transformed spring forces is more complicated.
2014-09-19 16:53:35 +02:00
1cd9800f3c Simple debug drawing support inside the implicit solver. 2014-09-19 16:52:49 +02:00
f0cf10b3b9 Widgets API.
This commit has first WIP code for widgets API.
Generally widgets should be registered similar to dropboxes, that is,
any code can query for a widgetmap for a certain space and area type
and the window manager will take care of initializing the handlers
automatically.

The owner will be able remove and readd widgets to a certain widgetmap
dynamically. Generally owners should cleanup their widgets though initial code
cleans up leftover widgets automatically.

All this is the theory still, some parts are in that commit, more to come
later, but it's a solid base to build from for an initial commit.
2014-09-19 13:07:01 +02:00
eb38d27b33 Added a damping term for angular bending springs. 2014-09-19 11:51:35 +02:00
1e8f11c473 Simple initial implementation of angular bending springs.
These are much better suited for creating stiff hair. The previous
bending springs are based on "push" type spring along the hypothenuse
of 3 hair vertices. This sort of spring requires a very large force
in the direction of the spring for any angular effect, and is still
unstable in the equilibrium.

The new bending spring model is based on "target" vectors defined in a
local hair frame, which generates a force perpendicular to the hair
segment. For further details see
"Artistic Simulation of Curly Hair" (Pixar technical memo #12-03a)
or
"A Mass Spring Model for Hair Simulation" (Selle, Lentine, Fedkiw 2008)

Currently the implementation uses a single root frame that is not yet
propagated along the hair, so the resulting rest shape is not very
natural. Also damping and derivatives are still missing.
2014-09-19 11:15:16 +02:00
33cee269da Custom color for SSAO 2014-09-18 21:40:45 +02:00
ce9fb0e997 Do not calculate SSAO on the background. Saves cycles on pixel shaders
as well as solves issue with SSAO artifacts around grids.
2014-09-18 21:20:46 +02:00
0416edaa6a Replace the dynamic root transform in the implicit solver data with a
single transform matrix.

Dynamic properties of the transformation are only needed during the
setup phase when they should be read from external data (hair system
roots) and generate fictitious forces on each point.
2014-09-18 19:42:20 +02:00
6b94a91827 More scons fixes for physics lib. 2014-09-18 11:27:34 +02:00
af484ae58e Merge branch 'master' into hair_immediate_fixes 2014-09-18 11:04:05 +02:00
2ed8ff0f02 Fixed scons build files for new physics subfolder. 2014-09-18 10:35:26 +02:00
3b4dd79db9 Disabled the velocity filtering feature for now, since the weighting is
incorrect.

The voxel grid needs better tool support to make it usable, so fixing
the filtering is not high priority right now.
2014-09-18 09:24:31 +02:00
41a71918bb Added basic filtering feature for velocity smoothing.
This is part of the original method from "Volumetric Methods for
Simulation and Rendering of Hair". The current filter is a simple box
filter. Other energy-preserving filters such as gaussian filtering
can be implemented later.

The filter size is currently given as a cell count. This is not ideal,
rather it should use a geometrical length value, but this is too
abstract for proper artistical use. Eventually defining the whole grid
in terms of spatial size might work better (possibly using an external
object).
2014-09-18 09:06:25 +02:00
dc1e92f16d Made the voxel grid size for hair interaction configurable and increased
the default to 32.
2014-09-17 14:21:06 +02:00
7334e9de91 Reduced the length threshold for disabling short hairs from 0.1 to 0.01. 2014-09-17 13:49:10 +02:00
b963bddd01 Fix for rB71271bb, was replacing the force vectors entirely instead of
adding.
2014-09-17 11:34:39 +02:00
71271bb0c7 Fix for effector force fields on hair, using the world-to-root
transformation.
2014-09-17 11:01:23 +02:00
ea6c0355f6 Add weak repulsion forces to hair collision response to keep the hair
at a the margin distance ("outer" softbody margin).

This has to be clamped arbitrarily unfortunately, otherwise the
repulsion force can add too much energy into the system. A factor of
4 * restitution impulse seems to give good results for now, this can
be refined later on if necessary.
2014-09-17 10:11:03 +02:00
81a3a364b5 fix issue with scons 2014-09-16 23:56:45 +02:00
7d3ddcac28 Added back the velocity smoothing implementation.
This is now also decoupled from the internal solver data. The grid is
created as an opaque structure, filled with vertex or collider data
(todo), and then forces can be calculated by interpolating the grid at
random locations. These forces and derivatives are then fed into the
solver.
2014-09-16 20:44:25 +02:00
c56cf0b887 WIP, beginning of renderer system that should take care of sorting
materials properly for rendering.

-Need to check aspect system first before going too much into this-
2014-09-16 19:07:56 +02:00
827ad6075d Hook up flags to request a specific sorting scheme from GPU buffer setup
routines. (still inactive
)
2014-09-16 18:30:38 +02:00
1e65bf5824 Fix for Sintel hair bug.
The hair solver needs sane input to converge within reasonable time
steps. In particular the spring lengths must not be too difference
(factor 0.01..100 or so max, this is comparable to rigid body simulation
of vastly different masses, which is also unstable).

The basic hair system generate strands with equally spaced points, which
is good solver material. However, the hair edit operators, specifically
the cutting tool, can move points along the strands, creating tightly
packed hair points. This puts the solver under enormous stress and
causes the "explosions" observed already during the Sintel project.

The simple solution for now is to exclude very short hairs from the
simulation. Later the cutting tool should be modified such that it
keeps the segments roughly at the same length and throws away vertices
when the hair gets too short (same goes for the extension tool).

The hair system should have a general mechanism for making sure that
situations such as this don't occur. This will have to be a design
consideration for replacements in any future hair system.
2014-09-16 14:36:56 +02:00
d1ed35480e Fix issue with sculpting and SSAO.
We need to enable stenciling on the compositing FBO or we can clear
areas we don't want to clear and cause invalid depth values.
2014-09-16 14:09:21 +02:00
829addcff0 Restore texture coordinates properly 2014-09-16 11:25:05 +02:00
313b568f92 Merge branch 'master' into viewport_experiments 2014-09-16 10:26:34 +02:00
3a0d276c55 Fix for flickering, recreate the framebuffer textures in that case
(looks like it's the only way to have matching per pixel results too)
2014-09-15 20:32:49 +02:00
acdaf71bbe Move GPU compositing to its own file.
Also avoid recreating the framebuffers and gpu/color textures each
frame.

Happiness :)

There are still some glithes when scaling the areas, I'll look at those
next.
2014-09-15 20:06:34 +02:00
fd388925c7 Minor fix when gravity code is disabled. 2014-09-15 17:41:53 +02:00
21f43fb13c SSAO
* Expose attenuation value - allows to change influence of far objects
* Change influence of far objects to quadratic, eliminates some extreme
fringing from far occluding surfaces.
2014-09-15 16:55:05 +02:00
2632c1308f SSAO shader.
This works by using the calculated view space normal and accumulating
coverage of a certain area by nearby pixels. There are two sliders to
control the effect:

* Scale controls the area around each pixel that the shader "collides"
against
* Darkening scales the occlusion effect.

The effect works, but due to the way the normals are calculated, the
normals are never smooth shaded (that would require a separate render
target to store them) and the edges or polygons can be too apparent.
This is not really fixable at the moment unless we move to deferred
pipeline.

The FX system is stll not well optimized and rendering does not always
work correctly, but it's good to have this out for people to play with.
2014-09-15 16:12:01 +02:00
624c99523e Removed unused code. 2014-09-15 14:22:36 +02:00
28f173b3e7 Added a calculation function for the fictitious forces introduced by
moving hair root reference frames.

This calculates Euler, Coriolis and Centrifugal forces which result
from describing hair in a moving reference frame.
http://en.wikipedia.org/wiki/Fictitious_force
2014-09-15 14:18:40 +02:00
e2e49b9a11 Fix for own misconception of fictitious forces in the moving hair root
frames.

These forces don't have to be calculated for each individual
contribution. Rather they can be split off and be calculated on top of
the basic force vector rotation (todo).
2014-09-15 12:51:18 +02:00
68275a412d Added back spring force definitions outside the implicit solver.
There are currently 3 types of springs: basic linear springs, goal
springs toward a fixed global target (not recommended, but works) and
bending springs.

These are agnostic to the specific spring definition in the cloth system
so hair systems can use the same API without converting everything to
cloth first.
2014-09-15 12:10:49 +02:00
ffb8b18074 Main cloth force calculation function outside of implicit core code.
Still misses spring forces.
2014-09-14 19:36:33 +02:00
6288a2d928 Hair volume calculation is now in its own file.
Code is currently disabled until the other main forces are in place.
2014-09-14 18:08:14 +02:00
5f0436838f Moved the unused goal force calculation function to the main mass-spring
source file.
2014-09-14 17:47:22 +02:00
d0337e0098 Moved most of the main cloth solver function out of implicit code core.
Force calculation is disabled, will follow shortly.
2014-09-14 17:36:53 +02:00
c5cb46fb27 Moved init/free functions for solver data out of implicit core.
This also initializes spring matrix indices (off-diagonal 3x3 blocks),
which now uses a new API function.
2014-09-14 14:16:03 +02:00
4da2c8498f Moved "set_positions" for cloth out of core implicit solver.
API for the solver now has functions for setting of vertex motion state
and the associated root transform data.
2014-09-14 13:23:14 +02:00
fe135d3550 Renamed functions to make them explicitly refer to cloth, and split the
create/free functions for solver data off from the cloth solver.
2014-09-13 18:45:58 +02:00
6978d15595 Moved the cloth solver code into a new subfolder/library inside Blender
code.

The implicit solver itself should remain agnostic to the specifics of
the Blender data (cloth vs. hair). This way we could avoid the bloated
data conversion chain from particles/hair to derived mesh to cloth
modifier to implicit solver data and back. Every step in this chain adds
overhead as well as rounding errors and a possibility for bugs, not to
speak of making the code horribly complicated.

The new subfolder is named "physics" since it should be the start of a
somewhat "unified" physics systems combining all the various solvers in
the same place and managing things like synchronized time steps.
2014-09-13 14:36:46 +02:00
33722d4011 Greatly improved normal calculation using view space position
derivatives.
2014-09-12 19:56:56 +02:00
9e2efd68e1 Framebuffer FX.
This commit introduces offscreen rendering for the 3D viewport.
There is test code that calculates depth and normal data
in screen space.

Currently just DOF is supported with a few parameters to control the
effect

This code recreates the framebuffer and texture objects every frame
which will make it -slow-. Use at your own risk.
2014-09-12 18:04:55 +02:00
1ecdfe22a6 Desperate attempt to get stable collisions: Disable restitution and
handle only one collision contact at a time.

Collision still randomly explodes, even with differing results on the
same file. This could indicate a threading issue, possibly also related
to the dependency graph since multiple objects are involved in
collisions.
2014-09-12 16:46:47 +02:00
9bae16453c Revert "Ignore velocity changes when the cloth solver does not converge."
This reverts commit c52b8ae818.

Sadly, at this point solver convergence is an exception rather than the
rule... Individual hairs can "explode" easily and thus disable the whole
simulation, which isn't helpful either.
2014-09-12 15:48:59 +02:00
c52b8ae818 Ignore velocity changes when the cloth solver does not converge.
This helps keep the simulation stable as long as there are only a few
substeps that become too constrained for the solver.

Eventually we need better feedback about these solver results, so that
artists can tweak situations specifically to resolve bad solver results.
This is somewhat similar to the camera tracker, which also can run into
cases that cannot be resolved and have to be fixed manually.
2014-09-12 15:02:37 +02:00
73235b3c61 Moved collision response into the main cloth sim source file and fixed
some coordinate transform issues.

Collision response should be regarded as part of the dynamics system
instead of the basic collision detection.
2014-09-12 14:34:14 +02:00
fcdcb8c818 Correction for inverse constraint matrix rotation. 2014-09-12 12:37:49 +02:00
9959cce4b6 Transform the constraint matrix and target solver vector z according to
the root frame transforms as well.

This ensures the hair constraints are actually in root space and applied
correctly by the solver.
2014-09-12 12:30:13 +02:00
efd1414d90 Use identity transform in the solver data roots to avoid possible errors
when this data is used outside the transform functions.
2014-09-12 12:28:56 +02:00
4ef085fe99 Option for disabling the root frame transformation altogether, mostly
for testing.
2014-09-12 11:22:39 +02:00
7d21e08de6 Ported root frame transformation to the old cloth solver. 2014-09-12 10:26:43 +02:00
8808289236 Switched back to the old solver for the time being.
The Eigen solver is not quite stable currently (possibly due to
incorrect porting of force calculations). It also still lacks threading
support and optimized matrix construction, making it slower in
comparison. Eventually would still like to switch, but fixing these
issues takes time.
2014-09-12 10:21:31 +02:00
26e8ebf5e2 Implemented gradient transformation for forces in the root frame (dFdX,
dFdV).
2014-09-12 10:19:41 +02:00
5e35f07ad1 Removed unused variable. 2014-09-11 18:32:26 +02:00
5ba680aa4e First stage of implementing moving frames of reference for hair/cloth.
This adds transformations for each hair from world to "root space".
Currently positions and velocities are simply transformed for the solver
data and inverse-transformed when copying the results back to the cloth
data. This way the hair movement becomes independent from the movement
of the emitter object. Eventually the "fictitious" forces originating
from emitter movement can be added back in a controlled way.

http://en.wikipedia.org/wiki/Fictitious_force

Ignoring these fictitious forces or scaling their effect is physically
correct, because in the absence of external forces the hair will always
return to rest position in this root frame.

External forces currently are not yet transformed into the root space.
2014-09-11 17:53:25 +02:00
330f5f1395 Disable some debugging options in Eigen to make it more usable in Debug
mode.

Eigen can become very slow in debug mode, which is a bit of a problem.
It relies heavily on compiler optimizations to remove function calls
etc. More optimizations may be desirable, possibly putting the implicit
solver into its own little library and enabling optimizations in debug
mode there could help.
2014-09-11 17:49:26 +02:00
6cd7d8f0ec Added new data in the cloth modifier for hair root information.
This will allow us to implement moving reference frames for hair and
make "fictitious" forces optional, aiding in creating stable and
controllable hair systems.

Adding data in this place is a nasty hack, but it's too difficult to
encode as a DM data layer and the whole cloth modifier/DM intermediate
data copying for hair should be removed anyway.
2014-09-11 14:19:52 +02:00
f503262eef Cleanup, removed unused old code. 2014-09-11 14:15:00 +02:00
a56baae7ce Optimized matrix filling using the Eigen triplets method.
Otherwise the construction of matrices becomes very slow for larger
vertex counts because adding a new element is O(n), making it O(n^2) in
total.
2014-09-11 11:14:11 +02:00
1f383436c7 Added back external effector forces for the cloth solver. 2014-09-10 23:11:56 +02:00
cbe66e6d82 Reenabled goal springs and removed the arbitrary structural scaling
factor.
2014-09-10 21:06:01 +02:00
ccf98b9faa Fixed bending forces for cloth springs. 2014-09-10 19:14:38 +02:00
0066cd1671 Correctly implemented and verified gravity, drag, structural springs. 2014-09-10 18:55:15 +02:00
e308e99208 Minor fix in debug print, so solver prints can be diff'ed. 2014-09-10 17:10:14 +02:00
b6f3db98c0 A couple of defines to disable various influences on the cloth sim for
debugging.
2014-09-10 16:59:22 +02:00
f235da9b53 Debug printing code for large sparse vectors and matrices, to compare
solver input/output of the old and new methods.
2014-09-10 16:04:31 +02:00
3871ec3d59 Added a new internal header for implicit solver defines.
Should become its own intern wrapper library eventually.
2014-09-10 14:30:55 +02:00
0335d92d84 Reenabled air drag force for cloth sim. 2014-09-09 12:36:49 +02:00
dfba467861 Arbitrary scaling factor for the structural spring forces (stretching).
This is not nice at all, but for some reason (possibly time scale) the
old force values are much too high and cause the solver to become
unstable. These will be revisited later anyway, so for now such scaling
should be fine.
2014-09-09 12:01:10 +02:00
4b9771a7cb Switched to the modified CG method that supports constraints, and
added back structural stretch springs.
2014-09-08 19:03:39 +02:00
084c6de309 Implemented a modifier conjugate gradient algorithm to support stable
constraining.

The algorithm is described in the paper "Large Steps in Cloth Simulation"
(Baraff/Witkin 1998). The same method was (incorrectly) implemented in
the old cloth solver.

It is based on restricting the degrees of freedom (ndof) of vertices
using a block matrix and a vector of target velocity deltas.
See chapter 5 of the paper for details.
2014-09-08 12:31:53 +02:00
e189fc0eeb Reimplemented Goal springs for the Eigen CG solver method.
Note that goal springs currently are really bad ... They have a factor
on hairs that "fades" goal influence from the root to the tip. The last
point on the hair is completely free, which makes the goal springs
pretty much useless on their own without supporting bend stiffness.
Can only assume this was added to compensate unphysical behavior of
goal springs when using uniform weight, but it's a poor replacement for
true localized bending forces ...
2014-09-05 17:07:30 +02:00
4535a9d926 To make gravity a true force vector, multiply by the mass. 2014-09-05 13:02:20 +02:00
854600aeed Alternative new solver for cloth using the Eigen CG solver instead of
a custom built solver.

The old cloth solver is broken unfortunately. Eigen is a designated
linear algebra library and very likely their implementation is a lot
better (can't compare until it's implemented though).

Only basic gravity is active atm, spring forces, external force fields,
damping and volumetric friction have to be added back by converting
the data into the Eigen format.
2014-09-05 12:48:49 +02:00
f3be91c2d8 Don't try to enforce a velocity change for pinned vertices; their
velocity is defined externally by hair root motion.
2014-09-04 19:58:17 +02:00
c4e00b15c7 Use squareroot of the current epsilon error target for CG, since we
square this value anyway.
2014-09-04 19:57:21 +02:00
f5efcfd3a7 WIP for overlay under sequencer strip view. 2014-09-04 19:51:17 +02:00
21e141406f Fix cancelling trim not refreshing the view 2014-09-04 17:43:55 +02:00
603392e587 Allow trimming scenes as well. 2014-09-04 15:51:55 +02:00
b39b70a615 Trim tool
* Support slow trimming with shift
* Give feedback on how many frames the input was trimmed
2014-09-04 15:36:41 +02:00
d2ece0d29b Disabled collision culling on the inside of the collider faces for now,
this seems to remove too many contact points somehow ...
2014-09-04 15:06:15 +02:00
6346a50405 Fix for collision response, the impulse response was far too small. 2014-09-04 15:05:12 +02:00
9faf2408fb Use the S matrix of the modifier CG algorithm for implementing collision
responses.

The S matrix together with the z Vector encodes the degrees of freedom
of a colliding hair point and the target velocity change. In a collision
the hair vertex is restricted in the normal direction (when moving
toward the collider) and the collision dynamics define target velocity.
2014-09-04 14:22:22 +02:00
010a52ff3c Better contact point near-test for hair.
This simply uses the position above the triangle instead of the
intersection point of the vertex path. The other method was broken
anyway, but also has a problem catching all the contacts reliably. The
new method might have a few false positives but that is acceptable.
2014-09-04 14:19:05 +02:00
ecf25938d0 Force refresh when trimming. 2014-09-04 12:55:24 +02:00
3d64c3530b Trim operator, accessible through T key, also in Strip menu. It moves
the contents of the strip around.

Only tested with movie strips now, metastrips won't work. Also there
might be some lingering bugs. Sonetimes refresh is needed to get
contents showing up correctly.
2014-09-04 12:50:17 +02:00
43b115ff1a Fixed for hair collision detection, old/new positions were swapped. 2014-09-04 10:34:32 +02:00
dd4504e895 Reduced minimum for cloth solver substeps to 1.
This is not very useful for artists, but helps with debugging.
2014-09-04 09:45:45 +02:00
5efd4b5552 Removed own debug print. 2014-09-04 09:32:01 +02:00
302d912732 Added a comment and use the new CG solver as the "official" version now. 2014-09-04 09:26:40 +02:00
4599123f8f Fixed implementation of the Conjugate Gradient method for the cloth
solver that properly supports constraints with some degrees-of-freedom.

The previous solver implementation only used the S matrix (constraint
filter matrix) for pinning vertices, in which case all elements are
zero and the error doesn't show up. With partial constraints (useful for
collision contacts) the matrix has non-zero off-diagonal elements and
the algorithm easily diverges.

There are also initial steps for implementing collision prevention as
described in the Baraff/Witkin paper "Large Steps in Cloth Simulation"
(http://www.cs.cmu.edu/~baraff/papers/sig98.pdf).
2014-09-03 23:49:24 +02:00
92bda4dd6b Hair collision: Use the S matrix for enforcing contact constraints.
This is a first test, the contacts are very explosive atm because they
basically pin hair vertices globally on collision, which leads to
stretching of the springs which is then suddenly released in the next
frame.
2014-09-03 17:12:17 +02:00
458fcfd4c4 Minor corrections:
* Add some comments to better describe what some numbers mean
* Fix cuddliness and parent position of strips
2014-09-03 16:47:31 +02:00
0796c1005e Preparation for collision code fixing.
Instead of handling contact tests and collision response in the same
function in collision.c, first generate contact points and return them
as a list, then free at the end of the stepping function. This way the
contact response can be integrated into the conjugate gradient method
properly instead of using the hackish and unstable double evaluation
that is currently used.
2014-09-03 15:44:03 +02:00
cfea750197 Cleanup: added some comments to the members of Implicit_Data. 2014-09-03 13:43:37 +02:00
509d516517 Merge branch 'master' into terrible_consequencer 2014-09-03 12:27:53 +02:00
087727366c Cleanup: No point in passing all the implicit solver arguments
individually.
2014-09-03 11:45:20 +02:00
570eb7f69b Cleanup: removed the unused olddV vectors from implicit solver data. 2014-09-03 11:34:40 +02:00
e167f9c9aa Revert "Gooseberry feature request, allow select left-right strips
operator to select all"

This change has been in master all the time after all, exposed the
operation better in master.

This reverts commit 799f974668.
2014-09-03 11:21:20 +02:00
3eed8933bd Some more debug elements for hair collisions. 2014-09-03 11:20:32 +02:00
b3a28d8334 Extended line/face collision near-check, to allow for distance margins.
The original BLI method for line/triangle intersection returns false
in case the line does not actually intersect, but in order to generate
repulsion forces we need to also handle contacts inside the margin.
2014-09-03 11:17:24 +02:00
799f974668 Gooseberry feature request, allow select left-right strips operator to
select all strips independently of channel of the active strip.
2014-09-02 19:23:56 +02:00
60a17cca27 Fix crash when setting parent. 2014-09-02 18:20:10 +02:00
cb1730d180 Merge branch 'master' into terrible_consequencer 2014-09-02 18:03:39 +02:00
7c0be7b2b1 Fix bounce/repulse calculation. 2014-09-02 15:03:15 +02:00
b23828f37f Hair debugging: use "categories" (strings) for grouping debug elements
and support clearing for categories.
2014-09-02 14:10:28 +02:00
5c1d565170 Fix for hair collision detection: need to use the second point of the
timestep segment.

This ensures the distance for a collision pair is the one of the current
point position, and the response gets calculated accordingly.
2014-09-02 12:49:55 +02:00
268d356fe2 Use repulsion forces in combination with the one-time penalty forces
in collision.
2014-09-01 18:49:53 +02:00
54832f1a19 Fix for crash when going into particle edit mode with baked hair
simulation.

Note that this currently generates an extreme amount of points, by
making a edit pathcache curve for each hair in every frame! But at least
doesn't simply crash now.
2014-09-01 18:47:27 +02:00
22245d0e04 Clear debug_data pointer in local cloth modifier data of the particle
systems on blend file load.
2014-09-01 18:46:32 +02:00
3a77ea644e Partial response force for hair collisions.
This implements a penalty force as well as a repulsion force to avoid
further penetration, as suggested in
"Simulating Complex Hair with Robust Collision Handling"
(http://graphics.snu.ac.kr/publications/2005-choe-HairSim/Choe_2005_SCA.pdf)

Friction forces are still missing. More problematic is handling of
moving colliders, when face swap places with the hair vertex and a
collision is missed, putting the vertex inside the mesh volume. Larger
margins might help, but ultimately using Bullet collision detection is
probably more reliable and failsafe.
2014-09-01 17:46:17 +02:00
1cce769d9a Merge branch 'master' into terrible_consequencer 2014-09-01 15:51:49 +02:00
670ee4c105 Debug drawing for simulations, to aid in visualizing abstract data such
as forces, velocities, contact points etc.

This uses a hash table to store debug elements (dots, lines, vectors at
this point). The hash table allows continuous display of elements that
are generated only in certain time steps, e.g. contact points, while
avoiding massive memory allocation. In any case, this system is really
a development feature, but very helpful in finding issues with the
internal solver data.
2014-08-30 17:54:36 +02:00
881e2f879a Some initial collision code, without actual response forces still.
This is still using the old BVH tree collision methods to generate
contact points, similar to what cloth does. This should be replaced
by a Bullet collision check, but generating contacts in this way is
easier for now, and lets us test responses and stability (although in
more complex collision cases the BVH method fails utterly, beside being
terribly inefficient with many colliders).
2014-08-30 15:23:40 +02:00
69f6ca664e Merge branch 'master' into hair_immediate_fixes 2014-08-29 17:06:21 +02:00
42a02c61e8 Implemented internal hair pressure to prevent hair from collapsing in
on itself.

This uses the same voxel structure as the hair smoothing algorithm.
A slightly different method was suggested in the original paper
(Volumetric Methods for Simulation and Rendering of Hair), but this is
based on directing hair based on a target density, which is another
way of implementing global goals. Our own approach is to define a
pressure threshold above which the hair is repelled in the density
gradient direction to simulate internal pressure from collisions.
2014-08-28 14:55:55 +02:00
e7e21950e7 Fixed hair velocity smoothing.
This is an important hair interaction feature that simulates friction
between hairs in an efficient way. The method is based on the paper
"Volumetric Methods for Simulation and Rendering of Hair"
( http://graphics.pixar.com/library/Hair/paper.pdf )

It was partially implemented already, but didn't work in this simplified
version. The same voxel structure can be used for implemeting repelling
forces on hair based on density, which can help a hair system maintain
volume instead of collapsing in on itself.
2014-08-27 18:12:51 +02:00
bd1c73636e Support for various data properties of the hair grid in the voxel
texture.
2014-08-27 14:11:49 +02:00
93d8e94598 Fixed voxel grid initialization from hair points and colliders by using
the suggested tent function from the original paper.

Plain float->int conversion for the grid location otherwise leads to
skewed data and unnecessary loss of information.
2014-08-27 12:33:39 +02:00
5d87f52a7a New voxel texture mode "Hair", for displaying the internal hair volume
structure as a texture.

This is mostly a debugging feature that may be removed again later.
2014-08-27 12:33:39 +02:00
a5be383c69 Code cleanup: Use a variable-sized array for the hair volume velocity
smoothing and collision code, split into multiple functions.
2014-08-27 12:33:39 +02:00
ab4da07b76 Add simple code to add (ctrl-P) and display parents. (WIP)
This is not a serious attempt though and possibly a good solution should
go through a dependency graph. Also there are some crashes on undo.
2014-08-15 16:58:30 +02:00
cb5b088410 Merge branch 'master' into terrible_consequencer 2014-08-13 20:48:33 +02:00
8ecb39a555 Fix cuddly strips shading and drawing issues. Also now there are no
issues on big zooms (they behave really cuddly)
2014-08-05 16:32:21 +02:00
ff66e9f929 Cuddlification of strips complete. Still need to make corners shrink on big zoom 2014-08-05 12:34:36 +02:00
4af1346a80 Strip drawing : Remove handle square, triangle is enough indicator here.
Also add cuddly outline
2014-08-04 22:47:42 +02:00
4145 changed files with 220867 additions and 336133 deletions

1
.gitignore vendored
View File

@@ -22,7 +22,6 @@ Desktop.ini
# commonly used paths in blender
/blender.bin
/user-config.py
/BUILD_NOTES.txt
# local patches
/*.patch

6
.gitmodules vendored
View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -43,11 +43,6 @@ ifndef BUILD_DIR
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
endif
# Allow to use alternative binary (pypy3, etc)
ifndef PYTHON
PYTHON:=python3
endif
# -----------------------------------------------------------------------------
# additional targets for the build configuration
@@ -81,20 +76,18 @@ endif
# -----------------------------------------------------------------------------
# Get the number of cores for threaded build
ifndef NPROCS
NPROCS:=1
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifeq ($(OS), Darwin)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), FreeBSD)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), NetBSD)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
NPROCS:=1
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifeq ($(OS), Darwin)
NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f3)
endif
ifeq ($(OS), FreeBSD)
NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f2 )
endif
ifeq ($(OS), NetBSD)
NPROCS:=$(shell sysctl -a | grep "hw.ncpu" | cut -d" " -f2 )
endif
@@ -120,23 +113,23 @@ endif
# -----------------------------------------------------------------------------
# Build Blender
all: .FORCE
all: FORCE
@echo
@echo Configuring Blender in \"$(BUILD_DIR)\" ...
@echo Configuring Blender ...
# # if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
# # $(CMAKE_CONFIG); \
# # fi
# if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
# $(CMAKE_CONFIG); \
# fi
# # do this always incase of failed initial build, could be smarter here...
@$(CMAKE_CONFIG)
# do this always incase of failed initial build, could be smarter here...
$(CMAKE_CONFIG)
@echo
@echo Building Blender ...
$(MAKE) -C "$(BUILD_DIR)" -s -j $(NPROCS) install
@echo
@echo edit build configuration with: "$(BUILD_DIR)/CMakeCache.txt" run make again to rebuild.
@echo Blender successfully built, run from: "$(BUILD_DIR)/bin/blender"
@echo blender installed, run from: "$(BUILD_DIR)/bin/blender"
@echo
debug: all
@@ -149,13 +142,13 @@ bpy: all
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
config: .FORCE
config: FORCE
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Help for build targets
help: .FORCE
help: FORCE
@echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
@echo " * debug - build a debug binary"
@@ -182,20 +175,14 @@ help: .FORCE
@echo " * package_archive - build an archive package"
@echo ""
@echo "Testing Targets (not associated with building blender)"
@echo " * test - run ctest, currently tests import/export,"
@echo " operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker"
@echo " which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8"
@echo " which are tagged to use the stricter formatting"
@echo " * test - run ctest, currently tests import/export, operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8 which are tagged to use the stricter formatting"
@echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed"
@echo " * test_style_c - checks C/C++ conforms with blenders style guide:"
@echo " http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_c - checks C/C++ conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_c_qtc - same as test_style but outputs QtCreator tasks format"
@echo " * test_style_osl - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_osl - checks OpenShadingLanguage conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo " * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo ""
@echo "Static Source Code Checking (not associated with building blender)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
@@ -214,12 +201,6 @@ help: .FORCE
@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."
@echo " * BUILD_DIR - override default build path."
@echo " * PYTHON - use this for the Python command (used for checking tools)."
@echo " * NPROCS - number of processes to use building (auto-detect when omitted)."
@echo ""
@echo "Documentation Targets (not associated with building blender)"
@echo " * doc_py - generate sphinx python api docs"
@echo " * doc_doxy - generate doxygen C/C++ docs"
@@ -229,18 +210,17 @@ help: .FORCE
@echo "Information"
@echo " * help - this help message"
@echo " * help_features - show a list of optional features when building"
@echo ""
# -----------------------------------------------------------------------------
# Packages
#
package_debian: .FORCE
package_debian: FORCE
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman: .FORCE
package_pacman: FORCE
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg
package_archive: .FORCE
package_archive: FORCE
make -C "$(BUILD_DIR)" -s package_archive
@echo archive in "$(BUILD_DIR)/release"
@@ -248,35 +228,35 @@ package_archive: .FORCE
# -----------------------------------------------------------------------------
# Tests
#
test: .FORCE
test: FORCE
cd $(BUILD_DIR) ; ctest . --output-on-failure
# run pep8 check check on scripts we distribute.
test_pep8: .FORCE
$(PYTHON) tests/python/pep8.py > test_pep8.log 2>&1
test_pep8: FORCE
python3 tests/python/pep8.py > test_pep8.log 2>&1
@echo "written: test_pep8.log"
# run some checks on our cmakefiles.
test_cmake: .FORCE
$(PYTHON) build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
test_cmake: FORCE
python3 build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
@echo "written: test_cmake_consistency.log"
# run deprecation tests, see if we have anything to remove.
test_deprecated: .FORCE
$(PYTHON) tests/check_deprecated.py
test_deprecated: FORCE
python3 tests/check_deprecated.py
test_style_c: .FORCE
test_style_c: FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
--no-length-check
test_style_c_qtc: .FORCE
test_style_c_qtc: FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
@@ -286,18 +266,18 @@ test_style_c_qtc: .FORCE
@echo "written: test_style.tasks"
test_style_osl: .FORCE
test_style_osl: FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl"
test_style_osl_qtc: .FORCE
test_style_osl_qtc: FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl" \
@@ -309,13 +289,13 @@ test_style_osl_qtc: .FORCE
# Project Files
#
project_qtcreator: .FORCE
$(PYTHON) build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_qtcreator: FORCE
python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_netbeans: .FORCE
$(PYTHON) build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
project_netbeans: FORCE
python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
project_eclipse: .FORCE
project_eclipse: FORCE
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
@@ -323,51 +303,51 @@ project_eclipse: .FORCE
# Static Checking
#
check_cppcheck: .FORCE
check_cppcheck: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt"
check_clang_array: .FORCE
check_clang_array: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint: .FORCE
check_splint: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse: .FORCE
check_sparse: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch: .FORCE
check_smatch: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_spelling_py: .FORCE
check_spelling_py: FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/release/scripts"
check_spelling_c: .FORCE
check_spelling_c: FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
check_spelling_c_qtc: .FORCE
check_spelling_c_qtc: FORCE
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \
@@ -376,13 +356,13 @@ check_spelling_c_qtc: .FORCE
> \
"$(BLENDER_DIR)/check_spelling_c.tasks"
check_spelling_osl: .FORCE
check_spelling_osl: FORCE
cd "$(BUILD_DIR)" ;\
PYTHONIOENCODING=utf_8 $(PYTHON) \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions: .FORCE
check_descriptions: FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python \
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
@@ -390,14 +370,14 @@ check_descriptions: .FORCE
# Utilities
#
tgz: .FORCE
tgz: FORCE
./build_files/utils/build_tgz.sh
icons: .FORCE
icons: FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
update: .FORCE
update: FORCE
if [ -d "../lib" ]; then \
svn update ../lib/* ; \
fi
@@ -410,26 +390,24 @@ update: .FORCE
#
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: .FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
doc_py: FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
doc_doxy: .FORCE
doc_doxy: FORCE
cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna: .FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup \
--python doc/blender_file_format/BlendFileDnaExporter_25.py
doc_dna: FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: .FORCE
$(PYTHON) doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
doc_man: FORCE
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
help_features: .FORCE
@$(PYTHON) -c \
help_features: FORCE
@python3 -c \
"import re; \
print('\n'.join([ \
w for l in open('"$(BLENDER_DIR)"/CMakeLists.txt', 'r').readlines() \
@@ -439,9 +417,9 @@ help_features: .FORCE
if w.startswith('WITH_')]))" | uniq
clean: .FORCE
clean: FORCE
$(MAKE) -C "$(BUILD_DIR)" clean
.PHONY: all
.FORCE:
FORCE:

1396
SConstruct Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@
set(LLVM_VERSION_MINOR 4)
if (NOT PACKAGE_VERSION)
- set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}svn")
+ set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}")
endif()
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)

View File

@@ -1,12 +0,0 @@
--- a/src/shaders/CMakeLists.txt
+++ b/src/shaders/CMakeLists.txt
@@ -27,7 +27,7 @@ macro (osl_compile oslsrc objlist headers)
message (STATUS "cmd: ${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc ${oslsrc}")
endif ()
add_custom_command (OUTPUT ${osofile}
- COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc" ${oslsrc}
+ COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc" "-o" ${osofile} ${oslsrc}
MAIN_DEPENDENCY ${oslsrc}
DEPENDS ${${headers}} ${oslsrc} "${CMAKE_CURRENT_BINARY_DIR}/stdosl.h" "${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

File diff suppressed because it is too large Load Diff

View File

@@ -1,143 +0,0 @@
# ######## Global feature set settings ########
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_full.cmake")
# Detect which libc we'll be linking against.
# Some of the paths will depend on this
if (EXISTS "/lib/x86_64-linux-gnu/libc-2.19.so")
message(STATUS "Building in GLibc-2.19 environment")
set(GLIBC "2.19")
set(MULTILIB "/x86_64-linux-gnu")
elseif (EXISTS "/lib/i386-linux-gnu//libc-2.19.so")
message(STATUS "Building in GLibc-2.19 environment")
set(GLIBC "2.19")
set(MULTILIB "/i386-linux-gnu")
elseif (EXISTS "/lib/libc-2.11.3.so")
message(STATUS "Building in GLibc-2.11 environment")
set(GLIBC "2.11")
set(MULTILIB "")
else()
message(FATAL_ERROR "Unknown build environment")
endif()
# 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
set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
# ######## Official release-specific build options ########
# Options which are specific to Linux release builds only
set(WITH_JACK_DYNLOAD ON CACHE BOOL "" FORCE)
set(WITH_SDL_DYNLOAD ON CACHE BOOL "" FORCE)
set(WITH_SYSTEM_GLEW OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP_STATIC ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL_NUMPY ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
# ######## Release environment specific settings ########
# All the hardcoded libraru paths and such
# LLVM libraries
set(LLVM_VERSION "3.4" CACHE STRING "" FORCE)
set(LLVM_ROOT_DIR "/opt/lib/llvm-${LLVM_VERSION}" CACHE STRING "" FORCE)
set(LLVM_STATIC ON CACHE BOOL "" FORCE)
# BOOST libraries
set(BOOST_ROOT "/opt/lib/boost" CACHE STRING "" FORCE)
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
# FFmpeg libraries
set(FFMPEG "/opt/lib/ffmpeg" CACHE STRING "" FORCE)
set(FFMPEG_LIBRARIES
avdevice avformat avcodec avutil avfilter swscale swresample
/usr/lib${MULTILIB}/libxvidcore.a
/usr/lib${MULTILIB}/libx264.a
/usr/lib${MULTILIB}/libmp3lame.a
/usr/lib${MULTILIB}/libvpx.a
/usr/lib${MULTILIB}/libvorbis.a
/usr/lib${MULTILIB}/libogg.a
/usr/lib${MULTILIB}/libvorbisenc.a
/usr/lib${MULTILIB}/libtheora.a
/usr/lib${MULTILIB}/libschroedinger-1.0.a
/usr/lib${MULTILIB}/liborc-0.4.a
CACHE STRING "" FORCE
)
# SndFile libraries
set(SNDFILE_LIBRARY "/usr/lib/libsndfile.a;/usr/lib/libFLAC.a" CACHE STRING "" FORCE)
# OpenAL libraries
set(OPENAL_ROOT_DIR "/opt/lib/openal" 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
CACHE STRING "" FORCE
)
# OpenCollada libraries
set(OPENCOLLADA_UTF_LIBRARY "" CACHE STRING "" FORCE)
set(PCRE_INCLUDE_DIR "/usr/include" CACHE STRING "" FORCE)
set(PCRE_LIBRARY "/usr/lib${MULTILIB}/libpcre.a" CACHE STRING "" FORCE)
set(XML2_INCLUDE_DIR "/usr/include" CACHE STRING "" FORCE)
set(XML2_LIBRARY "/usr/lib${MULTILIB}/libxml2.a" CACHE STRING "" FORCE)
# OpenColorIO libraries
set(OPENCOLORIO_ROOT_DIR "/opt/lib/ocio" CACHE STRING "" FORCE)
set(OPENCOLORIO_OPENCOLORIO_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libOpenColorIO.a" CACHE STRING "" FORCE)
set(OPENCOLORIO_TINYXML_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libtinyxml.a" CACHE STRING "" FORCE)
set(OPENCOLORIO_YAML-CPP_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.a" CACHE STRING "" FORCE)
# OpenImageIO
if(GLIBC EQUAL "2.19")
set(OPENIMAGEIO_LIBRARY
/opt/lib/oiio/lib/libOpenImageIO.a
/opt/lib/oiio/lib/libOpenImageIO_Util.a
/usr/lib${MULTILIB}/libwebp.a
/usr/lib${MULTILIB}/liblzma.a
/usr/lib${MULTILIB}/libjbig.a
CACHE STRING "" FORCE
)
endif()
# OpenSubdiv libraries
set(OPENSUBDIV_ROOT_DIR "/opt/lib/opensubdiv" CACHE STRING "" FORCE)
set(OPENSUBDIV_OSDCPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdCPU.a" CACHE STRING "" FORCE)
set(OPENSUBDIV_OSDGPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdGPU.a" CACHE STRING "" FORCE)
# OpenEXR libraries
set(OPENEXR_ROOT_DIR "/opt/lib/openexr" CACHE STRING "" FORCE)
set(OPENEXR_HALF_LIBRARY "/opt/lib/openexr/lib/libHalf.a" CACHE STRING "" FORCE)
set(OPENEXR_IEX_LIBRARY "/opt/lib/openexr/lib/libIex.a" CACHE STRING "" FORCE)
set(OPENEXR_ILMIMF_LIBRARY "/opt/lib/openexr/lib/libIlmImf.a" CACHE STRING "" FORCE)
set(OPENEXR_ILMTHREAD_LIBRARY "/opt/lib/openexr/lib/libIlmThread.a" CACHE STRING "" FORCE)
set(OPENEXR_IMATH_LIBRARY "/opt/lib/openexr/lib/libImath.a" CACHE STRING "" FORCE)
# JeMalloc library
set(JEMALLOC_LIBRARY "/opt/lib/jemalloc/lib/libjemalloc.a" CACHE STRING "" FORCE)
# Space navigation
set(SPACENAV_ROOT_DIR "/opt/lib/libspnav" CACHE STRING "" FORCE)
# Force some system libraries to be static
set(FFTW3_LIBRARY "/usr/lib${MULTILIB}/libfftw3.a" CACHE STRING "" FORCE)
set(JPEG_LIBRARY "/usr/lib${MULTILIB}/libjpeg.a" CACHE STRING "" FORCE)
set(PNG_LIBRARY "/usr/lib${MULTILIB}/libpng.a" CACHE STRING "" FORCE)
set(TIFF_LIBRARY "/usr/lib${MULTILIB}/libtiff.a" CACHE STRING "" FORCE)
set(ZLIB_LIBRARY "/usr/lib${MULTILIB}/libz.a" CACHE STRING "" FORCE)
# OpenVDB
set(OPENVDB_LIBRARY
/opt/lib/openvdb/lib/libopenvdb.a
/opt/lib/blosc/lib/libblosc.a
CACHE BOOL "" FORCE
)
# Additional linking libraries
set(CMAKE_EXE_LINKER_FLAGS "-lrt -static-libstdc++" CACHE STRING "" FORCE)

View File

@@ -1,12 +0,0 @@
# This is applied as an ovveride 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

@@ -0,0 +1,5 @@
BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
BF_NUMJOBS = 1
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']

View File

@@ -0,0 +1,5 @@
BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
BF_NUMJOBS = 1
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']

View File

@@ -0,0 +1,189 @@
BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
BF_NUMJOBS = 4
WITHOUT_BF_OVERWRITE_INSTALL = True
# Python configuration
BF_PYTHON_VERSION = '3.4'
BF_PYTHON_ABI_FLAGS = 'm'
BF_PYTHON = '/opt/lib/python-3.4'
WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_PYTHON_INSTALL_REQUESTS = True
WITH_BF_STATICPYTHON = True
# OpenCollada configuration
WITH_BF_COLLADA = True
WITH_BF_STATICOPENCOLLADA=True
BF_OPENCOLLADA = '/opt/lib/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB_STATIC = '${BF_OPENCOLLADA}/lib/libOpenCOLLADAStreamWriter.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADASaxFrameworkLoader.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADAFramework.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADABaseUtils.a ' + \
'${BF_OPENCOLLADA}/lib/libGeneratedSaxParser.a ' + \
'${BF_OPENCOLLADA}/lib/libMathMLSolver.a ' + \
'${BF_OPENCOLLADA}/lib/libbuffer.a ${BF_OPENCOLLADA}/lib/libftoa.a ' + \
'/usr/lib/libxml2.a /usr/lib/libexpat.a /usr/lib/libpcre.a'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib /home/sources/staticlibs/lib64'
BF_PCRE_LIB = ''
BF_EXPAT_LIB = ''
# FFMPEG configuration
WITH_BF_FFMPEG = True
WITH_BF_STATICFFMPEG = True
BF_FFMPEG = '/opt/lib/ffmpeg'
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib'
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ' + \
'${BF_FFMPEG_LIBPATH}/libavfilter.a ${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
'${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libswresample.a ' + \
'/usr/lib/libxvidcore.a /usr/lib/libx264.a /usr/lib/libmp3lame.a /usr/lib/libvpx.a /usr/lib/libvorbis.a ' + \
'/usr/lib/libogg.a /usr/lib/libvorbisenc.a /usr/lib/libtheora.a /usr/lib/libschroedinger-1.0.a ' + \
'/usr/lib/liborc-0.4.a'
# Don't depend on system's libstdc++
WITH_BF_STATICCXX = True
BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a'
WITH_BF_GETTEXT_STATIC = True
WITH_BF_FREETYPE_STATIC = False
WITH_BF_OPENEXR = True
BF_OPENEXR = '/opt/lib/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
WITH_BF_STATICOPENEXR = True
WITH_BF_TIFF = True
WITH_BF_STATICTIFF = True
BF_TIFF_LIB_STATIC = '${BF_TIFF}/lib/libtiff.a'
WITH_BF_JPEG = True
WITH_BF_STATICJPEG = True
BF_JPEG_LIB_STATIC= '${BF_JPEG}/lib/libjpeg.a'
WITH_BF_PNG = True
WITH_BF_STATICPNG = True
BF_PNG_LIB_STATIC = '${BF_PNG}/lib/libpng.a'
WITH_BF_STATICLIBSAMPLERATE = True
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = True
WITH_BF_OPENMP = True
WITH_BF_STATICOPENMP = True
BF_OPENMP_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.7/libgomp.a'
WITH_BF_GAMEENGINE = True
WITH_BF_BULLET = True
# Blender player (would be enabled in it's own config)
WITH_BF_PLAYER = False
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/opt/lib/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
# Use 3d mouse library
WITH_BF_3DMOUSE = True
WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/opt/lib/libspnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
# FFT
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
# JACK
WITH_BF_JACK = True
WITH_BF_JACK_DYNLOAD = True
# Cycles
WITH_BF_CYCLES = True
WITH_BF_CYCLES_CUDA_BINARIES = False
WITH_BF_OIIO = True
WITH_BF_STATICOIIO = True
BF_OIIO = '/opt/lib/oiio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
BF_IS_NEW_OSL = False
WITH_BF_CYCLES_OSL = True
WITH_BF_STATICOSL = BF_IS_NEW_OSL
BF_OSL = '/opt/lib/osl'
BF_OSL_INC = '${BF_OSL}/include'
# note oslexec would passed via program linkflags, which is needed to
# make llvm happy with osl_allocate_closure_component
BF_OSL_LIB = 'oslcomp oslexec oslquery'
BF_OSL_LIB_STATIC = '${BF_OSL}/lib/liboslcomp.a ${BF_OSL}/lib/liboslexec.a ${BF_OSL}/lib/liboslquery.a'
BF_OSL_LIBPATH = '${BF_OSL}/lib'
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
WITH_BF_LLVM = True
WITH_BF_STATICLLVM = False
BF_LLVM = '/opt/lib/llvm-3.4.2'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMObject LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMSupport'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
# Color management
WITH_BF_OCIO = True
WITH_BF_STATICOCIO = True
BF_OCIO = '/opt/lib/ocio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
WITH_BF_STATICBOOST = True
BF_BOOST = '/opt/lib/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
${BF_BOOST_LIBPATH}/libboost_thread.a'
if BF_IS_NEW_OSL:
BF_BOOST_LIB_STATIC += ' ${BF_BOOST_LIBPATH}/libboost_wave.a'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
# Ocean Simulation
WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization
BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
PLATFORM_LINKFLAGS = ['-lrt']
if BF_IS_NEW_OSL:
BF_PROGRAM_LINKFLAGS = ['-Wl,--version-script=source/creator/blender.map']
else:
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']

View File

@@ -0,0 +1,189 @@
BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
BF_NUMJOBS = 4
WITHOUT_BF_OVERWRITE_INSTALL = True
# Python configuration
BF_PYTHON_VERSION = '3.4'
BF_PYTHON_ABI_FLAGS = 'm'
BF_PYTHON = '/opt/lib/python-3.4'
WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_PYTHON_INSTALL_REQUESTS = True
WITH_BF_STATICPYTHON = True
# OpenCollada configuration
WITH_BF_COLLADA = True
WITH_BF_STATICOPENCOLLADA=True
BF_OPENCOLLADA = '/opt/lib/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB_STATIC = '${BF_OPENCOLLADA}/lib/libOpenCOLLADAStreamWriter.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADASaxFrameworkLoader.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADAFramework.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADABaseUtils.a ' + \
'${BF_OPENCOLLADA}/lib/libGeneratedSaxParser.a ' + \
'${BF_OPENCOLLADA}/lib/libMathMLSolver.a ' + \
'${BF_OPENCOLLADA}/lib/libbuffer.a ${BF_OPENCOLLADA}/lib/libftoa.a ' + \
'/usr/lib/libxml2.a /usr/lib/libexpat.a /usr/lib/libpcre.a'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib /home/sources/staticlibs/lib64'
BF_PCRE_LIB = ''
BF_EXPAT_LIB = ''
# FFMPEG configuration
WITH_BF_FFMPEG = True
WITH_BF_STATICFFMPEG = True
BF_FFMPEG = '/opt/lib/ffmpeg'
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib'
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ' + \
'${BF_FFMPEG_LIBPATH}/libavfilter.a ${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
'${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libswresample.a ' + \
'/usr/lib/libxvidcore.a /usr/lib/libx264.a /usr/lib/libmp3lame.a /usr/lib/libvpx.a /usr/lib/libvorbis.a ' + \
'/usr/lib/libogg.a /usr/lib/libvorbisenc.a /usr/lib/libtheora.a /usr/lib/libschroedinger-1.0.a ' + \
'/usr/lib/liborc-0.4.a'
# Don't depend on system's libstdc++
WITH_BF_STATICCXX = True
BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a'
WITH_BF_GETTEXT_STATIC = True
WITH_BF_FREETYPE_STATIC = False
WITH_BF_OPENEXR = True
BF_OPENEXR = '/opt/lib/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
WITH_BF_STATICOPENEXR = True
WITH_BF_TIFF = True
WITH_BF_STATICTIFF = True
BF_TIFF_LIB_STATIC = '${BF_TIFF}/lib/libtiff.a'
WITH_BF_JPEG = True
WITH_BF_STATICJPEG = True
BF_JPEG_LIB_STATIC= '${BF_JPEG}/lib/libjpeg.a'
WITH_BF_PNG = True
WITH_BF_STATICPNG = True
BF_PNG_LIB_STATIC = '${BF_PNG}/lib/libpng.a'
WITH_BF_STATICLIBSAMPLERATE = True
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = True
WITH_BF_OPENMP = True
WITH_BF_STATICOPENMP = True
BF_OPENMP_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.a'
WITH_BF_GAMEENGINE = True
WITH_BF_BULLET = True
# Blender player (would be enabled in it's own config)
WITH_BF_PLAYER = False
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/opt/lib/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
# Use 3d mouse library
WITH_BF_3DMOUSE = True
WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/opt/lib/libspnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
# FFT
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
# JACK
WITH_BF_JACK = True
WITH_BF_JACK_DYNLOAD = True
# Cycles
WITH_BF_CYCLES = True
WITH_BF_CYCLES_CUDA_BINARIES = False
WITH_BF_OIIO = True
WITH_BF_STATICOIIO = True
BF_OIIO = '/opt/lib/oiio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
BF_IS_NEW_OSL = False
WITH_BF_CYCLES_OSL = True
WITH_BF_STATICOSL = BF_IS_NEW_OSL
BF_OSL = '/opt/lib/osl'
BF_OSL_INC = '${BF_OSL}/include'
# note oslexec would passed via program linkflags, which is needed to
# make llvm happy with osl_allocate_closure_component
BF_OSL_LIB = 'oslcomp oslexec oslquery'
BF_OSL_LIB_STATIC = '${BF_OSL}/lib/liboslcomp.a ${BF_OSL}/lib/liboslexec.a ${BF_OSL}/lib/liboslquery.a'
BF_OSL_LIBPATH = '${BF_OSL}/lib'
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
WITH_BF_LLVM = True
WITH_BF_STATICLLVM = False
BF_LLVM = '/opt/lib/llvm-3.4.2'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMObject LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMSupport'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
# Color management
WITH_BF_OCIO = True
WITH_BF_STATICOCIO = True
BF_OCIO = '/opt/lib/ocio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
WITH_BF_STATICBOOST = True
BF_BOOST = '/opt/lib/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
${BF_BOOST_LIBPATH}/libboost_thread.a'
if BF_IS_NEW_OSL:
BF_BOOST_LIB_STATIC += ' ${BF_BOOST_LIBPATH}/libboost_wave.a'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
# Ocean Simulation
WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization
BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
PLATFORM_LINKFLAGS = ['-lrt']
if BF_IS_NEW_OSL:
BF_PROGRAM_LINKFLAGS = ['-Wl,--version-script=source/creator/blender.map']
else:
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']

View File

@@ -0,0 +1,9 @@
MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
WITH_BF_CYCLES_CUDA_BINARIES = True
WITH_BF_CYCLES_OSL = False # OSL never worked on OSX 32bit !
WITH_BF_COLLADA = False # we drop 32bit, newest collada is only x86_64 !

View File

@@ -0,0 +1,6 @@
CC = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang"
CXX = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang++"
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
WITH_BF_CYCLES_CUDA_BINARIES = True

View File

@@ -0,0 +1,139 @@
BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
BF_NUMJOBS = 4
# Python configuration
BF_PYTHON_VERSION = '3.4'
BF_PYTHON_ABI_FLAGS = 'm'
BF_PYTHON = '/opt/lib/python-3.4'
WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_PYTHON_INSTALL_REQUESTS = True
WITH_BF_STATICPYTHON = True
# OpenCollada configuration
WITH_BF_COLLADA = False
# FFMPEG configuration
WITH_BF_FFMPEG = True
WITH_BF_STATICFFMPEG = True
BF_FFMPEG = '/opt/lib/ffmpeg'
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib'
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ' + \
'${BF_FFMPEG_LIBPATH}/libavfilter.a ${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
'${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libswresample.a ' + \
'/usr/lib/libxvidcore.a /usr/lib/libx264.a /usr/lib/libmp3lame.a /usr/lib/libvpx.a /usr/lib/libvorbis.a ' + \
'/usr/lib/libogg.a /usr/lib/libvorbisenc.a /usr/lib/libtheora.a /usr/lib/libschroedinger-1.0.a ' + \
'/usr/lib/liborc-0.4.a'
# Don't depend on system's libstdc++
WITH_BF_STATICCXX = True
BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a'
WITH_BF_GETTEXT_STATIC = True
WITH_BF_FREETYPE_STATIC = False
WITH_BF_OPENEXR = True
BF_OPENEXR = '/opt/lib/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
WITH_BF_STATICOPENEXR = True
WITH_BF_TIFF = True
WITH_BF_STATICTIFF = True
BF_TIFF_LIB_STATIC = '${BF_TIFF}/lib/libtiff.a'
WITH_BF_JPEG = True
WITH_BF_STATICJPEG = True
BF_JPEG_LIB_STATIC= '${BF_JPEG}/lib/libjpeg.a'
WITH_BF_STATICLIBSAMPLERATE = True
WITH_BF_PNG = True
WITH_BF_STATICPNG = True
BF_PNG_LIB_STATIC = '${BF_PNG}/lib/libpng.a'
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = False
WITH_BF_OPENMP = True
WITH_BF_STATICOPENMP = True
BF_OPENMP_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.7/libgomp.a'
WITH_BF_GAMEENGINE = True
WITH_BF_BULLET = True
# Do not build blender when building blenderplayer
WITH_BF_NOBLENDER = True
WITH_BF_PLAYER = True
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/opt/lib/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
# Use 3d mouse library
WITH_BF_3DMOUSE = True
WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/opt/lib/libspnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
# Color management
WITH_BF_OCIO = True
WITH_BF_STATICOCIO = True
BF_OCIO = '/opt/lib/ocio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
WITH_BF_STATICBOOST = True
BF_BOOST = '/opt/lib/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
${BF_BOOST_LIBPATH}/libboost_thread.a'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
# JACK
WITH_BF_JACK = True
WITH_BF_JACK_DYNLOAD = True
# Motion Tracking
WITH_BF_LIBMV = False
# Ocean Simulation
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization
BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
PLATFORM_LINKFLAGS = ['-lrt']

View File

@@ -0,0 +1,139 @@
BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
BF_NUMJOBS = 4
# Python configuration
BF_PYTHON_VERSION = '3.4'
BF_PYTHON_ABI_FLAGS = 'm'
BF_PYTHON = '/opt/lib/python-3.4'
WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_PYTHON_INSTALL_REQUESTS = True
WITH_BF_STATICPYTHON = True
# OpenCollada configuration
WITH_BF_COLLADA = False
# FFMPEG configuration
WITH_BF_FFMPEG = True
WITH_BF_STATICFFMPEG = True
BF_FFMPEG = '/opt/lib/ffmpeg'
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib'
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ' + \
'${BF_FFMPEG_LIBPATH}/libavfilter.a ${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
'${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libswresample.a ' + \
'/usr/lib/libxvidcore.a /usr/lib/libx264.a /usr/lib/libmp3lame.a /usr/lib/libvpx.a /usr/lib/libvorbis.a ' + \
'/usr/lib/libogg.a /usr/lib/libvorbisenc.a /usr/lib/libtheora.a /usr/lib/libschroedinger-1.0.a ' + \
'/usr/lib/liborc-0.4.a'
# Don't depend on system's libstdc++
WITH_BF_STATICCXX = True
BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a'
WITH_BF_GETTEXT_STATIC = True
WITH_BF_FREETYPE_STATIC = False
WITH_BF_OPENEXR = True
BF_OPENEXR = '/opt/lib/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
WITH_BF_STATICOPENEXR = True
WITH_BF_TIFF = True
WITH_BF_STATICTIFF = True
BF_TIFF_LIB_STATIC = '${BF_TIFF}/lib/libtiff.a'
WITH_BF_JPEG = True
WITH_BF_STATICJPEG = True
BF_JPEG_LIB_STATIC= '${BF_JPEG}/lib/libjpeg.a'
WITH_BF_STATICLIBSAMPLERATE = True
WITH_BF_PNG = True
WITH_BF_STATICPNG = True
BF_PNG_LIB_STATIC = '${BF_PNG}/lib/libpng.a'
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = False
WITH_BF_OPENMP = True
WITH_BF_STATICOPENMP = True
BF_OPENMP_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.a'
WITH_BF_GAMEENGINE = True
WITH_BF_BULLET = True
# Do not build blender when building blenderplayer
WITH_BF_NOBLENDER = True
WITH_BF_PLAYER = True
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/opt/lib/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
# Use 3d mouse library
WITH_BF_3DMOUSE = True
WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/opt/lib/libspnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
# Color management
WITH_BF_OCIO = True
WITH_BF_STATICOCIO = True
BF_OCIO = '/opt/lib/ocio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
WITH_BF_STATICBOOST = True
BF_BOOST = '/opt/lib/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
${BF_BOOST_LIBPATH}/libboost_thread.a'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
# JACK
WITH_BF_JACK = True
WITH_BF_JACK_DYNLOAD = True
# Motion Tracking
WITH_BF_LIBMV = False
# Ocean Simulation
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization
BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
PLATFORM_LINKFLAGS = ['-lrt']

View File

@@ -4,7 +4,7 @@
# <pep8 compliant>
# List of the branches being built automatically overnight
NIGHT_SCHEDULE_BRANCHES = [None]
NIGHT_SCHEDULE_BRANCHES = [None, "gooseberry"]
# List of the branches available for force build
FORCE_SCHEDULE_BRANCHES = ["master", "gooseberry", "experimental-build"]
@@ -87,13 +87,14 @@ c['change_source'] = GitPoller(
# CODEBASES
#
# Allow to control separately things like branches for each repo and submodules.
# Allow to controll separately things like branches for each repo and submodules.
all_repositories = {
r'git://git.blender.org/blender.git': 'blender',
r'git://git.blender.org/blender-translations.git': 'blender-translations',
r'git://git.blender.org/blender-addons.git': 'blender-addons',
r'git://git.blender.org/blender-addons-contrib.git': 'blender-addons-contrib',
r'git://git.blender.org/scons.git': 'scons',
r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
}
@@ -128,6 +129,7 @@ def schedule_force_build(name):
forcesched.CodebaseParameter(hide=True, codebase="blender-translations"),
forcesched.CodebaseParameter(hide=True, codebase="blender-addons"),
forcesched.CodebaseParameter(hide=True, codebase="blender-addons-contrib"),
forcesched.CodebaseParameter(hide=True, codebase="scons"),
forcesched.CodebaseParameter(hide=True, codebase="lib svn")],
properties=[]))
@@ -143,6 +145,7 @@ def schedule_build(name, hour, minute=0):
"blender-translations": {"repository": "", "branch": "master"},
"blender-addons": {"repository": "", "branch": "master"},
"blender-addons-contrib": {"repository": "", "branch": "master"},
"scons": {"repository": "", "branch": "master"},
"lib svn": {"repository": "", "branch": "trunk"}},
branch=current_branch,
builderNames=[name],
@@ -264,7 +267,8 @@ def generic_builder(id, libdir='', branch='', rsync=False):
for submodule in ('blender-translations',
'blender-addons',
'blender-addons-contrib'):
'blender-addons-contrib',
'scons'):
f.addStep(git_submodule_step(submodule))
f.addStep(git_step(branch))
@@ -278,6 +282,11 @@ def generic_builder(id, libdir='', branch='', rsync=False):
descriptionDone='packaged'))
if rsync:
f.addStep(rsync_step(id, branch, rsync_script))
elif id.find('cmake') != -1:
f.addStep(FileUpload(name='upload',
slavesrc='buildbot_upload.zip',
masterdest=filename,
maxsize=150 * 1024 * 1024))
else:
f.addStep(FileUpload(name='upload',
slavesrc='buildbot_upload.zip',
@@ -285,21 +294,29 @@ def generic_builder(id, libdir='', branch='', rsync=False):
maxsize=150 * 1024 * 1024,
workdir='install'))
f.addStep(MasterShellCommand(name='unpack',
command=['python2.7', unpack_script, filename],
command=['python', unpack_script, filename],
description='unpacking',
descriptionDone='unpacked'))
return f
# Builders
# builders
add_builder(c, 'mac_x86_64_10_6_cmake', 'darwin-9.x.universal', generic_builder, hour=5)
add_builder(c, 'linux_glibc211_i686_cmake', '', generic_builder, hour=1)
add_builder(c, 'linux_glibc211_x86_64_cmake', '', generic_builder, hour=2)
add_builder(c, 'linux_glibc219_i686_cmake', '', generic_builder, hour=3)
add_builder(c, 'linux_glibc219_x86_64_cmake', '', generic_builder, hour=4)
add_builder(c, 'mac_x86_64_10_6_scons', 'darwin-9.x.universal', generic_builder, hour=5)
add_builder(c, 'mac_i386_10_6_scons', 'darwin-9.x.universal', generic_builder, hour=11)
add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder, hour=1)
add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder, hour=2)
add_builder(c, 'win32_scons_vc2013', 'windows_vc12', generic_builder, hour=1)
add_builder(c, 'win64_scons_vc2013', 'win64_vc12', generic_builder, hour=2)
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=3)
add_builder(c, 'win64_cmake_vc2013', 'win64_vc12', generic_builder, hour=4)
add_builder(c, 'win64_cmake_vc2015', 'win64_vc14', generic_builder, hour=5)
#add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder, hour=4)
add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder, hour=3)
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder, hour=1)
#add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder, hour=2)
# Multiview branch
add_builder(c, 'multiview_win64_scons', 'win64', generic_builder, 'multiview', hour=4)
add_builder(c, 'multiview_win32_scons', 'windows', generic_builder, 'multiview', hour=5)
# STATUS TARGETS
#

View File

@@ -31,181 +31,162 @@ if len(sys.argv) < 2:
builder = sys.argv[1]
# we run from build/ directory
blender_dir = os.path.join('..', 'blender.git')
def parse_header_file(filename, define):
import re
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
with open(filename, "r") as file:
for l in file:
match = regex.match(l)
if match:
return match.group(1)
return None
blender_dir = '../blender.git'
if 'cmake' in builder:
# cmake
# Some fine-tuning configuration
blender_dir = os.path.join('..', blender_dir)
build_dir = os.path.abspath(os.path.join('..', 'build', builder))
install_dir = os.path.abspath(os.path.join('..', 'install', builder))
targets = ['blender']
# set build options
cmake_options = ['-DCMAKE_BUILD_TYPE:STRING=Release']
chroot_name = None # If not None command will be delegated to that chroot
cuda_chroot_name = None # If not None cuda compilationcommand will be delegated to that chroot
build_cubins = True # Whether to build Cycles CUDA kernels
bits = 64
if builder.endswith('mac_x86_64_cmake'):
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
elif builder.endswith('mac_i386_cmake'):
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=i386')
elif builder.endswith('mac_ppc_cmake'):
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
# 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
if 'win64' in builder:
cmake_options.append(['-G', '"Visual Studio 12 2013 Win64"'])
elif 'win32' in builder:
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
# Set build options.
cmake_options = []
cmake_extra_options = ['-DCMAKE_BUILD_TYPE:STRING=Release']
cuda_cmake_options = []
if builder.startswith('mac'):
# Set up OSX architecture
if builder.endswith('x86_64_10_6_cmake'):
cmake_extra_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/bin/nvcc')
cmake_extra_options.append('-DCUDA_NVCC8_EXECUTABLE=/usr/local/cuda8-hack/bin/nvcc')
elif builder.startswith('win'):
if builder.endswith('_vc2015'):
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 14 2015'])
cmake_extra_options.append('-DCUDA_NVCC_FLAGS=--cl-version;2013;' +
'--compiler-bindir;C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin')
else:
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 12 2013 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 12 2013'])
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5/bin/nvcc.exe')
cmake_extra_options.append('-DCUDA_NVCC8_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/bin/nvcc.exe')
elif builder.startswith('linux'):
tokens = builder.split("_")
glibc = tokens[1]
if glibc == 'glibc219':
deb_name = "jessie"
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 = ['player', 'blender']
elif builder.endswith('i686_cmake'):
bits = 32
chroot_name = 'buildbot_' + deb_name + '_i686'
cuda_chroot_name = 'buildbot_' + deb_name + '_x86_64'
targets = ['player', 'blender', 'cuda']
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-7.5/bin/nvcc')
cmake_extra_options.append('-DCUDA_NVCC8_EXECUTABLE=/usr/local/cuda-8.0/bin/nvcc')
cmake_options.append("-C" + os.path.join(blender_dir, cmake_config_file))
# Prepare CMake options needed to configure cuda binaries compilation.
cuda_cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=%s" % ('ON' if build_cubins else 'OFF'))
cuda_cmake_options.append("-DCYCLES_CUDA_BINARIES_ARCH=sm_20;sm_21;sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61")
if build_cubins or 'cuda' in targets:
if bits == 32:
cuda_cmake_options.append("-DCUDA_64_BIT_DEVICE_CODE=OFF")
else:
cuda_cmake_options.append("-DCUDA_64_BIT_DEVICE_CODE=ON")
# Only modify common cmake options if cuda doesn't require separate target.
if 'cuda' not in targets:
cmake_options += cuda_cmake_options
cmake_options.append("-DCMAKE_INSTALL_PREFIX=%s" % (install_dir))
cmake_options += cmake_extra_options
# Prepare chroot command prefix if needed
if chroot_name:
chroot_prefix = ['schroot', '-c', chroot_name, '--']
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
# configure and make
retcode = subprocess.call(['cmake', blender_dir] + cmake_options)
if retcode != 0:
sys.exit(retcode)
if 'win' in builder:
retcode = subprocess.call(['msbuild', 'INSTALL.vcxproj', '/p:Configuration=Release'])
else:
chroot_prefix = []
if cuda_chroot_name:
cuda_chroot_prefix = ['schroot', '-c', cuda_chroot_name, '--']
else:
cuda_chroot_prefix = chroot_prefix[:]
retcode = subprocess.call(['make', '-s', '-j4', 'install'])
sys.exit(retcode)
else:
python_bin = 'python'
if builder.find('linux') != -1:
python_bin = '/opt/lib/python-2.7/bin/python2.7'
# Make sure no garbage remained from the previous run
# scons
os.chdir(blender_dir)
scons_cmd = [python_bin, 'scons/scons.py']
scons_options = ['BF_FANCY=False']
# We're using the same rules as release builder, so tweak
# build and install dirs
build_dir = os.path.join('..', 'build', builder)
install_dir = os.path.join('..', 'install', builder)
# Clean install directory so we'll be sure there's no
# residual libs and files remained from the previous install.
if os.path.isdir(install_dir):
shutil.rmtree(install_dir)
for target in targets:
print("Building target %s" % (target))
# Construct build directory name based on the target
target_build_dir = build_dir
target_chroot_prefix = chroot_prefix[:]
if target != 'blender':
target_build_dir += '_' + target
target_name = 'install'
# Make sure build directory exists and enter it
if not os.path.isdir(target_build_dir):
os.mkdir(target_build_dir)
os.chdir(target_build_dir)
# Tweaking CMake options to respect the target
target_cmake_options = cmake_options[:]
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'
# If cuda binaries are compiled as a separate target, make sure
# other targets don't compile cuda binaries.
if 'cuda' in targets and target != 'cuda':
target_cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=OFF")
# Configure the build
print("CMake options:")
print(target_cmake_options)
if os.path.exists('CMakeCache.txt'):
print("Removing CMake cache")
os.remove('CMakeCache.txt')
retcode = subprocess.call(target_chroot_prefix + ['cmake', blender_dir] + target_cmake_options)
if retcode != 0:
print('Condifuration FAILED!')
sys.exit(retcode)
buildbot_dir = os.path.dirname(os.path.realpath(__file__))
config_dir = os.path.join(buildbot_dir, 'config')
if 'win32' in builder:
command = ['msbuild', 'INSTALL.vcxproj', '/Property:PlatformToolset=v120_xp', '/p:Configuration=Release']
elif 'win64' in builder:
command = ['msbuild', 'INSTALL.vcxproj', '/p:Configuration=Release']
else:
command = target_chroot_prefix + ['make', '-s', '-j2', target_name]
if builder.find('linux') != -1:
configs = []
if builder.endswith('linux_glibc211_x86_64_scons'):
configs = ['user-config-player-glibc211-x86_64.py',
'user-config-cuda-glibc211-x86_64.py',
'user-config-glibc211-x86_64.py'
]
chroot_name = 'buildbot_squeeze_x86_64'
cuda_chroot = 'buildbot_squeeze_x86_64'
elif builder.endswith('linux_glibc211_i386_scons'):
configs = ['user-config-player-glibc211-i686.py',
'user-config-cuda-glibc211-i686.py',
'user-config-glibc211-i686.py']
chroot_name = 'buildbot_squeeze_i686'
print("Executing command:")
print(command)
retcode = subprocess.call(command)
# use 64bit cuda toolkit, so there'll be no memory limit issues
cuda_chroot = 'buildbot_squeeze_x86_64'
if retcode != 0:
sys.exit(retcode)
# Compilation will happen inside of chroot environment
prog_scons_cmd = ['schroot', '-c', chroot_name, '--'] + scons_cmd
cuda_scons_cmd = ['schroot', '-c', cuda_chroot, '--'] + scons_cmd
if builder.startswith('linux') and target == 'cuda':
blender_h = os.path.join(blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
blender_version = int(parse_header_file(blender_h, 'BLENDER_VERSION'))
blender_version = "%d.%d" % (blender_version // 100, blender_version % 100)
kernels = os.path.join(target_build_dir, 'intern', 'cycles', 'kernel')
install_kernels = os.path.join(install_dir, blender_version, 'scripts', 'addons', 'cycles', 'lib')
os.mkdir(install_kernels)
print("Copying cuda binaries from %s to %s" % (kernels, install_kernels))
os.system('cp %s/*.cubin %s' % (kernels, install_kernels))
common_options = ['BF_INSTALLDIR=' + install_dir] + scons_options
else:
print("Unknown building system")
sys.exit(1)
for config in configs:
config_fpath = os.path.join(config_dir, config)
scons_options = []
if config.find('player') != -1:
scons_options.append('BF_BUILDDIR=%s_player' % (build_dir))
elif config.find('cuda') != -1:
scons_options.append('BF_BUILDDIR=%s_cuda' % (build_dir))
else:
scons_options.append('BF_BUILDDIR=%s' % (build_dir))
scons_options += common_options
if config.find('player') != -1:
scons_options.append('blenderplayer')
cur_scons_cmd = prog_scons_cmd
elif config.find('cuda') != -1:
scons_options.append('cudakernels')
cur_scons_cmd = cuda_scons_cmd
if config.find('i686') != -1:
scons_options.append('BF_BITNESS=32')
elif config.find('x86_64') != -1:
scons_options.append('BF_BITNESS=64')
else:
scons_options.append('blender')
cur_scons_cmd = prog_scons_cmd
scons_options.append('BF_CONFIG=' + config_fpath)
retcode = subprocess.call(cur_scons_cmd + scons_options)
if retcode != 0:
print('Error building rules with config ' + config)
sys.exit(retcode)
sys.exit(0)
else:
if builder.find('win') != -1:
bitness = '32'
if builder.find('win64') != -1:
bitness = '64'
scons_options.append('BF_INSTALLDIR=' + install_dir)
scons_options.append('BF_BUILDDIR=' + build_dir)
scons_options.append('BF_BITNESS=' + bitness)
scons_options.append('WITH_BF_CYCLES_CUDA_BINARIES=True')
scons_options.append('BF_CYCLES_CUDA_NVCC=nvcc.exe')
if builder.find('mingw') != -1:
scons_options.append('BF_TOOLSET=mingw')
if builder.endswith('vc2013'):
scons_options.append('MSVS_VERSION=12.0')
scons_options.append('MSVC_VERSION=12.0')
scons_options.append('WITH_BF_CYCLES_CUDA_BINARIES=1')
scons_options.append('BF_CYCLES_CUDA_NVCC=nvcc.exe')
scons_options.append('BF_NUMJOBS=1')
elif builder.find('mac') != -1:
if builder.find('x86_64') != -1:
config = 'user-config-mac-x86_64.py'
else:
config = 'user-config-mac-i386.py'
scons_options.append('BF_CONFIG=' + os.path.join(config_dir, config))
if builder.find('win') != -1:
if not os.path.exists(install_dir):
os.makedirs(install_dir)
if builder.endswith('vc2013'):
dlls = ('msvcp120.dll', 'msvcr120.dll', 'vcomp120.dll')
if builder.find('win64') == -1:
dlls_path = '..\\..\\..\\redist\\x86'
else:
dlls_path = '..\\..\\..\\redist\\amd64'
for dll in dlls:
shutil.copyfile(os.path.join(dlls_path, dll), os.path.join(install_dir, dll))
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options)
sys.exit(retcode)

View File

@@ -36,205 +36,149 @@ builder = sys.argv[1]
# Never write branch if it is master.
branch = sys.argv[2] if (len(sys.argv) >= 3 and sys.argv[2] != 'master') else ''
blender_dir = os.path.join('..', 'blender.git')
build_dir = os.path.join('..', 'build', builder)
install_dir = os.path.join('..', 'install', builder)
buildbot_upload_zip = os.path.abspath(os.path.join(os.path.dirname(install_dir), "buildbot_upload.zip"))
# scons does own packaging
if builder.find('scons') != -1:
python_bin = 'python'
if builder.find('linux') != -1:
python_bin = '/opt/lib/python-2.7/bin/python2.7'
upload_filename = None # Name of the archive to be uploaded
# (this is the name of archive which will appear on the
# download page)
upload_filepath = None # Filepath to be uploaded to the server
# (this folder will be packed)
os.chdir('../blender.git')
scons_options = ['BF_QUICK=slnt', 'BUILDBOT_BRANCH=' + branch, 'buildslave', 'BF_FANCY=False']
buildbot_dir = os.path.dirname(os.path.realpath(__file__))
config_dir = os.path.join(buildbot_dir, 'config')
build_dir = os.path.join('..', 'build', builder)
install_dir = os.path.join('..', 'install', builder)
def parse_header_file(filename, define):
import re
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
with open(filename, "r") as file:
for l in file:
match = regex.match(l)
if match:
return match.group(1)
return None
if builder.find('linux') != -1:
scons_options += ['WITH_BF_NOBLENDER=True', 'WITH_BF_PLAYER=False',
'BF_BUILDDIR=' + build_dir,
'BF_INSTALLDIR=' + install_dir,
'WITHOUT_BF_INSTALL=True']
config = None
bits = None
# Make sure install directory always exists
if not os.path.exists(install_dir):
os.makedirs(install_dir)
if builder.endswith('linux_glibc211_x86_64_scons'):
config = 'user-config-glibc211-x86_64.py'
chroot_name = 'buildbot_squeeze_x86_64'
bits = 64
elif builder.endswith('linux_glibc211_i386_scons'):
config = 'user-config-glibc211-i686.py'
chroot_name = 'buildbot_squeeze_i686'
bits = 32
if config is not None:
config_fpath = os.path.join(config_dir, config)
scons_options.append('BF_CONFIG=' + config_fpath)
def create_tar_bz2(src, dest, package_name):
# One extra to remove leading os.sep when cleaning root for package_root
ln = len(src) + 1
flist = list()
blender = os.path.join(install_dir, 'blender')
blenderplayer = os.path.join(install_dir, 'blenderplayer')
subprocess.call(['schroot', '-c', chroot_name, '--', 'strip', '--strip-all', blender, blenderplayer])
# Create list of tuples containing file and archive name
for root, dirs, files in os.walk(src):
package_root = os.path.join(package_name, root[ln:])
flist.extend([(os.path.join(root, file), os.path.join(package_root, file)) for file in files])
extra = '/' + os.path.join('home', 'sources', 'release-builder', 'extra')
mesalibs = os.path.join(extra, 'mesalibs' + str(bits) + '.tar.bz2')
software_gl = os.path.join(extra, 'blender-softwaregl')
import tarfile
package = tarfile.open(dest, 'w:bz2')
for entry in flist:
package.add(entry[0], entry[1], recursive=False)
package.close()
os.system('tar -xpf %s -C %s' % (mesalibs, install_dir))
os.system('cp %s %s' % (software_gl, install_dir))
os.system('chmod 755 %s' % (os.path.join(install_dir, 'blender-softwaregl')))
retcode = subprocess.call(['schroot', '-c', chroot_name, '--', python_bin, 'scons/scons.py'] + scons_options)
if builder.find('cmake') != -1:
sys.exit(retcode)
else:
if builder.find('win') != -1:
bitness = '32'
if builder.find('win64') != -1:
bitness = '64'
scons_options.append('BF_INSTALLDIR=' + install_dir)
scons_options.append('BF_BUILDDIR=' + build_dir)
scons_options.append('BF_BITNESS=' + bitness)
scons_options.append('WITH_BF_CYCLES_CUDA_BINARIES=True')
scons_options.append('BF_CYCLES_CUDA_NVCC=nvcc.exe')
if builder.find('mingw') != -1:
scons_options.append('BF_TOOLSET=mingw')
if builder.endswith('vc2013'):
scons_options.append('MSVS_VERSION=12.0')
scons_options.append('MSVC_VERSION=12.0')
elif builder.find('mac') != -1:
if builder.find('x86_64') != -1:
config = 'user-config-mac-x86_64.py'
else:
config = 'user-config-mac-i386.py'
scons_options.append('BF_CONFIG=' + os.path.join(config_dir, config))
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options)
sys.exit(retcode)
else:
# CMake
if 'win' in builder or 'mac' in builder:
os.chdir(build_dir)
if 'win' in builder:
files = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')]
for f in files:
os.remove(f)
retcode = subprocess.call(['cpack', '-G', 'ZIP'])
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
# TODO(sergey): Such magic usually happens in SCon's packaging but we don't have it
# in the CMake yet. For until then we do some magic here.
tokens = result_file.split('-')
blender_version = tokens[1].split('.')
blender_full_version = '.'.join(blender_version[0:2])
git_hash = tokens[2].split('.')[1]
platform = builder.split('_')[0]
if platform == 'mac':
# Special exception for OSX
platform = 'OSX-10.6-'
if builder.endswith('x86_64_10_6_cmake'):
platform += 'x86_64'
elif builder.endswith('i386_10_6_cmake'):
platform += 'i386'
elif builder.endswith('ppc_10_6_cmake'):
platform += 'ppc'
if builder.endswith('vc2015'):
platform += "-vc14"
builderified_name = 'blender-{}-{}-{}'.format(blender_full_version, git_hash, platform)
if branch != '':
builderified_name = branch + "-" + builderified_name
os.rename(result_file, "{}.zip".format(builderified_name))
os.rename(result_file, "{}.zip".format(builder))
# create zip file
try:
if os.path.exists(buildbot_upload_zip):
os.remove(buildbot_upload_zip)
z = zipfile.ZipFile(buildbot_upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write("{}.zip".format(builderified_name))
upload_zip = "buildbot_upload.zip"
if os.path.exists(upload_zip):
os.remove(upload_zip)
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write("{}.zip".format(builder))
z.close()
sys.exit(retcode)
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(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")
# clean release directory if it already exists
release_dir = 'release'
# Get version information
blender_version = int(parse_header_file(blender_h, 'BLENDER_VERSION'))
blender_version = "%d.%d" % (blender_version // 100, blender_version % 100)
blender_hash = parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
blender_glibc = builder.split('_')[1]
if os.path.exists(release_dir):
for f in os.listdir(release_dir):
if os.path.isfile(os.path.join(release_dir, f)):
os.remove(os.path.join(release_dir, f))
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_squeeze_x86_64'
bits = 64
blender_arch = 'x86_64'
elif builder.endswith('i686_cmake'):
chroot_name = 'buildbot_squeeze_i686'
bits = 32
blender_arch = 'i686'
# Strip all unused symbols from the binaries
print("Stripping binaries...")
chroot_prefix = ['schroot', '-c', chroot_name, '--']
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender, blenderplayer])
print("Stripping python...")
py_target = os.path.join(install_dir, blender_version)
subprocess.call(chroot_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
# Copy all specific files which are too specific to be copied by
# the CMake rules themselves
print("Copying extra scripts and libs...")
extra = '/' + os.path.join('home', 'sources', 'release-builder', 'extra')
mesalibs = os.path.join(extra, 'mesalibs' + str(bits) + '.tar.bz2')
software_gl = os.path.join(blender_dir, 'release', 'bin', 'blender-softwaregl')
icons = os.path.join(blender_dir, 'release', 'freedesktop', 'icons')
os.system('tar -xpf %s -C %s' % (mesalibs, install_dir))
os.system('cp %s %s' % (software_gl, install_dir))
os.system('cp -r %s %s' % (icons, install_dir))
os.system('chmod 755 %s' % (os.path.join(install_dir, 'blender-softwaregl')))
# Construct archive name
package_name = 'blender-%s-%s-linux-%s-%s' % (blender_version,
blender_hash,
blender_glibc,
blender_arch)
if branch != '':
package_name = branch + "-" + package_name
upload_filename = package_name + ".tar.bz2"
print("Creating .tar.bz2 archive")
upload_filepath = install_dir + '.tar.bz2'
create_tar_bz2(install_dir, upload_filepath, package_name)
else:
print("Unknown building system")
# create release package
try:
subprocess.call(['make', 'package_archive'])
except Exception as ex:
sys.stderr.write('Make package release failed' + str(ex) + '\n')
sys.exit(1)
# find release directory, must exist this time
if not os.path.exists(release_dir):
sys.stderr.write("Failed to find release directory %r.\n" % release_dir)
sys.exit(1)
if upload_filepath is None:
# clean release directory if it already exists
release_dir = 'release'
# find release package
file = None
filepath = None
if os.path.exists(release_dir):
for f in os.listdir(release_dir):
if os.path.isfile(os.path.join(release_dir, f)):
os.remove(os.path.join(release_dir, f))
for f in os.listdir(release_dir):
rf = os.path.join(release_dir, f)
if os.path.isfile(rf) and f.startswith('blender'):
file = f
filepath = rf
# create release package
try:
subprocess.call(['make', 'package_archive'])
except Exception as ex:
sys.stderr.write('Make package release failed' + str(ex) + '\n')
sys.exit(1)
# find release directory, must exist this time
if not os.path.exists(release_dir):
sys.stderr.write("Failed to find release directory %r.\n" % release_dir)
sys.exit(1)
# find release package
file = None
filepath = None
for f in os.listdir(release_dir):
rf = os.path.join(release_dir, f)
if os.path.isfile(rf) and f.startswith('blender'):
file = f
filepath = rf
if not file:
sys.stderr.write("Failed to find release package.\n")
sys.exit(1)
upload_filename = file
upload_filepath = filepath
if not file:
sys.stderr.write("Failed to find release package.\n")
sys.exit(1)
# create zip file
try:
upload_zip = os.path.join(buildbot_upload_zip)
upload_zip = "buildbot_upload.zip"
if os.path.exists(upload_zip):
os.remove(upload_zip)
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write(upload_filepath, arcname=upload_filename)
z.write(filepath, arcname=file)
z.close()
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')

View File

@@ -19,7 +19,6 @@
# <pep8 compliant>
import subprocess
import os
import sys
# get builder name
@@ -34,26 +33,8 @@ blender_dir = '../blender.git'
if "cmake" in builder:
# cmake
print("Automated tests are still DISABLED!")
sys.exit(0)
build_dir = os.path.abspath(os.path.join('..', 'build', builder))
chroot_name = None
chroot_prefix = []
"""
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_squeeze_x86_64'
elif builder.endswith('i686_cmake'):
chroot_name = 'buildbot_squeeze_i686'
if chroot_name:
chroot_prefix = ['schroot', '-c', chroot_name, '--']
"""
os.chdir(build_dir)
retcode = subprocess.call(chroot_prefix + ['ctest', '--output-on-failure'])
retcode = subprocess.call(['ctest', '.' '--output-on-failure'])
sys.exit(retcode)
else:
print("Unknown building system")
sys.exit(1)
# scons
pass

View File

@@ -1,16 +1,15 @@
# - Find Alembic library
# Find the native Alembic includes and libraries
# Find the native Alembic includes and library
# This module defines
# ALEMBIC_INCLUDE_DIRS, where to find Alembic headers, Set when
# ALEMBIC_INCLUDE_DIR is found.
# ALEMBIC_INCLUDE_DIRS, where to find Alembic headers.
# ALEMBIC_LIBRARIES, libraries to link against to use Alembic.
# ALEMBIC_ROOT_DIR, The base directory to search for Alembic.
# This can also be an environment variable.
# ALEMBIC_FOUND, If false, do not try to use Alembic.
#
# ALEMBIC_HDF5_FOUND, indicates whether Alembic supports HDF5
#=============================================================================
# Copyright 2016 Blender Foundation.
# Copyright 2013 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -34,6 +33,15 @@ SET(_alembic_SEARCH_DIRS
/opt/lib/alembic
)
SET(_alembic_FIND_COMPONENTS
AlembicAbc
AlembicAbcCoreAbstract
AlembicAbcGeom
AlembicAbcCoreOgawa
AlembicOgawa
AlembicUtil
)
FIND_PATH(ALEMBIC_INCLUDE_DIR
NAMES
Alembic/Abc/All.h
@@ -43,28 +51,53 @@ FIND_PATH(ALEMBIC_INCLUDE_DIR
include
)
FIND_LIBRARY(ALEMBIC_LIBRARY
SET(_alembic_LIBRARIES)
FOREACH(COMPONENT ${_alembic_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(ALEMBIC_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
lib
lib/static
)
MARK_AS_ADVANCED(ALEMBIC_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _alembic_LIBRARIES "${ALEMBIC_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
# Sepcial handling of optional libraries
FIND_LIBRARY(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY
NAMES
Alembic
AlembicAbcCoreHDF5
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib lib/static
)
lib
lib/static
)
MARK_AS_ADVANCED(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY)
IF(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY)
LIST(APPEND _alembic_LIBRARIES "${ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY}")
SET(ALEMBIC_HDF5_FOUND TRUE)
ELSE()
SET(ALEMBIC_HDF5_FOUND FALSE)
ENDIF()
# 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)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Alembic DEFAULT_MSG
_alembic_LIBRARIES ALEMBIC_INCLUDE_DIR)
IF(ALEMBIC_FOUND)
SET(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARY})
SET(ALEMBIC_LIBRARIES ${_alembic_LIBRARIES})
SET(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
ENDIF(ALEMBIC_FOUND)
MARK_AS_ADVANCED(
ALEMBIC_INCLUDE_DIR
ALEMBIC_LIBRARY
ALEMBIC_LIBRARIES
)
UNSET(_alembic_SEARCH_DIRS)

View File

@@ -1,113 +0,0 @@
# - Try to find audaspace
# Once done, this will define
#
# AUDASPACE_FOUND - system has audaspace
# AUDASPACE_INCLUDE_DIRS - the audaspace include directories
# AUDASPACE_LIBRARIES - link these to use audaspace
# AUDASPACE_C_FOUND - system has audaspace's C binding
# AUDASPACE_C_INCLUDE_DIRS - the audaspace's C binding include directories
# AUDASPACE_C_LIBRARIES - link these to use audaspace's C binding
# AUDASPACE_PY_FOUND - system has audaspace's python binding
# AUDASPACE_PY_INCLUDE_DIRS - the audaspace's python binding include directories
# AUDASPACE_PY_LIBRARIES - link these to use audaspace's python binding
IF(NOT AUDASPACE_ROOT_DIR AND NOT $ENV{AUDASPACE_ROOT_DIR} STREQUAL "")
SET(AUDASPACE_ROOT_DIR $ENV{AUDASPACE_ROOT_DIR})
ENDIF()
SET(_audaspace_SEARCH_DIRS
${AUDASPACE_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
# Use pkg-config to get hints about paths
FIND_PACKAGE(PkgConfig)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(AUDASPACE_PKGCONF audaspace)
ENDIF(PKG_CONFIG_FOUND)
# Include dir
FIND_PATH(AUDASPACE_INCLUDE_DIR
NAMES ISound.h
HINTS ${_audaspace_SEARCH_DIRS}
PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES include/audaspace
)
# Library
FIND_LIBRARY(AUDASPACE_LIBRARY
NAMES audaspace
HINTS ${_audaspace_SEARCH_DIRS}
PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
PATH_SUFFIXES lib lib64
)
# Include dir
FIND_PATH(AUDASPACE_C_INCLUDE_DIR
NAMES AUD_Sound.h
HINTS ${_audaspace_SEARCH_DIRS}
PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES include/audaspace
)
# Library
FIND_LIBRARY(AUDASPACE_C_LIBRARY
NAMES audaspace-c
HINTS ${_audaspace_SEARCH_DIRS}
PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
PATH_SUFFIXES lib lib64
)
# Include dir
FIND_PATH(AUDASPACE_PY_INCLUDE_DIR
NAMES python/PyAPI.h
HINTS ${_audaspace_SEARCH_DIRS}
PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
PATH_SUFFIXES include/audaspace
)
# Library
FIND_LIBRARY(AUDASPACE_PY_LIBRARY
NAMES audaspace-py
HINTS ${_audaspace_SEARCH_DIRS}
PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
PATH_SUFFIXES lib lib64
)
FIND_PACKAGE(PackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace DEFAULT_MSG AUDASPACE_LIBRARY AUDASPACE_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_C DEFAULT_MSG AUDASPACE_C_LIBRARY AUDASPACE_C_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_Py DEFAULT_MSG AUDASPACE_PY_LIBRARY AUDASPACE_PY_INCLUDE_DIR)
IF(AUDASPACE_FOUND)
SET(AUDASPACE_LIBRARIES ${AUDASPACE_LIBRARY})
SET(AUDASPACE_INCLUDE_DIRS ${AUDASPACE_INCLUDE_DIR})
ENDIF(AUDASPACE_FOUND)
IF(AUDASPACE_C_FOUND)
SET(AUDASPACE_C_LIBRARIES ${AUDASPACE_C_LIBRARY})
SET(AUDASPACE_C_INCLUDE_DIRS ${AUDASPACE_C_INCLUDE_DIR})
ENDIF(AUDASPACE_C_FOUND)
IF(AUDASPACE_PY_FOUND)
SET(AUDASPACE_PY_LIBRARIES ${AUDASPACE_PY_LIBRARY})
SET(AUDASPACE_PY_INCLUDE_DIRS ${AUDASPACE_PY_INCLUDE_DIR})
ENDIF(AUDASPACE_PY_FOUND)
MARK_AS_ADVANCED(
AUDASPACE_LIBRARY
AUDASPACE_LIBRARIES
AUDASPACE_INCLUDE_DIR
AUDASPACE_INCLUDE_DIRS
AUDASPACE_C_LIBRARY
AUDASPACE_C_LIBRARIES
AUDASPACE_C_INCLUDE_DIR
AUDASPACE_C_INCLUDE_DIRS
AUDASPACE_PY_LIBRARY
AUDASPACE_PY_LIBRARIES
AUDASPACE_PY_INCLUDE_DIR
AUDASPACE_PY_INCLUDE_DIRS
)

View File

@@ -1,15 +1,14 @@
# - Find HDF5 library
# Find the native HDF5 includes and libraries
# Find the native hdf5 includes and library
# This module defines
# HDF5_INCLUDE_DIRS, where to find hdf5.h, Set when HDF5_INCLUDE_DIR is found.
# HDF5_LIBRARIES, libraries to link against to use HDF5.
# HDF5_ROOT_DIR, The base directory to search for HDF5.
# HDF5_INCLUDE_DIRS, where to find hdf5 headers.
# HDF5_LIBRARIES, libraries to link against to use hdf5.
# HDF5_ROOT_DIR, The base directory to search for hdf5.
# This can also be an environment variable.
# HDF5_FOUND, If false, do not try to use HDF5.
#
# HDF5_FOUND, If false, do not try to use hdf5.
#=============================================================================
# Copyright 2016 Blender Foundation.
# Copyright 2013 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -33,37 +32,44 @@ SET(_hdf5_SEARCH_DIRS
/opt/lib/hdf5
)
FIND_LIBRARY(HDF5_LIBRARY
NAMES
hdf5
HINTS
${_hdf5_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
SET(_hdf5_FIND_COMPONENTS
hdf5
hdf5_hl
)
FIND_PATH(HDF5_INCLUDE_DIR
FIND_PATH(_hdf5_INCLUDE_DIRS
NAMES
hdf5.h
HINTS
${_hdf5_SEARCH_DIRS}
PATH_SUFFIXES
include
)
# handle the QUIETLY and REQUIRED arguments and set HDF5_FOUND to TRUE if
SET(_hdf5_LIBRARIES)
FOREACH(COMPONENT ${_hdf5_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(HDF5_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_hdf5_SEARCH_DIRS}
)
MARK_AS_ADVANCED(HDF5_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _hdf5_LIBRARIES "${HDF5_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set HDF5_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG HDF5_LIBRARY HDF5_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(hdf5 DEFAULT_MSG
_hdf5_LIBRARIES _hdf5_INCLUDE_DIRS)
IF(HDF5_FOUND)
SET(HDF5_LIBRARIES ${HDF5_LIBRARY})
SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
SET(HDF5_LIBRARIES ${_hdf5_LIBRARIES})
SET(HDF5_INCLUDE_DIRS ${_hdf5_INCLUDE_DIRS})
ENDIF(HDF5_FOUND)
MARK_AS_ADVANCED(
HDF5_INCLUDE_DIR
HDF5_LIBRARY
HDF5_INCLUDE_DIRS
HDF5_LIBRARIES
)
UNSET(_hdf5_SEARCH_DIRS)

View File

@@ -57,13 +57,6 @@ if(NOT LLVM_LIBPATH)
set(LLVM_LIBPATH ${LLVM_LIBPATH} CACHE PATH "Path to the LLVM library path")
mark_as_advanced(LLVM_LIBPATH)
endif()
if(NOT LLVM_INCLUDE_DIRS)
execute_process(COMMAND ${LLVM_CONFIG} --includedir
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} CACHE PATH "Path to the LLVM include directory")
mark_as_advanced(LLVM_INCLUDE_DIRS)
endif()
if(LLVM_STATIC)
find_library(LLVM_LIBRARY
@@ -71,9 +64,7 @@ if(LLVM_STATIC)
PATHS ${LLVM_LIBPATH})
else()
find_library(LLVM_LIBRARY
NAMES
LLVM-${LLVM_VERSION}
LLVMAnalysis # check for the static library as a fall-back
NAMES LLVM-${LLVM_VERSION}
PATHS ${LLVM_LIBPATH})
endif()
@@ -87,9 +78,6 @@ if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY "${LLVM_LIBRARY}")
# libterminfo is missing in llvm-config --libfiles
set(LLVM_LIBRARY ${LLVM_LIBRARY} tinfo)
endif()
endif()

View File

@@ -59,8 +59,7 @@ FIND_LIBRARY(OPENIMAGEIO_LIBRARY
FIND_FILE(OPENIMAGEIO_IDIFF
NAMES
idiff
HINTS
${OPENIMAGEIO_ROOT_DIR}
${OPENIMAGEIO_ROOT_DIR}
PATH_SUFFIXES
bin
)

View File

@@ -1,112 +0,0 @@
# - Find OpenSubdiv library
# Find the native OpenSubdiv includes and library
# This module defines
# OPENSUBDIV_INCLUDE_DIRS, where to find OpenSubdiv headers, Set when
# OPENSUBDIV_INCLUDE_DIR is found.
# OPENSUBDIV_LIBRARIES, libraries to link against to use OpenSubdiv.
# OPENSUBDIV_ROOT_DIR, the base directory to search for OpenSubdiv.
# This can also be an environment variable.
# OPENSUBDIV_FOUND, if false, do not try to use OpenSubdiv.
#
# also defined, but not for general use are
# OPENSUBDIV_LIBRARY, where to find the OpenSubdiv library.
#=============================================================================
# Copyright 2013 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If OPENSUBDIV_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENSUBDIV_ROOT_DIR AND NOT $ENV{OPENSUBDIV_ROOT_DIR} STREQUAL "")
SET(OPENSUBDIV_ROOT_DIR $ENV{OPENSUBDIV_ROOT_DIR})
ENDIF()
SET(_opensubdiv_FIND_COMPONENTS
osdGPU
osdCPU
)
SET(_opensubdiv_SEARCH_DIRS
${OPENSUBDIV_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/opensubdiv
/opt/lib/osd # install_deps.sh
)
FIND_PATH(OPENSUBDIV_INCLUDE_DIR
NAMES
opensubdiv/osd/mesh.h
HINTS
${_opensubdiv_SEARCH_DIRS}
PATH_SUFFIXES
include
)
SET(_opensubdiv_LIBRARIES)
FOREACH(COMPONENT ${_opensubdiv_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(OPENSUBDIV_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_opensubdiv_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
LIST(APPEND _opensubdiv_LIBRARIES "${OPENSUBDIV_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
MACRO(OPENSUBDIV_CHECK_CONTROLLER
controller_include_file
variable_name)
IF(EXISTS "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv/osd/${controller_include_file}")
SET(${variable_name} TRUE)
ELSE()
SET(${variable_name} FALSE)
ENDIF()
ENDMACRO()
# handle the QUIETLY and REQUIRED arguments and set OPENSUBDIV_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSubdiv DEFAULT_MSG
_opensubdiv_LIBRARIES OPENSUBDIV_INCLUDE_DIR)
IF(OPENSUBDIV_FOUND)
SET(OPENSUBDIV_LIBRARIES ${_opensubdiv_LIBRARIES})
SET(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
# Find available compute controllers.
FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
SET(OPENSUBDIV_HAS_OPENMP TRUE)
ELSE()
SET(OPENSUBDIV_HAS_OPENMP FALSE)
ENDIF()
OPENSUBDIV_CHECK_CONTROLLER("tbbEvaluator.h" OPENSUBDIV_HAS_TBB)
OPENSUBDIV_CHECK_CONTROLLER("clEvaluator.h" OPENSUBDIV_HAS_OPENCL)
OPENSUBDIV_CHECK_CONTROLLER("cudaEvaluator.h" OPENSUBDIV_HAS_CUDA)
OPENSUBDIV_CHECK_CONTROLLER("glXFBEvaluator.h" OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
OPENSUBDIV_CHECK_CONTROLLER("glComputeEvaluator.h" OPENSUBDIV_HAS_GLSL_COMPUTE)
ENDIF(OPENSUBDIV_FOUND)
MARK_AS_ADVANCED(
OPENSUBDIV_INCLUDE_DIR
)
FOREACH(COMPONENT ${_opensubdiv_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
MARK_AS_ADVANCED(OPENSUBDIV_${UPPERCOMPONENT}_LIBRARY)
ENDFOREACH()

View File

@@ -1,74 +0,0 @@
# - Find OPENVDB library
# Find the native OPENVDB includes and library
# This module defines
# OPENVDB_INCLUDE_DIRS, where to find openvdb.h, Set when
# OPENVDB_INCLUDE_DIR is found.
# OPENVDB_LIBRARIES, libraries to link against to use OPENVDB.
# OPENVDB_ROOT_DIR, The base directory to search for OPENVDB.
# This can also be an environment variable.
# OPENVDB_FOUND, If false, do not try to use OPENVDB.
#
# also defined, but not for general use are
# OPENVDB_LIBRARY, where to find the OPENVDB library.
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If OPENVDB_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENVDB_ROOT_DIR AND NOT $ENV{OPENVDB_ROOT_DIR} STREQUAL "")
SET(OPENVDB_ROOT_DIR $ENV{OPENVDB_ROOT_DIR})
ENDIF()
SET(_openvdb_SEARCH_DIRS
${OPENVDB_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/openvdb
/opt/lib/openvdb
)
FIND_PATH(OPENVDB_INCLUDE_DIR
NAMES
openvdb/openvdb.h
HINTS
${_openvdb_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(OPENVDB_LIBRARY
NAMES
openvdb
HINTS
${_openvdb_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set OPENVDB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENVDB DEFAULT_MSG
OPENVDB_LIBRARY OPENVDB_INCLUDE_DIR)
IF(OPENVDB_FOUND)
SET(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY})
SET(OPENVDB_INCLUDE_DIRS ${OPENVDB_INCLUDE_DIR})
ENDIF(OPENVDB_FOUND)
MARK_AS_ADVANCED(
OPENVDB_INCLUDE_DIR
OPENVDB_LIBRARY
)
UNSET(_openvdb_SEARCH_DIRS)

View File

@@ -38,7 +38,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
ENDIF()
SET(PYTHON_VERSION 3.5 CACHE STRING "Python Version (major and minor only)")
SET(PYTHON_VERSION 3.4 CACHE STRING "Python Version (major and minor only)")
MARK_AS_ADVANCED(PYTHON_VERSION)
@@ -199,7 +199,7 @@ IF(PYTHONLIBSUNIX_FOUND)
)
# we need this for installation
# XXX No more valid with debian-like py3.5 packages...
# XXX No more valid with debian-like py3.4 packages...
# GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
# not required for build, just used when bundling Python.

View File

@@ -1,73 +0,0 @@
# - Find TBB library
# Find the native TBB includes and library
# This module defines
# TBB_INCLUDE_DIRS, where to find tbb.h, Set when
# TBB is found.
# TBB_LIBRARIES, libraries to link against to use TBB.
# TBB_ROOT_DIR, The base directory to search for TBB.
# This can also be an environment variable.
# TBB_FOUND, If false, do not try to use TBB.
#
# also defined, but not for general use are
# TBB_LIBRARY, where to find the TBB library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If TBB_ROOT_DIR was defined in the environment, use it.
IF(NOT TBB_ROOT_DIR AND NOT $ENV{TBB_ROOT_DIR} STREQUAL "")
SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})
ENDIF()
SET(_tbb_SEARCH_DIRS
${TBB_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/tbb
)
FIND_PATH(TBB_INCLUDE_DIR
NAMES
tbb/tbb.h
HINTS
${_tbb_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(TBB_LIBRARY
NAMES
tbb
HINTS
${_tbb_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set TBB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG
TBB_LIBRARY TBB_INCLUDE_DIR)
IF(TBB_FOUND)
SET(TBB_LIBRARIES ${TBB_LIBRARY})
SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
ELSE()
SET(TBB_TBB_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
TBB_INCLUDE_DIR
TBB_LIBRARY
)

View File

@@ -12,7 +12,7 @@
#
#=============================================================================
macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
if(WITH_GTESTS)
get_property(_current_include_directories
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -20,44 +20,30 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
set(TEST_INC
${_current_include_directories}
${CMAKE_SOURCE_DIR}/tests/gtests
${CMAKE_SOURCE_DIR}/extern/glog/src
${CMAKE_SOURCE_DIR}/extern/gflags/src
${CMAKE_SOURCE_DIR}/extern/libmv/third_party/glog/src
${CMAKE_SOURCE_DIR}/extern/libmv/third_party/gflags
${CMAKE_SOURCE_DIR}/extern/gtest/include
${CMAKE_SOURCE_DIR}/extern/gmock/include
)
unset(_current_include_directories)
add_executable(${NAME}_test ${SRC})
target_link_libraries(${NAME}_test
${EXTRA_LIBS}
${PLATFORM_LINKLIBS}
bf_testing_main
bf_intern_guardedalloc
extern_gtest
extern_gmock
# needed for glog
${PTHREADS_LIBRARIES}
extern_glog
extern_gflags)
extern_glog)
set_target_properties(${NAME}_test PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}"
INCLUDE_DIRECTORIES "${TEST_INC}")
if(${DO_ADD_TEST})
add_test(${NAME}_test ${TESTS_OUTPUT_DIR}/${NAME}_test)
endif()
add_test(${NAME}_test ${TESTS_OUTPUT_DIR}/${NAME}_test)
endif()
endmacro()
macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
BLENDER_SRC_GTEST_EX("${NAME}" "${SRC}" "${EXTRA_LIBS}" "TRUE")
endmacro()
macro(BLENDER_TEST NAME EXTRA_LIBS)
BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "TRUE")
endmacro()
macro(BLENDER_TEST_PERFORMANCE NAME EXTRA_LIBS)
BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "FALSE")
BLENDER_SRC_GTEST("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}")
endmacro()

View File

@@ -1,10 +1,5 @@
# This is called by cmake as an external process from
# This is called by cmake as an extermal process from
# ./source/creator/CMakeLists.txt to write ./source/creator/buildinfo.h
# Caller must define:
# SOURCE_DIR
# Optional overrides:
# BUILD_DATE
# BUILD_TIME
# Extract working copy information for SOURCE_DIR into MY_XXX variables
# with a default in case anything fails, for example when using git-svn
@@ -14,138 +9,133 @@ set(MY_WC_COMMIT_TIMESTAMP 0)
# Guess if this is a git working copy and then look up the revision
if(EXISTS ${SOURCE_DIR}/.git)
execute_process(COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# The FindGit.cmake module is part of the standard distribution
include(FindGit)
if(GIT_FOUND)
message(STATUS "-- Found Git: ${GIT_EXECUTABLE}")
if(MY_WC_BRANCH STREQUAL "HEAD")
# Detached HEAD, check whether commit hash is reachable
# in the master branch
execute_process(COMMAND git rev-parse --short HEAD
execute_process(COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_VARIABLE MY_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git branch --list master --contains ${MY_WC_HASH}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_contains_check
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "^[ \t]+" "" _git_contains_check "${_git_contains_check}")
if(_git_contains_check STREQUAL "master")
set(MY_WC_BRANCH "master")
else()
execute_process(COMMAND git show-ref --tags -d
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_tag_hashes
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_head_hash
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_git_tag_hashes MATCHES "${_git_head_hash}")
set(MY_WC_BRANCH "master")
endif()
unset(_git_tag_hashes)
unset(_git_head_hashs)
endif()
unset(_git_contains_check)
else()
execute_process(COMMAND git log HEAD..@{u}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_below_check
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(NOT _git_below_check STREQUAL "")
# If there're commits between HEAD and upstream this means
# that we're reset-ed to older revision. Use it's hash then.
if(MY_WC_BRANCH STREQUAL "HEAD")
# Detached HEAD, check whether commit hash is reachable
# in the master branch
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
execute_process(COMMAND git rev-parse --short @{u}
execute_process(COMMAND git branch --list master --contains ${MY_WC_HASH}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_VARIABLE _git_contains_check
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "^[ \t]+" "" _git_contains_check "${_git_contains_check}")
if(_git_contains_check STREQUAL "master")
set(MY_WC_BRANCH "master")
else()
execute_process(COMMAND git show-ref --tags -d
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_tag_hashes
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_head_hash
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_git_tag_hashes MATCHES "${_git_head_hash}")
set(MY_WC_BRANCH "master")
endif()
unset(_git_tag_hashes)
unset(_git_head_hashs)
endif()
unset(_git_contains_check)
else()
execute_process(COMMAND git log HEAD..@{u}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_below_check
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(MY_WC_HASH STREQUAL "")
# Local branch, not set to upstream.
# Well, let's use HEAD for now
if(NOT _git_below_check STREQUAL "")
# If there're commits between HEAD and upstream this means
# that we're reset-ed to older revision. Use it's hash then.
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
execute_process(COMMAND git rev-parse --short @{u}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(MY_WC_HASH STREQUAL "")
# Local branch, not set to upstream.
# Well, let's use HEAD for now
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
if(MY_WC_BRANCH MATCHES "^blender-v")
set(MY_WC_BRANCH "master")
endif()
unset(_git_below_check)
endif()
if(MY_WC_BRANCH MATCHES "^blender-v")
set(MY_WC_BRANCH "master")
endif()
unset(_git_below_check)
endif()
execute_process(COMMAND git log -1 --format=%ct
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_COMMIT_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
# May fail in rare cases
if(MY_WC_COMMIT_TIMESTAMP STREQUAL "")
set(MY_WC_COMMIT_TIMESTAMP 0)
endif()
# Update GIT index before getting dirty files
execute_process(COMMAND git update-index -q --refresh
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git diff-index --name-only HEAD --
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_changed_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _git_changed_files STREQUAL "")
set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)")
else()
# Unpushed commits are also considered local modifications
execute_process(COMMAND git log @{u}..
execute_process(COMMAND git log -1 --format=%ct
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_unpushed_log
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(NOT _git_unpushed_log STREQUAL "")
set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)")
endif()
unset(_git_unpushed_log)
endif()
OUTPUT_VARIABLE MY_WC_COMMIT_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
unset(_git_changed_files)
# Update GIT index before getting dirty files
execute_process(COMMAND git update-index -q --refresh
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git diff-index --name-only HEAD --
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_changed_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _git_changed_files STREQUAL "")
set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)")
else()
# Unpushed commits are also considered local modifications
execute_process(COMMAND git log @{u}..
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_unpushed_log
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(NOT _git_unpushed_log STREQUAL "")
set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)")
endif()
unset(_git_unpushed_log)
endif()
unset(_git_changed_files)
endif()
endif()
# BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
# but BUILD_DATE and BUILD_TIME are platform dependent
if(UNIX)
if(NOT BUILD_DATE)
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT BUILD_TIME)
execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
elseif(WIN32)
if(NOT BUILD_DATE)
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT BUILD_TIME)
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(WIN32)
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
# Write a file with the BUILD_HASH define

View File

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

View File

@@ -29,11 +29,11 @@ if not sys.version.startswith("3"):
sys.exit(1)
from cmake_consistency_check_config import (
IGNORE,
UTF8_CHECK,
SOURCE_DIR,
BUILD_DIR,
)
IGNORE,
UTF8_CHECK,
SOURCE_DIR,
BUILD_DIR,
)
import os
@@ -240,10 +240,9 @@ def cmake_get_src(f):
filen.close()
def is_ignore(f, ignore_used):
for index, ig in enumerate(IGNORE):
def is_ignore(f):
for ig in IGNORE:
if ig in f:
ignore_used[index] = True
return True
return False
@@ -279,17 +278,16 @@ def main():
# Write a 'sed' script, useful if we get a lot of these
# print("sed '%dd' '%s' > '%s.tmp' ; mv '%s.tmp' '%s'" % (i, cf, cf, cf, cf))
if is_err:
raise Exception("CMake referenecs missing files, aborting!")
del is_err
del errs
ignore_used = [False] * len(IGNORE)
# now check on files not accounted for.
print("\nC/C++ Files CMake doesnt know about...")
for cf in sorted(source_list(SOURCE_DIR, is_c)):
if not is_ignore(cf, ignore_used):
if not is_ignore(cf):
if cf not in global_c:
print("missing_c: ", cf)
@@ -306,7 +304,7 @@ def main():
print("\nC/C++ Headers CMake doesnt know about...")
for hf in sorted(source_list(SOURCE_DIR, is_c_header)):
if not is_ignore(hf, ignore_used):
if not is_ignore(hf):
if hf not in global_h:
print("missing_h: ", hf)
@@ -327,12 +325,5 @@ def main():
if i > 1:
traceback.print_exc()
# Check ignores aren't stale
print("\nCheck for unused 'IGNORE' paths...")
for index, ig in enumerate(IGNORE):
if not ignore_used[index]:
print("unused ignore: %r" % ig)
if __name__ == "__main__":
main()

View File

@@ -3,9 +3,16 @@ import os
IGNORE = (
"/test/",
"/tests/gtests/",
"/BSP_GhostTest/",
"/release/",
"/xembed/",
"/TerraplayNetwork/",
"/ik_glut_test/",
# specific source files
"extern/Eigen2/Eigen/src/Cholesky/CholeskyInstantiations.cpp",
"extern/Eigen2/Eigen/src/Core/CoreInstantiations.cpp",
"extern/Eigen2/Eigen/src/QR/QrInstantiations.cpp",
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp",
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp",
"extern/bullet2/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp",
@@ -14,8 +21,31 @@ IGNORE = (
"extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp",
"extern/eltopo/common/meshes/ObjLoader.cpp",
"extern/eltopo/common/meshes/meshloader.cpp",
"extern/eltopo/common/openglutils.cpp",
"extern/eltopo/eltopo3d/broadphase_blenderbvh.cpp",
"source/blender/imbuf/intern/imbuf_cocoa.m",
"extern/recastnavigation/Recast/Source/RecastLog.cpp",
"extern/recastnavigation/Recast/Source/RecastTimer.cpp",
"intern/audaspace/SRC/AUD_SRCResampleFactory.cpp",
"intern/audaspace/SRC/AUD_SRCResampleReader.cpp",
"intern/cycles/render/film_response.cpp",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_2.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_3.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_4.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_d.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_3.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_4.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_9.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_d.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_3.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_4.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_d.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_2.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_3.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_4.cc",
"extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_d.cc",
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h",
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h",
@@ -25,13 +55,21 @@ IGNORE = (
"extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.h",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h",
"extern/carve/include/carve/config.h",
"extern/carve/include/carve/random/random.h",
"extern/carve/patches/files/config.h",
"extern/carve/patches/files/random.h",
"extern/eltopo/common/meshes/Edge.hpp",
"extern/eltopo/common/meshes/ObjLoader.hpp",
"extern/eltopo/common/meshes/TriangleIndex.hpp",
"extern/eltopo/common/meshes/meshloader.h",
"extern/eltopo/eltopo3d/broadphase_blenderbvh.h",
"extern/recastnavigation/Recast/Include/RecastLog.h",
"extern/recastnavigation/Recast/Include/RecastTimer.h",
"intern/audaspace/SRC/AUD_SRCResampleFactory.h",
"intern/audaspace/SRC/AUD_SRCResampleReader.h",
)
"intern/cycles/render/film_response.h",
"extern/carve/include/carve/config.h",
"extern/carve/include/carve/external/boost/random.hpp",
"extern/carve/patches/files/config.h",
"extern/carve/patches/files/random.hpp",
)
UTF8_CHECK = True

View File

@@ -29,27 +29,19 @@ Example linux usage
Windows not supported so far
"""
import sys
# until we have arg parsing
import project_info
if not project_info.init(sys.argv[-1]):
sys.exit(1)
from project_info import (
SIMPLE_PROJECTFILE,
SOURCE_DIR,
CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
# is_py,
cmake_advanced_info,
cmake_compiler_defines,
cmake_cache_var,
project_name_get,
)
SIMPLE_PROJECTFILE,
SOURCE_DIR,
CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
# is_py,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
import os
@@ -57,8 +49,6 @@ from os.path import join, dirname, normpath, relpath, exists
def create_nb_project_main():
from xml.sax.saxutils import escape
files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
files_rel.sort()
@@ -81,9 +71,6 @@ def create_nb_project_main():
# be tricky, get the project name from git if we can!
PROJECT_NAME = project_name_get()
make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
make_exe_basename = os.path.basename(make_exe)
# --------------- NB spesific
defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines]
defines += [cdef.replace("#define", "").strip() for cdef in cmake_compiler_defines()]
@@ -144,9 +131,9 @@ def create_nb_project_main():
f = open(join(PROJECT_DIR_NB, "configurations.xml"), 'w')
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
f.write('<configurationDescriptor version="95">\n')
f.write('<configurationDescriptor version="94">\n')
f.write(' <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">\n')
f.write(' <df root="%s" name="0">\n' % SOURCE_DIR) # base_root_rel
f.write(' <df name="0" root="%s">\n' % SOURCE_DIR) # base_root_rel
# write files!
files_rel_local = [normpath(relpath(join(CMAKE_DIR, path), SOURCE_DIR)) for path in files_rel]
@@ -198,27 +185,16 @@ def create_nb_project_main():
f.write(' <toolsSet>\n')
f.write(' <compilerSet>default</compilerSet>\n')
f.write(' <dependencyChecking>false</dependencyChecking>\n')
f.write(' <rebuildPropChanged>false</rebuildPropChanged>\n')
f.write(' </toolsSet>\n')
f.write(' <codeAssistance>\n')
f.write(' </codeAssistance>\n')
f.write(' <dependencyChecking>false</dependencyChecking>\n')
f.write(' <rebuildPropChanged>false</rebuildPropChanged>\n')
f.write(' <makefileType>\n')
f.write(' <makeTool>\n')
f.write(' <buildCommandWorkingDir>.</buildCommandWorkingDir>\n')
if make_exe_basename == "ninja":
build_cmd = "ninja"
clean_cmd = "ninja -t clean"
else:
build_cmd = "${MAKE} -f Makefile"
clean_cmd = "${MAKE} -f Makefile clean"
f.write(' <buildCommand>%s</buildCommand>\n' % escape(build_cmd))
f.write(' <cleanCommand>%s</cleanCommand>\n' % escape(clean_cmd))
f.write(' <buildCommand>${MAKE} -f Makefile</buildCommand>\n')
f.write(' <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>\n')
f.write(' <executablePath>./bin/blender</executablePath>\n')
del build_cmd, clean_cmd
def write_toolinfo():
f.write(' <incDir>\n')
@@ -227,7 +203,7 @@ def create_nb_project_main():
f.write(' </incDir>\n')
f.write(' <preprocessorList>\n')
for cdef in defines:
f.write(' <Elem>%s</Elem>\n' % escape(cdef))
f.write(' <Elem>%s</Elem>\n' % cdef)
f.write(' </preprocessorList>\n')
f.write(' <cTool>\n')
@@ -245,11 +221,10 @@ def create_nb_project_main():
f.write(' \n')
for path in files_rel_local:
is_c = path.endswith(".c")
f.write(' <item path="%s"\n' % path)
f.write(' ex="false"\n')
f.write(' tool="%d"\n' % (0 if is_c else 1))
f.write(' flavor2="%d">\n' % (3 if is_c else 0))
f.write(' tool="1"\n')
f.write(' flavor2="0">\n')
f.write(' </item>\n')
f.write(' <runprofile version="9">\n')

View File

@@ -24,14 +24,28 @@
r"""
Example Linux usage:
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py --build-dir ~/blender-git/cmake
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake
Example Win32 usage:
c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py --build-dir c:\blender_dev\cmake_build
c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build
"""
from project_info import (
SIMPLE_PROJECTFILE,
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
is_py,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
import os
import sys
def quote_define(define):
@@ -41,20 +55,7 @@ def quote_define(define):
return define
def create_qtc_project_main(name):
from project_info import (
SIMPLE_PROJECTFILE,
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
def create_qtc_project_main():
files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
files_rel.sort()
@@ -62,14 +63,14 @@ def create_qtc_project_main(name):
# --- qtcreator specific, simple format
if SIMPLE_PROJECTFILE:
# --- qtcreator specific, simple format
PROJECT_NAME = name or "Blender"
PROJECT_NAME = "Blender"
FILE_NAME = PROJECT_NAME.lower()
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f:
f.write("\n".join(files_rel))
with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') as f:
f.write("\n".join(sorted(list(set(os.path.dirname(f)
for f in files_rel if is_c_header(f))))))
for f in files_rel if is_c_header(f))))))
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
with open(qtc_prj, 'w') as f:
@@ -87,11 +88,14 @@ def create_qtc_project_main(name):
# for some reason it doesnt give all internal includes
includes = list(set(includes) | set(os.path.dirname(f)
for f in files_rel if is_c_header(f)))
for f in files_rel if is_c_header(f)))
includes.sort()
# be tricky, get the project name from CMake if we can!
PROJECT_NAME = name or project_name_get()
if 0:
PROJECT_NAME = "Blender"
else:
# be tricky, get the project name from CMake if we can!
PROJECT_NAME = project_name_get()
FILE_NAME = PROJECT_NAME.lower()
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f:
@@ -115,7 +119,7 @@ def create_qtc_project_main(name):
f.write("\n")
defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines]
if os.name != "nt":
if sys.platform != "win32":
defines_final += cmake_compiler_defines()
f.write("\n".join(defines_final))
@@ -123,23 +127,17 @@ def create_qtc_project_main(name):
# --- end
def create_qtc_project_python(name):
from project_info import (
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_py,
project_name_get,
)
def create_qtc_project_python():
files = list(source_list(SOURCE_DIR, filename_check=is_py))
files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
files_rel.sort()
# --- qtcreator specific, simple format
# be tricky, get the project name from git if we can!
PROJECT_NAME = (name or project_name_get()) + "_Python"
if 0:
PROJECT_NAME = "Blender_Python"
else:
# be tricky, get the project name from git if we can!
PROJECT_NAME = project_name_get() + "_Python"
FILE_NAME = PROJECT_NAME.lower()
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f:
@@ -157,43 +155,9 @@ def create_qtc_project_python(name):
print("Python project file written to: %r" % qtc_prj)
def argparse_create():
import argparse
parser = argparse.ArgumentParser(
description="This script generates Qt Creator project files for Blender",
)
parser.add_argument(
"-n", "--name",
dest="name",
metavar='NAME', type=str,
help="Override default project name (\"Blender\")",
required=False,
)
parser.add_argument(
"-b", "--build-dir",
dest="build_dir",
metavar='BUILD_DIR', type=str,
help="Specify the build path (or fallback to the $PWD)",
required=False,
)
return parser
def main():
parser = argparse_create()
args = parser.parse_args()
name = args.name
import project_info
if not project_info.init(args.build_dir):
return
create_qtc_project_main(name)
create_qtc_project_python(name)
create_qtc_project_main()
create_qtc_project_python()
if __name__ == "__main__":

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,20 +1,18 @@
# Turn everything ON thats expected for an official release builds.
# turn everything OFF except for python which defaults to ON
# and is needed for the UI
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/blender_full.cmake ../blender
#
set(WITH_ALEMBIC ON CACHE BOOL "" FORCE)
set(WITH_BUILDINFO ON CACHE BOOL "" FORCE)
set(WITH_BULLET ON CACHE BOOL "" FORCE)
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_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)
@@ -27,6 +25,7 @@ set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_REDCODE ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
@@ -43,8 +42,7 @@ set(WITH_OPENAL ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
set(WITH_OPENMP ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
set(WITH_OPENNL ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
set(WITH_SDL ON CACHE BOOL "" FORCE)
@@ -54,24 +52,11 @@ set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
# platform dependent options
if(UNIX AND NOT APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
elseif(WIN32)
set(WITH_JACK OFF CACHE BOOL "" FORCE)
if(NOT CMAKE_COMPILER_IS_GNUCC)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
else()
# MinGW exceptions
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
endif()
elseif(APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME ON CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
endif()
if(APPLE)
set(WITH_CODEC_QUICKTIME ON CACHE BOOL "" FORCE)
endif()

View File

@@ -8,17 +8,14 @@
set(WITH_INSTALL_PORTABLE ON CACHE BOOL "" FORCE)
set(WITH_SYSTEM_GLEW ON CACHE BOOL "" FORCE)
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_AVI OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_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)
@@ -31,6 +28,7 @@ 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)
set(WITH_IMAGE_REDCODE OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF OFF CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
@@ -48,7 +46,8 @@ set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_OPENNL OFF CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION OFF CACHE BOOL "" FORCE)
set(WITH_SDL OFF CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE)

View File

@@ -31,5 +31,3 @@ set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -21,10 +21,10 @@ SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
# Get the build revision, note that this can get out-of-sync, so for packaging run cmake first.
set(MY_WC_HASH "unknown")
if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
find_package(Git)
include(FindGit)
if(GIT_FOUND)
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
execute_process(COMMAND git rev-parse --short HEAD
message(STATUS "-- Found Git: ${GIT_EXECUTABLE}")
execute_process(COMMAND git rev-parse --short @{u}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -37,8 +37,7 @@ unset(MY_WC_HASH)
# Force Package Name
execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE CPACK_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME_LOWER}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-git${CPACK_DATE}.${BUILD_REV}-${CMAKE_SYSTEM_PROCESSOR})
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# RPM packages
@@ -67,14 +66,13 @@ if(WIN32)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Blender Foundation/Blender")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Blender Foundation/Blender")
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/source/icons/winblender.ico)
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt)
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_SOURCE_DIR}/source/icons/winblender.ico)
set(CPACK_WIX_UPGRADE_GUID "B767E4FD-7DE7-4094-B051-3AE62E13A17A")
set(CPACK_WIX_TEMPLATE ${LIBDIR}/package/installer_wix/WIX.template)
set(CPACK_WIX_UI_BANNER ${LIBDIR}/package/installer_wix/WIX_UI_BANNER.bmp)
set(CPACK_WIX_UI_DIALOG ${LIBDIR}/package/installer_wix/WIX_UI_DIALOG.bmp)

View File

@@ -23,9 +23,11 @@
# <pep8 compliant>
"""
Module for accessing project file data for Blender.
Example Win32 usage:
c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build
Before use, call init(cmake_build_dir).
Example Linux usage:
python ~/blenderSVN/blender/build_files/cmake/cmake_qtcreator_project.py ~/blenderSVN/cmake
"""
__all__ = (
@@ -39,8 +41,7 @@ __all__ = (
"is_py",
"cmake_advanced_info",
"cmake_compiler_defines",
"project_name_get",
"init",
"project_name_get"
)
@@ -60,26 +61,19 @@ SOURCE_DIR = abspath(SOURCE_DIR)
SIMPLE_PROJECTFILE = False
# must initialize from 'init'
CMAKE_DIR = None
# get cmake path
CMAKE_DIR = sys.argv[-1]
if not exists(join(CMAKE_DIR, "CMakeCache.txt")):
CMAKE_DIR = os.getcwd()
if not exists(join(CMAKE_DIR, "CMakeCache.txt")):
print("CMakeCache.txt not found in %r or %r\n Pass CMake build dir as an argument, or run from that dir, aborting" % (CMAKE_DIR, os.getcwd()))
sys.exit(1)
def init(cmake_path):
global CMAKE_DIR, PROJECT_DIR
# get cmake path
cmake_path = cmake_path or ""
if (not cmake_path) or (not exists(join(cmake_path, "CMakeCache.txt"))):
cmake_path = os.getcwd()
if not exists(join(cmake_path, "CMakeCache.txt")):
print("CMakeCache.txt not found in %r or %r\n"
" Pass CMake build dir as an argument, or run from that dir, aborting" %
(cmake_path, os.getcwd()))
return False
PROJECT_DIR = CMAKE_DIR = cmake_path
return True
# could be either.
# PROJECT_DIR = SOURCE_DIR
PROJECT_DIR = CMAKE_DIR
def source_list(path, filename_check=None):
@@ -136,7 +130,7 @@ def is_project_file(filename):
def cmake_advanced_info():
""" Extract includes and defines from cmake.
""" Extracr includes and defines from cmake.
"""
make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
@@ -214,12 +208,7 @@ def cmake_advanced_info():
def cmake_cache_var(var):
cache_file = open(join(CMAKE_DIR, "CMakeCache.txt"), encoding='utf-8')
lines = [
l_strip for l in cache_file
for l_strip in (l.strip(),)
if l_strip
if not l_strip.startswith(("//", "#"))
]
lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
cache_file.close()
for l in lines:

View File

@@ -23,7 +23,7 @@
__all__ = (
"build_info",
"SOURCE_DIR",
)
)
import sys
@@ -59,21 +59,14 @@ def is_c_any(filename):
CMAKE_DIR = "."
def cmake_cache_var_iter():
import re
re_cache = re.compile(r'([A-Za-z0-9_\-]+)?:?([A-Za-z0-9_\-]+)?=(.*)$')
with open(join(CMAKE_DIR, "CMakeCache.txt"), 'r', encoding='utf-8') as cache_file:
for l in cache_file:
match = re_cache.match(l.strip())
if match is not None:
var, type_, val = match.groups()
yield (var, type_ or "", val)
def cmake_cache_var(var):
for var_iter, type_iter, value_iter in cmake_cache_var_iter():
if var == var_iter:
return value_iter
cache_file = open(join(CMAKE_DIR, "CMakeCache.txt"))
lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
cache_file.close()
for l in lines:
if l.split(":")[0] == var:
return l.split("=", 1)[-1]
return None

View File

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

View File

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

View File

@@ -0,0 +1,50 @@
import os
import platform
def FindPython():
all_abi_flags = ['m', 'mu', '']
python = "/usr"
abi_flags = "m" # Most common for linux distros
version = "3.4"
_arch = platform.uname()[4] + "-linux-gnu"
# Determine ABI flags used on this system
include = os.path.join(python, "include")
for cur_flags in all_abi_flags:
inc = os.path.join(include, "python" + version + cur_flags, "Python.h")
if os.path.exists(inc):
abi_flags = cur_flags
break
# Find config.h. In some distros, such as ubuntu 12.10 they are not in standard include dir.
incconf = os.path.join(include, _arch, "python" + version + cur_flags)
if not os.path.exists(os.path.join(incconf, "pyconfig.h")):
incconf = ''
# Determine whether python is in /usr/lib or /usr/lib64
lib32 = os.path.join(python, "lib", "python" + version, "sysconfig.py")
lib64 = os.path.join(python, "lib64", "python" + version, "sysconfig.py")
if os.path.exists(lib32):
libpath = "${BF_PYTHON}/lib"
elif os.path.exists(lib64):
libpath = "${BF_PYTHON}/lib64"
else:
# roll back to default value
libpath = "${BF_PYTHON}/lib"
libpath_arch = libpath
_libpath_arch = os.path.join(python, "lib", _arch) # No lib64 stuff with recent deb-like distro afaik...
_libs = ["libpython" + version + abi_flags + ext for ext in (".so", ".a")]
for l in _libs:
if not os.path.exists(os.path.join(libpath, l)) and os.path.exists(os.path.join(_libpath_arch, l)):
libpath_arch = os.path.join(libpath, _arch)
break
return {"PYTHON": python,
"VERSION": version,
"LIBPATH": libpath,
"LIBPATH_ARCH": libpath_arch,
"ABI_FLAGS": abi_flags,
"CONFIG": incconf}

View File

@@ -0,0 +1,42 @@
def FindSharedPtr(conf):
"""
Detect shared_ptr availability
"""
found = False
namespace = None
header = None
if conf.CheckCXXHeader("memory"):
# Finding the memory header doesn't mean that shared_ptr is in std
# namespace.
#
# In particular, MSVC 2008 has shared_ptr declared in std::tr1. In
# order to support this, we do an extra check to see which namespace
# should be used.
if conf.CheckType('std::shared_ptr<int>', language = 'C++', includes="#include <memory>"):
print("-- Found shared_ptr in std namespace using <memory> header.")
namespace = 'std'
header = 'memory'
elif conf.CheckType('std::tr1::shared_ptr<int>', language = 'C++', includes="#include <memory>"):
print("-- Found shared_ptr in std::tr1 namespace using <memory> header..")
namespace = 'std::tr1'
header = 'memory'
if not namespace and conf.CheckCXXHeader("tr1/memory"):
# Further, gcc defines shared_ptr in std::tr1 namespace and
# <tr1/memory> is to be included for this. And what makes things
# even more tricky is that gcc does have <memory> header, so
# all the checks above wouldn't find shared_ptr.
if conf.CheckType('std::tr1::shared_ptr<int>', language = 'C++', includes="#include <tr1/memory>"):
print("-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header..")
namespace = 'std::tr1'
header = 'tr1/memory'
if not namespace:
print("-- Unable to find shared_ptrred_map>.")
conf.env['WITH_SHARED_PTR_SUPPORT'] = namespace and header
conf.env['SHARED_PTR_NAMESPACE'] = namespace
conf.env['SHARED_PTR_HEADER'] = header

View File

@@ -0,0 +1,38 @@
def FindUnorderedMap(conf):
"""
Detect unordered_map availability
"""
namespace = None
header = None
if conf.CheckCXXHeader("unordered_map"):
# Even so we've found unordered_map header file it doesn't
# mean unordered_map and unordered_set will be declared in
# std namespace.
#
# Namely, MSVC 2008 have unordered_map header which declares
# unordered_map class in std::tr1 namespace. In order to support
# this, we do extra check to see which exactly namespace is
# to be used.
if conf.CheckType('std::unordered_map<int, int>', language = 'CXX', includes="#include <unordered_map>"):
print("-- Found unordered_map/set in std namespace.")
namespace = 'std'
header = 'unordered_map'
elif conf.CheckType('std::tr1::unordered_map<int, int>', language = 'CXX', includes="#include <unordered_map>"):
print("-- Found unordered_map/set in std::tr1 namespace.")
namespace = 'std::tr1'
header = 'unordered_map'
else:
print("-- Found <unordered_map> but can not find neither std::unordered_map nor std::tr1::unordered_map.")
elif conf.CheckCXXHeader("tr1/unordered_map"):
print("-- Found unordered_map/set in std::tr1 namespace.")
namespace = 'std::tr1'
header = 'tr1/unordered_map'
else:
print("-- Unable to find <unordered_map> or <tr1/unordered_map>. ")
conf.env['WITH_UNORDERED_MAP_SUPPORT'] = namespace and header
conf.env['UNORDERED_MAP_NAMESPACE'] = namespace
conf.env['UNORDERED_MAP_HEADER'] = header

View File

@@ -0,0 +1,263 @@
import commands
#############################################################################
################### Compiler & architecture settings ##################
#############################################################################
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
MACOSX_SDK='' # set an sdk name like '10.7' or leave empty for automatic choosing highest available
MACOSX_DEPLOYMENT_TARGET = '10.6'
# gcc always defaults to the system standard compiler linked by a shim or symlink
CC = 'gcc'
CXX = 'g++'
LCGDIR = '#../lib/darwin-9.x.universal'
LIBDIR = '${LCGDIR}'
#############################################################################
################### Dependency settings ##################
#############################################################################
# enable ffmpeg support
WITH_BF_FFMPEG = True
BF_FFMPEG = LIBDIR + '/ffmpeg'
BF_FFMPEG_INC = "${BF_FFMPEG}/include"
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg bz2'
#bz2 is a standard osx dynlib
BF_PYTHON_VERSION = '3.4'
WITH_OSX_STATICPYTHON = True
# python 3.4 uses precompiled libraries in bf svn /lib by default
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}m'
# BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}m'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
# BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
WITH_BF_STATICOPENAL = False
BF_OPENAL_INC = '${BF_OPENAL}/include' # only headers from libdir needed for proper use of framework !!!!
#BF_OPENAL_LIB = 'openal'
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
# we use simply jack framework
WITH_BF_JACK = True
BF_JACK = '/Library/Frameworks/Jackmp.framework'
BF_JACK_INC = '${BF_JACK}/headers'
#BF_JACK_LIB = 'jack' # not used due framework
BF_JACK_LIBPATH = '${BF_JACK}'
WITH_BF_SNDFILE = True
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'sndfile FLAC ogg vorbis vorbisenc'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib ${BF_FFMPEG}/lib' #ogg libs are stored in ffmpeg dir
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
BF_SDL_LIB = 'SDL2' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
BF_SDL_LIBPATH = '${BF_SDL}/lib'
WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = '${LCGDIR}/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'jpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_OPENJPEG = True
BF_OPENJPEG = '#extern/libopenjpeg'
BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_PNG = True
BF_PNG = LIBDIR + '/png'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
BF_ZLIB = '/usr'
#BF_ZLIB_INC = '${BF_ZLIB}/include' # don't use this, it breaks -isysroot ${MACOSX_SDK}
BF_ZLIB_LIB = 'z'
WITH_BF_INTERNATIONAL = True
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_OCEANSIM = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'libfftw3'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
BF_FREETYPE = LIBDIR + '/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_QUICKTIME = True
WITH_BF_ICONV = True
BF_ICONV = '/usr'
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
#BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = True
BF_OPENGL_LIB = 'GL GLU'
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
#OpenCollada flags
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa'
BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada'
BF_PCRE = LIBDIR + '/opencollada'
BF_PCRE_LIB = 'pcre'
BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
#BF_EXPAT = '/usr'
#BF_EXPAT_LIB = 'expat'
#BF_EXPAT_LIBPATH = '/usr/lib'
# Cycles
WITH_BF_CYCLES = True
#OSL
WITH_BF_CYCLES_OSL = True
BF_OSL = LIBDIR + '/osl'
BF_OSL_INC = '${BF_OSL}/include'
# note oslexec would passed via program linkflags, which is needed to
# make llvm happy with osl_allocate_closure_component
#BF_OSL_LIB = 'oslcomp oslquery'
BF_OSL_LIBPATH = '${BF_OSL}/lib'
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
WITH_BF_LLVM = True
BF_LLVM = LIBDIR + '/llvm'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMSupport LLVMObject'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
WITH_BF_OIIO = True
BF_OIIO = LIBDIR + '/openimageio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB = 'OpenImageIO'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
WITH_BF_OCIO = True
BF_OCIO = LIBDIR + '/opencolorio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB = 'OpenColorIO tinyxml yaml-cpp'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
BF_BOOST = LIBDIR + '/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt boost_wave-mt'
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mt'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_CYCLES_CUDA_BINARIES = False
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
#Freestyle
WITH_BF_FREESTYLE = True
#OpenMP ( will be checked for compiler support and turned off eventually )
WITH_BF_OPENMP = True
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = []
# SpaceNavigator and related 3D mice, driver must be 3DxWare 10 Beta 4 (Mac OS X) or later !
WITH_BF_3DMOUSE = True
#############################################################################
################### various compile settings and flags ##################
#############################################################################
BF_QUIET = '1' # suppress verbose output
CFLAGS = []
CXXFLAGS = []
CCFLAGS = ['-pipe','-funsigned-char']
CPPFLAGS = []
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']
LLIBS = ['stdc++']
REL_CFLAGS = []
REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2']
CC_WARN = ['-Wall']
C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
##FIX_STUBS_WARNINGS = -Wno-unused
##LOPTS = --dynamic
##DYNLDFLAGS = -shared $(LDFLAGS)
BF_PROFILE_CCFLAGS = ['-pg', '-g ']
BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE = False
BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g']
#############################################################################
################### Output directories ##################
#############################################################################
BF_BUILDDIR='../build/darwin'
BF_INSTALLDIR='../install/darwin'

View File

@@ -0,0 +1,281 @@
from FindPython import FindPython
py = FindPython()
BF_PYTHON_ABI_FLAGS = py['ABI_FLAGS']
BF_PYTHON = py['PYTHON']
BF_PYTHON_LIBPATH = py['LIBPATH']
BF_PYTHON_LIBPATH_ARCH = py['LIBPATH_ARCH']
BF_PYTHON_CONFIG = py['CONFIG']
BF_PYTHON_VERSION = py['VERSION']
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS} ' + BF_PYTHON_CONFIG
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}' # BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
BF_PYTHON_LIB_STATIC = '${BF_PYTHON_LIBPATH_ARCH}/libpython${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}.a'
WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = False
BF_OPENAL = '/usr'
BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'openal'
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
WITH_BF_JACK = False
BF_JACK = '/usr'
BF_JACK_INC = '${BF_JACK}/include/jack'
BF_JACK_LIB = 'jack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
WITH_BF_STATICSNDFILE = False
BF_SNDFILE = '/usr'
BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
BF_SNDFILE_LIB = 'sndfile'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
BF_SNDFILE_LIB_STATIC = '${BF_SNDFILE}/lib/libsndfile.a ${BF_OGG}/lib/libvorbis.a ${BF_OGG}/lib/libFLAC.a ${BF_OGG}/lib/libvorbisenc.a ${BF_OGG}/lib/libogg.a'
WITH_BF_SDL = True
BF_SDL = '/usr' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = '/usr'
# when compiling with your own openexr lib you might need to set...
# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf-2_1 Iex-2_1 Imath-2_1 '
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = '/usr'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'jpeg'
WITH_BF_PNG = True
BF_PNG = '/usr'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png'
WITH_BF_TIFF = True
BF_TIFF = '/usr'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
WITH_BF_ZLIB = True
BF_ZLIB = '/usr'
BF_ZLIB_INC = '${BF_ZLIB}/include'
BF_ZLIB_LIB = 'z'
WITH_BF_INTERNATIONAL = True
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_OCEANSIM = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
WITH_BF_ELTOPO = False
BF_LAPACK = '/usr'
BF_LAPACK_LIB = 'lapack3gf blas clapack'
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
BF_FREETYPE = '/usr'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype'
#BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a'
WITH_BF_ICONV = False
BF_ICONV = "/usr"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_BINRELOC = True
# enable ffmpeg support
WITH_BF_FFMPEG = True
BF_FFMPEG = '/usr'
BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
#WITH_BF_STATICFFMPEG = True
#BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH/libavcodec.a ${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libavutil.a ${BF_FFMPEG_LIBPATH}/libavdevice.a'
# enable ogg, vorbis and theora in ffmpeg
WITH_BF_OGG = False
BF_OGG = '/usr'
BF_OGG_INC = '${BF_OGG}/include'
BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
WITH_BF_OPENJPEG = True
BF_OPENJPEG = '#extern/libopenjpeg'
BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = False
WITH_BF_STATICFFTW3 = False
BF_FFTW3 = '/usr'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'fftw3'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
BF_FFTW3_LIB_STATIC = '${BF_FFTW3_LIBPATH}/libfftw3.a'
WITH_BF_REDCODE = False
BF_REDCODE = '#extern/libredcode'
BF_REDCODE_LIB = ''
# BF_REDCODE_INC = '${BF_REDCODE}/include'
BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
# Mesa Libs should go here if you're using them as well....
WITH_BF_STATICOPENGL = False
BF_OPENGL = '/usr'
BF_OPENGL_INC = '${BF_OPENGL}/include'
BF_OPENGL_LIB = 'GL GLU X11 Xi Xxf86vm'
BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
WITH_BF_COLLADA = False
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = '/usr'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
BF_PCRE = ''
BF_PCRE_LIB = 'pcre'
BF_PCRE_LIBPATH = '/usr/lib'
BF_EXPAT = '/usr'
BF_EXPAT_LIB = 'expat'
BF_EXPAT_LIBPATH = '/usr/lib'
WITH_BF_JEMALLOC = False
WITH_BF_STATICJEMALLOC = False
BF_JEMALLOC = '/usr'
BF_JEMALLOC_INC = '${BF_JEMALLOC}/include'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
BF_JEMALLOC_LIB = 'jemalloc'
BF_JEMALLOC_LIB_STATIC = '${BF_JEMALLOC_LIBPATH}/libjemalloc.a'
WITH_BF_OIIO = False
WITH_BF_STATICOIIO = False
BF_OIIO = '/usr'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB = 'OpenImageIO'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
WITH_BF_OCIO = False
WITH_BF_STATICOCIO = False
BF_OCIO = '/usr'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB = 'OpenColorIO yaml-cpp tinyxml'
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
WITH_BF_STATICBOOST = False
BF_BOOST = '/usr'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'boost_filesystem boost_regex boost_system boost_thread boost_date_time'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ' + \
'${BF_BOOST_LIBPATH}/libboost_thread.a'
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST
WITH_BF_CYCLES_CUDA_BINARIES = False
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
WITH_BF_OPENMP = True
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
#SpaceNavigator and friends
WITH_BF_3DMOUSE = True
WITH_BF_STATIC3DMOUSE = False
BF_3DMOUSE = '/usr'
BF_3DMOUSE_INC = '${BF_3DMOUSE}/include'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
BF_3DMOUSE_LIB = 'spnav'
BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
#Freestyle
WITH_BF_FREESTYLE = True
# HDF5
WITH_BF_HDF5 = True
BF_HDF5 = '/usr'
BF_HDF5_LIB = 'hdf5 hdf5_hl'
BF_HDF5_LIBPATH='${BF_HDF5}/lib'
# Alembic
WITH_BF_ALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_LIB = 'AlembicAbcGeom AlembicAbc AlembicAbcCollection AlembicAbcCoreFactory AlembicAbcCoreHDF5 AlembicAbcCoreAbstract AlembicAbcCoreOgawa AlembicAbcMaterial AlembicOgawa AlembicUtil'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH='${BF_ALEMBIC}/lib/static'
##
CC = 'gcc'
CXX = 'g++'
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
CFLAGS = ['-std=gnu89']
CXXFLAGS = []
CPPFLAGS = []
# g++ 4.6, only needed for bullet
CXXFLAGS += ['-fpermissive']
if WITH_BF_FFMPEG:
# libavutil needs UINT64_C()
CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
REL_CFLAGS = []
REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2']
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Wstrict-prototypes', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
CC_WARN = ['-Wall']
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
LLIBS = ['util', 'c', 'm', 'dl', 'pthread']
BF_PROFILE = False
BF_PROFILE_CCFLAGS = ['-pg','-g']
BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g']
BF_BUILDDIR = '../build/linux'
BF_INSTALLDIR='../install/linux'
#Link against pthread
PLATFORM_LINKFLAGS = ['-pthread']
#Fix for LLVM conflict with Mesa llvmpipe, SDL dynload also requires symbols to be hidden.
# TODO(sergey): Move this to SConstruct, so we can have this line depended on user config.
PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']

View File

@@ -0,0 +1,221 @@
LCGDIR = '#../lib/mingw32'
LIBDIR = "${LCGDIR}"
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.4'
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw'
BF_PYTHON_DLL = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a'
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_FFMPEG = True
BF_FFMPEG_LIB = 'avformat-55 avcodec-55 avdevice-55 avutil-52 swscale-2'
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'libsndfile-1'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
BF_SDL_LIB = 'SDL'
BF_SDL_LIBPATH = '${BF_SDL}/lib'
BF_PTHREADS = LIBDIR + '/pthreads'
BF_PTHREADS_INC = '${BF_PTHREADS}/include'
BF_PTHREADS_LIB = 'pthreadGC2'
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf Imath IlmThread Iex'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'liblibjpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_PNG = True
BF_PNG = LIBDIR + '/png'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
BF_ZLIB = LIBDIR + '/zlib'
BF_ZLIB_INC = '${BF_ZLIB}/include'
BF_ZLIB_LIB = 'z'
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
WITH_BF_INTERNATIONAL = True
WITH_BF_OPENJPEG = True
BF_OPENJPEG = '#extern/libopenjpeg'
BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'fftw3'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_OCEANSIM = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
BF_FREETYPE = LIBDIR + '/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_ICONV = False
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = False
BF_OPENGL = 'C:\\MingW'
BF_OPENGL_INC = '${BF_OPENGL}/include'
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
BF_OPENGL_LIB = 'opengl32 glu32'
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa xml'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
#Cycles
WITH_BF_CYCLES = True
WITH_BF_CYCLES_CUDA_BINARIES = False
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
WITH_BF_OIIO = True
BF_OIIO = LIBDIR + '/openimageio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB = 'OpenImageIO'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
WITH_BF_OCIO = True
BF_OCIO = LIBDIR + '/opencolorio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB = 'OpenColorIO'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
BF_BOOST = LIBDIR + '/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'boost_date_time-mgw46-mt-s-1_49 boost_filesystem-mgw46-mt-s-1_49 boost_regex-mgw46-mt-s-1_49 boost_system-mgw46-mt-s-1_49 boost_thread-mgw46-mt-s-1_49'
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mgw46-mt-s-1_49'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
WITH_BF_IME = True
WITH_BF_OPENMP = True
#CUDA
WITH_BF_CYCLES_CUDA_BINARIES = False
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
#Freestyle
WITH_BF_FREESTYLE = True
##
CC = 'gcc'
CXX = 'g++'
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
CXXFLAGS = []
CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC']
REL_CFLAGS = []
REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2']
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-ldbghelp']
if WITH_BF_IME:
LLIBS.append('-limm32')
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
## DISABLED, causes linking errors!
## for re-distribution, so users dont need mingw installed
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False
BF_DEBUG_CCFLAGS= ['-g']
BF_PROFILE_CCFLAGS = ['-pg', '-g']
BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE_FLAGS = BF_PROFILE_CCFLAGS
BF_PROFILE = False
BF_BUILDDIR = '..\\build\\win32-mingw'
BF_INSTALLDIR='..\\install\\win32-mingw'

View File

@@ -0,0 +1,256 @@
import subprocess
CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
CL_STDOUT, CL_STDERR = CL_OUT.communicate()
if "18.00." in CL_STDERR:
VC_VERSION = '12.0'
LCGDIR = '#../lib/windows_vc12'
else:
import sys
print("Visual C version not supported {}\n".format(CL_STDERR))
sys.exit(1)
LIBDIR = '${LCGDIR}'
WITH_BF_FFMPEG = True
BF_FFMPEG = LIBDIR +'/ffmpeg'
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat-55.lib avcodec-55.lib avdevice-55.lib avutil-52.lib swscale-2.lib'
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.4'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
BF_PYTHON_DLL = '${BF_PYTHON_LIB}'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_ICONV = True
BF_ICONV = LIBDIR + '/iconv'
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = True
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'libsndfile-1'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
BF_SDL_LIB = 'SDL2.lib'
BF_SDL_LIBPATH = '${BF_SDL}/lib'
BF_PTHREADS = LIBDIR + '/pthreads'
BF_PTHREADS_INC = '${BF_PTHREADS}/include'
BF_PTHREADS_LIB = 'pthreadVC2'
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'libjpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_PNG = True
BF_PNG = LIBDIR + '/png'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
BF_ZLIB = LIBDIR + '/zlib'
BF_ZLIB_INC = '${BF_ZLIB}/include'
BF_ZLIB_LIB = 'libz_st'
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
WITH_BF_INTERNATIONAL = True
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_OCEANSIM = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
WITH_BF_ELTOPO = False
BF_LAPACK = LIBDIR + '/lapack'
BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
WITH_BF_BINRELOC = False
BF_WITH_FREETYPE = True
BF_FREETYPE = LIBDIR + '/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype2ST'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_OPENJPEG = True
BF_OPENJPEG = '#extern/libopenjpeg'
BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'libfftw'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
WITH_BF_IME = True
WITH_BF_3DMOUSE = True
WITH_BF_OPENMP = True
#Cycles
WITH_BF_CYCLES = True
WITH_BF_CYCLES_OSL = True
WITH_BF_STATICOSL = True
BF_OSL = '${LIBDIR}/osl'
BF_OSL_INC = '${BF_OSL}/include'
BF_OSL_LIBPATH = '${BF_OSL}/lib'
BF_OSL_LIB_STATIC = '${BF_OSL_LIBPATH}/oslcomp.lib ${BF_OSL_LIBPATH}/oslexec.lib ${BF_OSL_LIBPATH}/oslquery.lib '
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
WITH_BF_LLVM = True
BF_LLVM = LIBDIR + '/llvm'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMObject LLVMRuntimeDyld LLVMSupport'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
WITH_BF_OIIO = True
BF_OIIO = '${LIBDIR}/openimageio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib'
WITH_BF_STATICOIIO = True
WITH_BF_OCIO = True
BF_OCIO = '${LIBDIR}/opencolorio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/OpenColorIO.lib'
WITH_BF_STATICOCIO = True
WITH_BF_BOOST = True
BF_BOOST = '${LIBDIR}/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55'
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
#CUDA
WITH_BF_CYCLES_CUDA_BINARIES = False
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
#Freestyle
WITH_BF_FREESTYLE = True
WITH_BF_STATICOPENGL = False
BF_OPENGL_INC = '${BF_OPENGL}/include'
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
BF_OPENGL_LIB = 'opengl32 glu32'
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
CC = 'cl.exe'
CXX = 'cl.exe'
CCFLAGS = ['/nologo', '/J', '/W3', '/Gd', '/w34062', '/wd4018', '/wd4065', '/wd4127', '/wd4181', '/wd4200', '/wd4244', '/wd4267', '/wd4305', '/wd4800', '/we4013', '/we4431']
CXXFLAGS = ['/EHsc']
BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
if VC_VERSION == '12.0':
CCFLAGS.append('/DOIIO_STATIC_BUILD') # OIIO api changed with 1.4 making this needed
BF_DEBUG_CCFLAGS = ['/Zi', '/Ob0', '/Od', '/FR${TARGET}.sbr']
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC']
REL_CFLAGS = []
REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2', '/Ob2']
C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
if WITH_BF_IME:
LLIBS.append('imm32')
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
# # Todo
# BF_PROFILE_CCFLAGS = ['-pg', '-g ']
# BF_PROFILE_LINKFLAGS = ['-pg']
# BF_PROFILE = False
BF_BSC=False
BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
BF_BUILDDIR = '..\\build\\win32-vc'
BF_INSTALLDIR='..\\install\\win32-vc'

View File

@@ -0,0 +1,216 @@
LCGDIR = '#../lib/mingw64'
LIBDIR = "${LCGDIR}"
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.4'
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw'
BF_PYTHON_DLL = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_FFMPEG = True
BF_FFMPEG_LIB = 'avformat.dll avcodec.dll avdevice.dll avutil.dll swscale.dll swresample.dll'
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll ${BF_FFMPEG_LIBPATH}/swresample-0.dll ${BF_FFMPEG_LIBPATH}/xvidcore.dll'
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
BF_JACK_LIB = 'libjack'
BF_JACK_LIBPATH = '${BF_JACK}/lib'
WITH_BF_SNDFILE = False
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'libsndfile-1'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
BF_SDL_LIB = 'SDL'
BF_SDL_LIBPATH = '${BF_SDL}/lib'
BF_PTHREADS = '' # Part of MinGW-w64
BF_PTHREADS_INC = ''
BF_PTHREADS_LIB = ''
BF_PTHREADS_LIBPATH = ''
WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf Imath IlmThread Iex'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'jpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_PNG = True
BF_PNG = LIBDIR + '/png'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
BF_ZLIB = LIBDIR + '/zlib'
BF_ZLIB_INC = '${BF_ZLIB}/include'
BF_ZLIB_LIB = 'z'
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
WITH_BF_INTERNATIONAL = True
WITH_BF_OPENJPEG = True
BF_OPENJPEG = '#extern/libopenjpeg'
BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'fftw3'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_GAMEENGINE = True
WITH_BF_OCEANSIM = True
WITH_BF_PLAYER = True
WITH_BF_LIBMV = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
# enable freetype2 support for text objects
BF_FREETYPE = LIBDIR + '/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2/'
BF_FREETYPE_LIB = 'freetype'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_ICONV = False
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = False
BF_OPENGL = 'C:\\MingW'
BF_OPENGL_INC = '${BF_OPENGL}/include'
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
BF_OPENGL_LIB = 'opengl32 glu32'
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa xml'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
#Cycles
WITH_BF_CYCLES = True
WITH_BF_CYCLES_CUDA_BINARIES = False
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
WITH_BF_OIIO = True
BF_OIIO = LIBDIR + '/openimageio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB = 'OpenImageIO'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
WITH_BF_OCIO = True
BF_OCIO = LIBDIR + '/opencolorio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIB = 'OpenColorIO'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
WITH_BF_BOOST = True
BF_BOOST = LIBDIR + '/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'boost_date_time-mgw47-mt-s-1_49 boost_date_time-mgw47-mt-sd-1_49 boost_filesystem-mgw47-mt-s-1_49 boost_filesystem-mgw47-mt-sd-1_49 boost_regex-mgw47-mt-s-1_49 boost_regex-mgw47-mt-sd-1_49 boost_system-mgw47-mt-s-1_49 boost_system-mgw47-mt-sd-1_49 boost_thread-mgw47-mt-s-1_49 boost_thread-mgw47-mt-sd-1_49'
BF_BOOST_LIB_INTERNATIONAL = ' boost_locale-mgw47-mt-s-1_49 boost_locale-mgw47-mt-sd-1_49'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
WITH_BF_IME = True
WITH_BF_OPENMP = True
#Freestyle
WITH_BF_FREESTYLE = True
##
CC = 'gcc'
CXX = 'g++'
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
CXXFLAGS = [ '-fpermissive' ]
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC']
REL_CFLAGS = []
REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2', '-ftree-vectorize']
# NOTE: C_WARN seems to get ignored - at least -Wno-char-subscripts doesn't work!
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
CC_WARN = [ '-Wall', '-Wno-char-subscripts' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-ldbghelp']
if WITH_BF_IME:
LLIBS.append('-limm32')
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
## DISABLED, causes linking errors!
## for re-distribution, so users dont need mingw installed
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False
BF_DEBUG_CCFLAGS= ['-g']
BF_PROFILE_CCFLAGS = ['-pg', '-g']
BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE_FLAGS = BF_PROFILE_CCFLAGS
BF_PROFILE = False
BF_BUILDDIR = '..\\build\\win64-mingw'
BF_INSTALLDIR='..\\install\\win64-mingw'

View File

@@ -0,0 +1,256 @@
import subprocess
CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
CL_STDOUT, CL_STDERR = CL_OUT.communicate()
if "18.00." in CL_STDERR:
VC_VERSION = '12.0'
LCGDIR = '#../lib/win64_vc12'
else:
import sys
print("Visual C version not supported {}\n".format(CL_STDERR))
sys.exit(1)
LIBDIR = '${LCGDIR}'
WITH_BF_FFMPEG = True
BF_FFMPEG = LIBDIR +'/ffmpeg'
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc '
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat-55.lib avcodec-55.lib avdevice-55.lib avutil-52.lib swscale-2.lib'
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
BF_PYTHON = LIBDIR + '/python'
BF_PYTHON_VERSION = '3.4'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
BF_PYTHON_BINARY = 'python'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
BF_PYTHON_DLL = '${BF_PYTHON_LIB}'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_SNDFILE = True
BF_SNDFILE = LIBDIR + '/sndfile'
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
BF_SNDFILE_LIB = 'libsndfile-1'
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_ICONV = True
BF_ICONV = LIBDIR + '/iconv'
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
BF_SDL_LIB = 'SDL2.lib'
BF_SDL_LIBPATH = '${BF_SDL}/lib'
WITH_BF_JACK = False
BF_PTHREADS = LIBDIR + '/pthreads'
BF_PTHREADS_INC = '${BF_PTHREADS}/include'
BF_PTHREADS_LIB = 'pthreadVC2'
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
WITH_BF_DDS = True
WITH_BF_JPEG = True
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
BF_JPEG_LIB = 'libjpeg'
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
WITH_BF_PNG = True
BF_PNG = LIBDIR + '/png'
BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True
BF_ZLIB = LIBDIR + '/zlib'
BF_ZLIB_INC = '${BF_ZLIB}/include'
BF_ZLIB_LIB = 'libz_st'
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
WITH_BF_INTERNATIONAL = True
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_OCEANSIM = True
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
WITH_BF_ELTOPO = False
BF_LAPACK = LIBDIR + '/lapack'
BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
WITH_BF_BINRELOC = False
BF_WITH_FREETYPE = True
BF_FREETYPE = LIBDIR + '/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype2ST'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_QUICKTIME = False
BF_QUICKTIME = LIBDIR + '/QTDevWin'
BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
BF_QUICKTIME_LIB = 'qtmlClient'
BF_QUICKTIME_LIBPATH = '${BF_QUICKTIME}/Libraries'
WITH_BF_OPENJPEG = True
BF_OPENJPEG = '#extern/libopenjpeg'
BF_OPENJPEG_LIB = ''
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
WITH_BF_FFTW3 = True
BF_FFTW3 = LIBDIR + '/fftw3'
BF_FFTW3_INC = '${BF_FFTW3}/include'
BF_FFTW3_LIB = 'libfftw'
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
WITH_BF_REDCODE = False
BF_REDCODE_INC = '#extern'
WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
WITH_BF_IME = True
WITH_BF_3DMOUSE = True
WITH_BF_OPENMP = True
#Cycles
WITH_BF_CYCLES = True
WITH_BF_CYCLES_OSL = True
WITH_BF_STATICOSL = True
BF_OSL = '${LIBDIR}/osl'
BF_OSL_INC = '${BF_OSL}/include'
BF_OSL_LIBPATH = '${BF_OSL}/lib'
BF_OSL_LIB_STATIC = '${BF_OSL_LIBPATH}/oslcomp.lib ${BF_OSL_LIBPATH}/oslexec.lib ${BF_OSL_LIBPATH}/oslquery.lib '
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
WITH_BF_LLVM = True
BF_LLVM = LIBDIR + '/llvm'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMObject LLVMRuntimeDyld LLVMSupport'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
WITH_BF_OIIO = True
BF_OIIO = '${LIBDIR}/openimageio'
BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib ${BF_OIIO_LIBPATH}/OpenImageIO_Util.lib'
WITH_BF_STATICOIIO = True
WITH_BF_OCIO = True
BF_OCIO = '${LIBDIR}/opencolorio'
BF_OCIO_INC = '${BF_OCIO}/include'
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/OpenColorIO.lib'
WITH_BF_STATICOCIO = True
WITH_BF_BOOST = True
BF_BOOST = '${LIBDIR}/boost'
BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55'
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
#CUDA
WITH_BF_CYCLES_CUDA_BINARIES = False
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
# No need to manually specify SSE/SSE2 on x64 systems.
BF_RAYOPTIMIZATION_SSE_FLAGS = ['']
#Freestyle
WITH_BF_FREESTYLE = True
WITH_BF_STATICOPENGL = False
BF_OPENGL_INC = '${BF_OPENGL}/include'
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
BF_OPENGL_LIB = 'opengl32 glu32'
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
CC = 'cl.exe'
CXX = 'cl.exe'
CFLAGS = []
CCFLAGS = ['/nologo', '/J', '/W3', '/Gd', '/w34062', '/wd4018', '/wd4065', '/wd4127', '/wd4181', '/wd4200', '/wd4244', '/wd4267', '/wd4305', '/wd4800', '/we4013', '/we4431']
# We want to support Vista level ABI for x64
if VC_VERSION == '12.0':
CCFLAGS.append('/D_WIN32_WINNT=0x600')
CCFLAGS.append('/DOIIO_STATIC_BUILD') # OIIO api changed with 1.4 making this needed
CXXFLAGS = ['/EHsc']
BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast']
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od', '/Ob0']
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC']
REL_CFLAGS = []
REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2', '/Ob2']
C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
if WITH_BF_IME:
LLIBS.append('imm32')
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
BF_BUILDDIR = '..\\build\\win64-vc'
BF_INSTALLDIR='..\\install\\win64-vc'

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
def disable(self):
self.HEADER = ''
self.OKBLUE = ''
self.OKGREEN = ''
self.WARNING = ''
self.FAIL = ''
self.ENDC = ''

View File

@@ -0,0 +1,917 @@
import os
import os.path
import SCons.Options
import SCons.Variables
try:
import subprocess
except ImportError:
pass
import string
import shutil
import sys
Variables = SCons.Variables
BoolVariable = SCons.Variables.BoolVariable
def get_command_output(*popenargs, **kwargs):
if hasattr(subprocess, "check_output"):
return subprocess.check_output(*popenargs, **kwargs)
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise subprocess.CalledProcessError(retcode, cmd)
return output
def get_version():
import re
fname = os.path.join(os.path.dirname(__file__), "..", "..", "..", "source", "blender", "blenkernel", "BKE_blender.h")
ver_base = None
ver_char = None
ver_cycle = None
re_ver = re.compile("^#\s*define\s+BLENDER_VERSION\s+([0-9]+)")
re_ver_char = re.compile("^#\s*define\s+BLENDER_VERSION_CHAR\s*(\S*)") # optional arg
re_ver_cycle = re.compile("^#\s*define\s+BLENDER_VERSION_CYCLE\s*(\S*)") # optional arg
for l in open(fname, "r"):
match = re_ver.match(l)
if match:
ver = int(match.group(1))
ver_base = "%d.%d" % (ver / 100, ver % 100)
match = re_ver_char.match(l)
if match:
ver_char = match.group(1)
if ver_char == "BLENDER_CHAR_VERSION":
ver_char = ""
match = re_ver_cycle.match(l)
if match:
ver_cycle = match.group(1)
if ver_cycle == "BLENDER_CYCLE_VERSION":
ver_cycle = ""
if (ver_base is not None) and (ver_char is not None) and (ver_cycle is not None):
# eg '2.56a-beta'
if ver_cycle != "release":
ver_display = "%s%s-%s" % (ver_base, ver_char, ver_cycle)
else:
ver_display = "%s%s" % (ver_base, ver_char)
return ver_base, ver_display, ver_cycle
raise Exception("%s: missing version string" % fname)
def get_hash():
try:
build_hash = get_command_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
except OSError:
build_hash = None
print("WARNING: could not use git to retrieve current Blender repository hash...")
except subprocess.CalledProcessError as e:
build_hash = None
print("WARNING: git errored while retrieving current Blender repository hash (%d)..." % e.returncode)
if build_hash == '' or build_hash == None:
build_hash = 'UNKNOWN'
return build_hash
def checkEndian():
return sys.byteorder
# This is used in creating the local config directories
VERSION, VERSION_DISPLAY, VERSION_RELEASE_CYCLE = get_version()
HASH = get_hash()
ENDIAN = checkEndian()
def print_arguments(args, bc):
if len(args):
for k,v in args.iteritems():
if type(v)==list:
v = ' '.join(v)
print '\t'+bc.OKBLUE+k+bc.ENDC+' = '+bc.OKGREEN + v + bc.ENDC
else:
print '\t'+bc.WARNING+'No command-line arguments given'+bc.ENDC
def validate_arguments(args, bc):
opts_list = [
'WITH_BF_FREESTYLE', 'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'WITH_BF_PYTHON_SECURITY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LIBPATH_ARCH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS',
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH', 'WITH_BF_SDL_DYNLOAD',
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', 'WITH_BF_JACK_DYNLOAD',
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC',
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
'WITH_BF_DDS', 'WITH_BF_CINEON', 'WITH_BF_HDR',
'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG', 'BF_FFMPEG_INC', 'BF_FFMPEG_DLL',
'WITH_BF_STATICFFMPEG', 'BF_FFMPEG_LIB_STATIC',
'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
'WITH_BF_FRAMESERVER',
'WITH_BF_COMPOSITOR',
'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH', 'WITH_BF_STATICJPEG', 'BF_JPEG_LIB_STATIC',
'WITH_BF_OPENJPEG', 'BF_OPENJPEG', 'BF_OPENJPEG_INC', 'BF_OPENJPEG_LIB', 'BF_OPENJPEG_LIBPATH',
'WITH_BF_REDCODE', 'BF_REDCODE', 'BF_REDCODE_INC', 'BF_REDCODE_LIB', 'BF_REDCODE_LIBPATH',
'WITH_BF_PNG', 'BF_PNG', 'BF_PNG_INC', 'BF_PNG_LIB', 'BF_PNG_LIBPATH', 'WITH_BF_STATICPNG', 'BF_PNG_LIB_STATIC',
'WITH_BF_TIFF', 'BF_TIFF', 'BF_TIFF_INC', 'BF_TIFF_LIB', 'BF_TIFF_LIBPATH', 'WITH_BF_STATICTIFF', 'BF_TIFF_LIB_STATIC',
'WITH_BF_ZLIB', 'BF_ZLIB', 'BF_ZLIB_INC', 'BF_ZLIB_LIB', 'BF_ZLIB_LIBPATH', 'WITH_BF_STATICZLIB', 'BF_ZLIB_LIB_STATIC',
'WITH_BF_INTERNATIONAL',
'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
'WITH_BF_GAMEENGINE',
'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
# 'WITH_BF_ELTOPO', # now only available in a branch
'BF_LAPACK', 'BF_LAPACK_LIB', 'BF_LAPACK_LIBPATH', 'BF_LAPACK_LIB_STATIC',
'BF_WINTAB', 'BF_WINTAB_INC',
'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH', 'WITH_BF_STATICFFTW3', 'BF_FFTW3_LIB_STATIC',
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
'WITH_BF_EGL', 'WITH_BF_GLEW_ES', 'BF_GLEW_INC', 'WITH_BF_GL_PROFILE_CORE', 'WITH_BF_GL_PROFILE_COMPAT', 'WITH_BF_GL_PROFILE_ES20',
'WITH_BF_GLEW_MX', 'WITH_BF_GL_EGL', 'WITH_BF_GL_ANGLE',
'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH',
'WITH_BF_STATICOPENCOLLADA', 'BF_OPENCOLLADA_LIB_STATIC',
'WITH_BF_PLAYER',
'WITH_BF_NOBLENDER',
'WITH_BF_BINRELOC',
'WITH_BF_LZO', 'WITH_BF_LZMA',
'LCGDIR',
'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC',
'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
'WITHOUT_BF_INSTALL',
'WITHOUT_BF_PYTHON_INSTALL', 'WITHOUT_BF_PYTHON_UNPACK',
'WITH_BF_PYTHON_INSTALL_NUMPY', 'WITH_BF_PYTHON_INSTALL_REQUESTS',
'WITHOUT_BF_OVERWRITE_INSTALL',
'WITH_BF_OPENMP', 'BF_OPENMP', 'BF_OPENMP_LIBPATH', 'WITH_BF_STATICOPENMP', 'BF_OPENMP_STATIC_STATIC',
'WITH_GHOST_SDL',
'WITH_GHOST_XDND',
'WITH_X11_XINPUT',
'WITH_X11_XF86VMODE',
'BF_GHOST_DEBUG',
'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
'BF_X264_CONFIG',
'BF_XVIDCORE_CONFIG',
'WITH_BF_DOCS',
'BF_NUMJOBS',
'BF_MSVS',
'WITH_BF_RAYOPTIMIZATION',
'BF_RAYOPTIMIZATION_SSE_FLAGS',
'WITH_BF_FLUID',
'WITH_BF_BOOLEAN',
'WITH_BF_REMESH',
'WITH_BF_OCEANSIM',
'WITH_BF_SMOKE',
'WITH_BF_CXX_GUARDEDALLOC',
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
'BUILDBOT_BRANCH',
'WITH_BF_IME',
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'BF_CYCLES_CUDA_ENV',
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH',
'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_INTERNATIONAL', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
'WITH_BF_LIBMV', 'WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS',
'WITH_BF_CYCLES_OSL', 'WITH_BF_STATICOSL', 'BF_OSL', 'BF_OSL_INC', 'BF_OSL_LIB', 'BF_OSL_LIBPATH', 'BF_OSL_LIB_STATIC', 'BF_OSL_COMPILER',
'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS',
'WITH_BF_ALEMBIC', 'BF_ALEMBIC', 'BF_ALEMBIC_INC', 'BF_ALEMBIC_LIB', 'BF_ALEMBIC_LIBPATH',
]
# Have options here that scons expects to be lists
opts_list_split = [
'BF_PYTHON_LINKFLAGS',
'BF_OPENGL_LINKFLAGS',
'BF_GL_DEFINITIONS',
'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS',
'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS',
'BGE_CXXFLAGS',
'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
'C_WARN', 'CC_WARN', 'CXX_WARN',
'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID',
'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET',
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING',
'WITH_BF_CPP11', 'WITH_BF_LEGACY_DEPSGRAPH',
]
arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE',
'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME',
'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE', 'BF_LINE_OVERWRITE',
'BF_BSC', 'BF_CONFIG',
'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG',
'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG',
'BF_UNIT_TEST', 'BF_BITNESS', 'MSVS_VERSION']
okdict = {}
for k,v in args.iteritems():
if (k in opts_list) or (k in arg_list):
okdict[k] = v
elif k in opts_list_split:
okdict[k] = v.split() # "" have already been stripped
else:
print '\t'+bc.WARNING+'Invalid argument: '+bc.ENDC+k+'='+v
return okdict
def print_targets(targs, bc):
if len(targs)>0:
for t in targs:
print '\t'+bc.OKBLUE+t+bc.ENDC
else:
print '\t'+bc.WARNING+'No targets given, using '+bc.ENDC+bc.OKGREEN+'default'+bc.ENDC
def validate_targets(targs, bc):
valid_list = ['.', 'blender', 'blenderstatic', 'blenderplayer', 'webplugin',
'blendernogame', 'blenderstaticnogame', 'blenderlite', 'release',
'everything', 'clean', 'install-bin', 'install', 'nsis','buildslave',
'cudakernels']
oklist = []
for t in targs:
if t in valid_list:
oklist.append(t)
else:
print '\t'+bc.WARNING+'Invalid target: '+bc.ENDC+t
return oklist
class OurSpawn:
def ourspawn(self, sh, escape, cmd, args, env):
newargs = " ".join(args[1:])
cmdline = cmd + " " + newargs
startupinfo = subprocess.STARTUPINFO()
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env=env)
data, err = proc.communicate()
rv = proc.wait()
if err:
print(err)
return rv
def SetupSpawn( env ):
buf = OurSpawn()
env['SPAWN'] = buf.ourspawn
def read_opts(env, cfg, args):
localopts = Variables.Variables(cfg, args)
localopts.AddVariables(
('LCGDIR', 'Location of SVN lib dir'),
('LIBDIR', 'Root dir of libs'),
(BoolVariable('WITH_BF_PYTHON', 'Compile with python', True)),
(BoolVariable('WITH_BF_PYTHON_SAFETY', 'Internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency)', False)),
(BoolVariable('WITH_BF_PYTHON_SECURITY', 'Disables execution of scripts within blend files by default', True)),
('BF_PYTHON', 'Base path for python', ''),
('BF_PYTHON_VERSION', 'Python version to use', ''),
('BF_PYTHON_INC', 'Include path for Python headers', ''),
('BF_PYTHON_BINARY', 'Path to the Python interpreter', ''),
('BF_PYTHON_LIB', 'Python library', ''),
('BF_PYTHON_LIBPATH_ARCH', 'Additional Python library under some linux flavors (arch-dependent)', ''),
('BF_PYTHON_DLL', 'Python dll - used on Windows only', ''),
('BF_PYTHON_LIB_STATIC', 'Python static libraries', ''),
('BF_PYTHON_LIBPATH', 'Library path', ''),
('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
(BoolVariable('WITH_BF_STATICPYTHON', 'Staticly link to python', False)),
(BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
(BoolVariable('WITH_BF_FLUID', 'Build with Fluid simulation (Elbeem)', True)),
(BoolVariable('WITH_BF_BOOLEAN', 'Build with boolean modifier', True)),
(BoolVariable('WITH_BF_REMESH', 'Build with remesh modifier', True)),
(BoolVariable('WITH_BF_OCEANSIM', 'Build with ocean simulation', False)),
(BoolVariable('WITH_BF_SMOKE', 'Build with smoke simulation', True)),
('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
(BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
('BF_OPENAL', 'Base path for OpenAL', ''),
('BF_OPENAL_INC', 'Include path for python headers', ''),
('BF_OPENAL_LIB', 'Path to OpenAL library', ''),
('BF_OPENAL_LIB_STATIC', 'Path to OpenAL static library', ''),
('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
(BoolVariable('WITH_BF_STATICOPENAL', 'Staticly link to openal', False)),
(BoolVariable('WITH_BF_SDL', 'Use SDL if true', False)),
('BF_SDL', 'SDL base path', ''),
('BF_SDL_INC', 'SDL include path', ''),
('BF_SDL_LIB', 'SDL library', ''),
('BF_SDL_LIBPATH', 'SDL library path', ''),
(BoolVariable('WITH_BF_SDL_DYNLOAD', 'Enable runtime dynamic SDL libraries loading (works only on Linux)', False)),
(BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
('BF_JACK', 'jack base path', ''),
('BF_JACK_INC', 'jack include path', ''),
('BF_JACK_LIB', 'jack library', ''),
('BF_JACK_LIBPATH', 'jack library path', ''),
(BoolVariable('WITH_BF_JACK_DYNLOAD', 'Enable runtime dynamic Jack libraries loading (works only on Linux)', False)),
(BoolVariable('WITH_BF_SNDFILE', 'Enable sndfile support if true', True)),
('BF_SNDFILE', 'sndfile base path', ''),
('BF_SNDFILE_INC', 'sndfile include path', ''),
('BF_SNDFILE_LIB', 'sndfile library', ''),
('BF_SNDFILE_LIB_STATIC', 'Path to sndfile static library', ''),
('BF_SNDFILE_LIBPATH', 'sndfile library path', ''),
(BoolVariable('WITH_BF_STATICSNDFILE', 'Staticly link to sndfile', False)),
('BF_PTHREADS', 'Pthreads base path', ''),
('BF_PTHREADS_INC', 'Pthreads include path', ''),
('BF_PTHREADS_LIB', 'Pthreads library', ''),
('BF_PTHREADS_LIBPATH', 'Pthreads library path', ''),
(BoolVariable('WITH_BF_OPENEXR', 'Use OPENEXR if true', True)),
(BoolVariable('WITH_BF_STATICOPENEXR', 'Staticly link to OpenEXR', False)),
('BF_OPENEXR', 'OPENEXR base path', ''),
('BF_OPENEXR_INC', 'OPENEXR include path', ''),
('BF_OPENEXR_LIB', 'OPENEXR library', ''),
('BF_OPENEXR_LIBPATH', 'OPENEXR library path', ''),
('BF_OPENEXR_LIB_STATIC', 'OPENEXR static library', ''),
(BoolVariable('WITH_BF_DDS', 'Support DDS image format if true', True)),
(BoolVariable('WITH_BF_CINEON', 'Support CINEON and DPX image formats if true', True)),
(BoolVariable('WITH_BF_HDR', 'Support HDR image formats if true', True)),
(BoolVariable('WITH_BF_FRAMESERVER', 'Support export to a frameserver', True)),
(BoolVariable('WITH_BF_FFMPEG', 'Use FFMPEG if true', False)),
('BF_FFMPEG', 'FFMPEG base path', ''),
('BF_FFMPEG_LIB', 'FFMPEG library', ''),
('BF_FFMPEG_DLL', 'FFMPEG dll libraries to be installed', ''),
('BF_FFMPEG_EXTRA', 'FFMPEG flags that must be preserved', ''),
('BF_FFMPEG_INC', 'FFMPEG includes', ''),
('BF_FFMPEG_LIBPATH', 'FFMPEG library path', ''),
(BoolVariable('WITH_BF_STATICFFMPEG', 'Use static FFMPEG if true', False)),
('BF_FFMPEG_LIB_STATIC', 'Static FFMPEG libraries', ''),
(BoolVariable('WITH_BF_OGG', 'Link OGG, THEORA, VORBIS with FFMPEG if true',
False)),
('BF_OGG', 'OGG base path', ''),
('BF_OGG_LIB', 'OGG library', ''),
(BoolVariable('WITH_BF_JPEG', 'Use JPEG if true', True)),
(BoolVariable('WITH_BF_STATICJPEG', 'Staticly link to JPEG', False)),
('BF_JPEG', 'JPEG base path', ''),
('BF_JPEG_INC', 'JPEG include path', ''),
('BF_JPEG_LIB', 'JPEG library', ''),
('BF_JPEG_LIBPATH', 'JPEG library path', ''),
('BF_JPEG_LIB_STATIC', 'JPEG static library', ''),
(BoolVariable('WITH_BF_OPENJPEG', 'Use OPENJPEG if true', False)),
('BF_OPENJPEG', 'OPENJPEG base path', ''),
('BF_OPENJPEG_INC', 'OPENJPEG include path', ''),
('BF_OPENJPEG_LIB', 'OPENJPEG library', ''),
('BF_OPENJPEG_LIBPATH', 'OPENJPEG library path', ''),
(BoolVariable('WITH_BF_REDCODE', 'Use REDCODE if true', False)),
('BF_REDCODE', 'REDCODE base path', ''),
('BF_REDCODE_INC', 'REDCODE include path', ''),
('BF_REDCODE_LIB', 'REDCODE library', ''),
('BF_REDCODE_LIBPATH', 'REDCODE library path', ''),
(BoolVariable('WITH_BF_PNG', 'Use PNG if true', True)),
(BoolVariable('WITH_BF_STATICPNG', 'Staticly link to PNG', False)),
('BF_PNG', 'PNG base path', ''),
('BF_PNG_INC', 'PNG include path', ''),
('BF_PNG_LIB', 'PNG library', ''),
('BF_PNG_LIBPATH', 'PNG library path', ''),
('BF_PNG_LIB_STATIC', 'PNG static library', ''),
(BoolVariable('WITH_BF_TIFF', 'Use TIFF if true', True)),
(BoolVariable('WITH_BF_STATICTIFF', 'Staticly link to TIFF', False)),
('BF_TIFF', 'TIFF base path', ''),
('BF_TIFF_INC', 'TIFF include path', ''),
('BF_TIFF_LIB', 'TIFF library', ''),
('BF_TIFF_LIBPATH', 'TIFF library path', ''),
('BF_TIFF_LIB_STATIC', 'TIFF static library', ''),
(BoolVariable('WITH_BF_ZLIB', 'Use ZLib if true', True)),
(BoolVariable('WITH_BF_STATICZLIB', 'Staticly link to ZLib', False)),
('BF_ZLIB', 'ZLib base path', ''),
('BF_ZLIB_INC', 'ZLib include path', ''),
('BF_ZLIB_LIB', 'ZLib library', ''),
('BF_ZLIB_LIBPATH', 'ZLib library path', ''),
('BF_ZLIB_LIB_STATIC', 'ZLib static library', ''),
(BoolVariable('WITH_BF_INTERNATIONAL', 'Use Boost::locale if true', True)),
(BoolVariable('WITH_BF_ICONV', 'Use iconv if true', True)),
('BF_ICONV', 'iconv base path', ''),
('BF_ICONV_INC', 'iconv include path', ''),
('BF_ICONV_LIB', 'iconv library', ''),
('BF_ICONV_LIBPATH', 'iconv library path', ''),
(BoolVariable('WITH_BF_FREESTYLE', 'Compile with freestyle', True)),
(BoolVariable('WITH_BF_GAMEENGINE', 'Build with gameengine' , False)),
(BoolVariable('WITH_BF_BULLET', 'Use Bullet if true', True)),
# (BoolVariable('WITH_BF_ELTOPO', 'Use Eltopo collision library if true', False)), # this is now only available in a branch
('BF_LAPACK', 'LAPACK base path', ''),
('BF_LAPACK_LIB', 'LAPACK library', ''),
('BF_LAPACK_LIB_STATIC', 'LAPACK library', ''),
('BF_LAPACK_LIBPATH', 'LAPACK library path', ''),
(BoolVariable('WITH_BF_STATICLAPACK', 'Staticly link to LAPACK', False)),
('BF_BULLET', 'Bullet base dir', ''),
('BF_BULLET_INC', 'Bullet include path', ''),
('BF_BULLET_LIB', 'Bullet library', ''),
('BF_WINTAB', 'WinTab base dir', ''),
('BF_WINTAB_INC', 'WinTab include dir', ''),
('BF_CXX', 'c++ base path for libstdc++, only used when static linking', ''),
(BoolVariable('WITH_BF_STATICCXX', 'static link to stdc++', False)),
('BF_CXX_LIB_STATIC', 'static library path for stdc++', ''),
('BF_FREETYPE', 'Freetype base path', ''),
('BF_FREETYPE_INC', 'Freetype include path', ''),
('BF_FREETYPE_LIB', 'Freetype library', ''),
('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
(BoolVariable('WITH_BF_FREETYPE_STATIC', 'Use Static Freetype if true', False)),
('BF_FREETYPE_LIB_STATIC', 'Static Freetype library', ''),
(BoolVariable('WITH_BF_OPENMP', 'Use OpenMP if true', False)),
(BoolVariable('WITH_BF_STATICOPENMP', 'Staticly link to OpenMP', False)),
('BF_OPENMP', 'Base path to OpenMP (used when cross-compiling with older versions of WinGW)', ''),
('BF_OPENMP_INC', 'Path to OpenMP includes (used when cross-compiling with older versions of WinGW)', ''),
('BF_OPENMP_LIBPATH', 'Path to OpenMP libraries (used when cross-compiling with older versions of WinGW)', ''),
(BoolVariable('WITH_GHOST_SDL', 'Enable building blender against SDL for windowing rather then the native APIs', False)),
(BoolVariable('WITH_X11_XINPUT', 'Enable X11 Xinput (tablet support and unicode input)', True)),
(BoolVariable('WITH_X11_XF86VMODE', 'Enable X11 video mode switching', True)),
('BF_OPENMP_LIB_STATIC', 'OpenMP static library', ''),
(BoolVariable('WITH_BF_QUICKTIME', 'Use QuickTime if true', False)),
('BF_QUICKTIME', 'QuickTime base path', ''),
('BF_QUICKTIME_INC', 'QuickTime include path', ''),
('BF_QUICKTIME_LIB', 'QuickTime library', ''),
('BF_QUICKTIME_LIBPATH', 'QuickTime library path', ''),
(BoolVariable('WITH_BF_FFTW3', 'Use FFTW3 if true', False)),
('BF_FFTW3', 'FFTW3 base path', ''),
('BF_FFTW3_INC', 'FFTW3 include path', ''),
('BF_FFTW3_LIB', 'FFTW3 library', ''),
('BF_FFTW3_LIB_STATIC', 'FFTW3 static libraries', ''),
('BF_FFTW3_LIBPATH', 'FFTW3 library path', ''),
(BoolVariable('WITH_BF_STATICFFTW3', 'Staticly link to FFTW3', False)),
(BoolVariable('WITH_BF_STATICOPENGL', 'Use MESA if true', True)),
('BF_OPENGL', 'OpenGL base path', ''),
('BF_OPENGL_INC', 'OpenGL include path', ''),
('BF_OPENGL_LIB', 'OpenGL libraries', ''),
('BF_OPENGL_LIBPATH', 'OpenGL library path', ''),
('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
(BoolVariable('WITH_BF_GLEW_MX', '', False)),
(BoolVariable('WITH_BF_GLEW_ES', '', False)),
(BoolVariable('WITH_BF_GL_EGL', '', False)),
(BoolVariable('WITH_BF_GL_PROFILE_COMPAT', '', True)),
(BoolVariable('WITH_BF_GL_PROFILE_CORE', '', False)),
(BoolVariable('WITH_BF_GL_PROFILE_ES20', '', False)),
(BoolVariable('WITH_BF_GL_ANGLE', '', False)),
('BF_GL_DEFINITIONS', '', []),
('BF_GLEW_INC', '', ''),
) # end of opts.AddVariables()
localopts.AddVariables(
(BoolVariable('WITH_BF_COLLADA', 'Build COLLADA import/export module if true', False)),
(BoolVariable('WITH_BF_STATICOPENCOLLADA', 'Staticly link to OpenCollada', False)),
('BF_COLLADA', 'COLLADA base path', ''),
('BF_COLLADA_INC', 'COLLADA include path', ''),
('BF_COLLADA_LIB', 'COLLADA library', ''),
('BF_OPENCOLLADA', 'OpenCollada base path', ''),
('BF_OPENCOLLADA_INC', 'OpenCollada base include path', ''),
('BF_OPENCOLLADA_LIB', 'OpenCollada library', ''),
('BF_OPENCOLLADA_LIBPATH', 'OpenCollada library path', ''),
('BF_PCRE', 'PCRE base path', ''),
('BF_PCRE_LIB', 'PCRE library', ''),
('BF_PCRE_LIBPATH', 'PCRE library path', ''),
('BF_EXPAT', 'Expat base path', ''),
('BF_EXPAT_LIB', 'Expat library', ''),
('BF_EXPAT_LIBPATH', 'Expat library path', ''),
('BF_OPENCOLLADA_LIB_STATIC', 'OpenCollada static library', ''),
(BoolVariable('WITH_BF_JEMALLOC', 'Use jemalloc if true', False)),
(BoolVariable('WITH_BF_STATICJEMALLOC', 'Staticly link to jemalloc', False)),
('BF_JEMALLOC', 'jemalloc base path', ''),
('BF_JEMALLOC_INC', 'jemalloc include path', ''),
('BF_JEMALLOC_LIB', 'jemalloc library', ''),
('BF_JEMALLOC_LIBPATH', 'jemalloc library path', ''),
('BF_JEMALLOC_LIB_STATIC', 'jemalloc static library', ''),
(BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
(BoolVariable('WITH_BF_IME', 'Enable Input Method Editor (IME) for complex Asian character input', False)),
(BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
(BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
('BF_3DMOUSE', '3d mouse library base path', ''),
('BF_3DMOUSE_INC', '3d mouse library include path', ''),
('BF_3DMOUSE_LIB', '3d mouse library', ''),
('BF_3DMOUSE_LIBPATH', '3d mouse library path', ''),
('BF_3DMOUSE_LIB_STATIC', '3d mouse static library', ''),
('CFLAGS', 'C only flags', []),
('CCFLAGS', 'Generic C and C++ flags', []),
('CXXFLAGS', 'C++ only flags', []),
('BGE_CXXFLAGS', 'C++ only flags for BGE', []),
('CPPFLAGS', 'Defines', []),
('REL_CFLAGS', 'C only release flags', []),
('REL_CCFLAGS', 'Generic C and C++ release flags', []),
('REL_CXXFLAGS', 'C++ only release flags', []),
('C_WARN', 'C warning flags', []),
('CC_WARN', 'Generic C and C++ warning flags', []),
('CXX_WARN', 'C++ only warning flags', []),
('LLIBS', 'Platform libs', []),
('PLATFORM_LINKFLAGS', 'Platform linkflags', []),
('MACOSX_ARCHITECTURE', 'python_arch.zip select', ''),
('MACOSX_SDK', 'Set OS X SDK', ''),
('XCODE_CUR_VER', 'Detect XCode version', ''),
('MACOSX_DEPLOYMENT_TARGET', 'Detect OS X target version', ''),
('C_COMPILER_ID', 'Detect the resolved compiler', ''),
(BoolVariable('BF_PROFILE', 'Add profiling information if true', False)),
('BF_PROFILE_CFLAGS', 'C only profiling flags', []),
('BF_PROFILE_CCFLAGS', 'C and C++ profiling flags', []),
('BF_PROFILE_CXXFLAGS', 'C++ only profiling flags', []),
('BF_PROFILE_LINKFLAGS', 'Profile linkflags', []),
(BoolVariable('BF_DEBUG', 'Add debug flags if true', False)),
('BF_DEBUG_CFLAGS', 'C only debug flags', []),
('BF_DEBUG_CCFLAGS', 'C and C++ debug flags', []),
('BF_DEBUG_CXXFLAGS', 'C++ only debug flags', []),
(BoolVariable('BF_BSC', 'Create .bsc files (msvc only)', False)),
('BF_BUILDDIR', 'Build dir', ''),
('BF_INSTALLDIR', 'Installation dir', ''),
('CC', 'C compiler to use', env['CC']),
('CXX', 'C++ compiler to use', env['CXX']),
(BoolVariable('BF_BUILDINFO', 'Buildtime in splash if true', True)),
(BoolVariable('BF_TWEAK_MODE', 'Enable tweak mode if true', False)),
(BoolVariable('BF_SPLIT_SRC', 'Split src lib into several chunks if true', False)),
(BoolVariable('WITHOUT_BF_INSTALL', 'dont install if true', False)),
(BoolVariable('WITHOUT_BF_PYTHON_INSTALL', 'dont install Python modules if true', False)),
(BoolVariable('WITH_BF_PYTHON_INSTALL_NUMPY', 'install Python numpy module', False)),
(BoolVariable('WITH_BF_PYTHON_INSTALL_REQUESTS', 'install Python requests module', False)),
(BoolVariable('WITHOUT_BF_PYTHON_UNPACK', 'dont remove and unpack Python modules everytime if true', False)),
(BoolVariable('WITHOUT_BF_OVERWRITE_INSTALL', 'dont remove existing files before breating the new install directory (set to False when making packages for others)', False)),
(BoolVariable('BF_FANCY', 'Enable fancy output if true', True)),
(BoolVariable('BF_QUIET', 'Enable silent output if true', True)),
(BoolVariable('BF_LINE_OVERWRITE', 'Enable overwriting of compile line in BF_QUIET mode if true', False)),
(BoolVariable('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', False)),
(BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)),
(BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)),
(BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)),
(BoolVariable('WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS', 'Enable fixed-size schur specializations', True)),
(BoolVariable('WITH_BF_COMPOSITOR', 'Enable the tile based nodal compositor', True)),
(BoolVariable('WITH_BF_HDF5', 'Use HDF5 if true', False)),
('BF_HDF5', 'HDF5 base path', ''),
('BF_HDF5_LIB', 'HDF5 library', ''),
('BF_HDF5_LIBPATH', 'HDF5 library path', ''),
(BoolVariable('WITH_BF_ALEMBIC', 'Use Alembic if true', False)),
(BoolVariable('WITH_BF_STATICALEMBIC', 'Staticly link to Alembic', False)),
('BF_ALEMBIC', 'Alembic base path', ''),
('BF_ALEMBIC_INC', 'Alembic include path', ''),
('BF_ALEMBIC_LIB', 'Alembic library', ''),
('BF_ALEMBIC_LIB_STATIC', 'Alembic static libraries', ''),
('BF_ALEMBIC_LIBPATH', 'Alembic library path', ''),
) # end of opts.AddOptions()
localopts.AddVariables(
('BF_X264_CONFIG', 'configuration flags for x264', ''),
('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
# (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'),
('BF_NUMJOBS', 'Number of build processes to spawn', '1'),
('BF_MSVS', 'Generate MSVS project files and solution', False),
(BoolVariable('BF_UNIT_TEST', 'Build with unit test support.', False)),
(BoolVariable('BF_GHOST_DEBUG', 'Make GHOST print events and info to stdout. (very verbose)', False)),
(BoolVariable('WITH_BF_RAYOPTIMIZATION', 'Enable raytracer SSE/SIMD optimization.', False)),
('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', ''),
(BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)),
('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
(BoolVariable('WITH_BF_CYCLES', 'Build with the Cycles engine', True)),
(BoolVariable('WITH_BF_CYCLES_CUDA_BINARIES', 'Build with precompiled CUDA binaries', False)),
(BoolVariable('WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'Build several render kernels at once (using BF_NUMJOBS)', False)),
('BF_CYCLES_CUDA_NVCC', 'CUDA nvcc compiler path', ''),
('BF_CYCLES_CUDA_ENV', 'preset environement nvcc will execute in', ''),
('BF_CYCLES_CUDA_BINARIES_ARCH', 'CUDA architectures to compile binaries for', []),
(BoolVariable('WITH_BF_CYCLES_DEBUG', 'Build Cycles engine with extra debugging capabilities', False)),
(BoolVariable('WITH_BF_CYCLES_LOGGING', 'Build Cycles engine with logging support', True)),
(BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
(BoolVariable('WITH_BF_STATICOIIO', 'Statically link to OpenImageIO', False)),
('BF_OIIO', 'OIIO root path', ''),
('BF_OIIO_INC', 'OIIO include path', ''),
('BF_OIIO_LIB', 'OIIO library', ''),
('BF_OIIO_LIBPATH', 'OIIO library path', ''),
('BF_OIIO_LIB_STATIC', 'OIIO static library', ''),
(BoolVariable('WITH_BF_OCIO', 'Build with OpenColorIO', False)),
(BoolVariable('WITH_BF_STATICOCIO', 'Staticly link to OpenColorIO', False)),
('BF_OCIO', 'OCIO root path', ''),
('BF_OCIO_INC', 'OCIO include path', ''),
('BF_OCIO_LIB', 'OCIO library', ''),
('BF_OCIO_LIBPATH', 'OCIO library path', ''),
('BF_OCIO_LIB_STATIC', 'OCIO static library', ''),
(BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)),
(BoolVariable('WITH_BF_STATICBOOST', 'Staticly link to boost', False)),
('BF_BOOST', 'Boost root path', ''),
('BF_BOOST_INC', 'Boost include path', ''),
('BF_BOOST_LIB', 'Boost library', ''),
('BF_BOOST_LIB_INTERNATIONAL', 'Boost library', ''),
('BF_BOOST_LIBPATH', 'Boost library path', ''),
('BF_BOOST_LIB_STATIC', 'Boost static library', ''),
(BoolVariable('WITH_GHOST_XDND', 'Build with drag-n-drop support on Linux platforms using XDND protocol', True)),
(BoolVariable('WITH_BF_CYCLES_OSL', 'Build with OSL sypport in Cycles', False)),
(BoolVariable('WITH_BF_STATICOSL', 'Staticly link to OSL', False)),
('BF_OSL', 'OSL root path', ''),
('BF_OSL_INC', 'OSL include path', ''),
('BF_OSL_LIB', 'OSL library', ''),
('BF_OSL_LIBPATH', 'OSL library path', ''),
('BF_OSL_LIB_STATIC', 'OSL static library', ''),
('BF_OSL_COMPILER', 'OSL compiler', ''),
(BoolVariable('WITH_BF_LLVM', 'Build with LLVM sypport (required for OSL)', False)),
(BoolVariable('WITH_BF_STATICLLVM', 'Staticly link to LLVM', False)),
('BF_LLVM', 'LLVM root path', ''),
('BF_LLVM_LIB', 'LLVM library', ''),
('BF_LLVM_LIBPATH', 'LLVM library path', ''),
('BF_LLVM_LIB_STATIC', 'LLVM static library', ''),
('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', ''),
(BoolVariable('WITH_BF_CPP11', '"Build with C++11 standard enabled, for development use only!', False)),
(BoolVariable('WITH_BF_LEGACY_DEPSGRAPH', 'Build Blender with legacy dependency graph', True)),
) # end of opts.AddOptions()
return localopts
def buildbot_zip(src, dest, package_name, extension):
import zipfile
ln = len(src)+1 # one extra to remove leading os.sep when cleaning root for package_root
flist = list()
# create list of tuples containing file and archive name
for root, dirs, files in os.walk(src):
package_root = os.path.join(package_name, root[ln:])
flist.extend([(os.path.join(root, file), os.path.join(package_root, file)) for file in files])
if extension == '.zip':
package = zipfile.ZipFile(dest, 'w', zipfile.ZIP_DEFLATED)
package.comment = package_name + ' is a zip-file containing the Blender software. Visit http://www.blender.org for more information.'
for entry in flist:
package.write(entry[0], entry[1])
package.close()
else:
import tarfile
package = tarfile.open(dest, 'w:bz2')
for entry in flist:
package.add(entry[0], entry[1], recursive=False)
package.close()
bb_zip_name = os.path.normpath(src + os.sep + '..' + os.sep + 'buildbot_upload.zip')
print("creating %s" % (bb_zip_name))
bb_zip = zipfile.ZipFile(bb_zip_name, 'w', zipfile.ZIP_DEFLATED)
print("writing %s to %s" % (dest, bb_zip_name))
bb_zip.write(dest, os.path.split(dest)[1])
bb_zip.close()
print("removing unneeded packed file %s (to keep install directory clean)" % (dest))
os.remove(dest)
print("done.")
def buildslave_print(target, source, env):
return "Running buildslave target"
def buildslave(target=None, source=None, env=None):
"""
Builder for buildbot integration. Used by buildslaves of http://builder.blender.org only.
"""
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'darwin', 'win64-mingw'):
extension = '.zip'
else:
extension = '.tar.bz2'
if env['OURPLATFORM'] == 'win32-mingw':
platform = 'mingw32'
elif env['OURPLATFORM'] == 'win64-mingw':
platform = 'mingw64'
else:
platform = env['OURPLATFORM'].split('-')[0]
if platform == 'linux':
import platform
if "glibc27" in env['BF_INSTALLDIR']:
glibc = "glibc27"
elif "glibc211" in env['BF_INSTALLDIR']:
glibc = "glibc211"
bitness = platform.architecture()[0]
if bitness == '64bit':
platform = 'linux-' + glibc + '-x86_64'
elif bitness == '32bit':
platform = 'linux-' + glibc + '-i686'
if platform == 'darwin':
platform = 'OSX-' + env['MACOSX_DEPLOYMENT_TARGET'] + '-' + env['MACOSX_ARCHITECTURE']
branch = env['BUILDBOT_BRANCH']
outdir = os.path.abspath(env['BF_INSTALLDIR'])
package_name = 'blender-' + VERSION+'-'+HASH + '-' + platform
if branch != '':
package_name = branch + '-' + package_name
package_dir = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name)
package_archive = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name + extension)
try:
if os.path.exists(package_archive):
os.remove(package_archive)
if os.path.exists(package_dir):
shutil.rmtree(package_dir)
except Exception, ex:
sys.stderr.write('Failed to clean up old package files: ' + str(ex) + '\n')
return 1
buildbot_zip(outdir, package_archive, package_name, extension)
return 0
def NSIS_print(target, source, env):
return "Creating NSIS installer for Blender"
def NSIS_Installer(target=None, source=None, env=None):
print "="*35
if env['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'win64-mingw'):
print "NSIS installer is only available on Windows."
exit()
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
bitness = '32'
elif env['OURPLATFORM'] in ('win64-vc', 'win64-mingw'):
bitness = '64'
start_dir = os.getcwd()
rel_dir = os.path.join(start_dir,'release','windows','installer')
install_base_dir = start_dir + os.sep
bf_installdir = os.path.join(os.getcwd(),env['BF_INSTALLDIR'])
bf_installdir = os.path.normpath(bf_installdir)
doneroot = False
rootdirconts = []
datafiles = ''
deldatafiles = ''
deldatadirs = ''
l = len(bf_installdir)
for dp,dn,df in os.walk(bf_installdir):
# install
if not doneroot:
for f in df:
rootdirconts.append(os.path.join(dp,f))
doneroot = True
else:
if len(df)>0:
datafiles += "\n" +r'SetOutPath $INSTDIR'+dp[l:]+"\n\n"
for f in df:
outfile = os.path.join(dp,f)
datafiles += ' File '+outfile + "\n"
# uninstall
deldir = dp[l+1:]
if len(deldir)>0:
deldatadirs = "RMDir $INSTDIR\\" + deldir + "\n" + deldatadirs
deldatadirs = "RMDir /r $INSTDIR\\" + deldir + "\\__pycache__\n" + deldatadirs
for f in df:
deldatafiles += 'Delete \"$INSTDIR\\' + os.path.join(deldir, f) + "\"\n"
#### change to suit install dir ####
inst_dir = install_base_dir + env['BF_INSTALLDIR']
os.chdir(rel_dir)
ns = open("00.sconsblender.nsi","r")
ns_cnt = str(ns.read())
ns.close()
# var replacements
ns_cnt = string.replace(ns_cnt, "[DISTDIR]", os.path.normpath(inst_dir+os.sep))
ns_cnt = string.replace(ns_cnt, "[VERSION]", VERSION_DISPLAY)
ns_cnt = string.replace(ns_cnt, "[SHORTVERSION]", VERSION)
ns_cnt = string.replace(ns_cnt, "[RELDIR]", os.path.normpath(rel_dir))
ns_cnt = string.replace(ns_cnt, "[BITNESS]", bitness)
# do root
rootlist = []
for rootitem in rootdirconts:
rootlist.append("File \"" + rootitem + "\"")
rootstring = string.join(rootlist, "\n ")
rootstring = rootstring
rootstring += "\n\n"
ns_cnt = string.replace(ns_cnt, "[ROOTDIRCONTS]", rootstring)
# do delete items
delrootlist = []
for rootitem in rootdirconts:
delrootlist.append("Delete $INSTDIR\\" + rootitem[l+1:])
delrootstring = string.join(delrootlist, "\n ")
delrootstring += "\n"
ns_cnt = string.replace(ns_cnt, "[DELROOTDIRCONTS]", delrootstring)
ns_cnt = string.replace(ns_cnt, "[DODATAFILES]", datafiles)
ns_cnt = string.replace(ns_cnt, "[DELDATAFILES]", deldatafiles)
ns_cnt = string.replace(ns_cnt, "[DELDATADIRS]", deldatadirs)
tmpnsi = os.path.normpath(install_base_dir+os.sep+env['BF_BUILDDIR']+os.sep+"00.blender_tmp.nsi")
new_nsis = open(tmpnsi, 'w')
new_nsis.write(ns_cnt)
new_nsis.close()
print "NSIS Installer script created"
os.chdir(start_dir)
print "Launching 'makensis'"
cmdline = "makensis " + "\""+tmpnsi+"\""
startupinfo = subprocess.STARTUPINFO()
#startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = True)
data, err = proc.communicate()
rv = proc.wait()
if rv != 0:
print
print data.strip().split("\n")[-1]
return rv
def cudakernels_print(target, source, env):
return "Running cudakernels target"
def cudakernels(target=None, source=None, env=None):
"""
Builder for cuda kernels compilation. Used by release build environment only
"""
# Currently nothing to do, everything is handled by a dependency resolver
pass
def check_environ():
problematic_envvars = ""
for i in os.environ:
try:
os.environ[i].decode('ascii')
except UnicodeDecodeError:
problematic_envvars = problematic_envvars + "%s = %s\n" % (i, os.environ[i])
if len(problematic_envvars)>0:
print("================\n\n")
print("@@ ABORTING BUILD @@\n")
print("PROBLEM DETECTED WITH ENVIRONMENT")
print("---------------------------------\n\n")
print("A problem with one or more environment variable was found")
print("Their value contain non-ascii characters. Check the below")
print("list and override them locally to be ASCII-clean by doing")
print("'set VARNAME=cleanvalue' on the command-line prior to")
print("starting the build process:\n")
print(problematic_envvars)
return False
else:
return True

View File

@@ -0,0 +1,184 @@
"""SCons.Tool.gcc
Tool-specific initialization for MinGW (http://www.mingw.org/)
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Tool/mingw.py 4043 2009/02/23 09:06:45 scons"
import os
import os.path
import string
import SCons.Action
import SCons.Builder
import SCons.Defaults
import SCons.Tool
import SCons.Util
# This is what we search for to find mingw:
prefixes = SCons.Util.Split("""
mingw32-
i386-mingw32msvc-
i486-mingw32msvc-
i586-mingw32msvc-
i686-mingw32msvc-
i686-pc-mingw32-
""")
def find(env):
for prefix in prefixes:
# First search in the SCons path and then the OS path:
if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'):
return prefix
return ''
def shlib_generator(target, source, env, for_signature):
cmd = SCons.Util.CLVar(['$SHLINK'])
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
if dll: cmd.extend(['-o', dll])
cmd.extend(['$SOURCES', '$SHLINKFLAGS', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))
def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
insert_def = env.subst("$WINDOWS_INSERT_DEF")
if not insert_def in ['', '0', 0] and def_target: \
cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
return [cmd]
def shlib_emitter(target, source, env):
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
no_import_lib = env.get('no_import_lib', 0)
if not dll:
raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
if not no_import_lib and \
not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
# Append an import library to the list of targets.
target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
'LIBPREFIX', 'LIBSUFFIX'))
# Append a def file target if there isn't already a def file target
# or a def file source. There is no option to disable def file
# target emitting, because I can't figure out why someone would ever
# want to turn it off.
def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
if not def_source and not def_target:
target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX'))
return (target, source)
shlib_action = SCons.Action.Action(shlib_generator, generator=1)
res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
source_scanner=SCons.Tool.SourceFileScanner)
SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
def generate(env):
mingw = find(env)
if mingw:
dir = os.path.dirname(mingw)
env.PrependENVPath('PATH', dir )
# Most of mingw is the same as gcc and friends...
gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'm4']
for tool in gnu_tools:
SCons.Tool.Tool(tool)(env)
#... but a few things differ:
env['CC'] = mingw + 'gcc'
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
env['CXX'] = mingw + 'g++'
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
env['SHLINKCOM'] = shlib_action
env['LDMODULECOM'] = shlib_action
env.Append(SHLIBEMITTER = [shlib_emitter])
env['RANLIB'] = mingw + 'ranlib'
env['LINK'] = mingw + 'gcc'
env['AS'] = mingw + 'as'
env['AR'] = mingw + 'ar'
env['WIN32DEFPREFIX'] = ''
env['WIN32DEFSUFFIX'] = '.def'
env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}'
env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}'
env['SHOBJSUFFIX'] = '.o'
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
env['RC'] = mingw + 'windres'
env['RCFLAGS'] = SCons.Util.CLVar('')
env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
env['RCINCPREFIX'] = '--include-dir '
env['RCINCSUFFIX'] = ''
env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
env['BUILDERS']['RES'] = res_builder
# Some setting from the platform also have to be overridden:
env['OBJPREFIX'] = ''
env['OBJSUFFIX'] = '.o'
env['LIBPREFIX'] = 'lib'
env['LIBSUFFIX'] = '.a'
env['SHOBJPREFIX'] = '$OBJPREFIX'
env['SHOBJSUFFIX'] = '$OBJSUFFIX'
env['PROGPREFIX'] = ''
env['PROGSUFFIX'] = '.exe'
env['LIBPREFIX'] = ''
env['LIBSUFFIX'] = '.lib'
env['SHLIBPREFIX'] = ''
env['SHLIBSUFFIX'] = '.dll'
env['LIBPREFIXES'] = [ '$LIBPREFIX' ]
env['LIBSUFFIXES'] = [ '$LIBSUFFIX' ]
def exists(env):
return find(env)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:

View File

@@ -0,0 +1,353 @@
"""tools.mstoolkit
Tool-specific initialization for Microsoft Visual C/C++ Toolkit Commandline
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2004 John Connors
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
import os.path
import re
import string
import types
import SCons.Action
import SCons.Builder
import SCons.Errors
import SCons.Platform.win32
import SCons.Tool
import SCons.Util
import SCons.Warnings
CSuffixes = ['.c', '.C']
CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
def get_msvctoolkit_paths():
"""Return a 4-tuple of (INCLUDE, LIB, PATH, TOOLKIT) as the values of those
three environment variables that should be set in order to execute
the MSVC .NET tools properly, if the information wasn't available
from the registry."""
MSToolkitDir = None
paths = {}
exe_path = ''
lib_path = ''
include_path = ''
# First, we get the shell folder for this user:
if not SCons.Util.can_read_reg:
raise SCons.Errors.InternalError, "No Windows registry module was found"
# look for toolkit
if os.environ.has_key('VCToolkitInstallDir'):
MSToolkitDir = os.path.normpath(os.environ['VCToolkitInstallDir'])
else:
# last resort -- default install location
MSToolkitDir = r'C:\Program Files\Microsoft Visual C++ Toolkit 2003'
# look for platform sdk
if os.environ.has_key('MSSdk'):
PlatformSDKDir = os.path.normpath(os.environ['MSSdk'])
else:
try:
PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir')[0]
PlatformSDKDir = str(PlatformSDKDir)
except SCons.Util.RegError:
raise SCons.Errors.InternalError, "The Platform SDK directory was not found in the registry or in the `MSSdk` environment variable."
# look for DX Sdk (expecting DX9)
# dxsdk docs have a directory key, look for it, extract path
#dxsdkdocs = ""
DXsdkDir = ""
#try:
# dxsdkdocs = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\DirectX SDK\DX9SDK Doc Path')
#except SCons.Util.RegError:
# raise SCons.Errors.InternalError, "The DXSDK directory was not found in the registry."
if os.environ.has_key('DXSDK_DIR'):
DXsdkDir = os.path.normpath(os.environ['DXSDK_DIR'])
#DXsdkDir = os.path.split(dxsdkdocs[0])[0]
DXsdkDir = os.path.split(DXsdkDir)[0]
include_path = r'%s\include;%s\include;%s\include' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
lib_path = r'%s\lib;%s\lib;%s\lib' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
exe_path = r'%s\bin;%s\bin\win95;%s\bin' % (MSToolkitDir, PlatformSDKDir, PlatformSDKDir)
return (include_path, lib_path, exe_path, PlatformSDKDir)
def validate_vars(env):
"""Validate the PDB, PCH, and PCHSTOP construction variables."""
if env.has_key('PCH') and env['PCH']:
if not env.has_key('PCHSTOP'):
raise SCons.Errors.UserError, "The PCHSTOP construction must be defined if PCH is defined."
if not SCons.Util.is_String(env['PCHSTOP']):
raise SCons.Errors.UserError, "The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']
def pch_emitter(target, source, env):
"""Sets up the PDB dependencies for a pch file, and adds the object
file target."""
validate_vars(env)
pch = None
obj = None
for t in target:
if SCons.Util.splitext(str(t))[1] == '.pch':
pch = t
if SCons.Util.splitext(str(t))[1] == '.obj':
obj = t
if not obj:
obj = SCons.Util.splitext(str(pch))[0]+'.obj'
target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work
if env.has_key('PDB') and env['PDB']:
env.SideEffect(env['PDB'], target)
env.Precious(env['PDB'])
return (target, source)
def object_emitter(target, source, env, parent_emitter):
"""Sets up the PDB and PCH dependencies for an object file."""
validate_vars(env)
parent_emitter(target, source, env)
if env.has_key('PDB') and env['PDB']:
env.SideEffect(env['PDB'], target)
env.Precious(env['PDB'])
if env.has_key('PCH') and env['PCH']:
env.Depends(target, env['PCH'])
return (target, source)
def static_object_emitter(target, source, env):
return object_emitter(target, source, env,
SCons.Defaults.StaticObjectEmitter)
def shared_object_emitter(target, source, env):
return object_emitter(target, source, env,
SCons.Defaults.SharedObjectEmitter)
pch_builder = SCons.Builder.Builder(action='$PCHCOM', suffix='.pch', emitter=pch_emitter)
res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res')
def pdbGenerator(env, target, source, for_signature):
if target and env.has_key('PDB') and env['PDB']:
return ['/PDB:%s'%target[0].File(env['PDB']).get_string(for_signature),
'/DEBUG']
def win32ShlinkTargets(target, source, env, for_signature):
listCmd = []
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
if implib: listCmd.append("/implib:%s"%implib.get_string(for_signature))
return listCmd
def win32ShlinkSources(target, source, env, for_signature):
listCmd = []
deffile = env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX")
for src in source:
if src == deffile:
# Treat this source as a .def file.
listCmd.append("/def:%s" % src.get_string(for_signature))
else:
# Just treat it as a generic source file.
listCmd.append(src)
return listCmd
def win32LibEmitter(target, source, env):
# SCons.Tool.msvc.validate_vars(env)
dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
no_import_lib = env.get('no_import_lib', 0)
if not dll:
raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
if env.get("WIN32_INSERT_DEF", 0) and \
not env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX"):
# append a def file to the list of sources
source.append(env.ReplaceIxes(dll,
"SHLIBPREFIX", "SHLIBSUFFIX",
"WIN32DEFPREFIX", "WIN32DEFSUFFIX"))
if env.has_key('PDB') and env['PDB']:
env.SideEffect(env['PDB'], target)
env.Precious(env['PDB'])
if not no_import_lib and \
not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
# Append an import library to the list of targets.
target.append(env.ReplaceIxes(dll,
"SHLIBPREFIX", "SHLIBSUFFIX",
"LIBPREFIX", "LIBSUFFIX"))
# and .exp file is created if there are exports from a DLL
target.append(env.ReplaceIxes(dll,
"SHLIBPREFIX", "SHLIBSUFFIX",
"WIN32EXPPREFIX", "WIN32EXPSUFFIX"))
return (target, source)
def prog_emitter(target, source, env):
#SCons.Tool.msvc.validate_vars(env)
if env.has_key('PDB') and env['PDB']:
env.SideEffect(env['PDB'], target)
env.Precious(env['PDB'])
return (target,source)
def RegServerFunc(target, source, env):
if env.has_key('register') and env['register']:
ret = regServerAction([target[0]], [source[0]], env)
if ret:
raise SCons.Errors.UserError, "Unable to register %s" % target[0]
else:
print "Registered %s sucessfully" % target[0]
return ret
return 0
regServerAction = SCons.Action.Action("$REGSVRCOM")
regServerCheck = SCons.Action.Action(RegServerFunc, None)
shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
compositeLinkAction = shlibLinkAction + regServerCheck
def generate(env):
"""Add Builders and construction variables for MSVC++ to an Environment."""
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
for suffix in CSuffixes:
static_obj.add_action(suffix, SCons.Defaults.CAction)
shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
for suffix in CXXSuffixes:
static_obj.add_action(suffix, SCons.Defaults.CXXAction)
shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
SCons.Tool.createStaticLibBuilder(env)
SCons.Tool.createSharedLibBuilder(env)
SCons.Tool.createProgBuilder(env)
env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s"%File(PDB)) or ""}'])
env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS'
env['CC'] = 'cl'
env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
env['CCCOM'] = '$CC $CCFLAGS $CCCOMFLAGS'
env['SHCC'] = '$CC'
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
env['SHCCCOM'] = '$SHCC $SHCCFLAGS $CCCOMFLAGS'
env['CXX'] = '$CC'
env['CXXFLAGS'] = SCons.Util.CLVar('$CCFLAGS $( /TP $)')
env['CXXCOM'] = '$CXX $CXXFLAGS $CCCOMFLAGS'
env['SHCXX'] = '$CXX'
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
env['SHCXXCOM'] = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'
env['CPPDEFPREFIX'] = '/D'
env['CPPDEFSUFFIX'] = ''
env['INCPREFIX'] = '/I'
env['INCSUFFIX'] = ''
env['OBJEMITTER'] = static_object_emitter
env['SHOBJEMITTER'] = shared_object_emitter
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
env['RC'] = 'rc'
env['RCFLAGS'] = SCons.Util.CLVar('')
env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
CScan = env.get_scanner('.c')
if CScan:
CScan.add_skey('.rc')
env['BUILDERS']['RES'] = res_builder
include_path, lib_path, exe_path, sdk_path = get_msvctoolkit_paths()
env.PrependENVPath('INCLUDE', include_path)
env.PrependENVPath('LIB', lib_path)
env.PrependENVPath('PATH', exe_path)
env['ENV']['CPU'] = 'i386'
env['ENV']['MSSDK'] = sdk_path
env['ENV']['BkOffice'] = sdk_path
env['ENV']['Basemake'] = sdk_path + "\\Include\\BKOffice.Mak"
env['ENV']['INETSDK'] = sdk_path
env['ENV']['MSSDK'] = sdk_path
env['ENV']['MSTOOLS'] = sdk_path
env['ENV']['TARGETOS'] = 'WINNT'
env['ENV']['APPVER'] = '5.0'
env['CFILESUFFIX'] = '.c'
env['CXXFILESUFFIX'] = '.cc'
env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS'
env['BUILDERS']['PCH'] = pch_builder
env['AR'] = 'lib.exe' #'"' +sdk_path + '\\bin\\Win64\\lib.exe"'
env['ARFLAGS'] = SCons.Util.CLVar('/nologo')
env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
env['SHLINK'] = '$LINK'
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
env['_SHLINK_TARGETS'] = win32ShlinkTargets
env['_SHLINK_SOURCES'] = win32ShlinkSources
env['SHLINKCOM'] = compositeLinkAction
env['SHLIBEMITTER']= win32LibEmitter
env['LINK'] = 'link.exe' #'"' +sdk_path + '\\bin\\Win64\\' + 'link.exe"'
env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')
env['_PDB'] = pdbGenerator
env["TEMPFILE"] = SCons.Platform.win32.TempFileMunge
env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES")}'
env['PROGEMITTER'] = prog_emitter
env['LIBDIRPREFIX']='/LIBPATH:'
env['LIBDIRSUFFIX']=''
env['LIBLINKPREFIX']=''
env['LIBLINKSUFFIX']='$LIBSUFFIX'
env['WIN32DEFPREFIX'] = ''
env['WIN32DEFSUFFIX'] = '.def'
env['WIN32_INSERT_DEF'] = 0
env['WIN32EXPPREFIX'] = ''
env['WIN32EXPSUFFIX'] = '.exp'
env['REGSVRACTION'] = regServerCheck
env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
env['REGSVRFLAGS'] = '/s '
env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET'
def exists(env):
return env.Detect('cl')

104
doc/build_systems/cmake.txt Normal file
View File

@@ -0,0 +1,104 @@
Blender CMake build system
============================
Contents
---------------
1. Introduction
2. Obtaining CMake
3. Building Blender
4. Generic Setup
5. Configuring the build after SVN updates
1. Introduction
---------------
This document describes general usage of the new CMake scripts. The
inner workings will be described in blender-cmake-dev.txt (TODO).
2. Obtaining CMake
------------------
CMake for can either be downloaded using your favorite package manager
or is also available from the CMake website at http://www.cmake.org
The website also contains some documentation on CMake usage but I found
the man page alone pretty helpful.
3. Building Blender
-------------------
Building Blender requires obtaining a compiler, library dependencies,
and correct setup depending on the system. For details on how to set
up a build on various operating systems, see the wiki documentation:
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender
4. Generic Setup
----------------
CMake allows one to generate the build project files and binary objects
outside the source tree which can be pretty handy in working and experimenting
with different Blender configurations (Audio/NoAudio, GameEngine/NoGameEngine etc.)
while maintaining a clean source tree. It also makes it possible to generate files
for different build systems on the same source tree. This also has benefits for
general SVN management for the developer as patches and submit logs are much cleaner.
Create a directory outside the blender source tree where you would like to build
Blender (from now on called $BLENDERBUILD). On the commandline you can then run
the cmake command to generate your initial build files. First just run 'cmake' which
will inform you what the available generators are. Thn you can run
'cmake -G generator $BLENDERSOURCE' to generate the build files. Here is an example
of all this for Xcode:
% mkdir $BLENDERBUILD
% cd $BLENDERBUILD
% cmake
...
...
--version [file] = Show program name/version banner and exit.
Generators
The following generators are available on this platform:
KDevelop3 = Generates KDevelop 3 project files.
Unix Makefiles = Generates standard UNIX makefiles.
Xcode = Generate XCode project files.
% cmake -G Xcode $BLENDERSOURCE
...
...
-- Configuring blender
-- Configuring blenderplayer
-- Configuring done
-- Generating done
-- Build files have been written to: $BLENDERBUILD
This will generate the build files with default values. Specific features can
be enabled or disabled by running the ccmake "GUI" from $BLENDERBUILD as follows:
% ccmake $BLENDERSOURCE
A number of options appear which can be changed depending on your needs and
available dependencies (e.g. setting WITH_OPENEXR to OFF will disable support
for OpenEXR). It will also allow you to override default and detected paths
(e.g. Python directories) and compile and link flags. When you are satisfied
used ccmake to re-configure the build files and exit.
It is also possible to use the commandline of 'cmake' to override certain
of these settings.
5. Configuring the build after SVN updates
------------------------------------------
The $BLENDERBUILD directory maintains a file called CMakeCache.txt which
remembers the initial run's settings for subsequent generation runs. After
SVN updates that contain changes to the build system, rebuilding Blender will
automatically invoke CMake to regenerate the CMakeCache.txt and other files
as needed.
/Jacques Beaurain (jbinto)

View File

@@ -0,0 +1,193 @@
Internals of Blenders SCons scripts
===================================
Scope
------
This document describes the architecture of the SCons scripts for
Blender. An overview of available functionality and how to modify,
extend and maintain the system.
Audience
--------
This document is for developers who need to modify the system,
ie. add or remove new libraries, add new arguments for SCons, etc.
Files and their meaning
-----------------------
The main entry point for the build system is the SConstruct-file in
$BLENDERHOME. This file creates the first BlenderEnvironment to work
with, reads in options, and sets up some directory structures. Further
it defines some targets.
Platform-specific configurations are in $BLENDERHOME/config. The
filenames have the form (platform)-config.py, where platform one of:
* darwin
* linux
* win32-mingw
* win32-vc
The user can override options by creating a file
$BLENDERHOME/user-config.py. It can have any option from
(platform)-config.py. Options in this file will override the platform
defaults.
Much of the actual functionality can be found in the python scripts
in the directory $BLENDERHOME/build_files/scons/tools, with
Blender.py defining the bulk of the functionality. btools.py has some
helper functions, and bcolors.py is for the terminal
colors. mstoolkit.py and crossmingw.py are modules which set up SCons
for the MS VC++ 2003 toolkit and the cross-compile toolset for
compiling Windows binaries on Linux respectively. Note: the
cross-compile doesn't work yet for Blender, but is added in
preparation for having it work in the distant future.
BlenderEnvironment
------------------
The module Blender.py implements a BlenderEnvironment class, derived
from the SConsEnvironment of SCons. This is done to wrap some often
used functionality. The BlenderEnvironment offers two important
wrappers: BlenderProg() and BlenderLib(). The first one is used to
specify a binary to be built, the second one is used to specify what
static library is built from given sources.
Build a static library called "somelib". The system handles library
pre- and suffixes automatically, you don't need to bother yourself
with these details:
env = BlenderEnvironment(ENV = os.environ) # create an environment
env.BlenderLib(libname="somelib", sources=['list.c','with.c','sources.c'],
includes=['/list/with/include/paths', '.', '..'],
defines=['LIST_WITH', 'CPP_DEFINES', 'TO_USE'],
libtype=['blender', 'common'] # this is a list with libtypes. Normally you don't
# need to specify this, but if you encounter linking
# problems you may need this
priority=[10, 20] # Priorities, list as long as libtype, priority per type
compileflags=['/O2'] # List of compile flags needed for this particular library.
# used only in rare cases, like SOLID, qhull and Bullet
)
There should be no need to ever add an extra BlenderProg to the
existing ones in SConstruct, see that file for its use, and Blender.py
for its implementation.
The new system works so that using these wrappers, has all libraries
(and programs) register with a central repository. This means that
adding a new library is as easy as just creating the new SConscript
and making sure that it gets called properly. Linking and such will
then be handled automatically.
If you want that adding new source files for a certain library
is handled automatically, you can use the Glob() function from
the BlenderEnvironment to create lists of needed files. See
$BLENDERHOME/source/blender/src/SConscript for an example. Keep in
mind that this will add any new file that complies to the rule given
to the Glob() function. There are a few (external) libraries with
which this can't be used, because it'd take files that shouldn't be
compiled, and create subsequentially problems during the linking stage
(like SOLID, qhull, Bullet).
Linking order and priorities
----------------------------
As shown above, you can give a library a priority in a certain
group. If you need to make sure that a Blender library is linked
before or after another one, you can give it a priority. To debug
the priorities us BF_PRIORITYLIST=1 on the command-line while running
a build.
% scons BF_PRIORITYLIST=1
This will give a list with values suggested by the system. Make
changes to all SConscripts in question to reflect or change the
values given by this command. ALWAYS check this after adding a new
internal, external library or core library, and make sure there are
sane values. You can use large and negative numbers to test with,
but after you've got a working linking order, do change the system
to reflect BF_PRIORITYLIST values.
Also, if you find that a library needs to be given multiple times to
the linker, you can do that by giving a python list with the names
of the available library types. They are currently:
B.possible_types = ['core', 'common', 'blender', 'intern',
'international', 'game', 'game2',
'player', 'player2', 'system']
More groups can be added, but that should be carefully considered,
as it may lead to large-scale changes. The current amount of libraries
should suffice.
The central repository is utilised in the SConstruct in two
ways. Firstly, it is used to determine the order of all static
libraries to link into the main Blender executable. Secondly, it
is used to keep track of all built binaries and their location,
so that they can be properly copied to BF_INSTALLDIR.
The libraries can be fetched in their priority order with
create_blender_liblist from Blender.py, see the SConstruct on how
it is used.
The program repository is the global list program_list from
Blender.py. See SConstruct for its usage.
Adding a new option and libraries
---------------------------------
Lets say we want to add WITH_BF_NEWLIB, which will
enable or disable a new feature library with sources in
$BLENDERHOME/source/blender/newlib. This 'newlib' needs external
headers from a 3rd party library '3rdparty'. For this we want to
add a set of options BF_3RDPARTY, BF_3RDPARTY_INC, BF_3RDPARTY_LIB,
BF_3RDPARTY_LIBPATH:
1) Add all mentiond options to all (platform)-config.py
files. WITH_BF_NEWLIB is a boolean option ('true', 'false'),
the rest are strings with paths and library names. See the
OpenEXR options for example.
2) Add all options to the argument checking function
validate_arguments() in btools.py. See again OpenEXR options
for example.
3) Add all options to the option reading function read_opts()
in btools.py. See again OpenEXR options for example. All default
values can be empty, as the actual default values are in the
(platform)-config.py files.
4) Add BF_3RDPARTY_LIB to the function setup_syslibs()
and BF_3RDPARTY_LIBPATH to the function setup_staticlibs()
in Blender.py
At this stage we have prepared all option setting and linking needs,
but we still need to add in the compiling of the 'newlib'.
5) Create a SConscript in $BLENDERHOME/source/blender/newlib. Look
at ie. $BLENDERHOME/source/blender/src/SConscript for
template. The new SConscript will register the new library
like so:
env.BlenderLib(libname='newlib', sources=sourcefiles, includes=incs) # the rest of the arguments get defaults = empty lists and values
6) Edit $BLENDERHOME/source/blender/SConscript with the following
addition:
if env['WITH_BF_NEWLIB'] == 1:
SConscript(['newlib/SConscript'])
After this you can see if this works by trying to build:
% scons WITH_BF_NEWLIB=1 # build with newlib
% scons WITH_BF_NEWLIB=0 # disable newlib
This is all what should be needed. Changing the library name doesn't
need changes elsewhere in the system, as it is handled automatically
with the central library repository.
Enjoy the new system!!
/Nathan Letwory (jesterKing)

227
doc/build_systems/scons.txt Normal file
View File

@@ -0,0 +1,227 @@
Blenders SCons build scripts
============================
Introduction
------------
Since the beginning of 2004 Blender has had the SCons system as a
build option. SCons is a Python-based, accurate build system. The
scripts that were implemented in the first iteration worked, but
the system grew quickly into such a state that maintaining it became
a nightmare, and adding new features was just horrible, leading to
many hacks without much sense in the overall structure.
The rewrite has been waiting for a long time. Jonathan Jacobs provided
a first overhaul of the scripts, which I used in the first phase of
the rewrite. To make the system as maintainable as possible I made
some radical changes, but thanks go to Jonathan for providing me
with the patch to get started.
This document describes the usage of the new SCons scripts. The
inner workings are described in scons-dev.txt.
Building Blender
----------------
To build Blender with the SCons scripts you need a full Python
install, version 2.4 or later (http://www.python.org). We already provide
a scons-local installation, which can be found in the scons/ subdirectory.
This document uses the scons-local installation for its examples.
For build instructions, including dependencies, consult the appropriate
section for your platform at
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender. Note that for
windows many of these dependencies already come in the lib/windows module
from CVS.
In the base directory of the sources (from now on called $BLENDERHOME)
you'll see a file named SConstruct. This is the entry point for the
SCons build system. In a terminal, change to this directory. To just
build, start the SCons entry script on Windows (will be used for the remainder
of this document):
% python scons\scons.py
On a Unix-compatible system it would be
% python ./scons/scons.py
This will start the build process with default values. Depending
on your platform you may see color in your output (non-Windows
machines). In the the beginning an overview of targets and arguments
from the command-line is given, then all libraries and binaries to
build are configured.
The build uses BF_BUILDDIR to build into and BF_INSTALLDIR to finally copy
all needed files to get a proper setup. The BF_DOCDIR is used to generate
Blender Python documentation files to. These variables have default values
for every platform in
$BLENDERHOME/build_files/scons/config/(platform)-config.py. See the next
section of this document for how to customize these paths. After the build
successfully completes, you can find everything you need in BF_INSTALLDIR.
If you want to create the installer package of Blender on Windows you'll
need to install nullsoft scriptable install system from http://nsis.sf.net.
As an extra dependency, you need the MoreInfo plugin too. The creation of
the installer is tied into the build process and can be triggered with:
% python scons\scons.py nsis
Configuring the build
---------------------
The default values for your platform can be found in the directory
$BLENDERHOME/build_files/scons/config. Your platform specific defaults are
in (platform)-config.py, where platform is one of:
- linux, for machines running Linux
- win32-vc, for Windows machines, compiling with a Microsoft compiler
- win32-mingw, for Windows machines, compiling with the MingW compiler
- darwin, for OS X machines
(TBD: add cygwin, solaris and freebsd support)
These files you will normally not change. If you need to override a
default value, make a file called $BLENDERHOME/user-config.py, and copy
settings from the build_files/scons/config/(platform)-config.py that you
want to change. Don't copy the entire file (unless explicitly stated in
the configuration file), because you may not get updated options you don't
change yourself, which may result in build errors. You should NEVER have
to modify $BLENDERHOME/build_files/scons/config/(platform)-config.py.
You can use BF_CONFIG argument to override the default user-config.py
check. This is just like the user-config.py, but just with another name:
% python scons\scons.py BF_CONFIG=myownsettings
If you want to quickly test a new setting, you can give the option
also on the command-line:
% python scons\scons.py BF_BUILDDIR=../mybuilddir WITH_BF_OPENEXR=0
This command sets the build directory to BF_BUILDDIR and disables
OpenEXR support.
If you need to know what can be set through the command-line, run
scons with -h:
% python scons\scons.py -h
This command will print a long list with settable options and what
every option means. Many of the default values will be empty, and
from a fresh checkout without a user-config.py the actual values
are the defaults as per $BLENDERHOME/config/(platform)-config.py
(unless you have overridden any of them in your
$BLENDERHOME/user-config.py).
Configuring the output
----------------------
This rewrite features a cleaner output during the build process. If
you need to see the full command-line for compiles, then you can
change that behaviour. Also the use of colors can be changed:
% python scons\scons.py BF_FANCY=0
This will disable the use of colors.
% python scons\scons.py BF_QUIET=0
This will give the old, noisy output. Every command-line per
compile is printed out in its full glory. This is very useful when
debugging problems with compiling, because you can see what the
included paths are, what defines are given on the command-line,
what compiler switches are used, etc.
Compiling Only Some Libraries
-----------------------------
Our implementation now has support for specifying a list of libraries that are
exclusively compiled, ignoring all other libraries. This is invoked
with the BF_QUICK arguments; for example:
% python scons\scons.py BF_QUICK=src,bf_blenkernel
Note that this not the same as passing a list of folders as in the
makefile's "quicky" command. In Scons, all of Blender's code modules
are in their own static library; this corresponds to one-lib-per-folder
in some cases (especially in blender/source/blender).
To obtain a list of the libraries, simple fire up scons and CTRL-C out once
it finishes configuring (and printing to the console) the library list.
Compiling Libraries With Debug Profiling
----------------------------------------
Scons has support for specifying a list of libraries that are compiled
with debug profiling enabled. This is implemented in two commands:
BF_QUICKDEBUG which is a command-line argument and BF_DEBUG_LIBS, which goes
in your user-config.py
BF_QUICKDEBUG is similar to BF_QUICK:
% python scons\scons.py BF_QUICKDEBUG=src,bf_blenkernel,some-other-lib
To use BF_DEBUG_LIBS, put something like the following in you user-config.py:
BF_DEBUG_LIBS = ['bf_blenlib', 'src', 'some_lib']
For instructions on how to find the names of the libraries (folders) you
wish to use, see the above section. Note that the command BF_DEBUG
(see below) will override these settings and compile ALL of Blender with
debug symbols. Also note that BF_QUICKDEBUG and BF_DEBUG_LIBS are combined;
for example, setting BF_QUICKDEBUG won't overwrite the contents of BF_DEBUG_LIBS.
Supported toolset
-----------------
WINDOWS
* msvc, this is a full install of Microsoft Visual C++. You'll
likely have the .NET Framework SDK, Platform SDK and DX9 SDK
installed * mstoolkit, this is the free MS VC++ 2003 Toolkit. You
need to verify you have also the SDKs installed as mentioned
for msvc. * mingw, this is a minimal MingW install. TBD: write
proper instructions on getting needed packages.
On Windows with all of the three toolset installed you need to
specify what toolset to use
% python scons\scons.py BF_TOOLSET=msvc
% python scons\scons.py BF_TOOLSET=mingw
LINUX and OS X
Currently only the default toolsets are supported for these platforms,
so nothing special needs to be told to SCons when building. The
defaults should work fine in most cases.
Examples
--------
Build Blender with the defaults:
% python scons\scons.py
Build Blender, but disable OpenEXR support:
% python scons\scons.py WITH_BF_OPENEXR=0
Build Blender, enable debug symbols:
% python scons\scons.py BF_DEBUG=1
Build Blender, install to different directory:
% python scons\scons.py BF_INSTALLDIR=../myown/installdir
Build Blender in ../myown/builddir and install to ../myown/installdir:
% python scons\scons.py BF_BUILDDIR=../myown/builddir BF_INSTALLDIR=../myown/installdir
Clean BF_BUILDDIR:
% python scons\scons.py clean
/Nathan Letwory (jesterKing)

View File

@@ -1,4 +1,4 @@
# Doxyfile 1.8.11
# Doxyfile 1.8.9.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -351,14 +351,7 @@ IDL_PROPERTY_SUPPORT = YES
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
# If one adds a struct or class to a group and this option is enabled, then also
# any nested class or struct is added to the same group. By default this option
# is disabled and one has to add nested compounds explicitly via \ingroup.
# The default value is: NO.
GROUP_NESTED_COMPOUNDS = NO
DISTRIBUTE_GROUP_DOC = YES
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
# (for instance a group of public functions) to be put as a subgroup of that
@@ -749,12 +742,6 @@ WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
# a warning is encountered.
# The default value is: NO.
WARN_AS_ERROR = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
@@ -778,7 +765,7 @@ WARN_LOGFILE =
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# spaces.
# Note: If this tag is empty the current directory is searched.
INPUT = doxygen.main.h \
@@ -800,17 +787,12 @@ INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# read by doxygen.
#
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
# *.h) to filter out the source-files in the directories. If left blank the
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
# *.qsf, *.as and *.js.
FILE_PATTERNS =
@@ -899,10 +881,6 @@ IMAGE_PATH =
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.
INPUT_FILTER =
@@ -912,10 +890,6 @@ INPUT_FILTER =
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.
FILTER_PATTERNS =
@@ -939,7 +913,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
# USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
@@ -1174,9 +1148,8 @@ HTML_COLORSTYLE_GAMMA = 79
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to YES can help to show when doxygen was last run and thus if the
# documentation is up to date.
# The default value is: NO.
# to NO can help when comparing the output of multiple runs.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = YES
@@ -1650,12 +1623,9 @@ COMPACT_LATEX = NO
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. The package can be specified just
# by its name or with the correct syntax as to be used with the LaTeX
# \usepackage command. To get the times font for instance you can specify :
# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
# To use the option intlimits with the amsmath package you can specify:
# EXTRA_PACKAGES=[intlimits]{amsmath}
# that should be included in the LaTeX output. To get the times font for
# instance you can specify
# EXTRA_PACKAGES=times
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@@ -1758,14 +1728,6 @@ LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_TIMESTAMP = NO
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -2265,8 +2227,7 @@ INCLUDED_BY_GRAPH = NO
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable call graphs for selected
# functions only using the \callgraph command. Disabling a call graph can be
# accomplished by means of the command \hidecallgraph.
# functions only using the \callgraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
@@ -2277,8 +2238,7 @@ CALL_GRAPH = NO
#
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command. Disabling a caller graph can be
# accomplished by means of the command \hidecallergraph.
# functions only using the \callergraph command.
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
@@ -2301,15 +2261,11 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. For an explanation of the image formats see the section
# output formats in the documentation of the dot tool (Graphviz (see:
# http://www.graphviz.org/)).
# generated by dot.
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
# to make the SVG files visible in IE 9+ (other browsers do not have this
# requirement).
# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
# png:gdiplus:gdiplus.
# Possible values are: png, jpg, gif and svg.
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.

View File

@@ -11,10 +11,6 @@
*
*/
/** \defgroup curve_fit Curve Fitting Library
* \ingroup extern
*/
/** \defgroup bullet Bullet Physics Library
* \ingroup extern
* \see \ref bulletdoc

View File

@@ -38,7 +38,7 @@
* \ingroup intern
*/
/** \defgroup eigen eigen
/** \defgroup opennl opennl
* \ingroup intern
*/

View File

@@ -7,7 +7,7 @@
* These pages document the source code of blender.
*
* \subsection implinks Important Links
* - <a href="http://developer.blender.org">developer.blender.org</a> with bug tracker.
* - <a href="http://developer.blender.org">developer.blender.org</a> with bug tracker
* - <a href="http://wiki.blender.org/index.php/Dev:Contents">Development documents</a> on our wiki.
*
* \subsection blother Other

View File

@@ -11,6 +11,7 @@
/** \defgroup bmesh BMesh
* \ingroup blender
*/
/** \defgroup texture Texturing */
/** \defgroup compositor Compositing */
/** \defgroup python Python
@@ -94,10 +95,6 @@
/** \defgroup blender Blender */
/** \defgroup blt BlenTranslation
* \ingroup blender
*/
/** \defgroup blf BlenFont
* \ingroup blender
*/
@@ -325,7 +322,7 @@
* \ingroup gui
*/
/** \defgroup externformats External Formats */
/** \defgroup externformats external formats */
/** \defgroup collada COLLADA
* \ingroup externformats

View File

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

View File

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

View File

@@ -1,7 +1,6 @@
"""
Basic Sound Playback
++++++++++++++++++++
This script shows how to use the classes: :class:`Device`, :class:`Factory` and
:class:`Handle`.
"""

View File

@@ -1,10 +1,9 @@
"""
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.
createTexture() and removeTexture() are to be called from a module Python
Controller.
"""
from bge import logic
from bge import texture

View File

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

@@ -1,8 +1,7 @@
"""
Basic Video Playback
++++++++++++++++++++
Example of how to replace a texture in game with a video. It needs to run
everyframe.
Example of how to replace a texture in game with a video. It needs to run everyframe
"""
import bge
from bge import texture

View File

@@ -1,7 +1,6 @@
"""
Basic Handler Example
+++++++++++++++++++++
This script shows the most simple example of adding a handler.
"""

View File

@@ -3,7 +3,6 @@ Intro
-----
.. warning::
Most of this object should only be useful if you actually manipulate i18n stuff from Python.
If you are a regular addon, you should only bother about :const:`contexts` member,
and the :func:`register`/:func:`unregister` functions! The :func:`pgettext` family of functions
@@ -13,12 +12,12 @@ Intro
| ``{locale: {msg_key: msg_translation, ...}, ...}``
| where:
- locale is either a lang iso code (e.g. ``fr``), a lang+country code (e.g. ``pt_BR``),
* locale is either a lang iso code (e.g. ``fr``), a lang+country code (e.g. ``pt_BR``),
a lang+variant code (e.g. ``sr@latin``), or a full code (e.g. ``uz_UZ@cyrilic``).
- msg_key is a tuple (context, org message) - use, as much as possible, the predefined :const:`contexts`.
- msg_translation is the translated message in given language!
* msg_key is a tuple (context, org message) - use, as much as possible, the predefined :const:`contexts`.
* msg_translation is the translated message in given language!
Then, call ``bpy.app.translations.register(__name__, your_dict)`` in your ``register()`` function, and
Then, call ``bpy.app.translations.register(__name__, your_dict)`` in your ``register()`` function, and \n"
``bpy.app.translations.unregister(__name__)`` in your ``unregister()`` one.
The ``Manage UI translations`` addon has several functions to help you collect strings to translate, and

View File

@@ -7,18 +7,11 @@ act on specified rather than the selected or active data, or to execute an
operator in the different part of the user interface.
The context overrides are passed as a dictionary, with keys matching the context
member names in bpy.context.
For example to override ``bpy.context.active_object``,
you would pass ``{'active_object': object}``.
.. note::
You will nearly always want to use a copy of the actual current context as basis
(otherwise, you'll have to find and gather all needed data yourself).
member names in bpy.context. For example to override bpy.context.active_object,
you would pass {'active_object': object}.
"""
# remove all objects in scene rather than the selected ones
import bpy
override = bpy.context.copy()
override['selected_bases'] = list(bpy.context.scene.object_bases)
override = {'selected_bases': list(bpy.context.scene.object_bases)}
bpy.ops.object.delete(override)

View File

@@ -3,21 +3,21 @@ Calling Operators
-----------------
Provides python access to calling operators, this includes operators written in
C, Python or macros.
C, Python or Macros.
Only keyword arguments can be used to pass operator properties.
Operators don't have return values as you might expect,
instead they return a set() which is made up of:
``{'RUNNING_MODAL', 'CANCELLED', 'FINISHED', 'PASS_THROUGH'}``.
Common return values are ``{'FINISHED'}`` and ``{'CANCELLED'}``.
Operators don't have return values as you might expect, instead they return a
set() which is made up of: {'RUNNING_MODAL', 'CANCELLED', 'FINISHED',
'PASS_THROUGH'}.
Common return values are {'FINISHED'} and {'CANCELLED'}.
Calling an operator in the wrong context will raise a ``RuntimeError``,
Calling an operator in the wrong context will raise a RuntimeError,
there is a poll() method to avoid this problem.
Note that the operator ID (bl_idname) in this example is ``mesh.subdivide``,
``bpy.ops`` is just the access path for python.
Note that the operator ID (bl_idname) in this example is 'mesh.subdivide',
'bpy.ops' is just the access path for python.
Keywords and Positional Arguments
@@ -32,9 +32,9 @@ There are 3 optional positional arguments (documented in detail below).
bpy.ops.test.operator(override_context, execution_context, undo)
- override_context - ``dict`` type.
- execution_context - ``str`` (enum).
- undo - ``bool`` type.
* override_context - dict type
* execution_context - string (enum)
* undo - boolean
Each of these arguments is optional, but must be given in the order above.

View File

@@ -20,7 +20,7 @@ bpy.types.Scene.my_settings = \
bpy.props.CollectionProperty(type=SceneSettingItem)
# Assume an armature object selected
print("Adding 2 values!")
print("Adding 3 values!")
my_item = bpy.context.scene.my_settings.add()
my_item.name = "Spam"

View File

@@ -48,9 +48,9 @@ bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array,
# Note: the getter/setter callback must use integer identifiers!
test_items = [
("RED", "Red", "", 1),
("GREEN", "Green", "", 2),
("BLUE", "Blue", "", 3),
("YELLOW", "Yellow", "", 4),
("GREEN", "Red", "", 2),
("BLUE", "Red", "", 3),
("YELLOW", "Red", "", 4),
]

View File

@@ -8,8 +8,7 @@ bl_info = {
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Object",
}
"category": "Object"}
import bpy

View File

@@ -1,18 +0,0 @@
import bpy
filepath = "//new_library.blend"
# write selected objects and their data to a blend file
data_blocks = set(bpy.context.selected_objects)
bpy.data.libraries.write(filepath, data_blocks)
# write all meshes starting with a capital letter and
# set them with fake-user enabled so they aren't lost on re-saving
data_blocks = {mesh for mesh in bpy.data.meshes if mesh.name[:1].isupper()}
bpy.data.libraries.write(filepath, data_blocks, fake_user=True)
# write all materials, textures and node groups to a library
data_blocks = {*bpy.data.materials, *bpy.data.textures, *bpy.data.node_groups}
bpy.data.libraries.write(filepath, data_blocks)

View File

@@ -1,7 +1,6 @@
"""
Submenus
++++++++
This menu demonstrates some different functions.
"""
import bpy

View File

@@ -1,7 +1,6 @@
"""
Extending Menus
+++++++++++++++
When creating menus for addons you can't reference menus in Blender's default
scripts.
Instead, the addon can add menu items to existing menus.

View File

@@ -1,80 +0,0 @@
"""
Preset Menus
++++++++++++
Preset menus are simply a convention that uses a menu sub-class
to perform the common task of managing presets.
This example shows how you can add a preset menu.
This example uses the object draw options,
however you can use properties defined by your own scripts too.
"""
import bpy
from bpy.types import Operator, Menu
from bl_operators.presets import AddPresetBase
class OBJECT_MT_draw_presets(Menu):
bl_label = "Object Draw Presets"
preset_subdir = "object/draw"
preset_operator = "script.execute_preset"
draw = Menu.draw_preset
class AddPresetObjectDraw(AddPresetBase, Operator):
'''Add a Object Draw Preset'''
bl_idname = "camera.object_draw_preset_add"
bl_label = "Add Object Draw Preset"
preset_menu = "OBJECT_MT_draw_presets"
# variable used for all preset values
preset_defines = [
"obj = bpy.context.object"
]
# properties to store in the preset
preset_values = [
"obj.draw_type",
"obj.show_bounds",
"obj.draw_bounds_type",
"obj.show_name",
"obj.show_axis",
"obj.show_wire",
]
# where to store the preset
preset_subdir = "object/draw"
# Draw into an existing panel
def panel_func(self, context):
layout = self.layout
row = layout.row(align=True)
row.menu(OBJECT_MT_draw_presets.__name__, text=OBJECT_MT_draw_presets.bl_label)
row.operator(AddPresetObjectDraw.bl_idname, text="", icon='ZOOMIN')
row.operator(AddPresetObjectDraw.bl_idname, text="", icon='ZOOMOUT').remove_active = True
classes = (
OBJECT_MT_draw_presets,
AddPresetObjectDraw,
)
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.OBJECT_PT_display.prepend(panel_func)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
bpy.types.OBJECT_PT_display.remove(panel_func)
if __name__ == "__main__":
register()

View File

@@ -1,7 +1,6 @@
"""
Basic Menu Example
++++++++++++++++++
Here is an example of a simple menu. Menus differ from panels in that they must
reference from a header, panel or another menu.
@@ -9,11 +8,9 @@ Notice the 'CATEGORY_MT_name' in :class:`Menu.bl_idname`, this is a naming
convention for menus.
.. note::
Menu subclasses must be registered before referencing them from blender.
.. note::
Menus have their :class:`Layout.operator_context` initialized as
'EXEC_REGION_WIN' rather than 'INVOKE_DEFAULT' (see :ref:`Execution Context <operator-execution_context>`).
If the operator context needs to initialize inputs from the

View File

@@ -7,10 +7,10 @@ for more flexible mesh editing from python see :mod:`bmesh`.
Blender stores 4 main arrays to define mesh geometry.
- :class:`Mesh.vertices` (3 points in space)
- :class:`Mesh.edges` (reference 2 vertices)
- :class:`Mesh.loops` (reference a single vertex and edge)
- :class:`Mesh.polygons`: (reference a range of loops)
* :class:`Mesh.vertices` (3 points in space)
* :class:`Mesh.edges` (reference 2 vertices)
* :class:`Mesh.loops` (reference a single vertex and edge)
* :class:`Mesh.polygons`: (reference a range of loops)
Each polygon reference a slice in the loop array, this way, polygons do not store vertices or corner data such as UV's directly,

View File

@@ -1,7 +1,6 @@
"""
Poll Function
+++++++++++++++
The :class:`NodeTree.poll` function determines if a node tree is visible
in the given context (similar to how :class:`Panel.poll`
and :class:`Menu.poll` define visibility). If it returns False,

View File

@@ -1,7 +1,6 @@
"""
Basic Object Operations Example
+++++++++++++++++++++++++++++++
This script demonstrates basic operations on object like creating new
object, placing it into scene, selecting it and making it active.
"""

View File

@@ -1,7 +1,6 @@
"""
Invoke Function
+++++++++++++++
:class:`Operator.invoke` is used to initialize the operator from the context
at the moment the operator is called.
invoke() is typically used to assign properties which are then used by
@@ -32,7 +31,7 @@ class SimpleMouseOperator(bpy.types.Operator):
y = bpy.props.IntProperty()
def execute(self, context):
# rather than printing, use the report function,
# rather then printing, use the report function,
# this way the message appears in the header,
self.report({'INFO'}, "Mouse coords are %d %d" % (self.x, self.y))
return {'FINISHED'}

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