1
1

Compare commits

..

4988 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
bcfe38aa03 Fix T44964: Bisect tool /w nonuniform scale 2015-06-08 22:30:45 +10: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
303c912093 Fix crash introduced by recent node tree localization
It should not add temporary datablocks to the bmain.
2015-06-08 14:10:43 +02:00
ec0ba4095f Fix T44979: Crash when rendering with more threads than the system ones
Revert "Nodes: Remove hardcoded BLENDER_MAX_THREADS number of threads"

This reverts commit fdc653e8ce.

The threads override is not affected by the scene, and hence the limit of the
threads was not giving correct result. Need to re-consider some things here.
2015-06-08 13:53:54 +02:00
d63615272c Use context manager for reading addon headers 2015-06-08 21:21:54 +10: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
07d51141ae Fix: a broken symlink to an addon resulted in a blank addon tab
The addons tab in the User Settings window would be empty, due to
a FileNotFound error. This error can be caused by a broken symlink,
which is now treated the same was as a file that misses its bl_info
dictionary.
2015-06-08 12:08:43 +02:00
87629b2a74 RNA: Object.shape_key_remove method
Python had no ability to remove shape keys
Original D1169 from @lichtwerk, with edits
2015-06-08 19:52:04 +10:00
546a0e2d96 Fix T44989: Crash on linking external OSL material
Issue was caused by passing NULL bmain to the path remap function when
localizing the node tree.

Paths are to be remapped, otherwise mapping of paths to OSL scripts
might happen in a wrong way.
2015-06-08 11:15:40 +02:00
0589a814ba Cycles: Fix crash doing render preview of external OSL script 2015-06-08 11:15:40 +02:00
2ebaa69676 Cycles: Move requested feature conversion to an own function
This way it could be used for the shader/baking kernels easily n the future.
making those kernels more optimal.
2015-06-08 11:15:40 +02:00
8c2750bc82 Cycles: Remove round-up trickery for max closure in split OpenCL kernel
Round-up was only enabled for viewport render, which was for a long time hardcoded to
use 64 closures. This was done in order to avoid unnecessary kernel re-compilations
when tweaking the shader tree.

We could enable selective closure compilation in the viewport later if it'll give
measurable speed improvements, but even then round-up is to happen outside of the
device level,

This commit also removes early output which happened in cases when max closure did
not change. It was wrong because other requested kernel features might have been
changed.
2015-06-08 11:15:39 +02:00
c6c06285a7 Cycles: Remove requirement of using experimental kernel for hair and blur on AMD
Those features are not selectively compiled, so there's no real benefit of hiding
them under the experimental feature set.
2015-06-08 11:15:39 +02:00
27ed75271c Cycles: Make hair, object and motion blur selective compiled into OpenCL
This features are now based on the scene settings, so scenes without those features
used are rendered even faster.

This gives about 30% speedup on the AMD A10 APU here, but at the same time it does
not mean such an improvement will happen on all the hardware. That being said, the
Tonga device here seems to have no measurable difference.

In any case it seems handy to have for the future, when we'll want to support SSS
in the kernel or to port selective compilation/split kernel to CUDA devices.
2015-06-08 11:15:39 +02:00
267c7b098d Fix "View All" operation in image space not available with locked interface 2015-06-08 11:15:39 +02:00
7c5944137e Fix T44995: Crash loading packed image 2015-06-08 18:21:54 +10:00
b54e95a5c8 Alternative fix copying windows from popup dialogs
It could still crash if the window was freed and another was activated. see T44688.
2015-06-08 16:02:57 +10:00
22a4fcb146 Fix T44991: Apply transform skips poly-radius 2015-06-08 12:58:50 +10:00
99fba34b8d rename wiki -> manual 2015-06-08 11:34:07 +10:00
9927849708 Fix T44984: wrong texture clamping when applying saturation > 1.0
Applying saturation > 1.0 in HSV space easily leads to negative values in RGB space,
so we have to clamp again...
2015-06-07 16:56:58 +02:00
b79a33e2d4 Allow compilation of cycles network with WITH_CYCLES_LOGGING is ON 2015-06-07 15:24:31 +02:00
de953bf7b8 Don't show smoke domain when render-only enabled
D1339 from @scorpion81
2015-06-07 21:52:11 +10:00
86bb0d1a35 MakeDupliFace: select new objects 2015-06-07 17:44:25 +10:00
404f9ddc37 Cleanup: use staticmethods 2015-06-07 17:40:39 +10:00
bf010c4a15 Cleanup: pep8 2015-06-07 17:28:02 +10:00
5aade17bdf Revert "BGE : KX_VertexProxy support for more than 2 UV channel."
This reverts commit fb0dd596e9.

This commit reintroduced a deprecated API that we'd rather not see in a
release. A better solution is being worked on.
2015-06-06 13:12:27 -07:00
c5748f3cc7 View3D: avoid jumping placing cursor /w lock on
The view would jump each time, now compensate by adjusting the cursor panning.
Less jarring and helps avoid problems when the cursor gets outside the view, see: T40353
2015-06-07 02:50:50 +10:00
60621940d0 Use threshold for selecting side-of-axis 2015-06-07 02:09:41 +10:00
Julian Eisel
4ee2ae97c3 Cleanup: Typos 2015-06-06 15:32:59 +02:00
50a1ad5bb3 Cleanup 2015-06-06 21:02:16 +10:00
94e7ac5b97 Fix wrong usage of THB_NORMAL size when generating .blend file thumbnail at save time.
We do not use that size of preview anymore, only THB_LARGE...
2015-06-05 19:42:59 +02:00
68cdd2b361 Fix T44961, bevel spikes out when certain angles near 180.
Made the test for whether one can "see" an adjacent edge less
knife-close to 180. This means it will chose to slide along
such an edge less often, and avoid some spikes.
2015-06-05 13:00:41 -04: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
e708042aa0 Cleanup:
Get rid of static functions that pass the exact same arguments in the
same order to other function.
2015-06-05 16:13:15 +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
28f798f86e Cycles: Initial support for OpenCL capabilities reports
For now it's just generic information, still need to expose memory, workgorup
sizes and so on.
2015-06-05 14:17:30 +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
d5bca524d5 Fix T44960: Crash with 'Shape Cut' in edit hair mode.
This is only supported for mesh objects so far.
Also, abort in case there are no faces in dm (instead of crashing on NULL BVH tree...).
2015-06-05 13:06:01 +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
304ee9af8d Depsgraph: Report to the console when the new depsgraph is used 2015-06-05 15:37:41 +05:00
907f804ad8 Depsgraph: Fix typo in header guard comment 2015-06-05 15:37:41 +05:00
fb92c553f1 ImBuf: Fix compilation error with latest OIIO
Latest OIIO libraries are using Boost libraries from the public headers.
2015-06-05 15:37:40 +05:00
7592e5dbf5 Disable collapse images option after operator ends. 2015-06-05 11:26:25 +02:00
ffaf271ab9 BMesh: decimator, allow vgroup factor over 1
Can be useful to apply more extreme weighting
2015-06-05 15:26:37 +10:00
aca40295e8 Check ftell return values 2015-06-05 11:46:01 +10:00
b2e5c017a1 BGE: correct ftell use in LoadGlobalDict 2015-06-05 11:16:46 +10:00
f3434e5f82 BGE Cleanup: remove dead code for collide, visible and twoside variables
As material is not NULL at this stage there is no need to do a NULL
check. Also to remove dead code

Reviewers: dfelinto, panzergame, hg1, moguri

Reviewed By: panzergame, hg1, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1330
2015-06-05 02:24:23 +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
2cbe60b476 New "use placeholders" feature of the sequencer did not detect correct
filenames.

Added BLI_path utility functions to decompose a path name and
extract the frame number. It should be useful in autocollapse
feature as well
2015-06-04 20:40:44 +02:00
455ca1b28f BMesh decimate, improve behavior with weights
Add slider to adjust the influence of weights relative to geometry distortion.
This allows subtle influences to be applied - without drastic changes in behavior.
2015-06-05 02:56:11 +10:00
fa147804b8 Make clamping able to return to exact previous values. 2015-06-04 17:51:21 +02:00
c64f491f9f Fix modifiers stack not recalculated when mapping requirements change
Reported by pixaal on irc, basically reproducable by inserting bevel
modifier on cube and entering/exiting texture paint mode.

Now object stores last needsMapping variable as well as customdata mask.

Also now texture painting only needs mapping when we are in texture
paint selection mode, so modifiers that don't support mapping can still
be used to paint now.
2015-06-04 17:40:10 +02:00
Julian Eisel
91d424b82a Fix tooltip colors not initialized correctly
Already committed similar fix (rBbeaed66f292dd) but saw it appearing on
other peoples screens a few times since them. Never was able to recreate
though.
This should make sure everything is initialized fine, so if we see it
appearing again, then it's likely because of manual tweaks or the
version saved in the .blend.
2015-06-04 17:07:05 +02:00
4a26f3b569 correct last commit 2015-06-04 23:47:03 +10:00
06f4bac104 BMesh: decimator minor edits 2015-06-04 23:42:10 +10: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
cf7a5e93f8 Fix buffer overrun searching program path on win32 2015-06-04 16:48:56 +10:00
3eb38a79d8 Loading raw targa now sets the filetype 2015-06-04 16:36:11 +10:00
061b59a1d4 Cleanup: redundant checks 2015-06-04 15:51:49 +10:00
81e3deadea Fix for leak creating stereo images 2015-06-04 15:41:28 +10:00
7a0f57cd01 Cleanup: clarify order of precedence: &/? 2015-06-04 15:41:27 +10:00
896f08bde8 Fix T41177. Bevel shouldn't try to slide along edge when can't see it. 2015-06-03 15:19:48 -04:00
451a077511 I18n extract: better handling of commandline args. 2015-06-03 17:15:00 +02:00
e4ab526ad1 Make reading previews from .blend file more robust.
Hit a case here where rect pointer was not NULL, when h & w were both zero...
Shall not happen, but better not crash on such cases!
2015-06-03 16:42:08 +02:00
44276743cf Merge branch 'alembic' into gooseberry 2015-06-03 12:11:15 +02:00
b9c563061c Do not show brush cursor for fill brush (size not supported) 2015-06-03 12:04:47 +02:00
43913fe212 Fix inconsistencies in texture paint UI T44929, T44927:
* lock alpha only works in projective painting
* fill threshold only works in 2D painting
2015-06-03 11:33:40 +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
b07be730b2 Fix error calculating bmesh normals
edge vector stack was left un-cleared.
2015-06-03 18:10:43 +10:00
6fbb580e51 BLI_stack: gtest for clear 2015-06-03 18:09:12 +10:00
1dbcccf5f9 BLI_stack, add clear function. 2015-06-03 18:07:30 +10:00
ebebc4ded1 Correct own fix reference before assignment
3rd fix for silly exception conversion!
2015-06-03 17:11:01 +10:00
2517f5c97c Fix memory leak loading multi-layer OpenEXR 2015-06-03 16:24:07 +10:00
e695b34505 Fix memory leak loading single-layer OpenEXR
Internal EXR API specifically avoids freeing non-file streams.
2015-06-03 16:24:00 +10:00
52795932a7 Fix for RMB Menu title including shortcut 2015-06-03 15:03:28 +10:00
2c7cb8ce59 Fix UI string clip (reverse search separator char)
The string may have many '|' characters, only the last is clipped.
2015-06-03 15:03:28 +10:00
b3d2b035c4 Cleanup: check button flag for shortcut delimiter 2015-06-03 14:35:41 +10:00
23f1c6835f Fix multires update (reading char * as an int *) 2015-06-03 13:42:44 +10:00
c07a11b83b Fix object align crash (use-after-free) 2015-06-03 13:42:44 +10:00
4056253627 Cleanup: metaballs called memcpy with NULL source
Simplify logic and use realloc
2015-06-03 13:42:44 +10:00
c0ca70a3b2 Correct vert/edge slide poll functions
Would crash trying to access outside the 3D view.
2015-06-03 13:42:44 +10:00
2be3ebd15d Correct own recent error printing Python exception 2015-06-03 13:42:44 +10:00
fd8b6021c4 Fix race condition
Exposed when checking on T44871
2015-06-03 11:01:44 +10:00
469c0695ac ImBuf: Fix memory leak around EXR handle's multiView 2015-06-02 22:43:23 +05: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
fd1ea5e3db Fix T44742. Bevel now avoids vertex meshes when only two edges are beveled.
Also, changed the algorithm for generating the vertex meshes when not all
edges into a vertex are beveled. Now it tries to slide along edges that
form part of the silhouette when possible; when not possible, it tries
to snap to the best plane in between the beveled edges.
2015-06-02 09:25:05 -04: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
9454377c71 Fix T36994: Make link modifier fails (soft body) 2015-06-02 20:23:01 +10:00
7724b26ab2 Cleanup: use const for object copy funcs 2015-06-02 20:21:45 +10:00
95b9d6d9c2 Fix operator exec /w popups that close the window
Related to T44688, note supporting this case isn't so nice,
but seems it can be made to work.
2015-06-02 19:01:24 +10:00
5f5e05b3eb Fix compilation error after recent commit 2015-06-02 13:11:03 +05:00
89025958af Fix T44921: Node editor, nodes position not maintained after Material panel changes
Also improved a bit behavior of adding new nodes, now they will not overlap that
badly. Still not ideal, but further improvements better not to happen at bcon4.
2015-06-02 12:32:43 +05:00
23b068ce8a Fix T44922: Split kernel renders black when using Bump node
Was missing feature detection in the BumpNode in the previous selective nodes
compilation commit.
2015-06-02 11:53:10 +05:00
660234bfba Fix own mistake searching python binary 2015-06-02 15:42:03 +10:00
aa2bdcccfc Simplify Win32 extension check 2015-06-02 15:38:14 +10:00
c67abff7f0 Fix drawing text on >2gig buffers (stamp for eg) 2015-06-02 14:59:31 +10:00
abc4a3d455 Fix T44869: Crash rendering >2gb images 2015-06-02 13:28:24 +10:00
33a7b72678 Fix T44919: BGE marhutils attrs leak memory 2015-06-02 11:08:17 +10:00
b53836d2c9 UI: tweaks to ID and non ID preview templates
- label is shown on a UI_UNIT_Y heigh instead of 0.2 * total button size
- vertically centering non-ID previews labels
- making some constants dependent on ui units
2015-06-01 21:37:56 +02:00
9e850addae template id previews: changes for consistency with icon views template
- elongate the buttons to acomodate the icon without the label overlapping.
- removing the blue background
- adding a consistent margin all around the popup
2015-06-01 21:37:56 +02:00
32cf18d9a2 template ID previews: quick fix for buttons region overlapping the search button 2015-06-01 21:37:56 +02:00
27c1262e21 Fix T44908: Blender crashes when trying to use cycles experimental displacement
The issue was caused by the reshuffle needed to make objects flags have proper
object's bounding box to solve regressions in SSS objects intersecting volumes.

There's actually a feedback loop happening here, which is now solved in quite
naive way -- for the true displacement we consider all objects are capable of
intersecting volumes, synchronize object flags prior to displacement shader
tasks runs and then re-update object flags for proper bounding box.

Not sure what will be the proper solution here, we can't do preliminary check
of intersection for displacement shader, but on the other hand we don't really
need this flag for displacement shader anyway.
2015-06-02 00:04:30 +05:00
a73d4b859a Thumbnails: fix bad handling of invalid thumbnails, cleanup and deduplication.
Invalid thumbnails (missing mtime metadata) are to be re-generated, not ignored!
2015-06-01 19:42:56 +02:00
bec3131112 Font Preview: much better handling of i18n case.
We have to regenerate previews when we change language. But we also need to do it
when translation is changed or added for a language, etc.

Previously, we were storing one preview per language, which was also stuffing
preview dir with (potentially) tens of PNGs per font file, if user plays with translations.

Now we use a better system, which is storing an additional optional metadata in previews
(some hexdigest), that Blender can use in addition to datetime to decide when to regenerate
previews.

This is only used (and needed) by font previews so far, but can easily be reused for other
types of previews if needed.
2015-06-01 19:42:56 +02:00
2d8880643d Font Preview: fallback to default english strings in case translated ones have not enough chars in current font.
This avoids some ugly 'missing char' in previews - not all cases of course, but most common ones.

A complete solution would be much much more involved, and probably not worth it here.
Definitively not before a release, at least!
2015-06-01 19:42:56 +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
7173069cbe Fix T44915 vertex color lost when adding new layer in edit mode.
Was copying new layer colors to old layer colors.
2015-06-01 19:06:46 +02:00
893677a76a Disable writing a crash file completely on Windows.
We had some reports where users did not even read the "Not supported on
release builds" message, and arguably writing a file sort of indicates
that the file may include something useful.
2015-06-01 18:54:03 +02:00
a6101cde06 Cycles XML API: * Add Bump and Holdout Node * Add todo comments for various things. * SSS falloff now works. 2015-06-01 19:56:39 +05:00
b10bc3a6ec Cycles: Number keys 0-3 can be used in interactive mode now to set max bounces. 2015-06-01 19:56:36 +05:00
3127d47029 Cycles: Fix wrong max nodes group used for the viewport render 2015-06-01 19:49:53 +05:00
9d4d55e78b Cycles: Strip meaningless empty output form the MVidia OpenCL compiler 2015-06-01 19:49:53 +05:00
f0a0b1eaac Cycles: Assert in the cases when SVM node was not handled
This will help figuring out cases when node was not properly handled by the SVM
by aborting execution on CPU, where all the nodes are expected to be supported.
2015-06-01 19:49:52 +05:00
ecd4ee75af Cycles: Implement selective nodes compilation
This commits finishes initial selective nodes compilation into kernel, which
helps a lot performance-wise for AMD OpenCL kernels.

Split by node groups is based on statistics from simple scenes like BMW and
more complex scenes like mango and gooseberry production files. Further
tweaks are always possible, but it should be a good starting point.

TODO: Still need to ignore unused nodes when calculating requested shader
features.
2015-06-01 19:49:52 +05:00
c0235da53c Cycles: Fix some typos in the selective modes compilation 2015-06-01 19:49:52 +05:00
399a27b261 Cycles: Code cleanup, spaces around keyword and brace 2015-06-01 19:49:52 +05:00
f45f2ac687 Cycles: Fix missing features gathering from the bump graph 2015-06-01 19:49:52 +05:00
4d8cf1329d Cycles: Add bump feature for selective nodes compilation
For now it is unused in the kernel, actual usage will come with
the next commits.
2015-06-01 19:49:52 +05:00
36ef6d1532 Cycles: Report build flags used for the OpenCL kernel compilation
For now it's reported to the stdout, matching to the CUDA behavior.
In the future we can hide this into GLog logging once the kernels
are considered all stable and so.
2015-06-01 19:49:52 +05:00
14251e8b45 Cycles: Shader node features are to be inherited from the base class 2015-06-01 19:49:52 +05:00
1fc6563917 Fix T44894: Round two.
We cannot `direct_link_packedfile()` twice on a same address, because this tries to
map again pf->data address, which leads to nothing (NULL).

So now, since `ima->packedfile` and `ima->packedfiles` are mutually exclusive
in 'live' blender data anyway, we either read one or the other.

Tested from/to official 2.74 and current master, everything looks fine now.
2015-06-01 13:12:41 +02:00
c8711b6f6f Fix T40621: Tablet in walk mode fails
Add support for walk mode /w absolute pointing devices.
2015-06-01 20:07:57 +10:00
07a6d4ed75 WM: include tablet data in WM_event_print 2015-06-01 17:40:52 +10:00
bfa7586ba3 Fix T44747: Drag toggle /w nodes (glitch)
It was possible to perform actions while performing a drag-toggle.
2015-06-01 16:40:43 +10:00
565faadd8e Cleanup: doxygen comments 2015-06-01 14:56:07 +10:00
668f1f9554 Fix for leak in BM_uv_element_map_create
Also correct over alloc and redundant alloc.
2015-06-01 14:16:28 +10:00
b147473f02 Fix T44892: Cursor warp, invoked outside the area
If an operator starts outside an area, don't use warping.
(problematic for menu's).
2015-06-01 12:03:02 +10:00
4b4695223a Fix vertex slide regression /w rotated objects 2015-06-01 11:26:35 +10:00
a8d6c69d76 Fix T44894: Broken packed image import from older .blend file.
rBe5fbeba0b3a6e9eea not only restored forward compat, it also broke backward compat...
for no reason at all even, exising ima->packedfile is only used by read/versionning
code if .blend version is below 274.4 (i.e. no multi-image packing exists).
2015-05-31 18:28:28 +02:00
3ca0870023 Improvements to the Freestyle Python API (needed by the SVG Exporter)
This patch adds some new functionality to the Freestyle Python API, notably:

  - MaterialBP1D, checks whether the supplied arguments have the same material
  - Fixes a potential crash in CurvePoint.fedge (due to NULL pointer)
  - Makes (error handling in) boolean predicates more robust
  - Adds a BoundingBox type, to make working with bounding boxes easier
  - Adds several new functions (get_object_name, get_strokes, is_poly_clockwise, material_from_fedge)
  - Adds a StrokeCollector StrokeShader, that collects all the strokes from a specific call to Operators.create()
  - Adds hashing and rich comparison to the FrsMaterial type

These new features (most of them, anyway) are needed for making a more robust SVG exporter that supports holes in fills.

Reviewers: kjym3, campbellbarton

Subscribers: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1245
2015-05-31 23:16:45 +09:00
Julian Eisel
3100fbef5e Fix ugly drawing of closed panels in horizontal layout
Also minor cleanup
2015-05-31 14:34:55 +02:00
f5a471ef86 Python: avoid mutable default param values
D1328 by @yedpodtrzitko
2015-05-31 15:58:58 +10:00
67bebc42f4 UI: comments (doxygen tweaks) 2015-05-31 14:20:03 +10:00
28ef76d0f0 BGE Cleanup: Removing flen variable where it is not used 2015-05-30 18:30:34 +02:00
71dcaa7744 BGE Cleanup: Identical code for both if/else branches 2015-05-30 18:15:11 +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
a5a1d4aa3a fix T44884: corrected a wrong usage of the CustomLayer API (due to a misunderstanding) 2015-05-30 14:19:01 +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
0a4bf5317f Correct own error with recent commit
Caused entering an invalid number to leak.
2015-05-30 20:26:26 +10:00
0187356613 python tar.gz changed structure due to python.exe being added. remove /lib/ from cmake as lib and bin are both in the tar.gz 2015-05-30 09:44:44 +02:00
1d34d3ee06 python tar.gz changed structure due to python.exe being added.
remove /lib/ from cmake as lib and bin are both in the tar.gz
2015-05-30 09:27:13 +02:00
36d47ce203 Fix leak in BMesh convex hull operator 2015-05-30 16:17:04 +10:00
8b494e03be Fix reading uninitialized buffer 2015-05-30 14:48:42 +10:00
Julian Eisel
1a0c961746 Cleanup: Use true/false for bool, naming 2015-05-29 21:35:13 +02:00
f0d15a6798 Merge branch 'master' into gooseberry 2015-05-29 17:45:03 +02:00
9755986637 BGE: Fix memory leak when unable to add wheel 2015-05-29 17:03:54 +02:00
51bec8e22e fix T44884: Index counter for active UV Map used wrong offset 2015-05-29 16:20:33 +02:00
9876d1f299 Yet another attempt to fix T44869
Fix some integer overflow cases in colormanagement code
2015-05-29 15:43:21 +02:00
dea3f7f5ff GHOST get rid of unused warnings 2015-05-29 15:13:47 +02:00
2f2f7c0e87 Fix T44882, color picker in texpainting doing linear interpolation even
when mipmap is off.

We used to always have nearest interpolation for texpaint but at least
make this work with mipmap off correctly.

Also added conversion casts to avoid integer overflow in filtering code
2015-05-29 13:38:20 +02:00
1bede8644a Fix T44880: transparency filter is only valid with raytransp, not ztransp. 2015-05-29 12:26:58 +02:00
52cfd0eef8 Fix T44879, data transfer modifier was missing a copy function 2015-05-29 11:38:57 +02:00
7b743defd4 Fix wrong 'check context' handling in addon i18n messages generator.
Reported (with patch) by yedpodtrzitko (yed podtrzitko), thanks a bunch!

Differential Revision: https://developer.blender.org/D1327
2015-05-29 11:08:26 +02:00
1c66edc14d Gooseberry: Workaround stupidness of MSVC with strict flags 2015-05-29 13:53:02 +05:00
166408cfe2 UI cleanup: removing if, condition was already tested 2015-05-29 09:27:23 +01:00
af434fea71 BMesh: select linked /w delimiters & wire edges
Add support for using edge delimiters mixed with wire edges.

Code isn't so elegant but users will expect this.
2015-05-29 14:41:39 +10:00
3511e2d6ae Cycles: Enable Object Motion on AMD OpenCL.
Like Camera Motion, only available in the Experimental kernel.
This should be it for the upcoming release, we now support almost everything, apart from Transparent Shadows, SSS and Volume.
2015-05-28 22:10:53 +02:00
Julian Eisel
d3556268d5 Aaaaand another fullscreen glitch
Steps to reproduce were: Set a *Properties Editor* to fullscreen-
>render->Info Editor is set to Image Editor instead of Properties Editor
2015-05-28 20:08:03 +02:00
Julian Eisel
23c7d14afd Fix another fullscreen toggle glitch
Steps to reproduce were: Set 3DView to fullscreen->render->toggle out of
fullscreen->escape->Area doesn't change back to 3DView
2015-05-28 19:48:28 +02:00
18208c8ad9 Fix T44872
All musgrave tupes use intensity, never hide it.
2015-05-28 18:05:50 +02:00
bdf242fa21 BGE Cleanup: Remove old commented Sumo physics code 2015-05-28 17:50:39 +02:00
3b158d2e05 BGE Cleanup: The value of ikconstraint cannot be NULL at this stage and
therefore it is not necessary the NULL check.
2015-05-28 17:18:50 +02:00
8dc6fabc34 Optimize render part commiting to render queue to mitigate delay in
T44869.

There are a couple of issues here:

* Code repeatedly calculated center of ready rendered parts even though
they would not change while the operation was done.

* Code would calculate distance of tiles from center multiple times

* Code would traverse all items, even the ones already sorted
* Traversal used linked lists which is quite slow.

Mitigated these by doing one pass for the center, a second to calculate
distances and a qsort at the end.

Should result in O (n * (log n + 2)) instead of O (n * (n * 2))
complexity, plus the number of repeated operations is much less as well.
2015-05-28 17:01:09 +02: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
eb476c2816 Depsgraph: Cleanup, multiple private functions are to be in anonymous namespace 2015-05-28 13:51:54 +05:00
f777983d5b Add missing particle system tagging on update to the new depsgraph
It's not ideal and mimics weak legacy code, but so close to bcon4 we'd better
not start re-considering the way how particle works..
2015-05-28 13:51:54 +05:00
d9b6768521 Fix T44688: Stereo3D time-sequential crashes 2015-05-28 18:46:15 +10:00
f3161c97a6 Ghost/X11: allow creating windows to fail
Would exit, problematic for setting stereo3d modes which aren't always supported.
2015-05-28 18:46:15 +10:00
4be7258f00 WM: remove windows if they fail to initialize 2015-05-28 18:46:15 +10:00
3dd346c2a1 Cleanup: warning 2015-05-28 18:46:14 +10:00
89c56f6e47 Install_deps: fix different 'libfreetype2' devel package name on fedora and suse... *sigh* 2015-05-28 10:38:48 +02:00
56f6aa977a Multi-value, multi-button cancel keeps value set 2015-05-28 15:52:53 +10:00
2480bbff56 Multi-value cancel, keeps scale set 2015-05-28 15:50:51 +10:00
dc1586063b BMesh: correct flag check (own mistake) 2015-05-28 12:11:35 +10:00
3e0c6a8ca2 BMesh: util functions to get edge loops from verts 2015-05-28 11:46:58 +10:00
46d8bcb617 Cleanup: Remove unused Noise Basis texture code.
Same as last commit, code is unused and this one actually would have required some fixes,
as these variants output values outside the 0-1 value range, which doesn't fit Cycles shader design.
2015-05-28 01:07:37 +02:00
20f6a0f2d7 Cleanup: Remove unused Voronoi texture code.
Let's finally delete this code, after 4 years of being unused,
there really is no excuse anymore.

If we decide to extend the procedural textures in SVM, we can do this anytime in the future.
2015-05-28 00:36:33 +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
930bf58478 Clamp min/max frame rate for player 2015-05-27 20:02:53 +02:00
07def553d2 Fix T44745 non manifold edges of mesh do not work when smoothing in
multires.

Code had special guards for such edges to stop this from happening. I
don't see why this is needed though since code above assigns smoothed
positions for all vertices in the grid.

After removing the guards I saw that this in fact was the only place
where grd adjacency was used, so I completely removed it.
2015-05-27 19:52:12 +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
9aea98d33c BGE: Add missing m_jumping initialization 2015-05-27 18:19:38 +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
c5a8a4e9d8 Fix mismatch in strings length compute in filebrowser, leading to annoying '...' in longest filename.
We must take kerning into account everywhere! Note this will disappear in upcomming filebrowser
refactor anyway.

Reported through IRC by Pablo (venomgfx), thanks.
2015-05-27 17:25:55 +02:00
Quentin Wenger
be4d34ca86 BGE Python API: Completing doc for bge.types.KX_FontObject
This adds description of the Font object and about its (only one)
attribute, as well as an example of use.

Reviewers: campbellbarton, fsiddi, dfelinto, moguri

Reviewed By: dfelinto

Subscribers: lordloki

Projects: #documentation, #game_engine

Differential Revision: https://developer.blender.org/D863
2015-05-27 17:18:43 +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
9fc1033429 Fix T44748: Particle is not displayed definitely when I use a new dependence graph 2015-05-27 19:22:52 +05: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
b52af946cd Forgot this in the last commit 2015-05-27 14:43:54 +02:00
c449d4e336 Fix jpeg preview for exr renders broken. 2015-05-27 14:41:51 +02:00
4bf64e841c Correct convex-hull for recent join-tri changes 2015-05-27 21:43:35 +10:00
0e00072ff0 fix:T44856 reverted triangluation back to bmesh ( apparently broken by commit rB51f33 ) 2015-05-27 13:19:40 +02:00
0e02ad8b64 Fix off by one error in display of start/end frame in sequencer. 2015-05-27 12:17:16 +02:00
4c1efcc829 Code cleanup, silence some warnings when building without legacy depsgraph 2015-05-27 13:10:26 +05:00
1fd2e6232a Fix compilation error with legacy depsgraph disabled 2015-05-27 13:09:57 +05:00
e665a60a85 Fix T44854: Creating hooks from curve to objects doesn't work
The issue was introduced in e529882 by doing wrong range checking.
2015-05-27 13:08:17 +05:00
92022218c2 Cycles: Code cleanup, split kernel 2015-05-27 13:08:17 +05:00
da192fb3a7 Missing NULL check getting selected obdata 2015-05-27 11:14:39 +10:00
77f0f3c54e Fix parent tips staying selected after separate 2015-05-27 10:35:14 +10:00
c3810c596e Use PKey for edit-armature separate
As used already for mesh & curves.

Add confirmation menu for curve & armature,
since this isn't such a common operation and undoing leaves object data
(long term bug/todo to fix).
2015-05-27 09:56:50 +10:00
84ad20acef Fix T44833: Can't use ccl_local space in non-kernel functions
This commit re-shuffles code in split kernel once again and makes it so common
parts which is in the headers is only responsible to making all the work needed
for specified ray index. Getting ray index, checking for it's validity and
enqueuing tasks are now happening in the device specified part of the kernel.

This actually makes sense because enqueuing is indeed device-specified and i.e.
with CUDA we'll want to enqueue kernels from kernel and avoid CPU roundtrip.

TODO:
- Kernel comments are still placed in the common header files, but since queue
  related stuff is not passed to those functions those comments might need to
  be split as well.

  Just currently read them considering that they're also covering the way how
  all devices are invoking the common code path.

- Arguments might need to be wrapped into KernelGlobals, so we don't ened to
  pass all them around as function arguments.
2015-05-26 22:54:02 +05:00
4ffcc6ff56 Fix T44497: Crash on deleting curve handle with hook modifier
It was possible race condition on empty curves -- it's possible that curve
object is fully updated and path is null in that cases, Proper way to deal
with this is to check curve_cache for non-NULL.
2015-05-26 22:36:18 +05:00
6245f4a39c Cycles: Enable advanced shading for NVidia OpenCL kernel
It was kept disabled due to render artifacts which weer in fact caused by bad
memory access, which is fixed in the previous commit.

We now also can make it enabled in regular AMD split kernel after someone tests
the updated code.
2015-05-26 21:29:21 +05:00
cf19012fb0 Fix T44831: Crash when using Intel OpenCL with split kernel
The issue was caused by underallocation of object motion related arrays,
which happened by accident.
2015-05-26 21:29:21 +05:00
b90c7dd730 Building without OpenEXR works again 2015-05-26 17:49:08 +02:00
d45c4af469 Cleanup: update comment 2015-05-27 00:00:31 +10:00
89b6c72f8d Cleanup: python 2015-05-26 23:53:47 +10:00
6973e26bf9 Fix T44036: Add option to bake into current action instead of creating a new one.
This is needed when you want to bake only part of an armature's bones, since they
all share a single action, otherwise you'd lose non-baked bones' animation...
2015-05-26 15:32:06 +02:00
322380999e Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/object/object_ops.c
2015-05-26 14:56:36 +02:00
a23fbc71a1 Cleanup, add comment for old code. 2015-05-26 14:38:24 +02:00
a64cb4185e Trying to pack image with invalid path crashes 2015-05-26 13:46:14 +02:00
8299284389 Correct own recent error, uninitialized var use 2015-05-26 21:36:49 +10:00
3c9da38e7e Style cleanup: space after keyword 2015-05-26 16:15:52 +05:00
7487a4d4ac Fix T44763: Surface Panel does not update correctly according to Node Output for Cycles UI 2015-05-26 16:15:34 +05:00
d20fd2da72 Revert "Cleanup: set var twice"
This reverts commit eb799dc350.

I recommend reading code before doing cleanup, next time...
2015-05-26 13:01:29 +02:00
bfe0ea4069 Fix own sillyness 2015-05-26 12:58:32 +02:00
ded0004f8b Don't crash with pie menus with more than 8 items.
This will print a warning and users will get overlap of pie buttons, but
it should be quick paper over the cracks and at least should keep
blender working until a more complete fix is coded.
2015-05-26 12:09:51 +02:00
718bc078a8 Fix T44740: Tweak events stuck (ignored release)
Tweak event was being added to the end of the event queue (out of order),
meaning any mouse releases already in the queue wouldn't be used to exit the gesture.
Gestures could get stuck (mostly when the system wasn't able to handle events fast enough).

Now tweak events are now added in order.
2015-05-26 20:07:58 +10:00
de68066c1c Fix multilayer OpenEXR not supporting metadata.
This will fix exporting of metadata and importing for imbufs, but image
editor will not display these metadata since multilayer gets converted
to renderresult, which does not support metadata display yet.
This commit is more meant for external image editors/viewers.
2015-05-26 12:02:30 +02:00
e5fbeba0b3 Images: Solve broken forward compatibility with packed images
Use first packed image as legacy image->packedfile, so saving .blend file with
latest builds makes it so packed images are not lost when opening with previous
releases.

This will only work reliably if mutliview is not used, otherwise it'll be only
first view in the .blend file, which is rather expected since previous releases
are not aware of views.
2015-05-26 14:46:05 +05:00
569a2035c7 GHOST: flush event printer output 2015-05-26 18:51:51 +10:00
de0c269c28 Fix T44821: Making warp shortcut fails
Using OBJECT prefix for editmode operators causes
shortcuts to go into the wrong keymap.
2015-05-26 17:55:34 +10:00
2e70a29f9e Merge branch 'master' into alembic 2015-05-26 09:34:31 +02:00
2c3c477223 Cleanup: warning, spelling 2015-05-26 16:46:33 +10:00
9b1ca19396 Fix RMB menu in popup, included 'Header' submenu 2015-05-26 16:45:01 +10:00
e4dc44d7ab Depsgraph: Fix for uninitialized variable in root depsnode 2015-05-26 11:34:18 +05:00
abf7378e44 Fix T44697: Multi-value edit /w layers fails
Not such a nice solution, but good to have this working.
2015-05-26 15:20:46 +10:00
8715fd0925 BMesh: join tris, split angle limit in two
Use a separate limit for face-angle and shape comparisons.

There was no way to join non-rectangular, co-planer tries.
2015-05-26 14:27:38 +10:00
9ce20d3341 BMesh: join tris now delimits all UV/Color layers
Previously was only checking active layers

Also add delimit by edge seam
2015-05-26 13:42:59 +10:00
eb799dc350 Cleanup: set var twice 2015-05-26 10:25:01 +10:00
de21604cf4 Minor cleanup... 2015-05-25 22:24:46 +02:00
1ac0fef345 Fix widget_draw_preview() not taking into account given alpha.
Needed to get correct 'inactive' effect on buttons with big previews.
2015-05-25 22:06:25 +02:00
e092a58fb5 I18n message extractor script: py code: do not consider strings inside 'Compare' AST nodes.
Otherwise, we'd get 'MOVIE' from `text="Build Proxy / Timecode" if clip.source == 'MOVIE' else "Build Proxy")`...
2015-05-25 21:17:49 +02:00
5e66827029 Fix T44842: Modal Timer (template) should return {'CANCELLED'} when cancelled! 2015-05-25 17:43:28 +02:00
6b5f3f5fef preview buttons: tiny optimization 2015-05-25 15:38:12 +01:00
Dalai Felinto
3a7691b73f Fix T44836: crash when multi-view is enabled and switching to BI rendered viewport display 2015-05-25 10:15:18 -03:00
2464395b6d Depsgraph: Avoid unnecessary char*/string conversion when creating RNAPathKey 2015-05-25 18:05:19 +05:00
0b9a65b2ae Fix T44709: New Depsgraph not evaluating driver interactively
Issue was caused by drivers which uses component of an array as a target,
this was not handled properly in the RNA path key.
2015-05-25 18:03:06 +05:00
a80c1e50bc Fix T44822: python enums' itemf callback did not handle 'NULL' context case.
Enum's itemf callback can be called without context in some cases (UI, doc generation...).
Python's enum properties did not handle this at all - it's kind of odd this did not cause
more trouble and wasn't notice earlier... Probably dynamic enums using context are not
much used in py code.

Note about nodes: those are heavy users of dynamic enum with context. Now,
we expect `NodeCategory.poll()` and `NodeItem.poll()` to always be called with
a valid context (since when there is no context available, we can assume `poll()`
is always True). `NodeCategory.items()`, however, must accept NULL context, so if
you use custom `items` callable for your custom node categories, you may need
to update it (as was done here for builtin `node_group_items()`).
2015-05-25 14:24:49 +02:00
39b85e452f Fix T44815: Sound bake doesn't check filepath 2015-05-25 22:13:18 +10:00
62f2d9b566 Cycles: Fix compilation error of split kernel
The code was failing to compile on runtime because of some path differences,
and it seems we don't need to specify full path to the file which originally
seemed to be needed to make include directives expansion working correct.
2015-05-25 14:18:01 +05:00
153cebd95b BGE: Fix bug with default material and MTFace.
It set default material even if there are a MTface but no blender material.
Tested in GLSL and Multitexture.

Reviewers: HG1
2015-05-25 10:33:04 +02:00
a5a648c7c6 Fix error redoing shrink fatten
Use a property to store even-offset option.
2015-05-25 15:45:56 +10:00
7fd93dc8dc Fix bend in object mode (wasn't rotating objects) 2015-05-25 10:37:09 +10:00
fe9ce6603c Fix memory leak /w bend tool 2015-05-25 10:37:09 +10:00
7b60a0f64b Cleanup: const char for operator ID's 2015-05-25 10:37:09 +10:00
a3ef51bba5 Fix T44833, OpenCL compile error on AMD.
This was broken after the kernel file restructure.
Variables allocated in the __local address space can only be defined
inside a __kernel function.

We probably need to solve this a bit differently once we do the CUDA
kernel split, but this fix shoud be good enough until then.
2015-05-25 01:02:06 +02:00
c3ab5b3089 Fix T44830, wrong sample progress number when using split device.
Value was not set, moved it out of the constructor into
device_opencl_create() now.
2015-05-25 00:37:01 +02:00
025a646114 Fix T44823: No menu entry for Circle Select in UV/Image editor. 2015-05-24 19:27:59 +02:00
78918e761f Fix T44814: 'preview' icons would not greyout.
Since they are premultiplied, we need separated handling of colors and alpha blending
if we want additional alpha factor to work OK.
2015-05-24 18:35:14 +02:00
a28adf1b35 Some more minor cleanup in new icon preview code. 2015-05-24 16:50:15 +02:00
febf8cb01d Cleanup: style 2015-05-25 00:19:39 +10:00
7f89bc8e85 Fix rare crash duplicating fluidsim 2015-05-25 00:19:39 +10:00
f9b6f5756c Fix crash clearing skin data on non mesh 2015-05-25 00:08:43 +10:00
0305e9604b Fix RNA type access 2015-05-25 00:08:43 +10:00
7456f06097 Fix unreported bug with recent enum icon preview changes, would show bad in case of mixing
items with and without label.
2015-05-24 15:49:04 +02:00
4737722968 Fix error joining tris -> quads
Incorrect flag check, would need to run multiple times.
2015-05-24 21:54:21 +10: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
2da9a39418 BGE : Fix black material on meshes without materials in blenderplayer.
Blenderplayer forgot to initialize the default material (defmaterail) with function init_def_material().
This reverts also the plumber commit 2fa4a48bce.

Reviewers: campbellbarton
2015-05-24 11:46:57 +02:00
78250f1d1d IconView template: adding optional labels to popup buttons 2015-05-23 16:21:05 +01:00
f01c6e185f Cleanup: typos 2015-05-23 22:38:47 +10:00
f340595dba Quadric: add common why doubles are used. 2015-05-23 22:37:46 +10:00
bc83076355 Math Lib: update API usage info 2015-05-23 22:37:37 +10:00
25f5d2b4d7 Fix (unreported) broken RNA Image pack handling since multiview merge.
Was breaking loading of embedded FBX images (among other things, most likely).
2015-05-22 23:28:41 +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
e529882be0 Fix second crashing part of T44497, out of bounds access to hook
modifier data.

Unfortunately seems like we also lose the hook mapping by doing this,
but this can be fixed later and is probably a separate issue.
2015-05-22 16:59:22 +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
cd9dc3143c BGE: grey out Alpha and Specular sliders when Transparency panel is
unchecked
2015-05-22 16:03:38 +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
2c503d8303 Cycles: Restructure kernel files organization
Since the kernel split work we're now having quite a few of new files, majority
of which are related on the kernel entry points. Keeping those files in the
root kernel folder will eventually make it really hard to follow which files are
actual implementation of Cycles kernel.

Those files are now moved to kernel/kernels/<device_type>. This way adding extra
entry points will be less noisy. It is also nice to have all device-specific
files grouped together.

Another change is in the way how split kernel invokes logic. Previously all the
logic was implemented directly in the .cl files, which makes it a bit tricky to
re-use the logic across other devices. Since we'll likely be looking into doing
same split work for CUDA devices eventually it makes sense to move logic from
.cl files to header files. Those files are stored in kernel/split. This does not
mean the header files will not give error messages when tried to be included
from other devices and their arguments will likely be changed, but having such
separation is a good start anyway.

There should be no functional changes.

Reviewers: juicyfruit, dingto

Differential Revision: https://developer.blender.org/D1314
2015-05-22 16:31:34 +05:00
7f4d5850fe SCons: Don't install SConscript into Cycles kernel folder 2015-05-22 16:00:26 +05: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
be6479c9ea Fix T44801: Blender crash in UV-editor.
Mistake in cleanup rB30b45d55... Odd compiler did not yell at that. :|
2015-05-22 11:01:22 +02:00
ed2cb8de2f Fix for join faces ignoring angle limit
Angle limit for join-faces was more advice then actual limit.
Now joining entire selection, gives assurance that no faces above the limit will be merged.

The purpose of this was to allow users to isolate 2 faces and always join them.
Instead, support this by bypassing limit only when its not set and 2 faces are selected.
2015-05-22 18:14:03 +10:00
d8c1d2d843 Alembic: Update stubs file so building without alembic works fine 2015-05-22 12:56:51 +05:00
476feb622c BMesh: extrude region didnt copy edge flags
Newly created edges around regions wouldn't get the edge flags from surrounding geometry.
2015-05-22 11:00:14 +10:00
a934730368 Cycles: Remove TM / R and whitespace from OpenCL device names.
Was already done for CPU devices, now we also do this for OpenCL.
2015-05-21 23:43:18 +02:00
53eab562b4 Cleanup: Remove some outdated comments related to split kernel. 2015-05-21 20:32:20 +02:00
8843a09df3 Fix T44744, tangents incorrect in edit mode.
Really bad code here, index of fetched data was basically totally off
and unrelated to what it should be.
2015-05-21 20:28:17 +02:00
e8014352c6 Yet another crappy Intel driver added for correct SSAO support. 2015-05-21 18:37:48 +02:00
94e69a379e SCons: Hopefully fix for gooseberry branch compilation 2015-05-21 20:43:41 +05:00
f6062638c1 Fix crash in blenderplayer when scrubbing off screen.
Was cache referencing deleted or NULL items.

Reported by Kopias on irc
2015-05-21 17:37:11 +02: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
a39efae03d Fix T44778 missing specular transparency slider in game engine 2015-05-21 16:37:37 +02:00
5b26c112d9 Use correct blending weights for hair shapekey references. 2015-05-21 16:15:29 +02:00
d3c67bc81e Fix T44791 triangles when painting on a texpaint plane
Problem was float precision issues across tile boundaries. Since we are
comparing pixels, give a small tolerance when comparing clipped vertices
against triangle lines.
2015-05-21 16:06:42 +02:00
069adb8104 SCons: Fix for missing avx and avx2 cycles kernels
SCons was checking for a particular compiler version to see whether compiler
flags are available or not, but compiler ID was only set on OSX.

Now it should be set on Linux as well.
2015-05-21 18:46:57 +05:00
67c8eb148b Removed unused variable. 2015-05-21 15:21:50 +02:00
25bedeca9b GPencil Eraser Size-Saving Fix
On second thought, the eraser size should be saved even if the brush type is not
eraser, as we can toggle this now.
2015-05-22 01:21:29 +12:00
389564c711 Fix T44774: Grease Pencil eraser size reset after exiting session
Previously, it would only save the eraser size if the session ended properly,
instead of being cancelled. However, that wouldn't happen if exiting the session
using Esc.
2015-05-22 01:21:28 +12:00
03eee4dce7 BMesh: decrease decimate epsilon
Since using doubles to calculate cost,
using topology fallback cost isn't needed as much.
2015-05-21 22:46:33 +10:00
4b8dcfc0f5 Fix T44795: same menu item for different command in node editor.
We have too much of those cases in our UI, if we want to keep operators doing
several similar/related but yet different tasks, we should have a real way to
support it on label/icon/tip side too. Easier to say than to do though. :|
2015-05-21 13:20:54 +02:00
7938bd1877 Cycles: Remove OSL from split headers
Split kernel is mainly useful for GPUs which can not support OSL in visible
future anyway.
2015-05-21 16:12:50 +05:00
329f704601 Cycles: Move utility atomics function to util_atomic.h
No functional changes, just better to keep all atomic function in a single place,
they might become handy later.
2015-05-21 16:12:50 +05:00
e37c4e5819 Fix T44780: Decimate planar creates concave edges
Float precision was causing problems for decimate,
small faces that create a nearly flat surface were detected as having no 'cost' to collapse.
2015-05-21 21:06:30 +10:00
6ee653352b Math Lib: double versions of vector funcs
- add_vn_vn_d
- add_vn_vnvn_d
- mul_vn_db
2015-05-21 21:06:29 +10:00
6b40a4bcb1 Fix T44794: Blend From Shape tool X Icon UI Bug?
Note: maybe we could even make `RNA_property_is_unlink()` always return false
for enum properties? But well, guess being explicit here does not hurt...
2015-05-21 12:00:31 +02:00
d4c676e81b Cycles: CYCLES_OPRNCL_DEBUG now affects on split kernel as well 2015-05-21 14:30:33 +05:00
f18d77b874 Cycles: Restore some lost custom cflags passed to the kernel compilation
They were lost during simplification of kernel loading but might be rather
crucial for the performance.

Also made it so cflags are shared across kernels. Surely it might lead to
some unwanted kernel re-compilation but at the same time they might easily
run out of sync with the changes in kernel and so.
2015-05-21 14:05:53 +05:00
aa54d93a29 BMesh: decimate improvement for flat surfaces
Previously decimate on flat areas of a mesh would more or less randomly collapse edges.
(giving bad topology).

This commit includes a topology 'cost', so smaller edges on flat surfaces collapse first.
2015-05-21 16:41:08 +10:00
2c000cc9fc Fix mesh mirror failing on isolated verts 2015-05-21 13:01:44 +10:00
9bfea67751 UI: Use Ctrl+Wheel to cycle values
Conflicted with Alt for editing multiple values.
This could also conflict with global frame change at times.
2015-05-21 11:06:24 +10:00
1aa1a53115 UI: ignore mouse wheel while editing text
Mouse wheel was used as home/end.
Was annoying since it could happen by accident.
2015-05-21 10:46:22 +10:00
2b0613b948 Fix: GPU_shader_export fails /w some lamp attrs
first/last vars missed some values.

D1309 by @NHA
2015-05-21 08:48:21 +10:00
148ed4e05e Cycles: Cleanup, synchronize name across file name, program and kernel names 2015-05-20 23:10:07 +05:00
6f48df45ee Cycles: Simplify code around kernel loading 2015-05-20 23:10:07 +05: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
093d11df35 BGE: Some changes for the constraint document
* Change the constraint type alignment to vertical.
* Changed PHY_CONE_TWIST_CONSTRAINT to the correct value.
* Some minor changes.
2015-05-20 18:49:18 +02:00
2c5d5a9feb BGE: Remove chapter in KX_WorldInfo python API 2015-05-20 18:36:02 +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
Martijn Berger
8dd9b7cc5f Cycles standalone, add device type in output listing 2015-05-20 17:11:09 +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
b5bf5b36f1 BMesh: decimate, test for face flip was too low
Created overlapping faces in T44780
2015-05-21 00:00:13 +10:00
24e1d7f4f4 BMesh: decimate wasn't using face/edge centers
When calculating quadrics, using the first-vertex isn't correct.
2015-05-21 00:00:13 +10: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
8edfcf653a Movie Clip: Invlaidate clip cache when changing timecode 2015-05-20 17:52:58 +05:00
44a6109ca9 Clip Editor: Make it more obvious that Rebuild Proxy also rebuilds Timecode 2015-05-20 17:52:57 +05: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
77ef3f9041 Fix T44717: use_negative_frames ignored /w graph-editor
D1303 by @barfot
2015-05-20 21:58:33 +10:00
0c83b9c129 Removed some useless old code. 2015-05-20 12:56:43 +02:00
eb6bab25ba Add dedicated command argument to switch depsgraph to a single-threaded evaluation
This way it is possible to have single threaded depsgraph but threaded other areas
which is handy for torubleshooting.

he argument is: --debug-depsgraph-no-threads
2015-05-20 15:48:29 +05: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
8c6a9b9edc Fix reserve frames in sequencer failing with big frame ranges.
Detect frame range automatically from number of digits.
2015-05-20 12:42:00 +02:00
f4d064a5b2 Send color managed signal if input spaces changes during image saving
We're currently only supporting save to a default format color space, which
makes it a bit tricky to prevent ImBuf from being changed.

For until when saving to a custom colorspace works we'll just reload image
if the space changes.
2015-05-20 15:33:30 +05: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
28b2977be9 Atomic operations: Add function declarations at the top of the header
No functional changes, just helps grasping what operations are actually
supported.
2015-05-20 11:57:17 +05:00
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
922d5ed939 doxygen: update config 2015-05-20 14:09:43 +10:00
f0c143ca72 doxygen: rename included files (they were ignored) 2015-05-20 13:06:42 +10:00
a1e8547877 BGE: Use CameCase code style for KX_WorldInfo python API. 2015-05-19 23:13:30 +02:00
377822729c BGE: Fix T40555: LibLoad material caching issue
Previously we don't merge material cached list, it create dangling pointer and memory leak.
Now we merge material cache list during the scene merge, and remove material in this list during the library free.

Reviewers: agoose77, dfelinto, hg1, pgi, campbellbarton, moguri

Reviewed By: campbellbarton, moguri

Subscribers: campbellbarton, youle, kupoman

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1278
2015-05-19 19:24:14 +02:00
fe0025f2ab Merge branch 'master' into gooseberry 2015-05-19 18:34:43 +02:00
fccf253e36 Support string metadata loading for OpenEXR files. 2015-05-19 18:32:41 +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
150a4b23ba Fix part of T44768 Yet another Intel driver failing on viewport Ambient
occlusion

(Maybe we should add drivers that DO work instead, but in the future
those will be much more since Intel claims to have fixed the issue)
2015-05-19 16:25:42 +02:00
158c891520 Clear animation list to avoid referencing freed memory. 2015-05-19 16:15:55 +02:00
df0a1fa3c5 Fix T44766: Connect fails /w selected ngon edges 2015-05-19 23:51:57 +10:00
07e9fb8ec6 BMesh: calls to store selection at the list head 2015-05-19 23:51:57 +10:00
d3cc7419a3 BMesh: add BM_edge_pair_share_face_by_len 2015-05-19 23:51:57 +10: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
78411dc7d7 Fix T44755 set_value node output in node tree not properly converted to
color in GLSL

Issue here is that intermediate result was clipped as an optimization in
such nodes and thus not converted to the correct type properly. Now only
clip those values if types match.
This keeps both the optimization and the conversion. I looked at
converting uniform types always but it's more involved to compare types
at conversion time for such links because the type was getting
overridden during link duplication.
2015-05-19 15:37:08 +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
dc3533030a Fix T44553.
Front face option did not get the correct normals to function - area
normal would always point to the direction of the stroke
2015-05-19 11:49:46 +02:00
8357040667 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/windowmanager/intern/wm_playanim.c
2015-05-19 11:20:54 +02:00
e8561e966d Fix T44762: Materials flicker in edit-mode 2015-05-19 19:13:25 +10:00
ac636a3c97 Fix T44759: Blender has problems reading and writing 42k images to PNG 2015-05-19 13:02:52 +05:00
293df68ebd Object Drawing: avoid redundant material update 2015-05-19 18:00:20 +10:00
eb05e87e16 BMesh: editmode drawing set every faces material
Check for changes in material (as other drawing code already does)
2015-05-19 18:00:19 +10:00
da34136de1 Cycles: Check for validity of the tiles arrays in progressive refine
In certain configurations (for example when start resolution is set to small
value for background render and progressive refine enabled) number of tiles
might change in the tile manager. This situation will confuse progressive
refine feature and likely cause crash.

We might also add some settings verification in the session constructor, but
having an assert with brief explanation about what's wrong should already be
much better than nothing.
2015-05-19 12:42:07 +05:00
f868be6295 Cycles: Check for whether update/write callbacks are set prior to calling them
This changes the progressive refine part, regular update was already checking
for whether callbacks are set.
2015-05-19 12:42:07 +05:00
66d39ad417 Merge branch 'master' into alembic 2015-05-19 08:48:46 +02:00
ddb1a068e9 SCons: install Python executable when its bundled 2015-05-19 16:44:19 +10:00
e698299e4f CMake: install Python executable when its bundled 2015-05-19 16:44:19 +10:00
d5a85f87b0 Python: search for 'python' and 'python#.#' 2015-05-19 16:44:19 +10:00
3d70a04a8a CMake: remove temp assignment, unused vars 2015-05-19 16:44:18 +10:00
183b643774 Building without Python works again 2015-05-19 11:38:07 +10:00
65328fadc3 Final solution for Intel card Ambient Occlusion in T43987.
Forgot to account for offscreen case in addition to compositing
2015-05-18 22:10:54 +02:00
Julian Eisel
598c2dffe9 Fix T44708: UI label should use plural
Just to keep commit ratio up while being busy preparing for final exams
;)
2015-05-18 21:29:57 +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
192fddb324 BGE: Fix blenderplayer bad call stubs not updated.
Please (dfelinto) compile the bge to avoid these kind of problems.
2015-05-18 18:54:13 +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
5fa0b8778b BGE: Set default envMap resolution to 512 pixels
I propose to change  the environment map render default resolution (600) to 512 (Thanks brecht for the correction... I don't know why I said dpi) (to make it compatible with this script: http://en.wikibooks.org/wiki/GLSL_Pr...cting_Surfaces ) to make cubeMap reflections easier and avoid this error:

invalid envmap size please render with CubeRes @ power of two
unable to initialize image(0) in MAMaterial, image will not be available

http://blenderartists.org/forum/showthread.php?371232-BGE-proposal-Set-default-envMap-resolution-to-512-dpi

http://blenderartists.org/forum/showthread.php?370026-Problem-with-cube-map-textures (post 11)

Author : youle (Ulysse MARTIN)

Reviewers: hg1, agoose77, lordloki, moguri, panzergame, dfelinto

Reviewed By: panzergame, dfelinto

Subscribers: brecht

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1306
2015-05-18 18:12:40 +02:00
Dalai Felinto
947b756d5e Multi-View: small cleranup/refactor with RE_pass_find_by_type and RE_RenderLayerGetPass 2015-05-18 10:57:59 -03:00
cecd1f98a4 Fix T44752: Clip Editor doesn't respect ColorSpace setting when playback after Prefetch 2015-05-18 16:40:52 +05:00
45afc02f11 Solve threading conflict related on proxy group's inverse matrix
It was possible that two threads will start calculating proxy group's inverted
matrix and store it in the object itself. This isn't good idea because it means
some threads might be using partially written matrix.
2015-05-18 16:40:52 +05:00
61f9f508a4 Make object material drivers evaluation thread safe
Previously it was very easy to run into situation when two objects are sharing
the same materials with drivers which will cause threading access issues.

This actually only needed for the old depsgraph, but since it's still the one
we're using by default we'd better solve this issue.
2015-05-18 16:40:52 +05:00
8540907d60 Attempt to make drivers more safe for threading
There were some reported data race conditions in the python interpreter which
seems to be rather valid.

Surely this is not very pretty solution, but it might solve some annoying bugs
related on threading.
2015-05-18 16:40:52 +05:00
40091ff83a Correction to early output in the parallel range implementation
The used heuristic of checking the value prior to lock is not totally safe
because assignment is not atomic and check might not give proper result.
2015-05-18 16:40:51 +05:00
b88597c218 Make switching to threaded malloc safe to be called from threads
For a long time this function was only intended to be used from the main thread,
but since out implementation of parallel range (which is currently only used by
mesh deform modifier) we might want to switch to threaded alloc from object
update thread.

Now we're using spinlock around the check, which makes the code safe to be used
from all over the place.

We might consider using a bit of atomics operations magic there, but it's not so
much important for now, this code is not used in the performance critical code
path.
2015-05-18 16:40:51 +05: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
17388794ce Filebrowser: Do not intent to draw empty strings, loss of time.
Fixes assert raised in `UI_text_clip_middle_ex()` when trying to draw (empty) 'size' string
for appended/linked blender datablocks.
2015-05-18 13:02:05 +02:00
bf93316c52 Fix assert in outliner regarding WM and SCR ID types... 2015-05-18 12:53:31 +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
5dfe88adba Fix T44553: Dyntopo ignores front-face option
When 'Front Faces' brush option was enabled, dyntop would still adjust detail on back-faces.
2015-05-18 18:22:31 +10:00
3dfce097e4 Cleanup: use const for Imbuf file types 2015-05-18 16:27:08 +10:00
924f31e54f Fix T44543: painted texture lost after first save
Fix for T36639 caused all path changes to reload (which could loose user content).

Change behavior:

- Only reload data when a flag is explicitly passed
  (currently only used by Find Files operator)
- Don't reload images which have been painted onto and not saved (dirty flag set).
2015-05-18 13:42:47 +10:00
662746fdd4 Fix multi-drag & multi-select, Alt press mid-drag
This would enable multi-value-editing in the middle of the drag action.
2015-05-18 11:52:59 +10:00
88acb3c599 Fix T44707: cycles border render regression 2015-05-18 11:37:19 +10:00
29aae4db38 UI: errors in buttons now show in info report
Mistakes in button expressions were previously only printed to the console.
2015-05-18 10:02:29 +10:00
3ed009af96 Change behavior of cycles xml to conform the spec: "Each XML document has exactly one single root element" 2015-05-17 23:41:38 +02:00
0b5bf9d419 BGE: Fix T42244 LibLoad crash with logic brick KX_TouchSensor
I remove duplicate and wrong code which treat the special case of KX_TouchSensor.
And Also the re-conversion of linked logic brick.
2015-05-17 22:19:09 +02:00
Julian Eisel
d1230ca723 Fix Node Editor using wrong snap element menu when called from shortcut
Kudos to @kopias for notifying me :)
2015-05-17 19:47:03 +02:00
105b87a3f7 Cycles: Enable advanced shading on AMD / OpenCL.
That is needed for Motion Blur and Render Passes to work properly.
I hope there are no nasty side effects, but we need to test this.
2015-05-17 19:29:33 +02:00
dae566894a Cycles / OpenCL: Enable Camera Motion and Hair for AMD.
Only enabled for the Experimental kernel though, so the feature set must
be changed in the UI to use the features.
2015-05-17 18:46:25 +02:00
14c2bc53c0 Cleanup: Typos, typos everywhere. :D 2015-05-17 18:32:31 +02:00
4139686817 Fix T44713: GLSL and BI inconsistency converting color to float node socket. 2015-05-17 18:18:04 +02:00
3cff7768d5 Fix T44718: Cycles GLSL not working for NURBS objects. 2015-05-17 17:25:57 +02:00
43ee3f4040 Fix T44739: OS X RMB emulation giving wrong mouse button release event. 2015-05-17 16:55:18 +02:00
48ed2b6309 UV editor: make Ctrl+E menu with mark/clear seam, instead of always marking. 2015-05-17 16:54:14 +02:00
a622cdaad8 Buildbot: Make sure files are readable by www group 2015-05-17 19:28:12 +05:00
2b9d806432 Fix T44084 - Cursor gets reset after MMB scrolling in another area while in GPencil Continous Draw Mode 2015-05-18 02:25:32 +12:00
206f29c12c Fix T44685 - In grease pencil stroke editing, selecting points is offset by a few pixels
The problem was that it was aborting too early after stumbling across a point which
might fit within the bounds required. This commit improves the logic here to solve
this and a few other little bugs like that.

Disclaimer: There are still a few cases where it randomly ends up picking something
way off. However, this only seems to occur very sporadically, so it's hard to say
how bad the problem may be.
2015-05-18 02:03:39 +12:00
30b45d5591 BMesh: don't check winding for uv-vert-map
Made link-select separate front/back with projected UV's
2015-05-17 23:06:41 +10:00
b68fa820d6 Fix T44715: crash compositing with undefined node due to re-save in older version 2015-05-17 13:44:22 +02:00
3b359f1fea BGE: Fix T43761 No re-creation of display list after a mesh modification.
I also removed unused flags in RAS_ListRasterizer.cpp.
2015-05-17 12:53:57 +02:00
4d45f47920 Fix T44737: Missing 'Spin' op entry in surface (NURBS) tools/menu. 2015-05-17 12:45:07 +02:00
effb912061 Cycles Standalone: Expose various light settings. 2015-05-17 12:36:42 +02:00
dad2850cc5 Numeric Input for Pose Breakdowner/Slide/Push Tools 2015-05-17 22:28:25 +12:00
347843f6fe Cycles Standalone: Update help screen. 2015-05-17 12:10:30 +02:00
f51fef63aa Fix own error deleting previews 2015-05-17 17:26:01 +10:00
847ec075eb Cleanup: pep8 2015-05-17 17:26:01 +10:00
02cbc3c1e0 Cleanup: indentation 2015-05-17 17:25:57 +10:00
daeb3069cf Cleanup: typos 2015-05-17 16:09:32 +10:00
6ba128129d CMake: correct file listing 2015-05-17 16:09:15 +10:00
60f60ed496 CMake: fixes for own checking script
don't error if generated files are missing.
2015-05-17 16:05:38 +10:00
6c15f3044b Yet another attempt to fix Intel case for T43987 2015-05-16 23:09:11 +02:00
dcacc54e07 Freestyle: Fix for stroke rendering performed with multi-views enabled.
Per-view Freestyle stroke rendering needs to be done without multi-views.
2015-05-16 23:59:14 +09:00
4c0f0eb338 Fix T44691 Freestyle render crashes when Views is on (Blender Internal).
In pipeline.c the function add_freestyle() was supposed to be called once
per frame, but after the Multi-view merge the function are called as many
as the number of views.  There were however a few Freestyle parameters
that have to be initialized per frame, and initializing one of the
parameters for each view was causing double freeing of allocated memory
which was enough to result in a crash.
2015-05-16 23:59:11 +09:00
a49534ae48 setting some RNA defaults for nodes 2015-05-16 13:04:40 +01:00
dddb4f655c BMesh: link-select-pick now supports redo
Without this you can't change delimiter options without editing the keymap.
2015-05-16 20:53:35 +10:00
3aa4a0e787 BMesh: add UV delimit for select-linked, dissolve 2015-05-16 12:21:31 +10:00
05c4c2409e BMesh: add sharp edge delimiter 2015-05-16 10:18:38 +10:00
5cc55486ee BMesh: select linked, support other delimiters
Use same options as limited dissolve (adds material & winding)
2015-05-16 10:17:46 +10:00
1bb3d0d485 Select linked seam limit, now works for picking
Second half of fix for also T42510
2015-05-16 09:35:35 +10:00
eeadd19eb5 Cleanup: use define for playback frame limiter 2015-05-16 08:35:25 +10:00
80c0097210 Only initialize icons in background mode.
Also enable this for headless builds too.

Calling UI_icons_init would initialize matcaps, brushes etc...
2015-05-16 06:21:26 +10:00
b931afe55e Fix new 'custom previews/icons' py feature crashing in background mode.
We want this even without UI, some scripts may use it in a background processing
mode to avoid too heavy process in actual 'user' blender...
2015-05-15 20:12:25 +02:00
08f30ef31c Fix T44724: missing menu entries for 'view fit' (F) in clip/image editors. 2015-05-15 19:49:00 +02:00
2d479421af Fix crasher in new lazy-rebuild outliner's treehash.
treehash must always been checked before used!

Reported on irc by sebastian_k and investigated by sergey, thanks!
2015-05-15 19:29:18 +02:00
5dc22fbbfb BGE: Fix T41299 Group API for child object in dupli instance group. 2015-05-15 19:17:15 +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
ce0d3112e4 Scene audio naming cleanup:
Remane sound_scene_handle to playback handle.
sound_scene_handle was a part of scene so we could see code like scene-
often in the same function.

If I understand things correctly, in audaspace lingo, the
playback_handle corresponds to a Reader while the scene_sound
corresponds to a Factory.

More cleanups will be done here later, but changing this now because my
brain hurts trying to remember which is which...
2015-05-15 16:51:46 +02:00
3d658bf7a7 BGE: Fix stupid typo error in DupliGroupRecurse 2015-05-15 16:25:45 +02:00
371e5f25a0 BGE: Cleanup : merge 3 loop in 1 in function DupliGroupRecurse. 2015-05-15 16:20:06 +02:00
f4e8e70b5d Add really simple memory reduction scheme for internal animation player.
Holds 30 frames in memory. Could make it check memory instead but that
should suffice for now to make sure blender does not crash on me with
movie files.

Previously the system would load eveything in memory so something like
playing caminandes in player would swap after 30 seconds in local
computer.
2015-05-15 16:01:01 +02:00
31e96cbf96 Cleanup: style, spelling 2015-05-15 23:38:53 +10:00
2fa4a48bce BGE: Fix T44700 mesh without material in blenderplayer.
If a mesh doesn't have a material we don't initialize the mSavedData in KX_BlenderMaterial to avoid crash.
2015-05-15 14:54:38 +02:00
7c06190882 Cycles: Make animated seed a builtin feature.
For animations, you often want an animated render seed (noise pattern).

This could be done by e.g. setting a driver on the seed value.
Now it's a little checkbox, that can be enabled.

The animated seed is based on the current Blender frame and
the seed value itself. Simply enabling it, will already result in an animated
seed (different on each Blender frame), but it can be randomized further
by setting a different seed value.

Disabled per default, so no backward compatibility break.

Differential Revision: https://developer.blender.org/D1285
2015-05-15 13:54:59 +02:00
e4c93dc7db 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-15 13:39:30 +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
c86a6f3efb Cycles: Enable CMJ for Intel/NVidia experimental split kernels
It is still disabled for AMD devices since can't test if it works fine
on this hardware.
2015-05-15 13:22:47 +05:00
c2b9f78415 Cycles: Pass __KERNEL_EXPERIMENTAL__ to OpenCL split kernels
Experimental feature set id currently unavailable for megakernel, it'll
require some changes to the cache system to distinguish cached regular
kernels from cached experimental kernels.

Currently unused, but some features will be enabled soon.
2015-05-15 13:22:47 +05:00
2ab909a88c Cycles: Make experimental kernel build option more generic
Previously it was explicitly mentioning it's NVidia kernel related option,
but in fact it's also handy for the OpenCL kernel.
2015-05-15 13:22:47 +05:00
c9e8888f87 Cycles: Disable bake OpenCL kernel for NVidia devices prior to sm_30
Driver fails to compile kernel in reasonable time for those devices here,
so for easier testing of the OpenCL split kernel work disabling bake kernel
for now.
2015-05-15 13:22:47 +05:00
960d7df56f Cycles: Pass device compute capabilities to kernel via build options
This way it's possible to do device-selective feature disabling/enabling.
Currently only supported for NVidia devices via OpenCL extension.
2015-05-15 13:22:47 +05:00
650fbd09f7 OpenCL wrangler: Add some of the extension defines 2015-05-15 13:22:47 +05:00
03f9d5a4cf Cycles: Cleanup, move build options string calculation into the device class
This way it's easier to access platform name, device ID and other stuff which
might be needed to define build options.
2015-05-15 13:22:47 +05:00
ba9dbaae64 Fix T42510: Limit by seams fails in edge/vert mode 2015-05-15 17:14:02 +10:00
547b676181 BMesh: add loop-shell walker 2015-05-15 17:07:57 +10:00
cfe54245a8 Correct recent cleanup
Removed call which was still needed
2015-05-15 11:29:34 +10:00
bc371030a7 BMesh: rename loop walker -> edgeloop 2015-05-15 10:55:56 +10:00
Julian Eisel
a92d8a34a8 Add material reorder buttons for Cycles as well 2015-05-15 01:25:03 +02:00
Julian Eisel
7549ec7301 Fix some issues found by Coverity Scan
Some of them are just brain dead code, some are potential bugs.
2015-05-15 01:08:41 +02:00
3c10ec96b5 Cycles: Enable object motion blur on Intel OpenCL platform
This required allocating some memory related on object transform needed
by ShaderData and currently it is done for all the platforms. Since we're
targeting full feature-complete platforms this is rather acceptable at
this point and in the future we'll do selective NO_HAIR/NO_SSS/NO_BLUR
kernels.

This is experimental still and in fact there're some major issues on
NVidia platform and it's not really clear if it's a bug in compiler,
some uninitizlied variable or other kind of issue.
2015-05-15 00:48:12 +05:00
03565218d5 Cycles: Various fixes
Some stupid fixes like spaces around operator and missing semicolon,
plus fix for wrong detecting of ShaderData SOA size. Thar was harmless
since there's only one closure array, but still better to fix this.
2015-05-15 00:42:05 +05:00
f6c6dd44de Cycles: Remove meaningless ifdef checks for features in device_opencl
This file was actually checking for features enabled on CPU and surely all
of them were enabled, so removing them does not cause any difference.

ideally we'll need to do runtime feature detection and just pass some stuff
as NULL to the kernel, or maybe also have variadic kernel entry points which
is also possible quite easily.
2015-05-14 23:44:19 +05:00
5c34266383 Cycles: Enable camera motion blur in split kernel for Intel/NVidia
It's good for testing and seems to work quite reliably here.

This probably not totally cheap in terms of performance, but this we
could solve quite easily by selective kernel compilation once other
things are tested/proved to be reliable.
2015-05-14 23:35:19 +05: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
0a60c7d8ee Cycles: Fix missing camera-in-volume update when using certain render layers configurations 2015-05-14 19:08:13 +05:00
3d3d805b64 Cycles: Prepare code for OpenCL camera/motion blur
The kernels are now compiling just fine, but there're some issues
during rendering. This is still to be investigated.
2015-05-14 18:48:56 +05:00
5a63edb929 Cycles: Use special _auto versions of transform function in motion blur code
Doing this as a separate commit so it's easier to revert in the future, once
OpenCL 2.0 is becoming our requirement.
2015-05-14 18:48:56 +05:00
33439626f1 Cycles: Add transformation functions with specified addrspace
This is required for OpenCL prior to 2.0 and those functions will become
handy when working on camera/motion blur support in split kernel.
2015-05-14 18:48:56 +05:00
79aa50dc53 Cycles: Enable hair for split kernels when using Intel or NVidia drivers
Apart from simply enabling this features needed changes to the code were done.
Technical change, replacing SD access from "simple" structure to SOA.
2015-05-14 18:48:56 +05:00
e7f2aec81b BGE: Add 'Lock Translation' for dynamic objects
The XYZ translation lock was missing for dynamic object.

Reviewed By: panzergame
2015-05-14 15:23:42 +02:00
1ccc417477 Invert value calculation for percentages it makes more sense that way 2015-05-14 14:22:57 +02:00
7aa74dfe5e Radial operator:
Percentage properties use interaction like factors with number feedback
and easier way to go predict lower percentages.
2015-05-14 14:01:33 +02:00
67dd6243f2 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-05-14 13:26:56 +02:00
057a8c6250 Add clear seams to uv editor 2015-05-14 12:48:47 +02:00
4376dfbf21 Fix for Drag force fields: was using inverted velocity. 2015-05-14 12:17:14 +02:00
8bf9e1412f BGE: Fix: Double jumps are not working with character motion actuator
The actual character motion actuator triggers every frame the jump method.
Adding an edge detection to trigger the jump method.

Reviewers: lordloki, sybren, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D1220
2015-05-14 09:45:51 +02:00
687f6a9752 BGE: Code Cleanup: LOD hysteresis calculation
* Cleanup duplicated code.
* Remove unnecessary "this->"

Reviewers: kupoman, lordloki

Reviewed By: kupoman, lordloki

Differential Revision: https://developer.blender.org/D1293
2015-05-14 09:40:03 +02:00
434086dc53 install_deps.sh: correct typo 2015-05-14 13:13:13 +10:00
9207c8d669 Fix project paint worldspace coord calc from seam
Surprising this worked at all, would show errors with non-flat-quads.
2015-05-14 13:06:19 +10:00
0e80eb82e0 Cycles: Resize light_data after possible light removal. 2015-05-14 01:13:40 +02:00
67eb2c7897 Cycles: Remove Emission shaders from the graph if color or strength is 0. 2015-05-14 01:13:40 +02:00
da1038c768 UI: Copy to selected nodes now filtered by type
Was needed because sockets are very generic type which would match on unrelated values.
2015-05-14 06:27:51 +10: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
fc31bae66f Cleanup: Avoid temp variable in portal sampling code. 2015-05-13 19:54:52 +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
93867ae549 Cycles: Cleanup: use generic utility function to set kernel arguments 2015-05-13 19:56:24 +05:00
51a6bc8faa Cycles: Inline sizeof of elements needed for the split kernel
No need to store them in the class, they're unlikely to be changed
and if they do change we're in big trouble anyway.

More appropriate approach would be then to typedef this things in
kernel_types.h, but still use inlined sizeof(),
2015-05-13 19:56:24 +05: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
0a6e32173e Cleanup / Cycles: De-Duplicate Portal data fetch and side check. 2015-05-13 16:05:30 +02:00
730e61b446 Clip editor: Selecting curves in graph view always extends tracks selection
Was actually an old TODO, hopefully solved now in a way so everyone is happy.
2015-05-13 16:11:26 +05:00
0d64e26740 Clip editor: Deselecting with shift-LMB does not work in graph view 2015-05-13 15:55:32 +05:00
38eab96f9b Fix T44683: Unable to mute movie clip when using stabilized display 2015-05-13 14:28:24 +05:00
ae9e38c5ad Fix T44689: New Depsgraph crash
Simple highschool rated issue -- uninitialized variable :)
2015-05-13 14:07:37 +05:00
1a0fb7e9ae Project Paint: enable old bleed UV calculation
Was disabled because other values weren't quite right.
2015-05-13 18:26:56 +10:00
a050d6063c Project Paint: resolve ugly bleed artifacts
Use the bilinear reverse to find the pixel to bleed from.
Was using pixel space which didn't work well.
2015-05-13 18:04:46 +10:00
3e782756e3 Project Paint: simplify uv bleed factor calc 2015-05-13 17:48:54 +10:00
7969b238db Fix T39775: Skin modifier crash 2015-05-13 16:08:19 +10:00
7742a8f09c Cleanup: reduce scope for win32, Linux vars 2015-05-13 16:08:19 +10:00
Dalai Felinto
c78df8f9ee Duplicate Render->RenderData.views for thread safety (as we do for layers)
This fixes nothing at the moment, but better safe than sorry since there
are still a few strange multiview issues around.
2015-05-13 01:03:19 -03:00
abb80abf8a UI: check visible layers when reading context
This resolves a problem where selected items edited for multi-value-editig
could include objects not in any visible views (unlocked layers, local view... etc).
2015-05-13 11:00:23 +10:00
08bbea9362 UI: multi-value-edit, distable alt+lmb on sliders 2015-05-13 10:32:30 +10:00
898b6491ed UI: multi-value-edit, tint button while editing
Currently re-uses node-flag (which is only used to tint color too)
2015-05-13 10:01:13 +10:00
91ec8d8d1e UI: multi-value-editing, copy value when typed in 2015-05-13 09:50:08 +10:00
bbadc3aecd UI: nodes support for multi-value-editing 2015-05-13 09:48:41 +10:00
Dalai Felinto
274b0838c7 Multi-View: return correct number of views when rendering only one of the stereo pairs
Without this fix ViewerNode would continously trash the views/buffer
when disabling either stereo eye.
2015-05-12 18:46:09 -03:00
b3334d936f Edit last commit, redundant 'data' in RNA path 2015-05-13 07:40:21 +10:00
ee3dde2d49 UI: ObData support for copy-to-selected
Now multi-object editing works for obdata too.
2015-05-13 07:25:04 +10:00
Dalai Felinto
3e519860e5 Fix T44684 Compositor backdrop isn't updating correctly 2015-05-12 18:20:05 -03:00
e4cd4c383f Cleanup: style 2015-05-13 06:10:49 +10:00
3160740421 Fix T40762: Python can't access macro values 2015-05-13 05:26:29 +10:00
b01dd748b6 Dyntopo PBVH build optimization:
Optimize the full rebuild case for now (though same code can be adapted to
partial redraws)

Main changes here:

* Calculate bounding centroid for faces only once (instead of every intermediate node)
* Faces do not get added to GSets immediately, instead we track a face
array which has faces that belong in a node in consecutive order.
Nodes just keep accounting of start and length in the array.
* Due to faces not being added to GSets, we can skip doing cleanup of GSets
and readdition for each intermediate node and instead only
add the faces to the final leafs node GSets when those nodes are created.

Results:
For a 1.9 million face test model, PBVH generation time (roughly measured by undoing) is
dropped from 6 seconds to about 4 seconds. Still too high, but still a nice improvement.

TODO:
Thread some parts. Unfortunately threading the GSet assignment part might not help much since
we'd need a lot of locking to avoid collisions with node assignments, especially for unique vertices.
2015-05-12 21:03:16 +02:00
f097453006 Fix missing define in blenloader
It caused blender versions compiled with scons not having proper
build date/hash stored in the .blend file.
2015-05-12 19:53:31 +05:00
Dalai Felinto
15016e1497 small cleanup on render_result_new()
(making the duplicate code more like the original one)
2015-05-12 11:38:24 -03:00
f0f481031c Fix T44616: Cycles crashes loading 42k by 21k textures
Simple integer overflow issue.

TODO(sergey): Check on CPU cubic sampling, it might also need size_t.
2015-05-12 18:48:55 +05:00
7c2905b8ec Fix T44398: Compositing displace node makes image fuzzy with zero displacement
EWA filtering with zero derivatives is introducing some fuzzyness into the
image. Currently solved by using regular sampling for cases when derivatives
are zero, which should also make compo faster in that areas.

Still need to look into checking if EWA filter can be tweaked in a way so
no fuzzyness is introduced.
2015-05-12 17:24:07 +05:00
8697c19e91 Depsgraph: Don't use C++11 function binding with MSVC
It has some weird incompatibility with the way how Boost and GCC C++11
function bindings works, resulting in compilation errors.
2015-05-12 16:41:23 +05:00
909d3228b1 BGE : Fix Bullet shape margin for triangle mesh static objects 2015-05-12 13:38:46 +02:00
615a7aea55 Depsgraph: Attempt to fix alignment issue on 32bit platforms 2015-05-12 16:36:34 +05:00
29529d2ac3 ImBuf: Update stubs so strict compiler is happy about unused arguments
Also use C++-style unused arguments tagging instead of legacy c-style.
It's less annoying this way because does not require adding argument to
two places of the function.
2015-05-12 16:25:39 +05:00
bac7353801 Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:

- More granular dependency relation nature, which solves issues with fake cycles
  in the dependencies.

- Move towards all-animatable, by better integration of drivers into the system.

- Lay down some basis for upcoming copy-on-write, overrides and so on.

The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.

It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.

There are number of assorted documents related on the design of the new system:

* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph

There are also some user-related information online:

* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/

Kudos to everyone who was involved into the project:

- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
  project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
  issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 16:06:37 +05:00
a09341469e Depsgraph: Add evaluation callbacks for granular nodes update
This commit only adds callbacks which then later be used with major dependency
graph commit, keeping the upcoming commit more clean to follow.

Should be no functional changes so far still.
2015-05-12 16:06:37 +05:00
051688b34c Depsgraph: Make ob_get_parent_matrix() more public and reusable
Currently still only used from object.c, but in the next commit it'll be also
used from granular object update callbacks.
2015-05-12 16:06:36 +05:00
08d87514d3 Depsgraph: Add utility function to check whether modifier depends on time
Currently unused, based on the code from old depsgraph.c. The purpose is to
re-sue the code over old and new depsgraph in an easy way.
2015-05-12 16:06:36 +05:00
31f0c27ae7 Depsgraph: Add additional relations/id update tags
This calls are not strictly speaking needed for the old dependency graph, but
due to more granular nature of upcoming depsgraph more actions requires update
of relations of IDs.

On the one hand this extra tags could be wrapped with if() statements, but on
the other hand it makes sense to keep tag in sync so it's clear if some issue
is caused by missing/extra tag or by depsgraph itself.
2015-05-12 16:06:36 +05:00
87fd166654 Depsgraph: Add utility function to tag pose for recalc
Currently this function only tags pose itself, totally matching previous
behavior. But this will be needed in the future once new dependency graph
is landed, because of it's granular nature which relies on the fact that
pose channels are all up to date when building the graph.

Should be no functional changes so far.
2015-05-12 16:06:36 +05:00
dbbe721c2a Depsgraph: Move update-related functions into own files
Currently it is just moving existing functions into a new file,
but in the future those new files will be grown much more due
to upcoming more granular scene updates.

Should be no functional changes.
2015-05-12 16:06:36 +05: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
ae00e42bc2 Fix T44677: Normal Edit Modifier Radial Mode broken with target object.
Very stupid mistake, odd nobody hit this earlier... :/
2015-05-12 10:57:39 +02:00
20e561dd6a PyAPI: Remove release method, just use delitem 2015-05-12 18:43:30 +10:00
f6dc0e918b Minor tweaks to preview templates 2015-05-12 18:29:06 +10:00
34c78a659b Doc: add bpy.utils.previews
Updated sphinx_doc_gen.py to better handle pure py-classes.
2015-05-12 18:24:32 +10:00
f727df6076 Doc: correct rst syntax
also remove some API docs from example
2015-05-12 18:23:29 +10:00
311f6cac92 Doc: replace addons -> scripts in docstring
Theres nothing add-on specific here.
2015-05-12 18:23:29 +10:00
8a231185aa Doc: minor fixes
- check for class/static methods assumed nonzero args.
- subclass references and set-flag items are now sorted.
- use 'order' for Py operator mix-ins,
  so operator settings don't show in random order.
2015-05-12 18:23:24 +10:00
8478c71a7b BGE: Adding material IPO support to GLSL materials
Most of this patch was created by Daniel Stokes, I'm mostly just cleaning
it up and testing it. Still todo: hardness. I need to figure out how to
handle the integer -> float conversion on a dynamic uniform.

Reviewers: psy-fi, brecht

Reviewed By: psy-fi

Subscribers: psy-fi

Differential Revision: https://developer.blender.org/D511
2015-05-11 23:05:04 -07: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
ce504cffad Freestyle: Fix for assertion failure in viewport preview.
An assertion to check if `re->clipsta` < 0 (added as part of addressing
T36009 in rBrB795034c17d76bef2a15e576ac9c70ae2268a823b) was failing when
Freestyle viewport preview rendering takes place in the camera view with
an orthographic camera (in this case, the user-defined clipping range is
used without changes, so that `re->clipsta` is positive).  The
`re->clipsta` property has a negative value only when the 3D viewport is
in an orthographic view but not in the camera view.  It seems that this
viewport setting cannot be identified from rendering settings accessible
from Freestyle.  Now a negative `re->clipsta` value is directly checked
instead, without relying on other render flags.
2015-05-12 02:18:24 +09:00
c7bccb30bf Cycles: check for F16C support with __cpuid, as we do for BMI and BMI2 2015-05-11 15:49:36 +00:00
1bf685488c Collada Exporter: sanitize a bit lnor export.
In case `BKE_mesh_calc_normals_split()` would fail, exporter would read
uninitialized random mem... Should not happen, but better be safe than sorry.
2015-05-11 17:22:18 +02:00
2c4736e6db Clearing preview image shall also unset 'user edited' flag! 2015-05-11 17:12:31 +02:00
4fc3188112 Cycles: Get rid of one more OpenGL matrix manipulation/push/pop. 2015-05-11 16:41:18 +02:00
d30f664c04 Expose PreviewImage & custom icons to py API.
This commit mainly:

* Exposes PreviewImage struct in RNA, including ways for user to set images data.
* Adds a new kind of PreviewImage, using a file path and IMB_thumb to get image.
* Adds a new kind of custom icon using PreviewImage, unrelated to ID previews system.
* Adds a python API (utils.previews) to allow python scripts to access those custom previews/icons.

Note that loading image from files' thumbnails is done when needed (deferred loading), not
when defining the custom preview/icon.

WARNING: for release addons who would want to use this, please keep it to a strict minimum, really needed level.
We do not want our UI to explode under hundreds of different flashy icons!

For more info, see also the release notes of Blender 2.75 (http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.75/Addons)
and the example/templates featured with Blender.

Patch by Campbell (ideasman42), Inês (brita) and Bastien (mont29).

Differential Revision: https://developer.blender.org/D1255
2015-05-11 16:37:15 +02:00
e38f914421 Cycles: use vertex buffers when possible to draw tiles on the screen.
Not terribly necessary in this case, since we are just drawing a quad,
but makes blender overall more GL 3.x core ready.
2015-05-11 16:28: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
cc1883468d Keep valgrind happy by using tight vec3 packing instead of lax vec4 with
an unused coordinate missing.
2015-05-11 14:14:06 +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
5588a51c9c Cycles OpenGL: Don't use full matrix transform when we can just use
simple addition.
2015-05-11 13:10:19 +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
dfbb876d46 UI: initial support for UI editing selected items
Add basic support (holding Alt) to edit all selected objects/bones/sequences.
2015-05-11 15:32:43 +10:00
097862cb26 GHash: avoid redundant casts 2015-05-11 12:39:39 +10:00
18cf235893 GHash: use const keys when only used for lookups 2015-05-11 12:39:08 +10:00
3141870c96 Outliner: postpone rebuilding the tree
On existing Blender could rebuild tree many times (on freeing each ID).
Use a flag instead of immediately rebuilding.
2015-05-11 11:09:21 +10:00
f4bae1f6d6 Outliner: cleanup flag was never cleared
Was running cleanup on every draw.
2015-05-11 10:58:53 +10:00
9e2e85a367 GHash: Add BLI_ghash_ensure_p_ex to copy the key
Needed in cases where the memory from each key is owned by the GHash.
2015-05-11 09:27:05 +10:00
d55868c3b2 Cycles: And yet another compilation fix after half-float commit for clang.
Suggested by Brecht, tested with gcc > 4.4 and Clang
2015-05-10 19:32:32 +00:00
3ec168465d Cycles: fix compilation on 32-bit Windows for half-floats
Reported by IRC user HG1.
2015-05-10 19:06:43 +00:00
c20c07f27a Fix T44633: image cache broken for movies and sequences.
After multiview, it was continuously unloading/loading image buffers from
the cache due to mismatch in cache insert and lookup keys.
2015-05-10 20:51:18 +02:00
8db2a9a352 Cycles: Add -mf16c for previous commit for Scons
Thanks to Dingto for noticing!
2015-05-10 17:51:04 +00:00
4d8f7eddda BGE : Fix crash during physics mesh update.
Currently we can't update the physics mesh of an added rigid body.
The cause is that that we need to update all shapes to say that the mesh was changed, for static object we don't do that previously because we use a odd way to reallocate memory at the same place.
So now when a mesh is changed we iterate all physics controllers which use the same shape info and recreate its shape with the correct mesh.

example file : {F168100}

Reviewers: scorpion81, sergof, hg1, sybren, moguri, agoose77

Reviewed By: moguri, agoose77

Subscribers: sybren

Differential Revision: https://developer.blender.org/D1269
2015-05-10 19:21:21 +02:00
2ec221aa28 Cycles: Use native float->half conversion instructions for Haswell CPUs.
This makes OCIO viewport color correction a little bit faster (about -0.5s for 100 samples)
Also set max half float value to 65504.0 to conform with IEEE 754.
2015-05-10 16:35:51 +00:00
3a2c0ccdd0 Cycles: Correction to opencl whitelist check
Was using platform as a device id accidentally.
2015-05-10 20:02:06 +05:00
1c02a201ba BGE: Cleanup constraints documentation
* Fixing Python example. Behavior has changed with Blender 2.74
* Adding missing return type
* Fixing typo simbolic
* Fixing note for upper/lower limit
* Adding link to constraints constants
2015-05-10 15:58:17 +02:00
d5228eb992 Drag type force field for keeping hairs "stuck" to a mesh surface. 2015-05-10 14:04:05 +02:00
a47ade34c2 Cycles: Fix tiny greying out inconsistency for Volume settings. 2015-05-10 12:59:18 +02:00
e8be170e79 Cycles: Do not show Branched Path integrator for OpenCL.
Branched Path is not supported, neither in the Split nor Megakernel.
2015-05-10 12:59:18 +02:00
0525db39d1 fix T44648: Collada finding bone chains during import crashes when no bones are there 2015-05-10 11:04:37 +02:00
1fb97ffeed Fix T44644 Missing thread-protection (spinlock) of image in new multiview code.
Many thanks to Sergey, for practically giving the solution!

Note that it may also fix T44345, depends whether there are other missing
protections/locks or not...
2015-05-10 09:18:52 +02:00
45d9df853e UI: consistent naming for operator props 2015-05-10 15:23:41 +10:00
d6b57436ef UI: move sharp/smooth out of vertex menu
Was confusing to have shade smooth/soft in both edge & vertex menu named differently.

This is an edge-flag, so keep in the edge-menu, use vertex option when in vertex mode.
2015-05-10 15:06:44 +10:00
dc95ca92ca BGE: Fix T43822 Videotexture does not use sky color for off-screen
rendering

Make scene background color as default for render-to-texture instead of
current blue color (0, 0, 255).

It is very useful for mirrors setups.

Reviewers: moguri, ben2610, sybren, panzergame, hg1

Reviewed By: panzergame, hg1, moguri

Subscribers: mpan3

Differential Revision: https://developer.blender.org/D1287
2015-05-10 00:56:51 +02:00
583fd3af65 Cycles: Fix typo in global space version of normal transform
It was using direction transform, which is obviously wrong.
2015-05-10 00:53:32 +05:00
136d7a4f62 Cycles: Only whitelist AMD GPU devices in the OpenCL section
Only those ones are priority for now, all the rest are still testable
if CYCLES_OPENCL_TEST or CYCLES_OPENCL_SPLIT_KERNEL_TEST environment
variables are set.
2015-05-09 23:40:26 +05:00
8647c7d501 Fix T38335: incorrect triangle index in raycast with more than 2 quads
eb81153896 broke the fix for T38335, and this fix was incomplete, now we iterate by triangles and polys in the same while block.
2015-05-09 19:12:22 +02:00
2840a5de8f Cycles: Workaround for AMD compiler crashing building the split kernel
It's a but in compiler but it's nice to have working kernel for until
that bug is fixed.
2015-05-09 19:56:38 +05:00
7f4479da42 Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.

Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.

Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.

This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.

More feature will be enabled once they're ported to the split kernel and
tested.

Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.

Based on the research paper:

  https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf

Here's the documentation:

  https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit

Design discussion of the patch:

  https://developer.blender.org/T44197

Differential Revision: https://developer.blender.org/D1200
2015-05-09 19:52:40 +05:00
f680c1b54a Cycles: Communicate number of closures and nodes feature set to the device
This way device can actually make a decision of how it can optimize the kernel
in order to make it most efficient.
2015-05-09 19:28:00 +05:00
6fc1669679 Cycles: Initial work towards selective nodes support compilation
The goal is to be able to compile kernel with nodes which are actually needed
to render current scene, hence improving performance of the kernel,

The idea is:

- Have few node groups, starting with a group which contains nodes are used
  really often, and then couple of groups which will be extension of this one.

- Have feature-based nodes disabling, so it's possible to disable nodes related
  to features which are not used with the currently used nodes group.

This commit only lays down needed routines for this approach, actual split will
happen later after gathering statistics from bunch of production scenes.
2015-05-09 19:22:16 +05:00
17c95d0a96 Cycles: Add utility function to count maximum number of closures used by session
This will be used by split kernel in order to compile most optimal kernel.

Maximum number of closures is actually being cached in the session, so viewport
rendering will not trigger kernel re-loading when number of closures goes down.
2015-05-09 19:17:49 +05:00
5068f7dc01 Cycles: Add utility function to graph to query number of closures used in it
Currently unused but will be needed soon for the split kernel work.
2015-05-09 19:13:32 +05:00
b3299bace0 Cycles: Pass requested tile size to the device via device task
This is currently unused but crucial for things like calculating amount of
device memory required to deal with the tasks.

Maybe not really best place to store it, but consider it good enough for now.
2015-05-09 19:09:07 +05:00
0e4ddaadd4 Cycles: Change the way how we pass requested capabilities to the device
Previously we only had experimental flag passed to device's load_kernel() which
was all fine. But since we're gonna to have some extra parameters passed there
it makes sense to wrap them into a single struct, which will make it easier to
pass stuff around.
2015-05-09 19:05:49 +05:00
d69c80f717 Cycles: Presumably correct workaround for addrspace in camera motion blur 2015-05-09 19:04:19 +05:00
c9133778cf Cycles: Add CPU compat headers to some of the OSL implementation files
This header was already included into some of the implementation files already,
and this change is needed for some upcoming changes in the way how kernel_types.h
works.
2015-05-09 19:04:16 +05:00
7eac672e4f Cycles: Set default closure values to some of the nodes
Previously it was only set at compilation time which is all fine but does
not let us to check which closure the node corresponds to prior to the
compilation.
2015-05-09 19:04:09 +05:00
8c1b805f87 Freestyle: Partial fix for a crash with Save Buffers option enabled.
Prevents null pointer references in the case of the Save Buffers option
enabled.  This is a regression likely due to rBd5f1b9c22233.
2015-05-09 13:20:40 +09:00
eb81153896 Cleanup: warning (sequence-point) 2015-05-09 11:00:50 +10:00
Julian Eisel
54ac84f2b8 Fix 3D View Properties scrollbar being not set to top in startup.blend 2015-05-08 22:20:18 +02:00
6ee0327594 Fix T38335: incorrect triangle index in raycast result
Previously we forgot to do a special operation for indexes to convert a quad to two triangles.
2015-05-08 21:12:36 +02:00
a08d90f070 matcaps browser: changing emboss style and grid direction according to T44613 2015-05-08 19:22:41 +01:00
b65c77e664 Add Intel's 3000 driver to exceptions for df/dy calculations. Should fix
another case of SSAO effect reversal.
2015-05-08 19:25:51 +02:00
2e6634e4a8 BGE: Cleanup function UpdateMesh and SetMesh in CcdPhysicsController.cpp
"if (value == true)" -> "if(value)"
"if (ptr == NULL)" -> "if (!ptr)"
"vector<bool>" -> "std::vector<bool>"
And other blender typo.
2015-05-08 18:17:37 +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
4c79608b3b Revert "Motionpaths: Use scene range option, takes start/end frame and
preview"

Looks like this does not work for animators here after all, will use a
different code for this (probably not hardcoded)

This reverts commit 3bbb4020e7.
2015-05-08 17:16:59 +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
3bbb4020e7 Motionpaths: Use scene range option, takes start/end frame and preview
settings into account.
2015-05-08 12:35:52 +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
900fc43bb4 Cleanup: Remove unused ray type flags.
They were added for completeness, but it seems we don't need them.
2015-05-08 12:10:26 +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
945e302409 Cleanup: #define -> enum, and get rid of useless braces in case's. 2015-05-08 10:44:18 +02:00
9190d18b74 Fix T44634: Slide edge not responding to ALT + WHEEL to change reference edge in "even mode".
Modal events (TFM_MODAL_EDGESLIDE_UP/_DOWN) were eaten by NOP generic transform event handling...
2015-05-08 10:29:59 +02:00
a8da11c014 Add missing TEXTEDIT_UPDATE option 2015-05-08 08:58:29 +10:00
a077be3658 Cleanup: use r_* prefix for return args 2015-05-08 07:25:39 +10:00
e010960431 DNA; document how to ignore a struct 2015-05-08 06:54:13 +10: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
0a82c3cfef Minor cleanup 2015-05-07 18:32:35 +02:00
a5dead2e8c Fix T44604 bad quality of rake with bezier curves.
We can calculate tangents analytically for bezier curves, so just make
them awesome. New code uses forward differencing calculation for
efficiency just like curve calculation.

Picture before/after:

http://www.pasteall.org/pic/87843
2015-05-07 18:10:48 +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
a2eb94b470 Fix T44631: Custom Normal Data Transfer crash.
Own stupid mistake in rBcdabf7e3...
2015-05-07 15:32:37 +02:00
13f0ec29ce Extended RNA update for shape keys to trigger re-reading of dupli caches. 2015-05-07 15:25:45 +02:00
aa3fc89257 Fix T44611: 'make_links_data' modifiers would fail and crash with multires modifier.
Since it was not ensuring dest has valid mdisp data matching new multires modifier subdiv level...

Also, fixed a bug in `multires_subdivide()`, which would crash when trying to
increase from level 0 (aka no subdiv) to > 1 (wrong check, trying to interpolate
when it should not). And added a few sanity checks.
2015-05-07 15:19:32 +02:00
15fd37fab2 Rake: store last position from mouse, don't store halfpoint between last
and current position.

patch by Bastien
2015-05-07 15:04:11 +02:00
e6a7fdd309 Fix T44627, black spots with lock alpha in projection paint:
Painting would revert alpha even on unpainted pixels, where values would
contain garbage.
2015-05-07 14:49:40 +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
e39ec27bba Fix crash when rendering opengl from sequencer. 2015-05-07 14:09:30 +02:00
e3b0d5e99b EdgeSlide: support for un-clamped sliding
Functionality matches vertex slide.
2015-05-07 21:31:24 +10:00
94b9b259e7 Cleanup: remove unneeded context arg 2015-05-07 21:31:24 +10:00
2ec808a4bc EdgeSlide: use pairs for TransDataEdgeSlideVert
no functional changes
2015-05-07 21:31:24 +10:00
cb7fdf45cd EdgeSlide: fix divide by zero 2015-05-07 21:31:24 +10:00
52117a07cc Conversion for shape keys back to strands data from edit mode. 2015-05-07 13:01:28 +02:00
9ca2b76a9f Cycles: Cleanup, make it more clear what endif closes what ifdef 2015-05-07 15:02:43 +05:00
11cf1ebdd1 Fix first part of T44627, locking alpha should happen in straight space
for float images or we get inconsistent premultiplied values.
2015-05-07 11:42:37 +02:00
0e9b210595 Fix T44630: incorrect mirror modifier merge limit tooltip. 2015-05-07 10:57:37 +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
3ec8bcebf3 Fix T27642: Add version in .exe installer properties 2015-05-07 10:31:21 +02:00
429741ac19 Gooseberry: Attempt to fix compilation error with scons 2015-05-07 13:01:42 +05:00
165598e49e Correct typo: ifdef'd now, but obviously wrong 2015-05-07 10:12:12 +10:00
2d590670b4 Fix T44614: Maya keymap left mouse click to add cut not working. 2015-05-06 23:59:21 +02:00
236360c838 Change fix for T44530 which caused a "regression".
Looks like the previous commit here is really correct and fixes cases of
distortion that were in mirror-subsurf combination since blender 2.5.

This may cause some changed files in which case we will be adding an
option, but it is expected this will only happen with low res models,
and hand painted textures, and the better distortion here compensates
for that enough to consider not adding a compatibility option yet.

Leaving the facemap winding argument as is just in case we do consider
to add the option.
2015-05-06 23:30:15 +02:00
e73f1035d7 Fix T44598: blender internal not giving same result on repeated texture bakes. 2015-05-06 23:06:47 +02:00
fb0dd596e9 BGE : KX_VertexProxy support for more than 2 UV channel.
I have added an optional named "index" argument for methode get/setUV, I have also modified the and set to deprecated methodes setUV2 and getUV2 : the doc was wrong and the methode can't be called anyway because it declared as VARARG in the .h and convert directly the args value to a vector in the .cpp.

Reviewers: sybren, lordloki, hg1

Reviewed By: lordloki, hg1

Subscribers: agoose77

Differential Revision: https://developer.blender.org/D1240
2015-05-06 22:55:46 +02:00
de180aba35 Feature request: Dyntopo detail expressed in percentage of brush radius.
Not sure how useful this will be but people have requested it so, here
it is...
2015-05-06 22:51:49 +02:00
7c3a714124 Fix T44624: world menu appears in node editor header with Blender internal. 2015-05-06 21:55:35 +02:00
4a5933bb74 Rip tool, support filling-edges with fill enabled 2015-05-07 05:34:07 +10:00
4d7b0e4fe3 Correct own error: is_manifold_region on wire vert 2015-05-07 05:23:07 +10:00
c740027e30 Fix T44381: Text Editor: Un-indent undo fails
D1284 by @mikidep
2015-05-07 05:04:05 +10: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
4487358da7 Fix T44618: Rip Fill on a single vert would only generate one of the two expected faces.
Was tagging (for filling) the wrong edge for one of the two involved loops...
2015-05-06 17:51:39 +02:00
51f33a2e55 collada:custom normals generated by normals modifier have not been exported correctly. Also triangulating during export did not work. 2015-05-06 17:03:38 +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
14d55ab7a3 Cleanup: use ntreeFromID 2015-05-07 00:18:11 +10: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
1d88bfce40 Shader node: support native render capabilities
D1188 by @a.romanov
2015-05-06 23:53:51 +10: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
5ffd10a6da OpenGL render: Update metadata as before, for every frame written to a
file, since we need the updated times and frames.

This was lost during stamp code refactoring. The refactoring moved the
stamp when render is initialized so we would be guaranteed to have
correct cameras even when saving render stills at a later time (and even
if cameras were changed). For regular render this would work since
render init takes care of stamp, but for openGL rendering we need to do
this manually.

Still not 100% correct, does not apply multiview cameras to metadata
2015-05-06 15:30:00 +02:00
aaa6b39bfe Quick patch-up for opengl render metadata.
Camera here is incorrect for multiview (as is in real multiview render)
but at least it works now.
2015-05-06 14:47:01 +02:00
15751238d5 BGE: Fix compound child shape added on instance game object 2015-05-06 14:23:22 +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
df422314c1 Only use render view name in render filenames if we are actually using
multiview.
2015-05-06 13:58:06 +02:00
d80ff8ce80 Image proxies now correctly support metadata (needs to regenerate
proxies though)
2015-05-06 13:05:59 +02:00
27c3886064 Cleanup: use functions we already use elsewhere for bone detection
instead of the ninja code that we use now.
2015-05-06 12:53:33 +02:00
Martijn Berger
3f04f64eea [cmake] move FindLLVM to its own file 2015-05-06 12:35:48 +02:00
69bf3a9e94 Updating node standard value won't work if node is hidden, patch by
Alexander Romanov with minor changes.
2015-05-06 11:59:39 +02:00
0abb6f3ef0 Patch D1283 by Alexander Romanov fixes reroute node type update not
correct when root reroute node is plugged in a different type of input
2015-05-06 11:46:47 +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
bc2f77e1da Add bpy.app.binary_path_python
Access to the python binary distributed with Blender,
fallback to system python executable (matching Blender's version).
2015-05-06 11:13:42 +10:00
c246e0c3b6 Prefer name 'program' over 'binary'
binary-search is confusing!
2015-05-06 06:34:19 +10:00
e00142bfa7 BLI_path: add PATH search utility functions 2015-05-06 06:21:16 +10:00
c641a5563f Fix T44612: add support for mouse button 6 and 7 on OS X. 2015-05-05 21:52:09 +02:00
1d0f1a1ec9 Fix T44593: particle volume distribution not working with large meshes. 2015-05-05 21:43:24 +02:00
b45ad4b214 Cycles: Fix for wrong clamp usage in fast math 2015-05-06 00:01:40 +05:00
4616a7a4d3 BGE: Fix collision callbacks for compound controllers
It fix some mistakes in b5e9653035 and made a more safety behavior for collision callbacks used in compound controllers during adding and removing.
2015-05-05 19:54:12 +02:00
962d53e144 Workaround ld.gold failing with msgfmt 2015-05-06 03:23:20 +10:00
264e800965 Alembic: Quick fixes for strict compiler flags 2015-05-05 21:54:43 +05:00
35c67d6750 Fix reading uninitialized memory finding paths 2015-05-06 02:22:00 +10: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
b5e9653035 BGE: Remove function DisableCcdPhysicsController and EnableCcdPhysicsController in CcdPhysicsEnvironment
Replace EnableCcdPhysicsController by AddCcdPhysicsController and DisableCcdPhysicsController by RemoveCcdPhysicsController.
Tested with compound shapes and collision sensors.

Reviewers:agoose77, ideasman42
2015-05-05 15:18:29 +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
d01b226870 Cleanup: Remove leftover from Distorted Noise node in XML reader. 2015-05-05 10:38:45 +02:00
e5e73ccc90 Math Lib: rename fill_*, to copy_*
matching convention for fixed length api, eg: copy_v3_fl
2015-05-05 17:08:29 +10:00
ea5f9fee8d Cleanup: function arg wrapping 2015-05-05 16:34:38 +10:00
1648feec94 Cleanup: rip tool 2015-05-05 16:34:37 +10:00
7201f6d14c Cycles: Use curve approximation for blackbody instead of lookup table
Now we calculate color in range 800..12000 using an approximation a/x+bx+c for R and G and ((at + b)t + c)t + d) for B.
Max absolute error for RGB for non-lut function is less than 0.0001, which is enough to get the same 8 bit/channel color as for OSL with a noticeable performance difference.
However there is a slight visible difference between previous non-OSL implementation because of lookup table interpolation and offset-by-one mistake.
The previous implementation gave black color outside of soft range (t > 12000), now it gives the same color as for 12000.

Also blackbody node without input connected is being converted to value input at shader compile time.

Reviewers: dingto, sergey

Reviewed By: dingto

Subscribers: nutel, brecht, juicyfruit

Differential Revision: https://developer.blender.org/D1280
2015-05-05 06:11:54 +00:00
22bbd1c512 BMesh: improve rip tool /w mon-manifold verts
Can now rip from multiple fans (mixed single faces or larger regions)

Also add BM_vert_is_manifold_region which only checks if a vert has disconnected fans.
2015-05-05 07:22:35 +10:00
e59bd19fa7 Cleanup: style & const's 2015-05-05 05:19:49 +10:00
7478eb9bd0 Cleanup: wrapped function indentation 2015-05-05 05:19:48 +10:00
cc81b58277 Cleanup: deduplicate code.
FileBrowser had its own 'shorten_string' func, when we have a full fledge one in interface_widget code...
2015-05-04 21:13:35 +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
e10ecb6494 Revert "Different drawing for object centers."
This reverts commit 5a8629c0d7.

It does not really work that well since objects can draw in front of
selection circles now.
2015-05-04 18:00:29 +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
1b8069bdd9 UI: location/scale were snapping to 10s
In practice this isn't useful (for scale especially).

For float buttons with a very large range, don't attempt to match the snap to the range.
2015-05-05 01:20:40 +10: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
fd5090ab41 UI: button snap (ctrl) was rounding down 2015-05-05 01:06:09 +10:00
1227e5c3d1 Fix T44503 full sample does not display any preview any more.
The fix exposes another error not fixed in this commit, escaping the
render will not flush the full sample render result correctly.
2015-05-04 16:57:48 +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
68fe630735 Fix eyedropper with quad-view 2015-05-04 23:50:38 +10:00
52b9d83417 Fix T44592: Zero scale on an axis, zeros all 2015-05-04 22:39:33 +10:00
9ff91acadb Follow up to previous commit, remove depth of field from UI in
wireframe/boundbox mode.
2015-05-04 14:38:02 +02:00
73c090fe81 Fix T44594 disable depth of field in wireframe/bounding box modes. We
don't supply depth information in those modes so supporting the effects
does not really make sense
2015-05-04 14:34:57 +02:00
c19f3ea1b2 Fixed comment. 2015-05-04 14:31:44 +02:00
66f96e555c Cycles: Fix copy / paste mistake in XML reader. 2015-05-04 14:31:20 +02:00
e560bbe1d5 Fix possible crash with datatransfer operator when source object was hidden.
Mismatch in poll and exec funcs when getting active (source) object...
2015-05-04 14:30:00 +02:00
5a8629c0d7 Different drawing for object centers.
Code here did depth test always and depth range 0.0.

There is no real reason for object centers to write and get tested
against depth buffer in this case, just disable the depth test instead
;)

Helps with blurry object centers in depth of field mode too (centers
wrote depth 0 and were always blurry)
2015-05-04 13:53:23 +02:00
be30070d86 BGE: Cleanup KX_BlenderSceneConverter.cpp
This commit is a little cleanup for whitspaces, braces, spaces around operators and useless keywords struct/class.

Reviewers:sybren
2015-05-04 13:36:11 +02:00
b7d0ff0ad6 Separate scene simplification into viewport and render
This way it is possible to have viewport simplification bumped all the way up,
making viewport really responsive but still have final render to use highest
subdivision possible.

Reviewers: lukastoenne, campbellbarton, dingto

Reviewed By: campbellbarton, dingto

Subscribers: dingto, nutel, eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1273
2015-05-04 16:31:10 +05: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
7e3ee2d15d Skin Modifier: remove redundant edge-calculation 2015-05-04 20:59:34 +10: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
abd68c6e45 Fix T42893: Skin Modifier, changes randomly toggling editmode
Own regression, previously it would do a full mesh normal calculation for each isolated shape
(could hang on meshes with many loose parts).

However the normals are needed, instead of doing a full calculation,
just set normals on new faces.

Thanks to Brecht for finding cause!
2015-05-04 20:56:57 +10:00
8d5eeab473 Skin Modifier: Add missing operator stack pop 2015-05-04 20:56:57 +10: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
93055b1c22 Fix metadata display in sequencer lost after doing a preprocess
transform.

IMB_makeSingleUser makes a copy and destroys metadata. I am not sure if
this is the safest way to make a single user ImBuf (setting the refcount
to 0 is simpler and there's less, but no zero, risk of dangling
pointers) but I will leave this as is for now in case there is an actual
need for a copy here. The alternative approach should be tested at some
point.
2015-05-04 12:53:16 +02:00
046388830a Freestyle: Fix for line style ID datablocks not copied when fully copying a scene. 2015-05-04 19:52:03 +09:00
b07c2961fa Don't scale metadata font with zoom - makes strings not consistently
adhere to the string length
2015-05-04 12:30:26 +02:00
711e2f71a8 Support displaying metadata for images in sequencer preview windows (not
backdrop)
2015-05-04 12:18:19 +02:00
23a79c42b5 BGE Player: Fix compilation error after cleanup commit da8a62a 2015-05-04 14:39:12 +05:00
4e1c27f646 Fix T29029: Grease pencil fails in Quad View 2015-05-04 19:12:54 +10:00
c46f40e9e2 Freestyle: Compilation error fix after recent changes in BKE_object_add() 2015-05-04 13:52:44 +05:00
7a8170e9c1 CMake: Only consider it INFO is ld.gold is missing 2015-05-04 18:33:37 +10:00
4edc9d50fd Correct own error in recent quad-view ruler fix 2015-05-04 18:32:47 +10:00
74dc4e87a6 Fix Buttons context, invalid object data access
Another instance of T44376.
Crash where the Python context would access a stale pointer to the active object.
2015-05-04 18:06:31 +10:00
c9e5e81064 Button Space: clear pin flag when NULL'ing pointer 2015-05-04 16:12:12 +10:00
77e6a001a9 Fix T44376: Buttons context, invalid data access
Removing a scene from the buttons window would crash from a Python operator.
2015-05-04 16:01:20 +10:00
8d5e57748a Cleanup: WM_main_remove_notifier_reference
Assumed the `reference` pointer is an ID, currently true, but may not always be.
Add a callback specifically for this purpose since cleaning up notifiers and space-types are different operations.
2015-05-04 16:01:20 +10:00
da8a62adce Cleanup: naming for callback wrappers 2015-05-04 16:01:20 +10:00
8515be8a73 Remove redundant outliner lookup freeing objects 2015-05-04 16:01:20 +10:00
fdc5f9c0a8 Add name argument to data creation API calls
Was adding then renaming, unnecessarily.
2015-05-04 16:01:20 +10:00
4e7ef3f5cd BGE: Added 'ghost' arg to KX_GameObject.suspendDynamics() method
The implementation of this 'ghost' argument already existed in the C++
source, but wasn't exposed to Python yet.
2015-05-04 12:04:09 +08: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
62b13c6d07 BGE: Fix: Activate collision mask/group in UI. 2015-05-03 19:16:27 +02:00
dbee634572 Fix typos. 2015-05-04 01:53:34 +09: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
ee7538613a Rigidbody: Fix viewport update when changing collision shape in toolbar 2015-05-03 18:01:47 +02:00
d33b564f91 Fix T44591: Set PBone Group operator did not handled predifined group index in its invoke func. 2015-05-03 16:53:43 +02:00
dced56f02a Fix T44185, Fix T44090: hair texture density working unreliable.
"Unexisting" particles must be freed after the unexist flag has been set,
which was no longer the case after 78c491e62a.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D1213
2015-05-03 16:21:58 +02:00
6159f9a55a Fix T41739: 3D view solid draw mode missing some material node updates. 2015-05-03 15:39:25 +02:00
2775eaf01a Fix T41893: inconsistent color management on sculpt texture nodes previews. 2015-05-03 15:25:43 +02:00
944e0bd7b5 Cleanup: rename clear_skin & clear_mask operators to skin_clear and mask_clear.
So that they match all other op names around - and sensible logic as well.
2015-05-03 15:18:27 +02:00
3a808270df Fix T44589: No way to add a skin data layer manualy.
There are several ways to end up with an object with skin modifier, but no
skin data on the geometry. So we need an operator to add it by hands.

Also tweaked a bit UI of this modifier.
2015-05-03 15:09:48 +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
472b3c5828 We do need to transform lnors in BKE_mesh_transform(), much handy for scripts. 2015-05-03 11:55:58 +02:00
9715d4c778 Added name attribute to instance_geometry nodes (request for Second Life) 2015-05-02 23:17:40 +02:00
6bc8a3f8d3 BMesh: rip-tool can now split off isolated fans
Useful since there wasn't a good way to do this previously.
2015-05-03 06:17:32 +10:00
dd48ddd605 BMesh: utility to split isolated loop regions 2015-05-03 06:16:59 +10:00
33cc5ed495 Cleanup: redundant vars 2015-05-03 06:16:59 +10:00
4fca12e0fa Fix rna default value in BGE UI. 2015-05-02 21:09:29 +02:00
bd5e578804 BMesh: rework BM_vert_is_manifold (simplify logic)
- simplify boundary handling (walk from boundary - no need to reset walking)
- early exit when the vert has >2 boundaries
- use BM_vert_step_fan_loop to walk the fan
2015-05-03 04:46:24 +10:00
de031b7c89 BMesh: replace radial count with simple checks 2015-05-03 04:41:39 +10:00
c826566ce3 Sound now returns even if file fails to load
With various codecs its hard to ensure a sound will load or not.
2015-05-03 04:41:39 +10:00
8e4ac2d229 Fix ghash assert during BGE libload.
The assert message was caused by the multi call of BLO_library_append_begin in KX_BlenderSceneConverter::LinkBlendFile.
2015-05-02 18:43:39 +02:00
2c72edc7f1 Fix T44586: Viet language problem for Blender Interface
We were missing many of the complex diacritics combinations in latin extended additional code block...

Alawyas a pleasure to edit this font... :|
2015-05-02 17:02:08 +02:00
ca15ffb8ad CMake: use ld.gold linker when available
Gives noticeable speedup linking blender
2015-05-02 22:14:12 +10:00
929c9de3dc Turn bpy.utils into a package, so that we can easily add submodules to it. 2015-05-02 10:38:51 +02:00
53d08ec506 BMesh: BM_mesh_edgesplit
Did quite a few checks not to tag bad splits (which wasn't working perfectly)

Instead rely on BM_vert_separate not to create invalid geometry.
2015-05-02 16:24:46 +10:00
f283b959e7 BMesh: BM_vert_separate double edge fix
Splitting edges could give duplicates.
2015-05-02 16:24:35 +10:00
c276cfb3c0 BMesh: return error on mesh validate 2015-05-02 15:52:27 +10:00
a5869945c6 Cleanup: bmesh src/dst order in API args 2015-05-02 15:46:03 +10:00
5e1c729882 Cleanup: use function attrs for BMesh inline funcs 2015-05-02 15:45:57 +10:00
b50c6e3f6f Object Align Operator: Make it use modifiers in high quality bounding box calculation 2015-05-01 16:17:23 -06:00
bd6e1e6ad7 Updated install_deps' Collada to 3335ac164e68b2512a40914b14c74db260e6ff7d. 2015-05-01 21:18:37 +02:00
23abcc0636 OSX: remove collada from fading out 32bit buildbot 2015-05-01 21:09:21 +02:00
86f80c481c Fix T44353, Fix T43981: random particle distribution overlaps if number is greater than 256. 2015-05-01 19:21:41 +02:00
b6caefdaa9 Fix T43711: dual quaternion deform bug with shearing in deform matrix.
This also increases the tolerances in is_orthogonal / is_orthonormal functions,
which were much too low for practical purposes.
2015-05-01 19:21:41 +02:00
bf7098a93f Auto pack: don't show "No new files have been packed" on every .blend file save. 2015-05-01 19:20:42 +02:00
4e40bdd02c Fix T44433: print "unknown" rather than "1970-01-01" when .blend date is unknown. 2015-05-01 19:18:26 +02:00
d3c4553552 Fix a couple of harmless compiler warnings. 2015-05-01 19:18:26 +02:00
920aa5e7d2 Merge branch 'master' into gooseberry 2015-05-01 17:43:49 +02:00
74d31279cd Fix T44560: Merge Collapse tool - UVs operator panel option ignored with Collapse but not with other merge types.
Was missing parameter for collapse bmesh operator...
2015-05-01 17:10:39 +02:00
f84135ee65 Fix T44577: writing tessellated cddata when we should not...
Own mistake in rBf75c89b3f42ffac51603e6e53459f9d94a8782cc...
2015-05-01 16:11:55 +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
535e75ea90 Use mono font for metadata 2015-05-01 14:27:44 +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
28ea3f5b94 Fix T44565 World background artifacts when world shader is void (or
compilation fails).
2015-05-01 12:06:05 +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
94d80c8ca4 Left some debug prints in here... 2015-05-01 12:44:37 +12:00
be0dcd4e34 Fix T43867: Clicking outside the viewport exits now Grease Pencil "Continous Draw" mode
When working with a pen only, it was previously impossible to exit Grease Pencil
draw mode (when continous drawing was enabled). Now, clicking outside the drawing region
(e.g. in the timeline, properties editor, or the header/properties/toolshelf regions)
where you are drawing will exit this mode.

Some corner cases to be aware of:
* When Region Overlap is enabled, clicking on the overlapping panels still exits
  draw mode (even though you can see behind the buttons)
* In the Nodes Editor, clicking on a node (while in drawmode) will still draw a
  dot/stroke. But, you can still exit drawmode by clicking on any of the panels
  (properties/toolshelf/header) mentioned earlier
* To cope with cases where the operator is launched from the toolshelf, the
  code now sets a new "active region" when the first stroke is performed
  (based on what region is under the cursor at the time of that stroke),
  overwriting the setting that got stored when invoking the operator (i.e. the toolshelf).
  This change doesn't have any real user-visible effects, other than making it possible for
  this fix to actually work without breaking that use case.
2015-05-01 12:44:35 +12:00
f8bdd8e6a8 BMesh: correct bmesh_edge_vert_swap
Missed swapping out loops.
2015-05-01 06:51:16 +10:00
6111da3629 BMesh: add bmesh_disk_vert_replace 2015-05-01 06:18:04 +10:00
a822106062 Cleanup: typos 2015-05-01 05:53:33 +10:00
cdabf7e353 Data transfer - Loop Islands Hell Fixes.
This commit fixes several issues:
* island_store->items_to_islands_num was reset each time we added a new island, this is stupid! Harmless too, though, afaikt.
* partial verts bvhtree (with several islands) was hugely over-allocated...
* we would 'leak' in neighbor islands when geometry itself was contiguous.
* best_nor_dot was used incorrectly, leading to smaller weights for better matching normal!

All those fixes are related to T44522 (through personal communications with reporter).
2015-04-30 20:58:34 +02:00
4d6584ba6a UI: use enum for thumbnail size 2015-05-01 01:49:58 +10:00
3247955492 Graph editor uses own function for setting frame, use scrub flag there
as well.
2015-04-30 17:47:56 +02:00
5ced6cb2bc Correct warning 2015-05-01 01:36:36 +10:00
83e83c6de7 Bring back audio scrub after last commit 2015-04-30 17:27:14 +02:00
3a9726783f RNA defaults test
Alternative to T32894, simple test which creates new data and compares with RNA defaults.

Can be used to keep the values in sync without having to maintain a large set of defines.
2015-05-01 01:15:55 +10:00
Dalai Felinto
078e589263 Better fix for T44556: Crash on the World Properties > Preview 2015-04-30 12:12:22 -03:00
Dalai Felinto
179fff94e8 Revert "Fix T44556: Crash on the World Properties > Preview"
This reverts commit 4bcc7a2ec6.
2015-04-30 12:12:22 -03:00
69ef1a3a83 Py/RNA: support to load and remove sounds 2015-05-01 00:58:08 +10: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
5dd63a977f Fix opengl rendering always looking through camera
Actually check if we have a camera and looking through it before
rendering in multiview.
2015-04-30 15:06:28 +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
f271d85b86 Fix T44439: outliner's treestore could keep invalid ID pointers, could crash on undo due to invalid mem access.
We cannot nuke treestore in readfile's `blo_lib_link_screen_restore()`, because this will
destroy all UI-state data (like opened/closed items, etc.).

Since we cannot know for sure whether an ID pointer from tselem->id is valid here, we
have to ensure they are never invalid, i.e. to always set them to NULL when we delete them.

To do so, this commit uses a similar approach as what already exists for ID references
in WM notifiers - it extends `free_notifier_reference_cb()` to also nullify those IDs in
all outliners.

Note that some ID types are not used(shown) by outliner currently, so `TREESTORE_ID_TYPE` macro
was added, that checks whether an ID is possibly used by outliner. Avoids a few searches
in whole tree whene deleting some IDs.

Reviewers: campbellbarton, sergey

Maniphest Tasks: T44439

Differential Revision: https://developer.blender.org/D1272
2015-04-30 14:28:22 +02:00
d1c98520f7 Missed this last commit 2015-04-30 14:24:05 +02:00
2d491b8415 Minor tweaks to make fill and invert support gpixel operations 2015-04-30 13:52:44 +02:00
04b23af02d Code Cleanup: Simplified insert_keyframe_button and delete_keyframe_button
As a followup for the previous commit, do the same thing for the insert/delete
keyframe button operators as is done for the clear keyframes op. There really isn't
much need/reason for conducting the looping there, as those functions natively
handle this themselves already.
2015-04-30 22:59:41 +12:00
7369c4f4d5 Code Cleanup: Simplify Clear Keyframes operator's code
On second thought, the previous commit was just adding additional complexity which
wasn't needed, as the operator was wasting effort by doing this looping itself.
2015-04-30 22:59:40 +12:00
debcd6b217 Fix T44558 - "Clear Keyframes" complains when operating on an array property and it had deleted the action in the process 2015-04-30 22:59:39 +12:00
16794f908f Cycles: Fix possible uninitialized XML read state which might cause crashes 2015-04-30 15:46:09 +05: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
2909975385 Fix T44541 aka gigapixel image render support in blender.
Moral of the story: Make sure that size_t is used whenever pointer
arithmetic is involved. For images, that basically means whenever any
squared dimensions are involved. Casting an operand to size_t early in
the operation is usually sufficient to force the entire operation to
size_t.

There might still be places lurking where we don't support this
correctly. This has been tested with render pipeline, quite a few image
functions (meaning we can paint on such images now, albeit somewhat
slowly ;) ) and export to jpeg. Too many places in code to check so I
guess we'll be handling cases as they come.

Don't try this at home unless you have an immense ammount of RAM.
First GPixel render of suzanne in the multiverse can be found here:

http://download.blender.org/demo/test/suzanne-billion-pixel.jpg

Can be viewed from blender (takes about 3.3 GB after loading but may
take more during loading so 8GB might be more safe to try this).
2015-04-30 12:11:20 +02:00
4bcc7a2ec6 Fix T44556: Crash on the World Properties > Preview
Issue was caused by de-referencing NULL pointer, rres did not have any
views because nothing was rendered yet.

Needs more closer look about where else such a de-reference could happen.
2015-04-30 14:52:59 +05:00
41d817f15d Fix T44548: Cycles Tube Mapping off / not compatible with BI
Was a typo in original implementation, probably a result of some code reshuffle
happened for optimization reasons.
2015-04-30 14:27:16 +05:00
aa4c97faa3 View3D: expose size as a distance in units
also note that size/rotation doesn't work for camera views. see T44511
2015-04-30 18:59:35 +10:00
1721d47106 CMake: Solve compilation error from path with a space 2015-04-30 12:55:52 +05:00
f553aba69f Correct docstring 2015-04-30 09:55:54 +10:00
0ecce09288 Correct missing break 2015-04-30 08:18:32 +10:00
b640700597 Cleanup: style 2015-04-30 08:18:23 +10:00
4eab0e72b3 Cleanup: Update some comments and add ToDo. 2015-04-29 23:56:46 +02:00
b3def11f5b Cycles: Record all possible volume intersections for SSS and camera checks
This replaces sequential ray moving followed with scene intersection with
single BVH traversal, which gives us all possible intersections.

Only implemented for CPU, due to qsort and a bigger memory usage on GPU
which we rather avoid. GPU still uses the regular bvh volume intersection code, while CPU now uses the new code.

This improves render performance for scenes with:
a) Camera inside volume mesh
b) SSS mesh intersecting a volume mesh/domain

In simple volume files (not much geometry) performance is roughly the same
(slightly faster). In files with a lot of geometry, the performance
increase is larger. bmps.blend with a volume shader and camera inside the
mesh, it renders ~10% faster here.

Patch by Sergey and myself.

Differential Revision: https://developer.blender.org/D1264
2015-04-29 23:31:06 +02:00
e9dcb068c7 Fix T44484: Edge-split corrupts mesh
Splitting non-manifold edges could produce duplicate edges.
2015-04-30 07:22:18 +10:00
99811c283e BMesh: use BM_face_loop_separate_multi for rip
Resolves bug over-splitting non-manifold connected edges.
2015-04-30 06:24:33 +10:00
3ef27ec807 BMesh: add BM_face_loop_separate_multi
New utility function to handle splitting off multiple loops from a face at once.
2015-04-30 06:24:33 +10:00
53662bcaf1 BMesh: simplify/optimize loop splitting logic
To split off a single loop, was splitting all fans off the vertex, then merging back together (except for one).

Now simply splits off one loop.
2015-04-30 06:24:33 +10:00
26541b7488 BMesh: refactor edge-vert swapping into API call 2015-04-30 06:24:32 +10:00
67fcb04bbf BMesh: minor change to swap-vert api
- assert if the verts not in the edge (all callers assume success)
- rename to bmesh_disk_vert_swap
- swap src/dst arg order.
2015-04-30 06:24:32 +10:00
7aab5c6ca9 Cycles: Fix wrong termination criteria in SSS volume stack update
Another issue spotted with Thomas.
2015-04-30 01:20:17 +05:00
e5f3193df3 Cycles: Fix wrong order in object flags calculations
Object flags are depending on bounding box which is only available after
mesh synchronization.

This was broken since 7fd4c44 which happened quite close to the release
and oddly enough was not sopped by anyone. Render test is coming for this.

Was spotted by Thomas Dinges while working on another patch.
2015-04-30 01:09:48 +05:00
a8cdd9dda7 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-04-29 21:41:02 +02:00
Dalai Felinto
3856d439db Fix filename has "new render view" suffix reported by Jason van Gumster (Fweeb)
Bug introduced in f8540d7fd5
2015-04-29 16:39:35 -03:00
054aa61f3c File browser - change thumbnails size with a slider
We can now scale from 32px up to 256px (default has been upgraded to 128px).
Thumbnails are now generated as 'large', i.e. 256px.

Previews are scaled up if necessary, unlike icons (for folders or files without preview images).

Note that .blend thumbnails themselves remain in 128px for now (they are embeded in .blend files,
not quite sure we want to make them four times bigger...).

Patch by DMS (Yaron Dames), with final edits by myself.

Reviewers: mont29

Subscribers: Severin, mont29

Differential Revision: https://developer.blender.org/D1260
2015-04-29 21:30:33 +02:00
3de45ee7fe Fix T44132: Crash after open EXR format
Was own mistake on adding Alpha socket for Combined pass.
2015-04-29 23:45:41 +05:00
ce32aae80c OSX: fix T44533, system_bookmarks not showing utf standard ( umlauts etc. ) 2015-04-29 20:07:53 +02:00
3878180a6f Fix typo using interp_v3_v3v3 over float[2] variables...
Found by asan! ;)
2015-04-29 19:44:06 +02:00
20c4b0d4a2 Merge branch 'master' into gooseberry 2015-04-29 18:50:19 +02:00
5782126d41 Make sure integer calculation uses large precision 2015-04-29 18:49:50 +02:00
d04ba6d562 Remove unused stubs
Noticed by TristanPorteries in IRC.
2015-04-29 21:47:30 +05:00
0dbc9060a6 Cleanup: make grumpy asan happy and do not use new [] to allocate data freed by free().
Probably nothing crucial, but asan build would crash on that stupid glitch... Annoying.
2015-04-29 17:46:03 +02:00
091832c955 fix for double call to update callback in uiTemplateIconView 2015-04-29 16:29:03 +01:00
611bbc696a cleanup for uiTemplateIconView 2015-04-29 16:29:03 +01:00
78956b6a83 Fix T44542: 'extend selection' editmode tool would select hidden elements. 2015-04-29 17:19:20 +02:00
Dalai Felinto
3e6a66b9de Multi-View cleanup: using RenderResult->rect* only for temporary RenderResults
Originally I wanted to get rid of RenderResult->rect* entirely, but it's
convenient to have for temporary structs.

This patch makes sure they are used only when really needed, which
should help clearing the code out.

(they are needed when using RE_AcquireResultImage() - which produces a
RenderResult with no RenderView)

Reviewers: sergey

Differential Revision: https://developer.blender.org/D1270
2015-04-29 11:55:53 -03: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
18ba32df37 Don't check against scene notifier twice 2015-04-29 16:28:20 +02:00
303e9b4032 Fix really stupid own mistake that caused leakage of timers. 2015-04-29 16:21:21 +02:00
Dalai Felinto
b033736eb7 Multi-View: new util functions RE_RenderViewGetById() and RE_RenderViewGetByName()
Both functions try to find a valid RenderView and if they can't they
fallback to the first RenderView of the RenderResult
2015-04-29 11:18:22 -03:00
3acc1ba49c Add macro BLI_SMALLSTACK_AS_TABLE
Use for edge-split (a little less overhead compare to popping each item).
2015-04-29 23:59:48 +10: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
d6b28bbb1d Cycles: Fix crashes when loading cache created with pre-leaf split builds 2015-04-29 15:48:49 +05:00
b6aaa73953 Merge branch 'master' into gooseberry 2015-04-29 12:38:26 +02:00
2e91bcfb9d Fix T44544: Cached BVH is broken since BVH leaf split
Still need to solve issues with reading old cache with new builds.
2015-04-29 15:38:07 +05:00
734fb30bda Use size_t to calculate size of tiles for rendering 2015-04-29 12:31:03 +02:00
7232157357 Correct comment 2015-04-29 20:16:40 +10:00
620cc762db Buildbot: Attempt to fix cudakernels target screwing up autotest cache 2015-04-29 14:51:50 +05:00
90b3832c4d Merge branch 'alembic' into gooseberry
Conflicts:
	intern/cycles/blender/blender_sync.h
2015-04-29 14:48:37 +05:00
65a9592660 BMesh: optimize edge split
Avoid hashing edges when splitting into fans,
Instead, walk & split fans until they're all done, gives approx 40% speedup.
2015-04-29 19:43:32 +10:00
179ffefce5 BMesh: replace smallhash flag for checking doubles 2015-04-29 19:43:21 +10:00
e1ecd39f0e BMesh: avoid over-counting vert-edges 2015-04-29 19:42:06 +10:00
728d4f296f Cleanup: headers 2015-04-29 19:42:00 +10: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
615414fa36 SCons: Ignore .svn folder when installing site-packages 2015-04-29 14:30:37 +05:00
e37373d96e Revert commit with perspective depth offset, makes simple cases such as
loopcuts on cube have zfighting.
2015-04-29 11:19:23 +02: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
029bd44bbd SCons: Fix wrong flags usage after recent stdc89 changes
CCFLAGS are used for both C and C++ compilers and one is better not to pass
C-related flags to C++ compiler. C-compiler flags are to be passed via CFLAGS
variable.
2015-04-29 13:57:02 +05:00
f4d7f5216f Buildbot: Fix typo in error message 2015-04-29 13:47:47 +05:00
Dalai Felinto
f8540d7fd5 RenderResult should have a valid view whenever possible 2015-04-28 18:08:56 -03:00
f9d23b82fe Rewind fix for T44505 (leave in ifdef'd)
This makes selection fail in simple cases,
default cube subdiv 10x for eg.
2015-04-29 06:08:45 +10:00
cbb601346a Error in last commit 2015-04-29 05:36:39 +10:00
e0ae693924 Store bit-depth for reuse, replace loop with shift 2015-04-29 05:32:25 +10:00
d2ac3abbc2 Compilation error fixes for strict compiler flags 2015-04-29 00:23:52 +05:00
859ac8fbc6 Fix ortho part of T44505
In this case we can calculate an offset without worrying about
perspective correction. Unfortunately if looking from a camera we still
have depth issues here. There's no really general case that can fix this
so I'm leaving this as is.
2015-04-28 20:41:49 +02: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
85ae4b87af Fix T44404: freestyle crashes blender.
The reported crash case seems to be caused by freeing compiled Python
objects in a thread.  Now this issue is avoided by allocating a buffer to
store a Python script and using BPY_string_exec() to run the script.  This
makes it unnecessary to repeatedly create and destroy Text data blocks.

Many thanks to Campbell Barton for his help on the bug fix.
2015-04-29 00:57:56 +09:00
7851534541 disable ARRAY_SIZE fixed length check for Clang 2015-04-29 01:37:45 +10:00
7615498e6d Alleviate somewhat the issue of T44505
Issue is zfighting with wire of mesh when parts of the mesh are close
together. We can make this slightly better by reducing the offset,
however this offset is calculated pre-perspective division and can vary
greatly with distance. Correct approach would be using polygon offset,
however we draw mesh wireframes as lines, (not polygons with polygon
mode line) so this approach will not work.
Alternatively, we could set an offset in a shader, however we don't have
code for that either.
2015-04-28 17:18:32 +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
be228d33f1 Curves: don't use 'charidx' for regular curves
Code attempted to sync them with materials,
but its not needed (and wasn't reliable).
2015-04-29 00:29:32 +10:00
34abe82205 Fix T44522: loop remapping between meshes when using 'nearest vert, best matching normal' modes
would fail on coplanar faces (or smooth verts).

Loop remapping is really a tricky topic... For now, we enhance a bit more
our Frankenfunc by using distance between dest and source polygons as
fallback in case we have too much similar normals...

Probably not a perfect solution, but should be robust enough I hope.

One core question remains open though: do we want to stick to 'use only seams
to detect UV islands'? This makes things much simpler, but will obviously fail
in case of actual islands without matching seams. :/
2015-04-28 16:01:43 +02:00
57a107c7bc Minor cleanup in comments. 2015-04-28 16:01:43 +02:00
f8c383472a Fix T44516 grid lines obscuring selection outline.
Was changed to draw after meshes without depth mask to make grid not
contribute to compositing effects. Now only draw it like this when we do
compositing (unfortunately can't have both).
2015-04-28 15:42:01 +02:00
e2d60d180e Project Paint: Add symmetry support
- Access from symmetry panel (as with sculpt)
- Supports multiple axis at once.
- Supports all brush types including clone.
2015-04-28 23:34:40 +10:00
43616918f3 Cleanup: const correctness 2015-04-28 23:15:48 +10:00
1f9fe0626f BLI_utildefines: add MEMSET_STRUCT_OFS macro 2015-04-28 23:15:47 +10: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
5e423775da Cleanup: Move Cycles volume stack update for subsurface into kernel_volume.h. 2015-04-28 11:20:27 +02:00
d920b8e075 Fix T44530 UV islands fail on subsurf after mirror modifier.
Caused by own commit that changed island detection code. In the case of
modifiers we don't want to take winding information into account, but
left the code since there are use cases (like painting) which could use
this.
2015-04-28 11:18:02 +02:00
eee666583f Use gnu89 for GCC
GCC5 defaults to gnu11, which we may switch to later
but disable for now to prevent accidental use.
2015-04-28 18:59:52 +10:00
2edb342ffa Fix for Clang type check 2015-04-28 18:59:47 +10:00
5c6ec169cc Added missing update tag to recalculate data after permutating materials 2015-04-28 10:52:19 +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
7e36c280c2 Cleanup: redundant checks 2015-04-28 16:47:45 +10:00
4288ab16e5 Add material slot reorder buttons 2015-04-28 07:30:04 +10:00
58a2b10a65 Cycles: Initialize portal variable directly, so we can avoid the one NULL check. 2015-04-27 23:12:53 +02:00
a4965249ec Math Lib: add range_vn_u 2015-04-28 06:54:50 +10:00
f478c2cfbd Cycles: Added support for light portals
This patch adds support for light portals: objects that help sampling the
environment light, therefore improving convergence. Using them tor other
lights in a unidirectional pathtracer is virtually useless.

The sampling is done with the area-preserving code already used for area lamps.
MIS is used both for combination of different portals and for combining portal-
and envmap-sampling.

The direction of portals is considered, they aren't used if the sampling point
is behind them.

Reviewers: sergey, dingto, #cycles

Reviewed By: dingto, #cycles

Subscribers: Lapineige, nutel, jtheninja, dsisco11, januz, vitorbalbio, candreacchio, TARDISMaker, lichtwerk, ace_dragon, marcog, mib2berlin, Tunge, lopataasdf, lordodin, sergey, dingto

Differential Revision: https://developer.blender.org/D1133
2015-04-28 01:30:16 +05:00
84836e8952 Cleanup: use strict flags 2015-04-28 06:24:06 +10:00
ae7d84dbc1 Cycles: Use native saturate function for CUDA
This more a workaround for CUDA optimizer which can't optimize clamp(x, 0, 1)
into a single instruction and uses 4 instructions instead.

Original patch by @lockal with own modification:

  Don't make changes outside of the kernel. They don't make any difference
  anyway and term saturate() has a bit different meaning outside of kernel.

This gives around 2% of speedup in Barcelona file, but in more complex shader
setups with lots of math nodes with clamping speedup could be much nicer.

Subscribers: dingto

Projects: #cycles

Differential Revision: https://developer.blender.org/D1224
2015-04-28 00:38:32 +05:00
278ff15c7f BLI_array: add permute utility function 2015-04-28 04:12:48 +10:00
6ada7a1a0b Usual UI messages fixes... 2015-04-27 20:10:32 +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
920fa0f963 Fix double-free on copied Text compiled py-code 2015-04-28 01:18:50 +10:00
84db9fdf4d Fix T44464: Viewport mipmaps no longer toggle off 2015-04-28 01:18:50 +10:00
8d8d1939fa Cleanup: use bool for mipmap args 2015-04-28 01:18:50 +10:00
c760c0dbb3 Cleanup: use mul_v3_mat3_m4v3 2015-04-28 01:18:50 +10:00
Dalai Felinto
4a80c4fade Multi-View: Code cleanup
I finally put the time into understanding what was going on here.
Basically RE_AcquireResultImage() produces RenderResults without
RenderViews. That will be fine for now since I'm planning to refactor
RenderResult soon.
2015-04-27 12:10:35 -03:00
Dalai Felinto
f809eef968 Muti-View: viewport crashes when empty is active camera - reported over IRC by Campbell Barton 2015-04-27 10:41:40 -03:00
Dalai Felinto
b315fcb7ed Fix T44514 Crash under cycles rendering using F12, based on patch from Gaia Clary 2015-04-27 10:41:40 -03: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
e1ed47eb5b Fix T44512: Cycles fails normal bake /w scale flip 2015-04-27 22:46:15 +10:00
9dadc8f599 Math Lib: add mul_v3_mat3_m4v3 2015-04-27 21:52:42 +10: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
3f80accfb3 Fix T44011: Ruler/Knife/Loop-cut fail in quad-view
This is a kind of sloppy-focus,
resolving long standing bug with loop-cut/knife/ruler /w quad-view.

Where activating a tool would lock onto one of quad-views,
especially problematic when activating from the toolbar or menus.
2015-04-27 19:17:07 +10:00
5df939fd15 Py API: expose operator runtime flags
eg from operator invoke/execute:
    self.options.is_grab_cursor
2015-04-27 19:00:10 +10:00
5e1eb8cdcf Cleanup: rename GRAB_POINTER -> GRAB_CURSOR
Term pointer is overloaded already.
2015-04-27 18:58:53 +10:00
ddb5f96295 Sculpt: symmetrize was leaving edge-tags dirty
This is used for the edge-queue
2015-04-27 03:35:16 +10:00
24448e11fb Correct own error in recent sculpt changes
mixed up squared nonsquared length, also remove invalid verify check.
2015-04-27 03:34:13 +10:00
Julian Eisel
cf366c8b66 UI: 'View Online Manual' Shortcut
D1031, implement proposal T37478 to give easy access to the online manual.

Use Alt+F1 while hovering over a button/setting.
2015-04-27 01:35:24 +10:00
5efbd2a407 BGE : addObject in python without reference object.
Making the reference argument optional for the addObject function.
```
scene.addObject("Cube")
```

This allows to keep the rotation, scale and position of the original object.
To avoid layer problems with lights if the reference arguments is None, the new object have the same layer than the active layers in scene.

Reviewers: lordloki, moguri, hg1, sybren

Reviewed By: hg1, sybren

Subscribers: agoose77

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1222
2015-04-26 16:29:58 +02:00
3524676036 BMesh: increase subdiv smooth strength
Now 1.0 gives near spherical output
2015-04-26 21:26:45 +10:00
2069187a1b Cleanup: bmesh subdivide
var names were a bit cryptic, set return arg last.
2015-04-26 20:34:03 +10:00
2374cb380b BMesh: subdiv smooth, use simpler even calculation
Was checking all vertices adjacent faces,
now just compare the difference between normal angles.

Also default to inverse-square for loopcut-subdiv falloff.
2015-04-26 19:20:34 +10:00
e1ca127419 Cleanup: subdivide smooth vertex placement 2015-04-26 19:12:20 +10:00
6e02f1da74 BMesh: use inverse-square falloff /w smooth-subdiv
Resolves ugly artifacts with multi-cut.
2015-04-26 18:35:42 +10:00
c2f7cffd56 Add inverse-square falloff to bmesh, mask & compo. 2015-04-26 18:31:54 +10:00
d33314393e BMesh: use const for API calls 2015-04-26 17:19:51 +10:00
12e7c7f674 BMesh: BM_ELEM_CD_GET_VOID_P cast removed const 2015-04-26 17:19:51 +10:00
3917e9f1f2 Macro GENERIC_TYPE_ANY map many types to one value 2015-04-26 17:19:51 +10:00
bc160d8a85 Cleanup: Code style. 2015-04-26 00:42:26 +02:00
8dd055cd47 Cleanup: Update Lookup table comments. 2015-04-26 00:06:38 +02:00
60c5a2f2d2 Cycles: Add Mirror ball mapping to camera panorama options
The projection code was already in place, so this just exposes the option.

Differential Revision: https://developer.blender.org/D1079
2015-04-25 23:51:56 +02:00
Julian Eisel
e4b1b17925 Merge branch 'master' into gooseberry 2015-04-25 14:07:18 +02:00
01dda9a434 correct own error in recent ngon creation edit 2015-04-25 21:16:58 +10:00
9eb191083a Fix neg-scaled project-paint in perspective mode 2015-04-25 20:47:19 +10:00
89f5a09ab4 Cleanup: use 8 space indent for multi-line args 2015-04-25 20:15:20 +10:00
757b5249d4 Alembic: Solve compilation error with strict compiler flags 2015-04-25 14:12:33 +05:00
a7381cca34 BMesh: simplify BM_face_create_ngon
Was doing quite a lot of unnecessary steps.
Now construct the sorted verts, edges /w error checking, in a single loop.
2015-04-25 17:26:22 +10:00
Julian Eisel
a4203814d1 UI: Panel drag-collapse
D1233, Adds a way to quickly open/close multiple panels by holding LMB and dragging over the desired panels,
Suggested by @maxon

The decision if the panels are opened or closed is made based on the first Panel the user drags over.
If it is closed, all panels he drags over are opened
(including the first one) if it's opened, they get closed (matching existing drag-toggle logic).
2015-04-25 13:11:32 +10:00
0221a11c95 Project Paint: save 8 bytes per pixel (re-align) 2015-04-25 12:54:55 +10:00
86d3a1f683 Cleanup 2015-04-25 12:29:52 +10:00
Julian Eisel
3bffcc675b Fix T42495: Fullscreen area icon glitch
Tried a couple of things to trigger an update/redraw for the exact right
moment (sending azone update event, timer, delayed redraw, etc) but this
seems to work rock solid without being *that* ugly.
2015-04-25 01:29:53 +02:00
Julian Eisel
de8e89d4f5 Fix T44405: Importing keyconfig with changed shortcut in "Screen Global"
causes rapid fullscreen toggeling
2015-04-24 20:08:52 +02:00
Dalai Felinto
7e66f0e9d4 Multi-View: Set Stereo 3D operator support for EXEC calls 2015-04-24 13:07:33 -03:00
Dalai Felinto
27ac96dbae Multi-View: rolls back to a non quadbuffer friendly window if displaymode changes from pageflip to something else
In some cases the graphic card supports quadbuffer, but not the display.
In this case it is nice to go back to a window that does not have
quadbuffer if you change back to anaglyph, interlace, ...

Otherwise you may be stuck with a flickering window
2015-04-24 13:06:49 -03: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
Dalai Felinto
fb17a3fb76 Multi-View: Time Sequencial (aka pageflip, aka quadbuffer) stereo support
TODO: I would be nicer if we could set win at file opening to the
current open window, but I'll implement this later.
2015-04-24 12:00:16 -03: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
324751259e correcting typos in python api docs 2015-04-24 14:08:31 +01: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
80d75cb3e4 Add debug option --debug-gpumem to show GPU memory used in status bar.
Only used in ATIs and NVIDIAs. Used extensions are:

https://www.opengl.org/registry/specs/ATI/meminfo.txt
http://developer.download.nvidia.com/opengl/specs/

If you read the documentation, the numbers are not supposed to be exact
and also depend on the time when the call is made. The numbers can also
change quite quickly. It's only meant to give a rough measure of what is
going on.
2015-04-24 14:11:21 +02:00
c2f861453e Fix T44492: knife tool should cut across a split edge.
Added filter condition in visibility check that prevented
a "butting-up-against" face from obscuring an edge.
2015-04-24 07:29:45 -04:00
546031b694 BGE : fix bugs with physics collision mask/group
Currently there are bugs with physics objects in inactive layers,
character and softbody.
I added a function in CcdPhysicsEnvironement to know if a physics
controller is currently active and for soft body I added the correct function in UpdateCcdPhysicsController to re-add a softbody in the dynamics world.

The bug was introduced in D1243 commit 3d55859

Reviewers: hg1, scorpion81, lordloki, moguri, agoose77, sergof

Reviewed By: sergof

Subscribers: youle, moguri

Differential Revision: https://developer.blender.org/D1253
2015-04-24 11:57:38 +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
c884ac28a7 3D Textures:
If we fail allocating a proxy texture don't fail, instead create a
smaller nearest filtered image to display in its place.

This can make viewing slow (it's an extra O^3 operation), but this will
probably help us render the tornado in 3D viewport in gooseberry and
still actually see something - despite the rendering taking longer.
I've added a debug print so we can know when this happens.
2015-04-24 11:35:57 +02:00
9576d03f50 CMake: add -Wformat-signedness 2015-04-24 19:11:02 +10: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
bdf6393c98 Math Lib: pow_i for int power-of 2015-04-24 11:37:48 +10:00
f829f556b4 Fix project painting on a negative scaled object 2015-04-24 11:04:27 +10:00
Dalai Felinto
efe41ae7fd Multiview: Quadbuffer (time sequential) working [debug builds only]
I'll enable this mode in Release builds once I figure out how to best
handle opening files that are saved with the quadbuffer mode.

In fact I think no display mode should be saved/read from a file.

Tested in Linux with NVidia 3D Vision and NVidia 3D Vision Pro with
NVidia Quadro FX 580 and Quadro FX 4600.

(kudos for the Visgraf Lab at IMPA, for having me around with all those
gadgets ;)

Thanks for Cédric Paille (cedricp) for the code snippets and tests -
T44327
2015-04-23 19:50:52 -03:00
0217e6517f Cleanup: minor edits 2015-04-24 07:32:43 +10:00
Dalai Felinto
1076adb458 OpenEXR: RenderResult should always have a RenderView 2015-04-23 18:16:55 -03:00
dc734da46e Cleanup: casts, correct debug ifdefs 2015-04-24 07:08:07 +10:00
97b1f22bc3 Project Paint: minor optimization comparing angles 2015-04-24 06:41:39 +10:00
f75c89b3f4 Fix T44461: Crash and file corruption after calc_normals_split, calc_tessface execution.
This one was nasty, issue comes with temp/nofree CD layers that get 'removed on the fly'
from saved mesh CDData. Since mesh struct itself was written before that cleanup, it would
still have the old, invalid number of layers. That would lead to a buffer overflow when
loading data later (odd you had to do this twice (i.e. have 2 'ghost' layers) to get the crash).

New code prevents that by always making a copy of the mesh (we were already doing that mostly
anyway, since we were saving without tessfaces), copying (by ref of course) in it cddata,
and then writing mesh struct. Makes code a bit more verbose, but... it works!
2015-04-23 20:53:12 +02:00
18ee593729 Expose CD_PAINT_MASK to Python API
D782 by Stanislav Blinov
2015-04-24 04:10:51 +10:00
d2f35d6d50 3D textures: detect if we are pushing OpenGL too hard with the texture
size.
2015-04-23 19:02:37 +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
61ac5dd5ba Correct missing NULL check (own mistake) 2015-04-24 02:38:15 +10:00
372752c739 Math Lib: add count_bits_i utility function 2015-04-24 01:37:12 +10:00
27e03dcd21 Fix T44422: Zoom to mouse fails in camera view
Camera now supports all zoom styles too.
2015-04-24 00:18:42 +10: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
Dalai Felinto
22b564f93e Fix T44498 - Blender crashes in some files after render slots fix
This is a temporary fix until I get to investigate it more carefully.
It will help if the report could include the steps to reproduce it
besides the buggy file.

Note: RenderResult should *always* have at least a valid RenderView,
which is not what happens here.
2015-04-23 11:01:56 -03: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
bcac112dde Fix T44494 crop node changes values during execution.
We used the node data as a store for node execution,
bad idea, since the data itself is a template from which
execution data should be derived, never to be modified during execution.
2015-04-23 14:23:42 +02: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
Julian Eisel
2dfbf31a41 Display slot menu in Properties Region even if render slot is empty
For the records, this one is caused by 31f984bc3f, it wasn't
implemented at all ;)
2015-04-23 13:33:29 +02:00
Julian Eisel
85e455b245 Fix slot menu not displayed if render result slot is empty
Caused by own mistake in 31f984bc3f, reported by @sebastian_k in
IRC
2015-04-23 13:21:36 +02: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
8010672bbc BMesh: mesh-data picking, edge+vert improvement
When zoomed out vert bias over edges meant it wasn't possible to select edges.
Now pick the edge if the cursor is closer to its center.
2015-04-23 16:11:54 +10:00
87b3e62b3d Cleanup: warnings 2015-04-23 16:09:30 +10:00
0287b39468 Py API: Remove deprecated callback_add 2015-04-23 12:58:49 +10:00
Dalai Felinto
ecb3362a24 Fix T44396 - Compositing render slots don't work
Note 1: If you go to a render slot previously rendered and change
something in the compositing the buffer will still vanish.

This is an old bug, T44181, and not addressed here
(I'm basically just fixing the regression introduced with multiview)

Note 2: I have a work in progress patch to get rid of
RenderResult->rectf/rect32/rectz entirely. It still not working, and we
should have a working code base before doing refactoring anyways.
2015-04-22 18:48:31 -03:00
6a1c123df4 Fix broken uiTemplateIconView().
Was using enum **value** as **icon id**... tripple sigh!
Guess it was working for its only current use (matcaps), but still.
2015-04-22 22:48:40 +02:00
Julian Eisel
90b7652334 Fix T44472: Stereo 3D save options missing in File Browser 2015-04-22 21:50:49 +02:00
Dalai Felinto
4a8421faa4 Fix T44463 - crash on "Full Sample" 2015-04-22 16:40:21 -03:00
Julian Eisel
31f984bc3f Show buttons to change render layer/pass in UV Editor header
Previousely this was "hidden" in the Properties Region, this makes it
more visible/usable.

Requested by @sebastian_k
2015-04-22 20:43:43 +02:00
147d0cdf98 Tracking: Show plane track outline if image failed to load 2015-04-22 23:20:00 +05:00
f35489fa94 Tracking: Fix missing pointer array check when reading plane track
This could cause memory corruption when moving files from system with one
bitness to another.
2015-04-22 23:00:41 +05: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
3174cbe8f2 Double click selection on animation channels selects all keyframes of the range 2015-04-22 19:28:07 +02:00
3da7226844 Freestyle: Fixed a crash due to missing call of StrokeShader.__init__() in Python.
Many thanks to the problem report by flokkievids (Folkert de Vries)
through a comment in Patch D963.
2015-04-23 01:12:55 +09:00
Julian Eisel
798facbff3 Fix crashes when moving game property with invalid index (from py/redo
panel)

Also hides index option in redo panel to be consistent with similar
operators
2015-04-22 17:20:10 +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
d354eeab74 Placeholder image strips feedback session changes no.2:
Change paths operator can also have the same placeholder logic now
2015-04-22 14:11:51 +02:00
e7c2d244c3 Placeholder image strips feedback session changes no.1:
Autodetect range of strips.
2015-04-22 14:11:51 +02:00
62d10cd833 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-22 14:11:51 +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
Julian Eisel
dc36e1fe39 Fix T44476: Hiding Grease Pencil from Outliner RMB doesn't update 3D
View
2015-04-22 14:02:48 +02:00
Julian Eisel
18aaae101a Fix T44477: Overlapping tooltips in Outliner
Tooltips for buttons in the Outliner could overlap the Outliner's RMB
menu in some cases (and there's no way to get rid of the tooltip again).
This disables the button's tooltip before creating the menu (as we do it
for the normal RMB menu)
2015-04-22 13:41:43 +02:00
1044dfd965 Fix and simplify vertical positioning and calculation of metadata
display more.
2015-04-22 13:19:58 +02: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
a069b8d5d8 Rename stamp panel to metadata panel.
Rationale - this panel also enables metadata that get written on files.

Also moved draw_stamp property in the panel - to make it clearer it only
controls the drawing, not individual metadata.
2015-04-22 12:35:59 +02: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
818a0cdc76 Fix stamp missing after multiview merge.
Was not using acquired render result correctly, most likely a copy paste
error.
2015-04-22 12:03:06 +02:00
97587dc5d6 Stamp cannot be written to file.
Make sure stamp data is avaliable before writing stamp to image - this
still does not fix stamp, looks like issue is availability of the images
themselves for the view, investigating next.
2015-04-22 11:50:57 +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
414990b0f1 Tracking: Some more code de-duplication 2015-04-22 12:46:29 +05:00
18a47b67fd Tracking: Code cleanup, de-duplicate some code in tracking context finish 2015-04-22 12:34:01 +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
e6ceecdf97 Cleanup: pep8, spelling 2015-04-22 16:26:54 +10:00
4da050674e Fix T44470: File Selection sometimes surpresses last Character.
Tweak hack of `file_draw_string()` (there may be better solution, but not worth
spending time on this, the whole filebrowser drawing code is to be rewritten anyway).
2015-04-22 08:15:05 +02:00
e1a53b6d52 Fix T44475: Merge option of Mirror Modifier behavior reversed.
Glitch in rB57d9badc.
2015-04-22 07:54:14 +02:00
a8adeeb6fb Logic Editor: Buttons for moving game properties up/down
D1163 by @panzergame, with minor edits by me (@Severin)
2015-04-21 23:33:45 +02:00
b35743d39f Tracking: Add missing plane track remapping when joining two point tracks 2015-04-22 02:10:50 +05:00
260f75a2ca Tracking: Cleanup, move some plane tracks code to utility functions 2015-04-22 02:10:50 +05:00
Dalai Felinto
9425a8ff38 BGE: scene.pre_draw_setup[] callback
This callback allows the user to change the camera data right before the
rendering calculations.

scene.pre_draw[] is not enough here, because if you want to change the
camera matrices (projection/modelview) the culling test is done before
that (after pre_draw_setup[] though).

Reviewers: moguri, campbellbarton

Differential Revision: https://developer.blender.org/D1251

Python sample code using this. The sample scene would need a default
camera (not used for rendering), a dummy camera ('Camera.VR'), and two
cameras ('Camera.Left', 'Camera.Right') that will be used for the actual
rendering.

```
import bge

def callback():
    scene = bge.logic.getCurrentScene()
    objects = scene.objects

    vr_camera = objects.get('Camera.VR')

    if bge.render.getStereoEye() ==  bge.render.LEFT_EYE:
        camera = objects.get('Camera.Left')
    else:
        camera = objects.get('Camera.Right')

    vr_camera.worldOrientation = camera.worldOrientation
    vr_camera.worldPosition =  camera.worldPosition

def init():
    scene = bge.logic.getCurrentScene()
    main_camera = scene.active_camera
    main_camera.useViewport = True

   scene.pre_draw_setup.append(callback)

    objects = scene.objects
    vr_camera = objects.get('Camera.VR')
    vr_camera.useViewport = True
    vr_camera.setViewport(
            0,
            0,
            bge.render.getWindowWidth(),
            bge.render.getWindowHeight() )
```
2015-04-21 17:41:23 -03:00
f2956d5fc7 Tracking: Fix over-allocation in plane track's point tracks pointers when removing point track 2015-04-22 01:36:15 +05:00
Julian Eisel
6885d316b1 Fix T44474: Rotation manipulator not hidden completely with all axes
locked

Really doesn't look like a bug on a first glance but the line of code
that was there previously seemed to be there to prevent the manipulator
from drawing in this case.
2015-04-21 21:55:19 +02:00
bf69453ae7 BLI_string: add BLI_snprintf_rlen
use when the length of the destination string is needed.
2015-04-22 05:37:22 +10:00
c9f9e29538 Math Lib: handling bits handling into own file 2015-04-22 04:44:24 +10:00
b47892e9f5 Minor edits to metadata commit
No need to calculate height of each line, just use height of font.
2015-04-22 04:43:13 +10:00
e1ce83f762 Initialize and use the theme for metadata text 2015-04-21 19:01:09 +02:00
58c511fb01 Stamp refactoring:
Write those on render result during rendering, so we can cleanly write a
render result image after rendering.
2015-04-21 18:37:06 +02:00
3091ea49fe Metadata:
* Theme support for metadata display
* Increase text DPI with scaling.
2015-04-21 18:37:06 +02:00
50bfc4bfa0 Metadata display support - patch by Julian and me.
Basically, blender adds a few metadata fields to images when
we render an image. Those metadata can now be viewed in the
image editor.

Also, made sure metadata are available when we write imbufs
to disc with "Save As". There may be more cases here that need
fixing, but this means that loading an image with metadata
will now properly preserve them in blender.
2015-04-21 18:37:06 +02:00
Julian Eisel
f9972fa53e VSE: Allow GPencil drawing without having a strip loaded
Previously the GPencil strokes were just not drawn (even though they
were generated) until a strip was loaded.
2015-04-21 17:44:11 +02: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
84d117b3ad Minor edit to edit-mesh selection bias
only choose verts over edges (not faces)
2015-04-22 00:43:31 +10:00
3a3f80673c Cleanup: minor corrections 2015-04-22 00:16:26 +10:00
Julian Eisel
de687b6fa0 Fix T44465: Crash using VSE OGL render + Grease Pencil
Likely caused by rBd5f1b9c22233
2015-04-21 16:04:14 +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
e3a6440e7a BMesh: mesh-data picking, general improvements
Generalize logic for vert/edge/face selection:
- index cycling.
- selection bias with mixed modes.

Details:
- Edges now support index cycling (as verts/faces did already)
- Cycling over near elements is now only enabled when the mouse position remains the same.
- No longer do 2 selection passes to perform index cycling.

Fixes:
- Edges behind the view could be selected (surprising nobody reported!)
- Selection bias now only changes the element that gets picked without interning the return distance
  (was buggy with mixed modes).
2015-04-21 21:25:43 +10:00
907d4d310f Backdrop strictly shows image result only - it could get influenced by
scopes setting of space if one changed the space type back and forth.

Thanks to Sergey for reporting.
2015-04-21 12:13:02 +02:00
e0ae23b4d6 Allow editing of active strip proxy settings again in addition to the
set operator
2015-04-21 12:00:10 +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
b82d571c85 Cleanup: style 2015-04-21 15:53:32 +10:00
f36e91ad0a Correct crash in last commit (spacebar search) 2015-04-21 15:18:34 +10:00
Julian Eisel
56a93e9cb1 Add eyedropper for selecting object & obdata
In addition to the unlink icon to clear a value,
When cleared, show an eyedropper to select objects or object-data
(was already available via the EKey).
2015-04-21 14:25:03 +10:00
912397756a Fix T44432: Zoom to mouse fails /w FCurve editor 2015-04-21 13:10:32 +10: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
62e149881a Fixes for backbuf selection logic
- Fix ED_view3d_backbuf_sample_rect, r_dist was set completely wrong.
- Avoid duplicate calculations picking the nearest edge.
- Bias against picking selected edges is now optional.
- Remove unused callback reading the backbuf.
- Remove unused strict option picking vertices.
2015-04-21 04:50:39 +10: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
aa880bb815 Cleanup: use ED_view3d_backbuf_* prefix 2015-04-21 03:19:27 +10:00
d57a93a7cb Fix T44383: Select face fails in some positions
When mixing vert/edge/face with select-visible,
face selection could fail when not close enough to the center.

This also fixes a bug where the bias for verts over edges would
prefer faces over edges too, making edges harder to pick.

Mixing edge with other selection modes works more predictably now.
2015-04-21 03:10:32 +10: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
0626d27bf6 Editmesh select nearest fixes
- distance from edge check wasn't clamping 0-1
- vertex bias wasn't taking pixelsize into account.
- index & pass counter were floats

Also some improvements

- use BMesh lookup tables when available.
- use structs to avoid issues getting out of sync.
2015-04-21 01:50:21 +10:00
60e8e20132 Cleanup: use macro for common view3d zbuf check 2015-04-21 01:50:20 +10:00
57d9badc21 Cleanup: use bool /w flag checks 2015-04-21 01:50:20 +10: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
6298632bfa Guardedalloc: Don't use aligned blocks to calculate memory sloppyness
Aligned memory is allocated with memalign() and malloc_usable_size() can't be
used to measure this block.
2015-04-20 19:23:25 +05:00
8a9dc8451d Merge branch 'master' into alembic 2015-04-20 15:45:17 +02:00
42e427905c CMake: Move performance tests under the cmake option
This way running full sweep of regression tests does not require
waiting for the performance test to finish.
2015-04-20 18:30:26 +05:00
4d5446cea7 Usual UI messages fixes... 2015-04-20 14:46:09 +02:00
4cecbf42cc Merge branch 'master' into gooseberry 2015-04-20 17:45:16 +05:00
828abaf11c 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-20 17:29:51 +05:00
cd44449578 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-20 17:29:51 +05:00
b07c630676 I18n: Add Vietnamese language. 2015-04-20 14:27:20 +02: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
6bc26540c2 Fix T44452: Inconsistent gpencil color in prefs 2015-04-20 21:20:39 +10:00
fa761dfe6d Fix T44419: extruding when using lasso deselect 2015-04-20 21:10:52 +10: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
437f69ab45 Allow Python overrides for materials. 2015-04-20 20:20:33 +10: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
9b4c8a2507 Fix T44458 strip modifier mask not copied correctly when doing scene
copy.

What happens is that the strip is copied, but it still refers to the old
scene. Here we need to fix this by referring to the copy of the strip
and also do it after copying to make it order independent.
2015-04-20 11:51:43 +02:00
0aa2eed0c2 Compilation error fix for MSVC: It does not support expressions in array
declarations
2015-04-20 14:07:26 +05: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
bf6bde232d Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount 2015-04-20 13:53:54 +08:00
dbb2b29bea Action Stashing: Newly stashed strips now get "sync length" option enabled by default 2015-04-20 17:27:59 +12:00
a0e1b6573a Action Editor "Browse" Fix: Stash active action if nothing else uses it
Following the initial action management commits for 2.74, blurrymind pointed out a
problematic workflow involving the "Browse Action" dropdown in the Action Editor
which would lead to actions being accidentally lost. Namely, it turns out that
game animators frequently flip between different actions from the Browse menu while
working.

While the new up/down operators and/or other NLA based tools are better suited to this
without the problems of actions getting lost, some additional precautions were needed
for the Browse menu as well. So now, if the active action will have no users as a result
of the switch (i.e. it was a new action, and the user is checking on a previous action
via the Browse menu), this action will now get stashed. This workflow is not perfect though,
as there is the problem of the stashed action strips not reflecting the actions they reference.
2015-04-20 17:27:58 +12:00
689241b6e5 Fix for potential null-pointer-dereference if the new action is NULL 2015-04-20 17:27:57 +12:00
e4fbc8fc8d Fix: Changing actions in the Action Editor using the Browse dropdown should happen in tweakmode
When a NLA strip is being tweaked, it should not be possible to use the Action Editor to change
the action that it uses. Instead of changing the action in tweakmode, it now exits tweakmode
first before doing so.
2015-04-20 17:27:56 +12:00
5f6b958e96 Fix: "show_points" setting for Grease Pencil drawing didn't work
As reported by zeffi, the "show_points" option was not working in master.
It probably broke recently, after some changes meant that the point sizes
weren't geting set prior to drawing these points anymore. Since this was
originally added as a debugging tool (though it is now somewhat redundant
due to the stroke editing functionality, which uses/exposes the same points),
this option wasn't really that important. I have decided to add back a toggle
for this to the UI though, since it can be used for some interesting effects...
2015-04-20 17:27:55 +12:00
79319b3fba Sculpt: remove workaround T25371
It's no longer needed,
and made calc_area_normal different to the normal from calc_area_normal_and_center.
2015-04-20 13:36:51 +10:00
436004b6b1 Sculpt: clay-strips was missing accumulate button
Correct & de-duplicate check for accumulate.
2015-04-20 13:23:47 +10:00
07a7d77ec1 Fix: solved BGE compiler error on Linux/gcc 2015-04-20 10:58:25 +08:00
5db143efbb Fix T44449, sm_52 kernel missing in CMake builds. 2015-04-19 22:04:23 +02:00
62f79856e9 BGE : Standardization of callbacks execution.
A new function (RunPythonCallBackList) to call all python functions
contained in a python list was developed.

This function has:
  - first argument is the python list of callbacks
  - second argument is a python list of arguments
  - third argument is the minimum quantity of arguments
  - forth argument is the maximum quantity of arguments

It improves flexibility and supports *args.

Reviewers: moguri, dfelinto, campbellbarton, sybren

Reviewed By: campbellbarton, sybren

Subscribers: sybren

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1102
2015-04-19 20:33:08 +02:00
6f0f1dc3be Cleanup: warnings 2015-04-19 22:03:42 +10:00
e5048dd4ca Dyntopo: non-topology tool origdata support
Brushes that don't change topology didn't have access to original data.
2015-04-19 19:56:46 +10:00
ac73fe5fe0 Cleanup: use meaningful names re: (fc, an, sn) 2015-04-19 18:38:58 +10:00
fb6a0d24e1 Dyntopo: support for original normal access
Rename calc_flatten_center to calc_area_center,
since theres no 'flatten' spesific logic there.

Also refactor calc_area_center, calc_area_normal, calc_area_normal_and_center
so they're next to eachother - they're almost the same,
having them scattered about isn't helpful.
2015-04-19 18:24:21 +10:00
fe39ebea12 Cleanup: move project code into util function 2015-04-19 17:52:35 +10:00
57b020528b Cleanup: calculating sculpt center & normal
also avoid sqrt calculating dyntopo center (only checks for flipping)
2015-04-19 17:03:51 +10:00
eb4fb4f4fe disable verify from last commit (too slow) 2015-04-19 16:06:40 +10:00
d09a9a9597 Dyntopo: USE_EDGEQUEUE_TAG broke even subdiv
While adding edges to the queue multiple times is redundant,
walking over them is still needed.
2015-04-19 16:03:12 +10:00
550c3c2c1e Dyntopo: avoid over-counting /w neighbor average 2015-04-19 14:46:32 +10:00
2448c21cb3 Sculpt: avoid CD lookup /w mask smooth 2015-04-19 14:46:32 +10:00
9ac618a90e Sculpt: smooth brush, exclude self from average
Was including the vertices own location when accumulating.
2015-04-19 14:46:32 +10:00
3d55859924 BGE: Support for collision group/mask from the api + activated on EndObject.
A Python API for the collision group / mask has been added:
```
KX_GameObject.collisionGroup
KX_GameObject.collisionMask
```
The maximum number of collision groups and masked has been increased from eight to sixteen.
This means that the max value of collisionGroup/Mask is (2 ** 16) - 1

EndObject will now activate objects that were sleeping and colliding with the removed object.
This means that, unlike now, if a rigid body starts sleeping on top of another object, when the latter is removed the rigid body will activate and fall, rather than float midair as before.

Collision groups that do not intersect used to collide on the first frame. Now this has been fixed so that they collide appropriately.

Thanks to agoose77 for his help.

Reviewers: scorpion81, hg1, agoose77, sergof

Reviewed By: agoose77, sergof

Subscribers: sergof, moguri

Projects: #game_physics, #game_engine

Differential Revision: https://developer.blender.org/D1243
2015-04-19 01:04:22 +02:00
a2f9a0cfd9 BGE: Fix T43536 logic.getCurrentScene() returning wrong scene in
pre_draw and post_draw calls

A simple insert of KX_SetActiveScene(scene) before pre_draw and
post_draw calls solves the issue.

Reviewers: dfelinto, sybren, brita_, campbellbarton, moguri, lordloki

Reviewed By: moguri, lordloki

Projects: #game_logic, #game_engine

Differential Revision: https://developer.blender.org/D1129
2015-04-18 21:37:59 +02:00
252b0cf5d2 Cleanup: API naming use BKE_undo_ prefix 2015-04-18 18:25:07 +02:00
38bea4e86c Cleanup: use BLO_memfile prefix 2015-04-18 18:11:01 +02:00
230712e6cb Autosave:
Flush edits only when saving global undo. This will stop freeing of PBVH
in sculpt mode, which introduces some pretty severe freezes, especially
in dyntopo. For global undo we flush the contents of the global undo
buffer which does not include localized edits of sculpt/edit mode, so
those data will not get saved anyway.
2015-04-18 15:50:29 +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
4f2657bf47 BGE: New Draw debug shadow box for sun lamp
New Check option "Show Shadow Box" in shadow panel of sun lamp to get
feedback about which objects project shadows.

Minor tweaks by Campbell Barton and Jorge Bernal

Reviewers: moguri, sybren, kupoman, dfelinto, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: sergey, lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1149
2015-04-18 12:30:02 +02:00
3a4a2a9427 Fix T44390: Clay brush weirdness part-2
Use the normal of the plane instead of the vertex normal,
since projecting using the vertex normal frequently causes artifacts.
2015-04-18 05:08:14 +10:00
05b6de545a Fix T44390: Clay brush weirdness part-1
Clay brush had a feedback loop with dyntopo,
getting the plane from the cursor center didn't support original data.
2015-04-18 05:08:03 +10: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
b0c2fdd927 Cleanup: simplify sculpt normal accumulation 2015-04-18 03:09:16 +10:00
28b9a0276f Cleanup: simplify sculpt plane accumulation 2015-04-18 02:54:49 +10:00
e0aeafdf0a BGE : Fix light layer check
The layers in Blender are using a bit field for the 20 layers. The light layer value was limited to 20, so the highest usable light layer was five.
The patch modify the range and add layer out of range error messages.

Reviewers: sybren, hg1, moguri

Reviewed By: hg1, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1238
2015-04-17 18:12:51 +02:00
84f7f3d4b8 Merge branch 'alembic' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-04-17 17:47:49 +02:00
Dalai Felinto
394c5318c6 Bake-API: reduce memory footprint when baking more than one object (Fix T41092)
Combine all the highpoly pixel arrays into a single array with a lookup
object_id for each of the highpoly objects.

Note: This changes the Bake API, external engines should refer to the
bake_api.c for the latest API.

Many thanks for Sergey Sharybin for the complete review, changes
suggestion and feedback. (you rock!)

Reviewers: sergey

Subscribers: pildanovak, marcclintdion, monio, metalliandy, brecht

Maniphest Tasks: T41092

Differential Revision: https://developer.blender.org/D772
2015-04-17 12:25:37 -03:00
45e929dc12 Cleanup: redundant casts 2015-04-18 00:16:05 +10:00
e3a0345d8d Merge branch 'master' into gooseberry 2015-04-17 19:11:42 +05:00
fa0f936a64 Fix BPlayer (c) 2015-04-17 16:03:14 +02:00
3a015bb76b Depsgraph: Report total time spent on scene update
Previously was only per-thread timing.
2015-04-17 18:57:13 +05:00
15d3d8560d Cleanup: remove unused face normals
also use const
2015-04-17 23:50:23 +10:00
Dalai Felinto
80b4b43727 Code cleanup (for previous commit) 2015-04-17 10:41:31 -03:00
Dalai Felinto
cd729e9a4e Image Editor: Fix passes increase/decrease buttons
This was half-broken even in 2.74 (if you were using compositor), multiview did us the favour of breaking this for all cases (you are welcome).
It is all working now.
2015-04-17 10:38:17 -03:00
Dalai Felinto
479b669693 Fix T44336: Unable to select cycles-specific passes in UV/image editor
This approach gets rid of iuser->pass for good.

Also, I'm commenting out the pass increase/decrease. This was broken
since multiview. I will fix it later (before 2.75), but I didn't want to
get this patch mangled with that fix.

Thanks Sergey Sharybin for the review and feedbacks.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D1232
2015-04-17 09:48:31 -03:00
02fba106fa Dyntopo: save 4 bytes per BMLogVert 2015-04-17 18:07:08 +10: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
e05f719b8b Dyntopo: avoid redundant lookup on original data 2015-04-17 17:34:14 +10:00
50522cba92 Fix T44411: poll() function of MESH_OT_knife_project was not strict enough.
We need a 3DView region here, not only the 3DView...
2015-04-17 08:09:16 +02:00
09f2aa9382 Fix T44412: Crash when trying to paint on a GPencil frame when the frames are out of order 2015-04-17 13:32:57 +12:00
582fa5e36e Fix for Grease Pencil and negative frames
While investigating T44412, I noticed some weirdness going on when trying to
draw on frame 0 (i.e. strokes were getting added to frame 1 instead). Clearly,
this seemed like an off-by-one error related to clamping to prevent negative
frames which was also excluding frame 0.

This commit reverts the fixes made for T36831 in:
rBf18f2fbb33d90ecc91e6f3d063cb9f97f217e808

After thinking this over, I think these checks against drawing on negative
frames aren't needed. Even if the current userpref setting doesn't allow
navigating to negative frames, this may not be true for other users that
may work on the same file (in a team environment). Also, negative frame
values can get set via the dopesheet.
2015-04-17 13:02:45 +12:00
4cd37541b0 BGE: Fix for T44374 Crash when collision sensor deactivated
Don't allocate memory for sensor logic brick if it is deactivated
2015-04-17 02:12:57 +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
afc2f415ab Cleanup: use const for sculpt code 2015-04-17 03:11:26 +10:00
bbae0664a3 Added Support for Custom Vertex Normals to Collada exporter 2015-04-16 19:02:26 +02:00
a7cae2987d OpenGL does not like line thickness less than 1.0.
Check here is not completely correct either, we should check against
GL_ALIASED_LINE_WIDTH_RANGE and GL_SMOOTH_LINE_WIDTH_RANGE
2015-04-16 18:35:07 +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
6589d07c8f Action Editor: Preemptive fix for null-pointer dereference
A few weeks ago, I got a random crash while testing som edge cases
(IIRC, it was trying to assign an action with no active object),
which I haven't been able to reproduce since then. This commit though
adds some extra sanity checks here, as a user may try to assign an
action to an animdata block which did not have an action already.
2015-04-17 01:11:56 +12:00
0b691563ea Fix T44408: "Rest Length" property in the Stretch To constraint was getting clipped when using Metric Units
Increased the upper bound for the "Rest Length" property to cope with metric
units, especially when large (i.e. > 2 m) distances are involved. It may be
necessary to increase this again in the future, if even larger distances get
used (though it then starts getting a bit difficulty to justify such setups).
2015-04-17 01:11:55 +12:00
78f8c3eb31 Merge branch 'master' into cycles_memory_experiments 2015-04-16 17:42:11 +05:00
6603a10331 Cleanup: remove redundant initializers 2015-04-16 22:26:20 +10:00
91161dc983 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2015-04-16 13:03:26 +02:00
69b33b6ed3 Draw smoke domain in transparent pass. Should composite smoke domains
correctly in scene - with known limitations of blending between
transparent objects.
2015-04-16 13:02:09 +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
eced87b2d6 Fix T44406: the Hebrew font causes trouble.
Looks like the droidsans hebrew font we used back in the days had some kerning bug or so...
Updated with latest version from Debian Testing repo, works nice now.
2015-04-16 12:37:03 +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
59db8d74b9 RNA: avoid past tense in property names 2015-04-16 16:41:12 +10:00
c5a126ee70 Docs: BLI_rand non-obvious behavior 2015-04-16 16:14:30 +10:00
8c98b1649d BGE: Fix for T42341 Sensor.frequency is badly named
"Frequency" parameter is renamed to "Skip" in the LogicBricks sensors as it represents skipped frames between pulses.

Naming something (frequency) the exact opposite of what it represents (period) was the worst choice.

Also, a new BGE python attribute 'skippedTicks' was introduced. 'frequency' attribute is maintained but deprecated.

Internally, freq variable is used yet at DNA_Sensor to maintain compability and to avoid do_versions.

Thanks to Sybren for the investigation.

{F162440}

Reviewers: campbellbarton, sybren, moguri, hg1

Reviewed By: sybren, hg1

Differential Revision: https://developer.blender.org/D1229
2015-04-16 06:39:33 +02:00
b466a82fa5 Partial fix for T44404: freestyle crashes blender.
Logical predicates AndUP1D and OrUP1D were instantiated even with an empty
list of unary 1D predicates, causing an exception in the constructors of
the logical predicate classes.

This is a regression made in b408d8af31.
2015-04-16 13:35:24 +09:00
b88421aa62 Dyntopo: avoid redundant loop collapsing edges 2015-04-16 12:24:59 +10:00
f57b904807 Dyntopo: blend vertex normals when collapsing 2015-04-16 11:59:48 +10: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
6675fd6b52 dyntopo: don't allocate tessfaces while sculpting
Tessellation data isn't used for drawing or sculpting.

This frees up some memory ~approx 10% in own tests.
Also slight spee-up since it avoids calculating it in the first place.
2015-04-16 04:32:16 +10: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
7f4b6a345e Fix crash loading file without scene in bg mode 2015-04-16 01:45:30 +10: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
99299da4b5 Cleanup: warnings, ws 2015-04-16 01:12:22 +10:00
34c1319d06 Cleanup: use const for event->tablet_data 2015-04-16 01:07:54 +10:00
f660085e2f Increase max brush size from 200 to 500 2015-04-16 00:59:43 +10: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
7730391d74 BGE: subclass with more than 1 argument, D1237
In the BGE you can't create a subclass with more than 1 argument like : "player = Player(owner, 10)"
I have modified the py_base_new to check only the first argument of args tuple.
Now we can do :

    class Player(types.KX_GameObject):
        def __init__(self, gameobj, life):
            print("create new player :", self, ", life :", life)

    player = Player(own, 50)
2015-04-15 22:02:16 +10:00
b9ea6fbb30 BMesh: dyntopo used lopsided normals
Normals from subdivided edges were only taken from the edges first vertex.

Interpolate between the two to give more even results.
2015-04-15 20:56:59 +10:00
240c5704e4 BMesh: Missed normal from example /w skip-cd flag
We may still want to use the normal as a reference but skip customdata.
2015-04-15 20:56:11 +10: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
255fb79ff3 Fix T44395: String untranslated in open file window. 2015-04-15 11:11:22 +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
730684f976 BMesh: avoid ghash lookups splitting the pbvh
This isn't a bottleneck but may as well avoid the extra ghash overhead.
2015-04-15 16:14:27 +10:00
9a711f98a7 typo in last commit 2015-04-15 15:34:06 +10:00
356ceded27 Sculpt: change behavior of crease brush
Pinch would give a flat result on either side of the stroke,
because points were dragged towards a single point.

Now pinch is projected on the sculpt plane, which gives a tighter crease.
The reverse is true too - blob brush which shares the code is also more curved.
2015-04-15 15:27:27 +10:00
b216f7abd6 RNA: use lock_ prefix for booleans 2015-04-15 14:51:17 +10:00
Julian Eisel
9b9978656d Fix T44389: Tooltips swapped in Logic Editor 2015-04-14 17:24:55 +02:00
Dalai Felinto
2d33057c75 Multiview: compositor openexr multiview images fully working
This is from my original missing-bits/TODO list.
Basically multiview openexr was only working when multiview was on.
2015-04-14 12:19:11 -03:00
Dalai Felinto
66e2fc39ce Fix T44343 Compositor image node cannot properly load multilayer EXRs 2015-04-14 11:21:01 -03:00
0b30c9db2a Merge branch 'alembic' into gooseberry 2015-04-14 16:09:06 +02:00
f1355d0b45 Second round of hair random rotation limited to 180 degrees
This time roll back to originally discussed in the code review page approach
with simply bumping UI range for the property.

It's still not totally free from forward compatibility breaking (which is
already broken comparing to previous release) but at least it'll keep files
working inbetween of git blender versions in cases random factor was not
set above 2.0.

Differential Revision: https://developer.blender.org/D1214
2015-04-14 19:04:12 +05: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
f1e1ec2d8d Action Editor: Make the warning on unlinking actions a bit less intrusive
venomgfx was complaining that having it do the popup everytime was too intrusive,
so demoting it to just showing the warning in the header.
2015-04-15 01:19:38 +12: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
04daaee0fd Fix T44385 SSAO inverted with new Intel drivers.
Intel has decided to fix this for newer devices and drivers only, so we
can't really avoid keeping a list of buggy drivers here.
2015-04-14 12:31:23 +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
ed40d5eaa7 Add flag that prevents editing of markers. Can be located in marker
menu.

When active, all editing operators for markers will not fire up.
2015-04-14 12:12:17 +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
68eeeea57e Dyntopo queue added the same edges multiple times
Use tagging to avoid re-evaluating the same edges while sculpting.

While gives only minor speedup,
it allows for changes to the queue without additional redundant checks.
2015-04-14 18:56:49 +10:00
7daa921359 BMesh: avoid customdata copy for new dyntopo verts 2015-04-14 18:41:01 +10:00
d36429b930 initialize members in-order 2015-04-14 18:41:01 +10:00
825b015e92 Fix T44348: Blender crashes when selecting bone from inactive scene in outliner
Pose is not guaranteed to be existing in object, so can't be used for selection
flag clear. Use bones themselves for that.
2015-04-14 13:25:25 +05:00
8486ee39bd PBVH: use realloc/recalloc 2015-04-14 17:58:07 +10:00
34d4ad326c Animation Editors: Name filter now updates as you type, making it a true "live search" 2015-04-14 18:50:15 +12:00
1e488802dc NLA: The "filter by name" functionality now works with NLA strips too 2015-04-14 18:39:09 +12:00
bb1bc7ecda NLA: Store track that the strip being tweaked comes from
There should be no functional changes visible from this change, but this commit
should make it easier to code tools which need to check on tweeakmode status,
by making it easier to figure out which NLA Track contains the strip which
owned the action being edited. (The strip is already saved, so this commit just
adds the track alongside it).

For now there is no version patch for this. The worst that happens is that an
extra refresh is needed in the NLA editor to get these to show up.
2015-04-14 18:39:07 +12:00
c95f38b92a Fix for another NLA drawing bug uncovered by the previous commit
With multiple strips in tweakmode, only the one tagged as being "active"
would get drawn in the correct colours, while all the others would just
get drawn as a selected strip instead.
2015-04-14 18:39:05 +12:00
5361339ba0 Temporary fix for NLA strips not getting drawn in tweakmode with multiple strips selected
When entering tweakmode on multiple strips (from different AnimData blocks)
simultaneously, only the track containing the last selected strip would be
shown. All the other tracks with strips being tweaked would not appear at
all.
2015-04-14 18:39:03 +12:00
097801e701 NLA: Shift-Tab toggles tweakmode AND makes that track solo
To help make it more convenient to edit stashed actions, Shift-Tab
(i.e. holding down the Shift key, which "tabbing" into tweakmode as
usual to edit the action referenced by the active NLA strip) now flags
the NLA Track that the strip occupies as being "solo" too.

This allows you to use the NLA to select a stashed action, then Shift-Tab
to start editing it without any other actions in the NLA stack interfering.
Like the "Next/Previous Layer" tools in the Action Editor, this is designed
to help with checking on stashed actions.
2015-04-14 18:39:02 +12:00
d841b75c5f BMesh: avoid redundant face-exists check (dyntopo) 2015-04-14 15:27:27 +10:00
6fb0563aee BMesh: optimize BM_face_exists
Avoid flagging/clearing flags,
just walk over the face until a mismatch is found.
2015-04-14 15:27:08 +10:00
c448196bb4 Cleanup: warnings 2015-04-14 10:34:32 +10:00
af2f4724d5 Cleanup: don't use single sets for comparisons 2015-04-14 10:34:32 +10:00
Dalai Felinto
2bceb3ae18 Fix for *harmless* T44342 Error when saving multilayer EXR
This was introduced with multiview, and it was an oversight on my end.
There is no error, we simply was never returning True
2015-04-13 19:56:56 -03:00
54c18d4849 Fix T44362 no easy way to repeatedly duplicate keyframes in action
editors.

Reporter used a hacky work-around by placing cursor at end of keyframe
range and doing ctrl-C ctrl-V repeatedly. This was working on 2.73 but
not anymore since the old selection is not kept.

Much better is to have duplication operator be repeatable. This commit
takes care of that.
2015-04-13 23:58:50 +02:00
27ded012d6 cleanup: style
to match my earlier commit in temp_viewport_fx_merge branch
https://developer.blender.org/rBc3f3b958dc0b

plus more

no functional changes
2015-04-13 16:56:43 -04:00
057c7c6fab Cleanup: do not use _reportf() when not doing any string formating!
Also usual minor i18n messages stuff...
2015-04-13 21:00:45 +02:00
Julian Eisel
1bccbbc04c Merge branch 'master' into gooseberry 2015-04-13 20:36:07 +02:00
Julian Eisel
86fe894f86 Moar precision for Color Stop position slider in Color Ramps
Normal dragging now uses a precision of 0.01 instead of 0.1, shift+dragging now uses 0.001. (0.1 steps can still be done using ctrl)

Requested by @venomgfx
2015-04-13 20:31:40 +02:00
7c28ee9c4a Merge branch 'master' into gooseberry 2015-04-13 18:38:21 +02:00
aed97c9efb Fix bug with autonormalization and transform (after own range commit).
Transforming the center after transforming a handle would continuously
flush an extra offset to the handles.

Also use normalization range of -1.0 to 1.0 instead of -0.5 to 0.5 (not
really important, just for better comparisons)
2015-04-13 18:37:15 +02:00
cae23bab6b Fix for crash with non-camera as a camera 2015-04-14 01:00:07 +10:00
f27e0b7c5e After user feedback:
* Allow ctrl click to do negative stroke in line strokes
* Use alt for angle constraints.
2015-04-13 16:31:06 +02:00
4c4673ce7f Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-04-13 19:18:27 +05:00
4ce437fff0 Revert "Fix hair random rotation limited to 180 degrees"
This reverts commit 176ed5bfe2.
2015-04-13 19:16:54 +05:00
1f75229237 Merge branch 'master' into gooseberry 2015-04-13 15:58:18 +02:00
198ca57ae4 Graph editor:
Normalization feature now uses the full range of the data instead of
just one semiaxis for the maximum size.
2015-04-13 15:57:57 +02:00
8ad37b0d22 Fix T44359: mesh_normals_loop_custom_set() would not behave correctly with zero-normals.
Zero-normals here are used as a shortcut to say 'use auto-computed values'.
So we have to do so in pre-process steps!
2015-04-13 15:44:09 +02:00
17a9b05b9d Fix T44350: View3D layer out of sync /w scene 2015-04-13 23:10:43 +10:00
41350a91b5 Workaround T44351: Scopes make editmesh lag
Scopes are very heavy to calculate and editmesh uv's can cause the image view to redraw.

Best just disable scopes in this case.
2015-04-13 22:44:08 +10:00
04d9e28621 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-04-13 14:31:36 +02:00
364b6b29ff New operator for action and graph editor that centers around current
scene frame, bound to numberpad zero.
2015-04-13 14:30:24 +02:00
d1f9fcaabc Cleanup: style 2015-04-13 22:08:51 +10:00
d2da8aa27a BMesh: resolve skinny face artifacts /w dyntopo
Dyntopo can currently create skinny faces,
especially when the faces are much larger then the resolution.

To get the old behavior, set debug value to 1234
2015-04-13 21:25:39 +10:00
a50955ee0f Minor edits of python class documentation (regarding ID tagging) 2015-04-13 13:22:55 +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
8c616e86b5 Calculate auto normalization maximum from keyframes within range if
preview is on
2015-04-13 12:44:06 +02:00
fdc653e8ce Nodes: Remove hardcoded BLENDER_MAX_THREADS number of threads
Use actual available number of threads now, which will make it easier
to increase max number of threads, without having some sloppy memory
usage and without doing some redundant checks on thread data which was
never used.
2015-04-13 15:40:44 +05:00
efe90384b7 Be a bit more specific in the message. 2015-04-13 12:28:12 +02:00
8a97d46296 Windows:
Only print backtrace on debug builds, since on release builds there is
only some useless output from a python library and fftw.
2015-04-13 12:21:32 +02:00
97ae0f22cd Depsgraph debug: Remove hardcoded array of BLENDER_MAX_THREADS elements
Allocate statistics array dynamically, so increasing max number of threads does
not increase sloppyness of the memory usage.

For the further cleanups: we can try alloca-ing this array, but it's also not
really safe because we can have quite huge number of threads in the future.
Plus statistics will allocate memory for each individual entry, so using alloca
is not going to give anything beneficial here.
2015-04-13 14:41:02 +05:00
890e533c76 Fix adding to paint-curves from the first point
- add_index now works when selecting the first point.
- sliding now selects the correct handle.
2015-04-13 19:30:43 +10:00
Mai Lavelle
176ed5bfe2 Fix hair random rotation limited to 180 degrees
The issue was caused by phase being limited from 0 to 1, which gave only
0..M_PI distribution which is not good enough for good randomness.

Now the phase is being randomized across full 0..2*M_PI range.
2015-04-13 14:17:00 +05:00
6fbf05f326 Make python gotchas more clear (regarding handling of stale data) 2015-04-13 11:00:22 +02:00
4fb33d82e2 Fix T44361: array modifier "fit curve" mode not working properly
'tot_length / step_length' gives the number of 'segments', not the number of
copies - we have to add 1 here.
2015-04-13 10:51:04 +02:00
f684dfc432 Fix T44364: Remove shape key crashes Blender 2015-04-13 15:54:37 +10:00
dd0cba0076 error in last commit 2015-04-13 15:46:27 +10:00
919de1e4c9 BMesh: diagram for dyntopo edge subdiv 2015-04-13 15:43:25 +10:00
9b359c1592 Py API: default arg for location_3d_to_region_2d
This function could return None for points behind the view,
note this in the doc-string and add an optional fallback argument.
2015-04-13 14:35:16 +10:00
e688ba0304 GHash: use unsigned int for ghash_size 2015-04-13 13:45:48 +10:00
55b7a8c027 ndof: fix Linux device detect regression 2015-04-12 19:58:17 -04: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
c950b8f289 making add>lamp its own menu so it can be extended by addons 2015-04-12 11:38:18 +01:00
542a0c41d2 Dyntopo: redundant length check subdividing edges 2015-04-12 19:14:28 +10:00
690b90f1e2 BMesh: minor optimization counting adjacent data
add BM_***_count_is_over(), _count_is_equal()

Useful if we only want to know if the count is a smaller value.
2015-04-12 17:38:14 +10:00
6d2c3a2456 BMesh: avoid ghash realloc's making log entry 2015-04-12 17:38:14 +10:00
Julian Eisel
f50fed6a6d Reset view after ctrl-clicking a Panel
Using ctrl+LMB to collapse all panels except of the clicked one resulted
in an empty area if done from a view that is scrolled down to some
degree. Resetting the view makes this much better, although it still
doesn't work that well if the area is really small, but I don't think
it's worth over-complicating things here.

"Feature-Request" by @maxon ;)
2015-04-12 08:07:34 +02:00
17b4f57bf0 Missed this last commit (dyntopo hashing) 2015-04-12 11:12:57 +10: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
87b6d3c796 BGE: Add keyword arguments to createConstraint API
Added keyword arguments to createConstraint.
Changed initial values for the pivod XYZ  form 1 to 0.0.
Changed initial values for the axis Z form 1 to 0.0.
Delete the parsing for 4 parameters, because parsing only the X pivot is not necessary, also it was not working correctly (int instead of  float).

Reviewers: brita_, sybren, lordloki, campbellbarton, moguri

Reviewed By: lordloki, campbellbarton

Subscribers: campbellbarton

Differential Revision: https://developer.blender.org/D705
2015-04-11 16:17:07 +02:00
b329016b29 BGE: FIX T43537: ImageMirror does not work in BlenderPlayer with quad buffer
In quad-buffer stereo mode, the GE render pass ends with the right eye on the right buffer, but we need to draw on the left buffer to capture the render.

Reviewed By: agoose77, HG1
2015-04-11 16:08:15 +02:00
a6421e1291 BMesh: intersect was using ptr hash for int keys 2015-04-11 23:41:10 +10:00
ccf44c400c BMesh: simplify hashing for dyntopo
Was using pointer hashing when the keys are in fact uint's.
Since they're well distributed from the rangetree,
no need to do bit-shifting tricks. just use int as hash.
Gives ~8% speedup in own tests.
2015-04-11 23:36:37 +10: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
7447a0173c Remove splash link to support gooseberry
Was included only for initial campaign.
2015-04-11 19:41:31 +10:00
465a5d29c0 BGE : Fix T43800: getScreenVect()/getScreenPosition()/modelview_matrix returns incorrect results
The getScreenVect(), getScreenPosition() and modelview_matrixmethod returns an incorrect results if called after the camera has been translated on the same frame.
The model view matrix will be update only once per frame with Cam->SetModelviewMatrix in KX_KetsjiEngine::RenderFrame.
Using GetWorldToCamera as model view matrix to get an actual view matrix even if the camera is moved.

Reviewers: sergey, dfelinto, brita_, sybren, hg1, campbellbarton

Reviewed By: hg1, campbellbarton

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1170
2015-04-10 20:20:52 +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
35812e65f4 Cycles: Fix compilation error on windows after recent logging changes 2015-04-10 22:35:10 +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
d850fd8244 Disable strict flags for msvc 2015-04-11 00:43:15 +10:00
Dalai Felinto
02a5cf75a2 Fix for debug-only crash when setting "Any" keymap input type
Another one of those assert crashes when passing values != than 1 and 0
(in this case the value is -1)

Notes from reviewer:
--------------------
These should really be enums. since valid values are KM_ANY,
KM_MOD_FIRST, KM_MOD_SECOND.

But can see at some point this was changed from an enum so... I guess
this is the only way.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1227
2015-04-10 11:10:10 -03:00
f75bbe27e2 Thumbnails: Add translations to font preview.
Not much to say, this is pretty straightforward.
We just have to add current locale to thumbnails 'signature', so that
previews get re-generated when we change locale...

Tested with Japanese and French.

Btw, I do not really understand why using BLF in ImBuf is badlevel... :/
2015-04-10 15:34:31 +02:00
8a99dc2324 BLF translation: fix BLF_lang_get(), add UI-agnostic BLF_translate/_do helpers.
BLF_lang_get() shall return 'default' Blender locale (en_US) when translations
are completely disabled!

Also, add BLF_translate() and BLF_translate_do() to allow translating some strings
outside of label/tip context, but still only when i18n global flag is enabled.
2015-04-10 15:34:31 +02:00
a36c43fc8c Thumbnails: some reorganization, decouple actual path of file to preview from 'ref' one.
(Partial) backport from asset-experiments branch.

Reorganization: previously we could recompute name/path of thumb file two or three times,
now added lower-level internal functions that take those as parameters, so in most case
they are computed only once. Very minor optimization, but simple too.

Also, path of file to preview is now decoupled from path used to generate its URI
(and hence thumbnail path). In asset-experiments branch this is needed because
we also handle datablock previews in/as thumbnails (file_path is .blend path,
URI is .blend path + datablock 'path').

Here this will be needed for same kind of reason - once translated, font thumbnails
need to be re-generated when we change current language...
2015-04-10 15:34:31 +02:00
ec710775cf Use off_t for filesize (was int)
Resolves finding >2gig files.

Also enable strict flags.
2015-04-10 22:06:28 +10:00
b0906bcc5e Cleanup: remove win32 workaround 2015-04-10 22:06:28 +10: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
aac0df956f Cycles: Cleanup, make more clear what camera utility functions are private/public 2015-04-10 16:25:35 +05:00
085fa2e3d7 Fix T44329: Second part: prevent 'cachebuffer' and 'fullOSA' in preview renders. 2015-04-10 13:17:08 +02:00
0d2826d86b Merge branch 'master' into gooseberry 2015-04-10 13:06:00 +02:00
711a5c79d8 Don't use vertex colors in textured mesh display during texpaint.
Wasn't that irritating?
2015-04-10 13:05:32 +02:00
e073562f80 Cycles: Make transform from viewplane a generic utility function 2015-04-10 15:53:14 +05:00
c2d6d6d824 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_view3d/drawvolume.c
2015-04-10 12:47:50 +02:00
237c53fbf1 Only selected keys will get cleaned by the action and graph clean
operators
2015-04-10 12:45:13 +02:00
2f5dd83759 Cycles: Add some statistics logging
Covers number of entities in the scene (objects, meshes etc), also reports
sizes of textures being allocated.
2015-04-10 15:37:49 +05:00
a6b9fc6f22 Use depsgraph tagging and notifiers to enforce dupli cache updates
in the viewport.
2015-04-10 12:34:25 +02:00
1e71270f77 Fix T44329: Blender Crash when rendering in 3DView.
This commit fixes two different issues actually:
* When view name is unknown/irrelevant, you should pass a NULL str pointer to
  `RE_RenderLayerGetPass()`, not an empty string!
* `render_result_rescale()` would unconditionnaly free re->result (at the end),
  even if it did not replaced it at all, leading to freed memory access later.

This is only a partial fix though, "CacheBuffer" (i.e. saving tiles in EXR files)
shall not be used in 3DView rendering, and yet it is here...
2015-04-10 12:32:19 +02:00
253d15ea16 Move clean operator from action/ipo editors to the delete menu, now that
O key is bound to proportional editing.
2015-04-10 11:56:18 +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
11a48b7227 Python API docs, don't hard-code sphinx themes
also set the theme to classic (as it was for 2.73)
2015-04-10 15:49:07 +10:00
40334b4920 missed last commit 2015-04-10 13:44:26 +10:00
31d354dfa3 rename _ipo -> _fcurve 2015-04-10 13:41:57 +10:00
f2452bc9ab Test: blacklist loading addons /w known problems
The test now runs without warnings
2015-04-10 12:08:23 +10:00
Dalai Felinto
52f511269b Multiview: remove option to preview the selected stereo 3d mode and error when quadbuffer not supported
This was causing glitches when switching from/to fullscreen modes (e.g.,
side by side to anaglyph).

As for the quadbuffer errors this is part of a more complete solution to
be committed later.
2015-04-09 20:44:03 -03: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
Dalai Felinto
33028d17a0 Multiview: fix crashes with pageflip mode - by Cédric Paille (cedricp) 2015-04-09 15:22:53 -03:00
866532360c Fix T31546 fragment program gets created every frame
That was really crappy indeed. Now we have a separate API
for low level OpenGL programs, plus a nice interface for GPU, also
removes some GL calls from main code as a plus :)

The source for the programs is also moved to nice external .glsl files
(not sure which extension convention GPU assemply uses)
2015-04-09 20:20:50 +02:00
7ea4163e1e Cycles: Fix BVH counter on mesh updates 2015-04-09 22:23:59 +05: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
851ea206d0 Separate proportional editing options for graph and action editor. 2015-04-09 18:30:14 +02:00
cca4405437 Cycles: Fix wrong render result in certain configuration of render layer's surface/hair
There were some synchronization missing in cases when only one of those settings
was disabled.

Also added a render test for such configurations now.
2015-04-09 21:22:48 +05:00
ae5f2c2025 Fix regression after multiview, basically we appended the wrong frames
to movie file.

We have to resort to use crappy workarounds with preview arguments again
since preview range is only for OpenGL preview.
2015-04-09 18:02:43 +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
b30a2fe3f4 Fix T44322: Crash when trying to render spotlight halos.
Trying to access rl's from full samples in non-full-OSA context (with uninitialized
sample index even :P ).

Caused by rBd5f1b9c2, probably a copy/paste typo or so.
2015-04-09 16:32:45 +02:00
4cadbb03a8 Seriously... Fix building! 2015-04-09 16:17:51 +02:00
5197aa04c6 Fix part of T44320 selecting islands can fail.
Issue here is simple and has been fixed in other places such as
texpainting: Basically if face has different winding, do not calculate
it as adjucent to the other face, even if UV is identical.

This allows us to stack islands of symmetrical closed meshes on top of
one another and still be able to select the two identical island halfs
(provided the normals are correct of course).
2015-04-09 16:12:43 +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
d687428122 Error in own last commit 2015-04-09 21:23:21 +10: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
8a1c444c93 Disable proportional editing when duplicating keyframes 2015-04-09 12:49:06 +02:00
6ee460f299 Fix compilation with strict compiler flags 2015-04-09 15:47:13 +05:00
9749b2cb81 Fix partial image update during rendering
Was broken since 5d212fb.
2015-04-09 15:33:44 +05:00
d75bfdfafc Fix T44308 painting in 2D editor offset by one pixel.
Not sure why this was so in the first place but changing it seems OK.
2015-04-09 12:18:51 +02: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
8732c1a8b7 WM: allow 'save as' to path set by operator
Invoke assumed the filepath was never set.
Scripts couldn't invoke save-as at a custom location.
2015-04-09 19:49:05 +10:00
cc6e0b7394 UI: Extend preset menu
- allow for preset menu to change operator defaults.
- allow preset menu to select own kinds of file extensions.
2015-04-09 19:10:00 +10: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
bdad2c0595 Fix uninitialized var use reading view prefix 2015-04-09 17:30:26 +10:00
55ee436618 Fix missing NULL checks 2015-04-09 17:23:51 +10:00
089fc24c76 Fix for passing -1 to close() 2015-04-09 17:21:17 +10:00
5467260ce9 Cleanup: redundant NULL checks 2015-04-09 17:20:02 +10:00
0b59865115 Fix missing NULL check 2015-04-09 17:09:10 +10: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
1b72ad0c3d GHOST: don't instantiate assert arg
When debugging is disabled, function calls in an assert should never run.
2015-04-09 13:55:46 +10:00
12661de087 Remove invalid assert 2015-04-09 13:00:58 +10: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
aa24704749 Fix T44235: UNC Path Fails in open.
Here again, stat on '\\MYSERVER\foo\..' does not work...

Anyway, we can handle this in a much much simpler way using
BLI_access and BLI_parent_dir...
2015-04-08 21:59:05 +02:00
114d1b23d2 Fix T44113: Some System Folders do not contain go back arrow.
On windows empty dirs are completely empty - no par or current entries
are listed either, in those cases artificially add those.

Furthermore, stat on UNC paths do not support current/parent 'shortcuts'
(i.e. things like '\\SERVER\foo\bar\..' do not work), so we have to hack
around that mess...

This should ensure us we always do have valid parrent entry...
2015-04-08 21:59:05 +02:00
Dalai Felinto
5d212fb812 Fix T44310: Other render slots cleared after each render 2015-04-08 16:17:56 -03: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
0a304337e1 Freestyle: Fix for AndBP1D and OrBP1D not working due to typos.
Problem report by Folkert de Vries (flokkievids) through personal
communications.  Thanks!
2015-04-09 00:29:07 +09:00
780d257e6e Merge branch 'master' into gooseberry 2015-04-08 20:21:02 +05:00
c523e82e31 Particles: Fix for missing particles in render if they're disabled for viewport
The issue was introduced in rB4b685e1 and it appears some crazy area still
accesses particles for render after deleting it's render data, which broke
viewport/render behavior.

This commit restores previous G.is_rendering logic and adds corresponding
checks to cache construction, so counting is all consistent.

Goes to the TODO list to either replace G.is_rendering with eval_ctx or to
make it so psys->renderdata always exists during render sync.
2015-04-08 20:17:44 +05:00
2d05466700 Fix T44213: Bevel object from different scene won't update generated bezier curve geometry
The issue was caused by bevel object being automatically added to the scene graph
by dag_get_node() and had no incoming relations, even form the scene. This confused
scene update flush logic.

Now there'll be a scene relation added to such nodes, so they're always reachable
from the root node.
2015-04-08 20:06:42 +05:00
62f863b78a Fix memory leak in bump GLSL node 2015-04-08 16:48:15 +02: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
7fcb0bf71e Attempt GLSL compile fix in opensuse linux basically, we passed a vec3
as a float.
2015-04-08 16:30:45 +02:00
Julian Eisel
715c57f3b0 Merge branch 'master' into gooseberry 2015-04-08 16:27:31 +02:00
bf11e362c5 Fix T44046: Cycles speed regression in 2.74 (CPU only)
Issue was caused by MSVC not being able to optimize some code out in the same
way as GCC/Clang does, so now that parts of code are explicitly unfolded in
order to help compilers out.

This makes speed loss much less drastic on my laptop. That's probably as good
as we can do with MSVC without investing infinite amount of time looking trying
to workaround the optimizer.
2015-04-08 18:47:25 +05:00
2c91f9dc11 Transform: use relative motion for vertex slide
Vertex slide was using absolute mouse position unlike all other kinds of transform.

also remove need for allocated 2d projections.
2015-04-08 23:01:38 +10:00
01b1eb445c Math Lib: add project_plane_v3_v3v3
Useful for projecting one vector onto another (as a plane).

This is a rather common operation,
doing inline isn't always obvious whats happening.
2015-04-08 23:01:37 +10:00
d249db9755 Action editor proportional editing:
Fix crash when extending instead of translating
2015-04-08 14:36:25 +02:00
3b440dbf66 FileBrowser previews: Get rid of ugly, stupid and confusing 'FILE_TYPE_ICON_MOVIE' hack.
Was only handling failures in video thumbnails, was confusing (giving two different types
for video files, *sigh*), and... useless, since thumbnail code already handles smartly
failures in preview generation!
2015-04-08 14:31:49 +02:00
c5c60099c5 Proportional editing in action editor: display circle in center of
region.

It's -really- hard getting the center of selection here in the y axis, I
feel this is the best compromise.
2015-04-08 14:31:11 +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
40984f6c86 Fix annoying warning in GHOST when ASSERT_ABORT is off 2015-04-08 13:00:46 +02:00
d4c002d537 Merge branch 'master' into gooseberry 2015-04-08 12:50:39 +02:00
235f1feaf4 Fix opengl render preview in image editor broken
During multiview, invalidation of the display imbuf of the preview image
was eaten by code eating elves.
2015-04-08 12:49:54 +02:00
7621ff7e55 Cycles: Code cleanup, indentation. Was wrong in the multiview commit 2015-04-08 15:35:01 +05:00
bb19c7c3f7 Forgot this last commit. 2015-04-08 12:02:23 +02:00
d6d4d5e094 Fix multiview issue: play animation crashes
We need to avoid passing a NULL string here, and also we need to pass
the correct suffix we used to pass view string directly which is
probably not what we want.
2015-04-08 11:53:14 +02:00
079f1aa64a Bending forces in strand hair simulation. 2015-04-08 11:44:37 +02:00
a18e5d6a67 warning: unused 2015-04-08 16:26:58 +10:00
ab2a8832dd Use IS_EQF for floats 2015-04-08 16:20:53 +10:00
Dalai Felinto
60ecc6b3b3 Multiview: Expose current drawn eye to API (viewport only) 2015-04-08 03:12:45 -03:00
45e2366148 Cleanup: remove unused defines 2015-04-08 15:09:20 +10:00
Dalai Felinto
796b17b843 Multiview: Fullscreen modes (sidebyside/topbottom) were not working
* WM_window_is_fullscreen() is not the correct test.
* Also, we no longer change window to fullscreen automatically.
2015-04-08 02:02:59 -03:00
f5648f6db9 BGE : Fix T36285 Wrong viewport scale.
Fix of T36285, I just invalidate projection matrix when a camera switch
to viewport mode, because we need to rewrite the projection matrix in
RenderFrame.
It worked with old blender version because when you use viewport render
one camera is added in the camera list and initialize its projection
matrix for the first time. But when we used several cameras + viewport
for splitscreen we had issues.

Reviewers: dfelinto, hg1, ben2610, lordloki, moguri

Reviewed By: moguri

Projects: #game_rendering, #game_engine

Differential Revision: https://developer.blender.org/D1202
2015-04-08 06:56:17 +02:00
441f68e2b0 Partial fix for T44219
Prevent crashes from out of bounds array access if an invalid rotation mode
is passed to the euler rotation blenlib calculations.
2015-04-08 14:34:07 +12:00
1492db09d1 Partial fixes for issues raised in T44219
* The breakdowner tool will no longer operate directly on properties
  of type "enum", as this doesn't make sense most of the time. This
  is still not much use though when custom properties (ints) are used
  to drive some underlying enum property though (as in blenrig)
* The breakdowner no longer tries to perform any blending if the
  start and end values are the same, to avoid float precision issues.
2015-04-08 14:34:06 +12:00
808ea6271a Cleanup: confusing if statements & alignment 2015-04-08 12:24:52 +10:00
ccfb9a96c3 CMake: resolve linking error on Linux
Since multiview, matrixGlyph failed to link
2015-04-08 11:50:57 +10:00
8c539b0ab5 Font preview for file browser
D1002 by @plasmasolutions, with own refactoring.

Note, needed to do a bad-level call here (IMB -> BLF)
Also can't use the BLF API directly because its not thread-safe.
So keep the function isolated (blf_thumbs.c).
2015-04-08 10:38:19 +10:00
c56c493cf4 BLF: use regular unsigned int's
So GL isnt needed to include BLF types.
2015-04-08 10:30:18 +10:00
a2ea4ce70d Cleanup: IMB/thumb naming 2015-04-08 09:55:02 +10:00
a57b898d17 BLF: Fix clamping drawing into byte buffer 2015-04-08 09:55:01 +10:00
Julian Eisel
7e52d810f3 Muliview: Minor UI-tweaks
* Don't grey multiview options in file browser and in Node Editor Properties out if multi-view is disabled, hide them completely (I think greying out single buttons is fine, but in case of entire blocks we should just hide to save space)
* Move multiview settings in Node Editor Properties above alpha settings to prevent the alpha buttons from appearing above multiview settings if multiview is enabled and Stereo 3D format is chosen (making them appear below is much nicer)
2015-04-08 00:41:37 +02:00
796c3c7748 Fix T44290: Clear users & fake-user conflict
The purpose of clearing users in this case is not to save the data,
so keeping fake-user doesn't make sense.
2015-04-08 06:50:38 +10:00
c89637be30 BGE: use tuple for returning display size 2015-04-08 06:28:05 +10:00
09a746b857 Cycles: Cleanup, typos 2015-04-08 01:15:38 +05:00
Dalai Felinto
cc9c049ff7 Multiview: compositor - avoid trashing image viewer views/buffers when multiview is off
I found this while investigating why the backdrop shows 'blank' while I
update a node influence factor. This problem still persist, but maybe it
was there before multiview. In release it is not noticeable, but in my
debug build is quite evident.
2015-04-07 16:56:31 -03:00
Dalai Felinto
4c2306d21a Multiview: compositor was not updating when multiview was off 2015-04-07 16:38:21 -03:00
c1e5d966c6 Proportional editing support for the action editor.
There are a few things here which are not so nice:

* Position of proportional edit circle is not centered on data
(difficult to predict positions here since those are completely custom,
 will probably be positioned at center of area later instead)

* Result is flushed to curve handles only at the end of the transform,
so if people have the graph editor open they will see handles lagging behind.
2015-04-07 20:49:47 +02:00
Dalai Felinto
662c2cd910 Multiview: update Set Stereo 3D menu when the selected stereo mode changes 2015-04-07 15:43:06 -03:00
858f54f16e Cycles: Cleanup, indentation 2015-04-07 22:41:08 +05: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
e36b0cb8f3 BGE: New API method getDisplayDimensions
This patch adds a new API function to get the actual display dimensions in pixels.

Reviewers: dfelinto, sybren, lordloki, moguri

Reviewed By: lordloki, moguri

Differential Revision: https://developer.blender.org/D648
2015-04-07 18:32:25 +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
f9f3c29a3a Fix crash when changing proxy storage type for editing (was own
stupidity casting from Scene to Editing in RNA)

Move versioning for proxy storage to multiview version check (not really
correct but it was orphaned before and it doesn't hurt either).
2015-04-07 16:08:46 +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
Julian Eisel
cc78664d50 Revert Sticky Keys (and everything related to that)
Our current keymap doesn't give us enough room to make such changes in
the event system. To fix small issues caused by this, we would need to do
drastic changes in Blender's keymaps and internal handling. It was worth
a try, but it didn't work.

I can write down a more descriptive statement in a few days, but for now
I need a break of this stuff.
2015-04-07 14:13:20 +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
d60ff6c112 Fix for own last commit
resolved bug but wasn't correct
2015-04-07 20:27:08 +10: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
34818a44b2 Make image strips also follow the project directory storage options. 2015-04-07 12:15:18 +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
20a780e3e8 Fix T44258: Can't select similar regions 2015-04-07 19:56:24 +10:00
dc6d51c555 Take strand bounds into account when calculating bounding boxes for
dupli overrides.
2015-04-07 11:17:19 +02:00
4b685e1b90 Fix T44268: Particles: too many virtual parents + non-100 display% = crash
Issue was caused by mismatched logic in counting child/parent particles in
job initialization and actual job execution. Confusion here came from mixed
usage of psys->renderdata and G.is_rendering.

We need to get rid of G.is_rendering and use eval_ctx if it's really needed,
but we also might just use psys->renderdata check since it's expected psys
to have this structure anyway.
2015-04-07 13:52:42 +05:00
98f4106694 Metaball tessellation optimization (Octree to BVH)
Speedup is non-linear, 2x-10x faster is quite normal.
Patch T43678.

- Switched from an Octree to BVH.
- Finding first points of surface no longer "wastes" density function evaluation: every result is cached.
- Use MemArena instead of using own memory management.
- Correct calculation of metaelem bounding box.
- Remove mball_count(): mballs are now counted "on the go".
2015-04-07 13:19:50 +10:00
9510137d12 Cleanup: brace placement /w structs 2015-04-07 11:25:42 +10:00
e2eeb46a1b Cleanup: rename treehash -> outliner_treehash
This is an API specifically for the outliner,
not some generic hierarchical hash structure.
2015-04-07 11:01:47 +10:00
5217d2bc0e Use BKE_edgehash_ensure_p where possible 2015-04-07 10:53:58 +10:00
808de65d91 EdgeHash: ensure function, avoids multiple lookups 2015-04-07 10:53:20 +10:00
1b9f1519bc Cleanup 2015-04-07 08:46:48 +10:00
Julian Eisel
3dcdacffca This commit doesn't deserve a title
Today just wasn't my day...
2015-04-06 23:23:13 +02:00
d3388f0c7a Fix compilation error in Win Debug. 2015-04-06 23:17:18 +02:00
Julian Eisel
bcc9a23548 Various Sticky fixes (tm)
* Revert 776bfa64a5 and c3dad7953a (some X11 systems are doing
stupid things forcing me to do an extra check that completely breaks the
click type handling on other systems using the slightly changed
implementation from those commits - see T44278)
* Fix sample lines in Compositor+VSE

(And yes, this time I tested on both of my systems to make sure
everything is fine)
2015-04-06 23:10:21 +02:00
33a9247334 UI i18n cleanup...
And some general style cleanup as well (line length...).
2015-04-06 22:06:06 +02:00
e2354e64d2 Cycles: Cleanup, spaces around assignment operator
Did some bad spacing in recent commits, better to get rid of those so
they does not confuse those who're working on sources.
2015-04-07 00:25:54 +05:00
c1d8ddacaf Cycles: Avoid doing paranoid checks in filepath of builtin images
Originally we thought it's needed in order to distinguish builtin file from
filename which starts with '@', but the filepath is actually full path there
and it's unlikely to have file system where '@' is a proper root character.

Surprisingly this does not give visible speed differences, but it's still
nice to get rid of redundant check.
2015-04-07 00:11:47 +05:00
7c19239bf9 Cycles: Support bultin 3d textures with OSL backend 2015-04-06 23:29:29 +05:00
2aa79679dc OSX: add also license for iomp5 using cmake and fix all textfiles wrong destination 2015-04-06 19:55:51 +02:00
28e9058e7a OSX: add a license file for libiomp5 ( intel omp ) when compiled with 2015-04-06 19:12:23 +02:00
593b4d84c4 BGE: followup of renaming parameter "other" to "reference"
See commit 3e5332bb95
2015-04-06 18:23:56 +02:00
3e5332bb95 BGE: fixed nomenclature of KX_Scene::addObject and KX_Scene::AddReplicaObject
KX_Scene::addObject: Changed the parameter "other" to "reference", as "other" doesn't mean anything.
KX_Scene::AddReplicaObject: Changed the parameter "parentobject" to "referenceobject", as the parameter did NOT contain a parent object in any way.

Now both functions use the same kind of name for the same thing.

Thanks to panzergame / Porteries Tristan.
2015-04-06 17:11:36 +02:00
d0aae79505 Cycles: More instant feedback on progressive rendering for first sample
Main purpose of this change is to make material preview appearing more
instant after the shader tweaks.
2015-04-06 19:28:25 +05:00
b5f58c1ad9 Cycles: Experiment with making previews more interactive
There were two major problems with the interactivity of material previews:

- Beckmann tables were re-generated on every material tweak.
  This is because preview scene is not set to be persistent, so re-triggering
  the render leads to the full scene re-sync.

- Images could take rather noticeable time to load with OIIO from the disk
  on every tweak.

This patch addressed this two issues in the following way:

- Beckmann tables are now static on CPU memory.

  They're couple of hundred kilobytes only, so wouldn't expect this to be
  an issue. And they're needed for almost every render anyway.

  This actually also makes blackbody table to be static, but it's even smaller
  than beckmann table.

  Not totally happy with this approach, but others seems to complicate things
  quite a bit with all this render engine life time and so..

- For preview rendering all images are considered to be built-in. This means
  instead of OIIO which re-loads images on every re-render they're coming
  from ImBuf cache which is fully manageable from blender side and unused
  images gets freed later.

  This would make it impossible to have mipmapping with OSL for now, but we'll
  be working on that later anyway and don't think mipmaps are really so crucial
  for the material preview.

  This seems to be a better alternative to making preview scene persistent,
  because of much optimal memory control from blender side.

Reviewers: brecht, juicyfruit, campbellbarton, dingto

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1132
2015-04-06 19:22:17 +05:00
Dalai Felinto
36f352a4e4 Fix doversion check - patch by Sergey Sharybin 2015-04-06 11:11:36 -03:00
Dalai Felinto
d5f1b9c222 Multi-View and Stereo 3D
Official Documentation:
http://www.blender.org/manual/render/workflows/multiview.html

Implemented Features
====================
Builtin Stereo Camera
* Convergence Mode
* Interocular Distance
* Convergence Distance
* Pivot Mode

Viewport
* Cameras
* Plane
* Volume

Compositor
* View Switch Node
* Image Node Multi-View OpenEXR support

Sequencer
* Image/Movie Strips 'Use Multiview'

UV/Image Editor
* Option to see Multi-View images in Stereo-3D or its individual images
* Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images

I/O
* Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images

Scene Render Views
* Ability to have an arbitrary number of views in the scene

Missing Bits
============
First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report.

Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report.

Everything else is likely small todos, and may wait until we are sure none of the above is happening.

Apart from that there are those known issues:
* Compositor Image Node poorly working for Multi-View OpenEXR
(this was working prefectly before the 'Use Multi-View' functionality)
* Selecting camera from Multi-View when looking from camera is problematic
* Animation Playback (ctrl+F11) doesn't support stereo formats
* Wrong filepath when trying to play back animated scene
* Viewport Rendering doesn't support Multi-View
* Overscan Rendering
* Fullscreen display modes need to warn the user
* Object copy should be aware of views suffix

Acknowledgments
===============
* Francesco Siddi for the help with the original feature specs and design
* Brecht Van Lommel for the original review of the code and design early on
* Blender Foundation for the Development Fund to support the project wrap up

Final patch reviewers:
* Antony Riakiotakis (psy-fi)
* Campbell Barton (ideasman42)
* Julian Eisel (Severin)
* Sergey Sharybin (nazgul)
* Thomas Dinged (dingto)

Code contributors of the original branch in github:
* Alexey Akishin
* Gabriel Caraballo
2015-04-06 10:40:12 -03:00
74df307ca4 Cycles: Free unused image buffers when rendering with locked interface
It is still possible to free a bit more memory by detecting buildin images
which are not used by shaders, but that's not going to improve memory usage
that much to bother about this now.

Such change brings peak memory usage from 4.1GB to 3.4GB when rendering
01_01_01_D layout scene from the Gooseberry project. Mainly because of
freeing memory used by rather huge environment map in the viewport.

Reviewers: campbellbarton, juicyfruit

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D1215
2015-04-06 17:47:08 +05:00
Julian Eisel
bb2300de94 Fix T44282: Image sampling line disappears after a while
Now even to master
2015-04-06 14:12:05 +02:00
Julian Eisel
883663a0ad Fix T44278: Tab, Z-Key and Spacebar not working
Seems like a fix that is needed for some X11 systems causes this bug on
others :| Not sure if the systems that needed this fix are now still
fine (since I did a slight change to the click type check procedure),
but I need to check that on my system in the institute in a bit.
2015-04-06 13:13:35 +02:00
26e50295ce Use BKE_ghash_ensure_p where possible 2015-04-06 20:41:37 +10:00
dd129125b6 GHash: ensure function, avoids multiple lookups 2015-04-06 20:33:02 +10:00
3639a70eae Fix T44222: Crash using pointiness attribute for volume shaders
This attribute is not really supported for volumes, so it get's converted to
constant 0 at shader compile time.

TODO: We should consider doing the same for tangent attribute in order to save
some annoying checks at tracing time.
2015-04-06 14:11:28 +05:00
a9bb8d8a73 Cycles: de-duplicate fast/approximate erf function calculation
Our own implementation is in fact the same performance as in fast_math from
OpenShadingLanguage, but implementation from fast_math is using explicit madd
function, which increases chance of compiler deciding to use intrinsics.
2015-04-06 12:49:44 +05:00
9f8ffd478e Only show image slot-name in render view 2015-04-06 17:06:37 +10:00
dd3aa1b372 Cleanup: replace confusing 'if' statements 2015-04-06 16:40:26 +10:00
8cc475c40b Fix T43696: Baking tearing normals
Patch D1207 by @chrisr
2015-04-06 15:56:33 +10:00
986972701e Fix T44249: Cursor depth offset 2015-04-06 15:00:07 +10:00
434087981a Fix minor glitch getting depth from mouse cursor 2015-04-06 15:00:07 +10:00
46b42dba14 Fix: Stroke Edit Mode warning for GPencil draws correctly with Region Overlap enabled 2015-04-06 13:21:18 +12:00
5574f4c59d Fix: It was difficult to select control points for NLA Control FCurves in the Graph Editor 2015-04-06 12:19:20 +12:00
7157f3dbce GHash: no reason to use GSetEntry in ghash API 2015-04-06 09:08:10 +10:00
Julian Eisel
c3dad7953a Stickies: Remove redundant fixes
Those fixes aren't needed anymore due to
776bfa64a5
2015-04-05 20:04:37 +02:00
Julian Eisel
776bfa64a5 Stickies: Don't send extra event on KM_CLICK
Just add KM_CLICK to the already sent KM_RELEASE, don't send a new one
for this.

This might help us to get rid of quite some glitches and workarounds \o/
(why didn't this come earlier to my mind? :S)
2015-04-05 19:32:57 +02:00
Julian Eisel
af23e8d44a Fix T44275: CTRL+LMB to extrude to mouse position conflicts with snapped
extruding

More practical description of the bug: extruding with ctrl to use
snapping and confirming the action added another extrusion to the mouse
position.
This was caused from the second event that is now sent if a key release
happens within the click timeout. It triggers the "Extrude to Cursor"
operator since it is called by CTRL+LMB wich is exactly the event that
is sent in this case.

I'm not totally happy with this workaround since it changes the Confirm/
Abort event for all transformation actions to key release which *might*
result in more conflicts (fingers crossed this isn't the case). If this
happens we might need to write some special transformation handling for
extrusion.

This is an example of the difficulties we get from loading too much
functions on the same keys - we need to be careful with that!
2015-04-05 18:52:36 +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
ab2d05d958 Fix T44269: Typo in volume_attribute_float:geom_volume.h
Was rather harmless typo since we either pass both dx,dy or pass both NULL.
2015-04-05 19:07:45 +05:00
b06962fcfe Cycles: Avoid using lookup table for Beckmann slopes on GPU
This patch is based on some work done in D788 and re-formulation from Beckmann
implementation in OpenShadingLanguage.

Skipping texture lookup helps a lot on GPUs where it's more expensive to access
texture memory than to do some extra calculation in threads.

CPU code still uses lookup-table based approach since this seems to be still
faster (at least on computers i've got access to).

This change gives about 2% speedup on BMW scene with GTX560TI.
2015-04-05 19:07:45 +05:00
252b36ce77 Cycles: Remove unused Beckmann slope sampling code
It did not preserve stratification too well and lookup-table approach was
working much better. There are now also some more interesting forumlation
from Wenzel and OpenShadingLanguage which should work better than old code.
2015-04-05 19:07:44 +05: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
Julian Eisel
92755da471 Fix T44251 (2nd try): Changing views using numpad broken 2015-04-05 15:41:20 +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
29e968a315 BGE: Fix T36703: Character motion actuator local movement not working correct.
The character motion actuator local movement does not taking account of the object rotation.
It is necessary to rotate the motion vector before adding the local movement.

Reviewers: sybren, lordloki, moguri

Reviewed By: lordloki, moguri

Maniphest Tasks: T42709

Differential Revision: https://developer.blender.org/D1206
2015-04-05 10:13:04 +02:00
1a117ad40c Fix T44263: Invalid parameters to fill_vn_fl in deform.c.
Own fault, thanks a bunch to LazyDodo for finding that - and odd
GCC did not warn about it...
2015-04-05 09:50:16 +02:00
a1c2b1a8a8 Fix T44265: Win32 error checking GL version 2015-04-05 09:57:10 +10:00
59bfc5c76e Fix T44270: Similar face region crash /w wire edge 2015-04-05 09:44:30 +10:00
00f732f268 Fix T44266: win32 delete's malloc'd memory 2015-04-05 06:54:34 +10:00
2f42be6995 Cleanup: remove MSVC2008 workaround 2015-04-05 06:54:34 +10:00
26979d45b1 Cleanup: use float math funcs 2015-04-05 06:54:34 +10:00
cedd7cde44 WM: prefer define over zero wmEvent.val 2015-04-05 06:54:34 +10:00
8eac4085be Fix T44264 copy paste error, checking same condition twice. 2015-04-04 22:39:25 +02:00
Julian Eisel
1604a26fe6 Fix T44251: Changing views using numpad broken
For KM_ANY I've filtered out every event that has a click type, although
that was only needed for the additional event sent on KM_HOLD. A bit weird
that this only happened on a few machines though.
2015-04-04 19:17:39 +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
Julian Eisel
59df941ea5 Fix T44259: Secondary strokes get terminated early when drawing in Continuous Drawing mode 2015-04-04 14:27:05 +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
f5949efb53 Missed in recent cleanup 2015-04-04 18:58:49 +11:00
e84b0e4c35 Ghost: update tests for recent changes 2015-04-04 17:21:18 +11:00
eca22d076c Cleanup: move filelist out of storage
Depends on imbuf, problematic for tests
2015-04-04 17:21:18 +11:00
e5392069cc Cleanup: Typo fix in HSV code. 2015-04-04 07:50:09 +02:00
12cede5ca3 Cleanup: use BKE_ocean_* prefix 2015-04-04 15:19:24 +11:00
7acd69958b Cleanup: use BKE_sculptsession_* prefix 2015-04-04 15:19:21 +11:00
1c96a84320 Cleanup: use BKE_animdata_* prefix 2015-04-04 15:13:56 +11:00
89a3e4deff Cleanup: redundant normalize in expmap_to_quat 2015-04-04 14:45:54 +11:00
519e20f984 Cleanup 2015-04-04 10:48:17 +11:00
92c7632835 Add missing break statements 2015-04-04 10:48:05 +11:00
4a4aaabfa9 CMake: treat inline C files as headers 2015-04-04 10:37:38 +11:00
f9b6709a17 Add missing declarations 2015-04-04 10:37:38 +11:00
53f4aa7817 WIP: Added dedicated operator for unlinking actions from the Action Editor (NLA buttons support to come)
After looking into this more carefully, I've found that we do in fact need a dedicate
operator to add some custom logic when trying to unlink an action from the editor/datablocks.

Specifically, this new operator does the following:
1) When in Tweak Mode, it shouldn't be possible to unlink the active action,
   or else, everything turns to custard.
2) If the Action doesn't have any other users, the user should at least get
   a warning that it is going to get lost.
3) We need a convenient way to exit Tweak Mode from the Action Editor
4) If none of the above apply, we can just unlink normally

This commit implements this for the Action Editor, with stubs for the NLA Editor too.
Those will be fixed next.
2015-04-04 11:37:06 +13:00
34c4133daf Tweaks to descriptions for Action Layer Up/Down 2015-04-04 11:37:05 +13: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
Julian Eisel
a3fdc6b755 Update keyconfigs for stickies
Change are needed to avoid conflicts due to rB53a3850a8a05249942a0c4
2015-04-03 16:44:42 +02:00
Julian Eisel
53a3850a8a Sticky Keys backend
Design task: T42339
Differential Revision: D840
Initial implementation proposal: T41867

Short description:
With this we can distinguish between holding and tabbing a key. Useful
is this if we want to assign to operators to a single shortcut. If two
operators are assigned to one shortcut, we call this a sticky key.

More info is accessible through the design task and the diff.

A few people that were involved with this:
* Sean Olson for stressing me with this burden ;) - It is his enthusiasm
that pushed me forward to get this done
* Campbell and Antony for the code and design review
* Ton for the design review
* All the other people that gave feedback on the patch and helped to
make this possible

A big "Thank You" for you all!
2015-04-03 16:21:22 +02:00
b444887054 Fix T44243: File browser behavior is inconsistent between append and open.
Only basic fix, the whole 'dir' field handling needs rework to correctly support
lib stuff (will be done as part of asset-experiment rewriting work)...

All this code is doing way too much filesystem inspection by itself, instead of
reusing flielist.c work - this is stupid, and will completely break with future
asset engines!
2015-04-03 16:20:18 +02:00
3f30ebf64a Fix related to T44243: do not systematically do live-update when tab-completing textedit buttons.
We now have a specific flag for that, use it! Note that for all 'search menu' buttons,
there is already a similar behavior, so there is no need to force apply butt in this case
anyway, which means in practice this change only has effect in the single place
it is needed currently - file browser dir/file fields.

In this case (dir field), applying button even on partial matches leads code
to ask to create a new dir, which breaks completely the expected behavior of
completion. And we do not need immediate apply at all here.

Note this is the only 'autocomplete' button not using search menu, so this change
does not affect anything else in UI.
2015-04-03 16:20:18 +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
03f2e5d4a6 Fix: Drawing glitch when renaming animation channels
When renaming animation channels, the old names are no longer drawn behind the
text boxes anymore. This used to cause problems if the names were long, or
if text boxes were set to have transparent backgrounds.

Thanks to kopias for reporting on IRC.
2015-04-04 01:40:01 +13:00
6ef7e0a194 Bugfix: Stashed actions now get added to the bottom of the NLA Stack if there weren't any stashed actions already 2015-04-04 01:40:00 +13:00
b30836dad7 Fix: Action/NLA Tweakmode Checks
Made all action management operators use the AnimData-local flag instead of the scene
global one. Technically, this is more accurate and results in less blocking
situations (i.e. another object may be in tweakmode, but because of that, the active
object's action couldn't be stashed).

The main impetus for this though was that the Action Up/Down feature doesn't clear
the global flag, since it is not in a position to do so (since it can't load up
everything to clear it).

TODO:
I'll need to review how this global flag works and/or potentially ditch it (or
perhaps add some better ways to ensure that it stays valid), since while thinking
this over, I've noticed a few problems here. But, for the meantime, this commit
at least makes things more usable here in the short term.
2015-04-04 01:39:59 +13:00
5681b4fc83 Action Editor: Move up/down buttons to be before the datablock selector
It turned out that the constantly changing width of the datablock selector
made it a pain to use these to quickly toggle between different actions,
as the buttons would keep jumping around, thus leading to errors when
quickly toggling between actions. This way doesn't look quite as great,
but should be more usable.
2015-04-04 01:39:58 +13:00
943b830bf6 Action Layer Up/Down: Fixes for NLA Solo / NLA Muting
Now marking NLA Tracks as Solo'd and muting the NLA stack are linked together
when using the Action Layer Up/Down tools. That is, when switching from a NLA strip
to the active action, if the track was solo'd, then the NLA stack will get muted;
and when switching from the active action to a NLA track, if the stack was muted,
the track will get solo'd. This linkage means that we ensure that when moving up
and down the stack, we can continue to check the actions in isolation without things
messing up when you switch to and from the active action.

Also fixed a bug where this wasn't getting applied when going in the other direction.

TODO:
- When we get the rest/reference track support, we're going to need to insert
  some calls to flush the restpose values so that values from the previously
  used action do not pollute the pose for the new action (if not all the
  same controls get keyed across both). For now, it's best to only do this
  switching from the first frame.
2015-04-04 01:39:56 +13:00
961dac55cf Code Cleanup: Deduplicate logic to switch between NLA Strips/Actions 2015-04-04 01:39:55 +13:00
f350e9f3fc Code Cleanup: Split out duplicate code for finding an available NLA strip above/below 2015-04-04 01:39:54 +13:00
bcf1abbc83 Action Editor: Go to Next/Previous Animation Layer
With this feature, it is now possible to quickly switch between different actions
stacked/stashed on top of each other in the NLA Stack without having to go to the
NLA Editor and doing a tab-select-tab dance, thus saving quite a few clicks. It
was specifically designed with Game Animation / Action Library workflows in mind,
but also helps layered animation workflows.

Usage:
Simply click on the up/down arrow buttons (between the action datablock selector
and the pushdown/stash buttons) to go to the action in the NLA Track above/below
the NLA Strip being whose action is being tweaked in the Action Editor.

Notes:
- These still work when you're not editing the action used by a NLA Strip.
If you're just animating a new action normally, it is possible to use the "down arrow"
to temporarily jump down to the previous action without losing the new action you're
working on, and then use the "up arrow" to get back to it once you're done checking
the other action(s).

- If there are multiple actions/strips on the same layer/track, then only the one
closest to the current frame will be used.
2015-04-04 01:39:53 +13: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
13a63234d6 Fix T44237: translation does not work for input sockets in 'Active node properties' panel. 2015-04-03 12:38:59 +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
99d8e08ed9 Fix T44237: translation does not work in spacebar search.
Added translation there, also fixed a stupid bug which was leading most internal
operators to have 'dual' i18n_context (default NULL one and default 'Operator' one).
2015-04-03 12:26:29 +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
89530f1486 Fix T44240: Lamp Halo invisible in rendering.
Halo is not possible when using 'deep' buffer shadow - reflect that in UI.
When not using buffered shadows, switch lamp bufftype to 'regular' on render, as already
done with 'halfway' method.
2015-04-03 11:17:58 +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
43101289a6 Fix T44183 particles in linked group offset from object
A nice bug combining all the broken features of blender:
Particles, duplis and multiple scene dependencies.

Fortunately this was solvable: Basically, we need to
make sure derivedmesh for dupli instance is generated before
obmat is overriden. This also makes sense, since no instance
has "true" obmat apart from original. Lazy initialization of
derivedmesh just does not work here (or it -does- work but first
use should be before instance drawing).

Fingers crossed nothing else breaks after this...
2015-04-02 17:13:45 +02:00
5156c283dd Fix for wrong pointer used in the modifier cache copy function. 2015-04-02 16:39:10 +02:00
018dc3aeda Action Editor: Experimental tweak to ordering of buttons
This commit is an experiment exploring the relationship between the action
management buttons (i.e. action selector + pushdown/stash, and soon a few others)
and the filtering stuff (i.e. summary, only selected, etc.)

The old ordering meant that the filtering stuff was consistently in the same
place beside the mode selector, meaning that the order was "common stuff, then
editor specific stuff", this was not that great on smaller windows, where there
important stuff was often out of view.

This new order places greater emphasis on the parts which are likely to be more
important. It also allows us to have a better hierarchy/flow; this is especially
because we'll soon introduce a way to specify which datablock "level" the
action comes from, so going from "level -> action -> filters within action" will
make more sense.
2015-04-03 02:17:45 +13:00
5d4beee8c6 Code Cleanup: Split Action management operator stuff into action_data.c 2015-04-03 02:17:44 +13:00
a6998f132a Force calculation function for strands (only gravity atm). 2015-04-02 15:03:06 +02:00
64fed6841a Cleanup: followup to rBf87d7c605dcfb - use __func__ instead of literal func name in string.
Since we are already using BKE_reportf... This way, no more issue if/when we copy/paste
or rename that!
2015-04-02 14:51:37 +02:00
Dalai Felinto
f87d7c605d Fix error messages for RE_layer_load_from_file() and RE_layer_load_from_file() 2015-04-02 09:08:25 -03: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
77ff544d93 Fix issue reported by copias on irc, shift duplicate and snap crashes in
sequencer.

Missing snap callback case. Quick patch is to use the sequencer specific
operator instead of generic translate. We really need to support proper
snap/snap options at some point though.
2015-04-02 13:47:53 +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
ff45930cc5 Cleanup: Make strict flags happy
We might also just remove those arguments perhaps?
2015-04-02 16:01:23 +05:00
fd2ea3a909 Cycles: Make guarded allocator happy about strict C++ flags 2015-04-02 15:51:43 +05:00
f30b60d139 Fix: Crash when using "On Selected Markers" mode for Propogate Pose with no markers present
The function to get a list of markers was not clearing the list before it exited
early, and with no way to tell that the method failed, callers could make the
mistake of trusting that the list was now valid (i.e. either full of marker
frames or empty, vs being invalid)
2015-04-02 23:48:25 +13:00
838c3503a7 Expose the Pose Propagate tool a bit more in the UI
From the various forum threads and the fact that a new addon has cropped up,
it appears that it is not that well known that this tool exists, and that it
can be used solve a very common problem that animators face. Namely:
  When you've gone through blocking out your key poses and then realise
  that you need to adjust parts of the rig which don't change much, this
  tool solves the problem of needing to go through doing grunt-work to
  fix all the other keyframes which now need to change as well.

So, this tool is now available in the following two places (in addition to
the existing Pose -> Propagate menu):
* Toolbar - The "Propagate" button will use the default mode (or the last
            used mode for each subsequent invocation).
            The arrow-button beside this will allow choosing between the different
            modes. (NOTE: The UI team may have different thoughts on this, but,
            let's give this a try for a while first, to see if this sort of thing works)
* Alt-P   - In Pose Mode, this will now bring up a menu allowing you to choose
            which mode is used. Since this sort of thing is something that does
            get run several times in a row when you need it, having this hotkey
            will make it a bit more convenient.
2015-04-02 23:48:24 +13:00
97f6bff45a Propagate Pose: Added 'Selected Keyframes' mode
This commit adds a new mode for the Propagate Pose tool. With this new option,
the Propagate Pose will copy the current pose over to all selected keyframes
after the current frame.

For reference, some of the other/existing options are: to copy it to each subsequent
keyframe with the same value (WHILE_HELD - the default), to the next keyframe,
or to the last keyframe.
2015-04-02 23:48:23 +13:00
f5adbcc3a2 GPencil: Draw status indicator in top-right corner when in Stroke Edit Mode
When in Stroke Edit Mode, an indicator/warning message is now shown in the top-right
corner to make it easier to notice that operations will apply to Grease Pencil
strokes instead.
2015-04-02 23:48:22 +13:00
2cac2e7213 GPencil: H/Shift-H/Alt-H now work to Hide and Reveal Layers in Strokes Edit Mode
* H       = Hide active layer
* Shift-H = Hide non-active layers
* Alt-H   = Show all layers
2015-04-02 23:48:21 +13:00
335b495196 Merge branch 'master' into gooseberry 2015-04-02 12:37:22 +02:00
146be8e258 Fix proportional editing always turned on in graph editor. 2015-04-02 12:34:35 +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
2fc69d11c8 Add custom properties to sequence strips 2015-04-02 21:07:23 +11:00
ac2530be8c Cleanup own todo: RE_pipeline is not a bad include from BKE, it's already used in few places 2015-04-02 14:39:58 +05: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
77667ad80f Cleanup 2015-04-02 16:12:33 +11:00
efc7c355b2 Code Cleanup: Pruning back the unusued includes now 2015-04-02 16:33:09 +13:00
26fa13e6f8 Code Cleanup: Reshuffling some of the GPencil code
* Moved the context handling stuff into gpencil_utils.c

* Moved the datablock and layer operators out into their own file too. Again,
  these weren't related to the other stuff that much

* Split the GPencil to Curves operator out into its own file (gpencil_convert.c).
  This was quite a massive blob of code (48kb) that was not that related to the
  other operators still in that file (gpencil_edit.c)
2015-04-02 16:29:33 +13:00
b6d878fa96 Fix for incorrect description 2015-04-02 12:12:35 +13:00
Julian Eisel
4b847595ee Fix T44217: Crash when starting .blend without "Load UI" enabled
Caused by changes in 31e26bb83b. This makes it fall back to the old
method if we can't find a screen.

Patch is actually by @LazyDodo with minor edits by me.
2015-04-02 00:24:58 +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
f1494edf78 Cycles: Make SSS intersection closer to regular triangle intersection 2015-04-01 21:20:04 +05:00
394b947a50 Cycles: Remove unused direction from triangle intersection functions
This argument was unused and got nicely optimized out. But once it
starts to be using registers are getting stressed really crazy,
causing slow down of render.
2015-04-01 21:08:12 +05: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
8e6e7010bc Proportional editing for graph editor did not work outside edit mode 2015-04-01 11:24:58 +02:00
dc172108f2 Merge branch 'master' into cycles_point_density 2015-04-01 14:23:02 +05:00
af399884e1 Fix T44113: Ashikhmin-Shirley distribution of glossy shader at 0 roughness causes artifacts when background uses MIS
Was a division by zero error, solved in the same way as beckmann/ggx
deals with small roughness values.
2015-04-01 14:21:21 +05:00
9e39cfe16d Merge branch 'alembic' into gooseberry 2015-04-01 10:01:25 +02:00
71af08e1c9 Fix T44212: Crash on Group Rename.
Nice offset-by-one index error. ;)
2015-04-01 09:48:48 +02:00
f7dbce9914 Real fix for T44127: Python does not guarantee to free all objects on exit...
All kudos to Campbell for the head-up and patch!
2015-04-01 09:34:01 +02:00
6461fbd9ce Fix glitch scaling bone radius
connected parents radius could get out of sync with child.
2015-04-01 17:07:04 +11:00
879f5c832b Match corrective-smooth UI to smooth modifier 2015-04-01 09:29:56 +11:00
c59ca9e477 silence MSVC warning
‘*/‘ found outside of comment
2015-03-31 14:58:41 -04: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
d9c566a2d8 Corrections to submodules: we need to use latest tag available from master branch 2015-03-31 22:10:26 +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
f3b45eb76f Fix T43987 ambient occlusion wrong for Intel cards on windows (tested on
HD3000 and HD4000 cards so far).

Similar issue to Radeon 3xxx series but Intels need the opposite factors
for dfdy.
2015-03-31 17:37:17 +02:00
7ee340c0b4 Fix writing freed memory, exiting full view 2015-04-01 02:01:02 +11: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
79918e0577 Cycles: Avoid float/int conversion in few places 2015-03-31 19:52:14 +05:00
7da4c2637d Cycles: Fix typo in distance heuristic for shadow rays
It's not that bad because this typo could only caused not really
efficient BVH traversal, causing higher render times. Not as if
it was causing render artifacts.
2015-03-31 19:52:14 +05:00
66a028a576 Proportional editing for IPO editor - version ready for feedback by artists.
This works by using the distance in the x axis only (usually artists want to influence nearby
keyframes based on timing, not value). Tweaking handles is the same as tweaking
the central handle. It's a bit ambiguous if proportional editing is really meaningful
for handles but will leave that for artists to decide.
2015-03-31 16:45:30 +02:00
41f9cdc955 Point master's submodules to v2.74 tag as well 2015-03-31 18:57:17 +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
b98c7bcf3a Fix T44077 material update fails in textured mode when VBOs are off.
The issue has been here since we changed drawing code for meshes to use
vertex arrays instead of immediate mode when VBO was off. Basically we
should now always invalidate the GPU objects regardless of the VBO
setting in the preferences.

The bug has been there since 2.73 at least, but what made it apparent
now is that new version resets preferences and as an extension the VBO
flag.

Should be included in final 2.74 release
2015-03-31 11:42:39 +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
4153ff3610 Fix T44201: Crash Deleting Hierarchy in Outliner
Typical error using '->next' member of a freed linked list item. A bit trickier
even here, since we have some recursion...

Trivial fix for nasty crasher, safe for 2.74 imho?
2015-03-31 08:36:48 +02:00
c16a8983ef Corrective Smooth Modifier (aka delta-mush)
This modifier can be used to correct bad deformations,

Original patch D1183 by @sazerac, with own modifications
2015-03-31 10:20:11 +11:00
660173ed72 BGE: Fix: VehicleWrapper compiler warning.
The return type of raise_exc_wheel() is bool, but the method return -1. The compiler will change the return type type to an int. This can cause some problems on 64bit systems.

Reviewers: lordloki, sybren

Reviewed By: lordloki, sybren

Differential Revision: https://developer.blender.org/D1204
2015-03-30 22:47:46 +02:00
1740fedb64 Merge branch 'master' into gooseberry 2015-03-31 00:27:22 +05:00
dd0604c606 Fix T44193: Hair intersection with duplis causes flickering
It was an issue with what bounds to use for BVH node during construction.

Also corrected case when there are all 4 primitive types in the range and
also there're objects in the same range.
2015-03-31 00:24:43 +05:00
9b4172cc6c Fix T43266, when we have a blendfile name use only that without the pid
for autosave. Will save Windows users from polluting their tmp folders
too much.
2015-03-30 19:21:38 +02: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
050f28f03f Remove wrong back jump detection on looping 2015-03-30 18:27:28 +02:00
bacdfc70e2 Fix T41191: Custom Loop Normals Viewport shading not updating when set from py script
Missing update tagging...

Safe for 2.74.
2015-03-30 15:04:42 +02:00
c6ce8200dd Attempt to fix T44056, dof high quality shader error in ATI cards.
ATI driver does not like declaration of gl_FragColor and glFragData in
the same source file (even though only one of the two is ever
referenced), just use one of the two.
2015-03-30 14:45:14 +02:00
79a68617b3 Pass bool arg to RNA_property_boolean_set 2015-03-30 23:31:42 +11:00
2a032a2f6e Merge branch 'alembic' into gooseberry 2015-03-30 14:16:03 +02:00
590efaacb8 Potential fix for T43987, ambient occlusion different between offscreen
and on screen rendering.

Aaaaah, the beauty of driver implementations of OpenGL!

Turns out the problem here is that drivers calculate df/dy differently
in some cases (probably because OpenGL counts y reverse to how the
window system does, so drivers can get confused).

Fixed this for the ATI case based on info we have so far, there's also
the Intel case which will be handled separately (missing info on Intel's
renderer string etc).

Unfortunately we can't really fix this for the general case so we'll
have to haldle cases as they come in our tracker and by adding silly
string comparisons in our GPU initialization module <sigh>.
2015-03-30 14:14:52 +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
4aeb34dc82 Cleanup: use const for typeinfo 2015-03-30 22:15:06 +11:00
98cbde91d2 Fix compilation of game engine in ubuntu 2015-03-30 13:06:54 +02:00
bfe63bbfc4 Grey out high quality depth of field when it's not supported by GPU 2015-03-30 12:49:05 +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
01e0062b4c missed last commit 2015-03-30 21:25:28 +11:00
268524c025 Cleanup: use const for typeinfo 2015-03-30 21:18:49 +11:00
b663f1f1cf Cycles: Correction to previous commit: non-msvc compilers also should use nullptr 2015-03-30 15:17:09 +05:00
d694058fcf Merge branch 'master' into gooseberry 2015-03-30 15:07:24 +05:00
131912dc73 Cycles: Fix compilation error with MSVC after recent C++11 changes 2015-03-30 15:06:45 +05:00
09397ac2c1 Fix for invalid buffer access on zero-face meshes 2015-03-30 20:50:23 +11: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
afbc45ed93 Cycles: Attempt to fix osl+scons compilation
Defines (and other cflags) are not inherited by scons to the subdirectories,
need to take care of them in all nested SConscripts.
2015-03-30 14:00:03 +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
1b327aa219 Fix T44186: Bezier Bevel facto mapping broken when 'start' was set to 'Resolution' and 'end' was not.
Trivial, we need totla_length in that case too.

Safe to be backported to 2.74.
2015-03-30 10:24:26 +02:00
59740a6c98 SCons: cudakernels now depends on some configuration tests 2015-03-30 13:11:08 +05:00
23c0e46a00 Buildbot: Use Clang with OpenMP support for 64bit OSX builds
This should make such areas as simulations and sculpting nicely threaded.

32bit will be tried to be supported later.
2015-03-30 13:05:14 +05:00
786763ca4c remove zero translations
within draw_emtpy_*
These are no-ops.

Also const-ified some variables there.
2015-03-30 02:53:39 -04:00
e47a96463d cleanup: remove unused code & vars 2015-03-30 01:25:34 -04:00
8d1dc22bec cleanup: typos in comments, style
no functional changes
2015-03-30 00:51:00 -04:00
dea0e3833f Remove use_invert_vertex_group use_ prefix
To match other modifiers.
2015-03-30 10:46:53 +11:00
ab9d903b99 Cleanup: single quotes for enums 2015-03-30 10:46:53 +11:00
3204aff6d0 Fix compilation of cycles network server when logging is enabled 2015-03-29 22:22:53 +02:00
f01456aaa4 Optionally use c++11 stuff instead of boost in cycles where possible. We do and continue to depend on boost though
Reviewers: dingto, sergey

Reviewed By: sergey

Subscribers: #cycles

Differential Revision: https://developer.blender.org/D1185
2015-03-29 22:12:40 +02: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
70d9c01325 Fix T44162: Outliner: modifier's icons toggle update issue
Use same notifier for button callback as the one used in matching outliner operator...
2015-03-29 13:14:59 +02:00
47c1112e6e Make internal functions of point density independent from Render 2015-03-29 02:34:44 +05:00
94b0193196 Make point density sampling functions a bit easier for re-use
Still not ideal but getting closer. Main annoying thing so far is
dependency of Render structure for now. It is used to switch particles
to render mode and could probably also be eliminated.
2015-03-29 02:14:06 +05:00
b25c208d5b Code cleanup: whitespace, line wrapping 2015-03-28 23:50:36 +05:00
2c5ba41413 Code cleanup: Get rid of set but unused matrix 2015-03-28 23:40:56 +05:00
44a4b90b4f Fix collada compile after BKE cleanup 2015-03-28 18:17:54 +01:00
b1d758ae6b Cleanup: redundant struct declarations 2015-03-29 03:56:39 +11:00
8a183aa26b Cleanup: use BKE_texture_ prefix 2015-03-29 03:16:55 +11:00
8c1c2b40a2 Use union for EditBone's
Avoids complicated casts accessing as int
2015-03-29 01:30:44 +11:00
fcc086a92b Cleanup: unused args 2015-03-29 01:26:09 +11:00
7a1e7295a5 NLA Strip Keyframes: Nullified the risk that NLA mapping can get applied to NLA Curves 2015-03-29 03:03:05 +13:00
b253be1a19 Nla Strip Keyframes: Active FCurve Keyframes panel displays names properly now (and doesn't disable the FCurves) 2015-03-29 02:45:24 +13:00
0c5d0422b4 NLA Strip Keyframes: Insert keyframe tools in Anim Editors work now
* Insert Keyframe tool for Dopesheet/Graph Editors needed to be modified to
  not try to resolve the paths for NLA Control Curves
* For now, the poll callback to get the "Active FCurve" also works when given
  a NLA control curve. They're really the same in most cases, and this should
  be fine until one of the channels does something funky.
2015-03-29 02:20:57 +13:00
0ffd7f721e Nla Strip Keyframes: Sliders in channel list insert keyframes now 2015-03-29 01:39:59 +13:00
34209b59b8 Nla Strip Curves: This works with anim channel rearranging tools now 2015-03-29 01:39:58 +13:00
182e84da88 Nla Strip Curves: Getting more stuff working
* Clicking anywhere on the expander collapses it (like for the gpencil one)
* Deleting these curves works now (but has the side effect of turning off
  the animated influence/time options too, as it is assumed that when those
  are enabled there is a corresponding fcurve)
2015-03-29 01:39:57 +13:00
67f983ac53 Nla Strip Controls: Added special FCurve type (in the animfiltering code)
Using the standard "FCurve" animchannel type didn't work that well for
the control FCurves on NLA Strips, as the paths would not resolve correctly,
and the indentation was wrong. Also, there would likely be issues down the
track with applying NLA mapping. Hence, it's easier to just create a separate
type for this case, and adapt the rest of the code to also consider these (todo).
2015-03-29 01:39:56 +13:00
8f4c5ff0ec Nla Strip Controls: Added dedicated "Expander" channel to Action/Graph Editors
The "Nla Strip Controls" channel is used to house the per-strip
FCurves for controlling the strip_time and influence properties.
It sits above the active action's first group, at the same level
in the hierarchy as other groups.

TODO: It looks like a dedicated FCurve channel is needed for these
control FCurves, so that we won't accidentally apply NLA mapping
or have these FCurves disabled by the path lookups failing.
2015-03-29 01:39:55 +13:00
6dac874d68 Fix for various small issues which may cause crashes 2015-03-29 01:39:54 +13:00
da0d0b2f20 Compile fix
New parameter added by these fixes did not exist when this call got added
2015-03-29 01:39:53 +13:00
90e9a22eaa Fix for earlier commit - Turning off "animated" influence/time didn't work
Reshuffled order that in which NLA Strip's F-Curves vs its automatic settings are
evaluated so that the automatic settings can always override the custom settings,
since it's not that easy to get things working correctly the other way around.
2015-03-29 01:39:53 +13:00
fc0a576c30 Keyframes on NLA-Strip F-Curves are detected by RNA buttons too 2015-03-29 01:39:52 +13:00
59b2316e82 Code Cleanup / Preemptive Bug Fixing: "action" parameter may get set when it shouldn't be
Logically, it makes sense that this parameter only gets used to describe the action
that the F-Curve actually belongs to (if it belongs to one). Otherwise, it should not
be set at all.
2015-03-29 01:39:51 +13:00
2b4ff142ab Fix T36385: Animated Strip-Time doesnt update
This commit implements proper evaluation + keyframing support for animating influence
and time on NLA Strips (among other properties) by resolving a few long standing issues
which prevented the original design for this from working.

The original design for animating these properties (and/or some of the other settings
on NLA Strips) is that NLA Strips actually have some of their own F-Curves that are
used for animating settings which will affect how they are evaluated. As seen in this
bug report, the alternative of having these animated as part of the stack (which the
strips work above/outside/on-top of) means that glitches can occur.

Although one of the original considerations for why this wasn't implemented earlier
was that introducing keyframes there isn't so clean cut, and causes UI design issues
for how we expose these via the animation editors for editing (NOTE: support for that
is still to come). Another concern is that this sets a precedent for how FModifiers
might get evaluated.
2015-03-29 01:39:50 +13:00
1a5c5ac742 Fix T44068: "Layered" option for auto keyframing doesn't "Insert Available Only" is enabled
The "Layered" option for auto keyframing will create a new NLA strip if playback
reaches the end of the frame range and jumps back again. The idea is that instead
of overwriting the keyframes you've already made, it will make a new animation
layer. However, this does not work with the "Insert Available Only" option
(which can either be set in the User Prefs, or in the active keyingset), as that
option needs some existing FCurves to tell what it can insert keyframes into.

The "fix" here is to simply not show the offending button in situations where it
cannot be used!
2015-03-28 23:48:10 +13:00
b7afbaf8cc Bugfix: Fix for crash when trying to create new action in Shape Key DopeSheet mode
When the active object had no shapekey data, trying to create a new action from the
Shape Keys mode of the DopeSheet would crash. The segfault here was a silly regression
caused by my earlier Action Stashing work.

However, the old (pre-Action Stashing) code here also wasn't that great either.
While it didn't crash, it would still silently create a new action, even if that
could not get assigned/used anywhere. To prevent both of these problems from
happening again, I've added additional null checks, as well as beefing up the poll
callback here to forbid keyframing
2015-03-28 23:23:23 +13:00
469ba8a30a Tracking: Code cleanup, missing break statements 2015-03-28 00:46:59 +05:00
5498629906 Freestyle: Code cleanup, silence warning in release mode 2015-03-28 00:34:16 +05:00
e1bcc2d779 Cycles: Code cleanyp, sky model
For as long as code stays in official folders it should follow
our code style.
2015-03-28 00:28:37 +05:00
5ff132182d Cycles: Code cleanup, spaces around keywords
This inconsistency drove me totally crazy, it's really confusing
when it's inconsistent especially when you work on both Cycles and
Blender sides.

Shouldn;t cause merge PITA, it's whitespace changes only, Git should
be able to merge it nicely.
2015-03-28 00:15:15 +05:00
6f43e1dfef Cleanup: win32 mixed declare/statements in main()
Make it a more clear where declarations end
(ifdef's all over made it a bit confusing).
2015-03-28 04:12:12 +11:00
59b578e320 Cleanup: use const char for stats arg 2015-03-28 04:12:12 +11:00
a5180abde0 Merge branch 'alembic' into gooseberry 2015-03-27 17:27:11 +01:00
3d305b5a37 Cycles: Code cleanup, make strict flags happy about disabled OSL 2015-03-27 19:10:36 +05:00
d18e8ad1f3 Cleanup: view3d headers 2015-03-28 01:05:50 +11:00
267904dd3c Cleanup: gpencil headers 2015-03-28 01:05:50 +11:00
7cbb659400 Use squared dist /w comparisons (mask, edge-slide) 2015-03-28 01:05:49 +11:00
7b7eac9211 Add profiling prints for audio synch to detect how continuous our frame
progression is
2015-03-27 15:00:13 +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
74e8e14cce Makesrna: Fix function prototypes for struct used RNA_def_struct_sdna_from
Previously makesrna would have generated code expecting DNA structure from
RNA_def_struct_sdna_from() to be passed to it. This was wrong because actual
PointerRNA points to a "parent" structure, making it impossible to add
functions to certain RNA structures.

It so far never needed and we didn't notice this issue, but it's needed for
some ongoing development now.
2015-03-27 18:44:11 +05:00
1c2f1ff725 Compositor: Cleanup, remove unused need_sync parameter 2015-03-27 18:23:32 +05:00
d84cc6a18f Compositor: Followup to previous stats commit
No need to mark tree for localization, it was never done and
it all just worked. We can save some CPU ticks by skipping doing
this.
2015-03-27 18:23:32 +05:00
da170d9dc3 Compositor: Fix heap overflow when copying previews 2015-03-27 18:23:32 +05:00
8af5390968 Fix T44149: Compositing : Node Groups do not work correctly
Input constants are to be connected before removing proxies,
otherwise node groups might give totally different result.

This is a regression and to be put into final release.
2015-03-27 18:23:32 +05:00
3366b30bf1 Compositor: Code cleanup, debug mode is now fine with strict flags 2015-03-27 18:23:32 +05:00
6cd82dbf57 CMake: Enable strict flags for C++ 2015-03-27 18:23:31 +05:00
061e73a270 Physics: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
052ebd6564 C++ RNA API: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
4393b60579 ImBuf: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
13358d049e Freestyle: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
2ada3512a2 Compositor: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
585dd26120 Cycles: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
232c2d382e Dualcon: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
3f4219a694 OpenColorIO: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
90f645855a GHost: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
38c4645f0a rename BGE attr from D1091 (match methods) 2015-03-27 22:23:19 +11:00
a93d4da344 Merge branch 'master' into gooseberry 2015-03-27 11:39:53 +01:00
34c92848a7 Use preview option to detect frame range for filename when using ctrl
F11.
2015-03-27 11:39:09 +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
e7afba4b29 Compositor: Cleanup, don't pollute namepace with all symbols from std 2015-03-27 14:41:20 +05:00
408a2a8420 Compositor: Improve reports to the interface about what's going on
The functionality was got lost when new compositor system was landed
and it wasn't always clear what's causing the hicucps. Now it's nicely
reported to the stats line.
2015-03-27 14:38:02 +05: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
a12b2ec66d BGE: New isDynamicSuspended python attribute
This is a new KX_GameObject attribute that it increments the
possibilities of optimization during the game

Additionally the unused m_bSuspendDynamics variable is removed.

Reviewers: moguri, agoose77, lordloki

Reviewed By: agoose77, lordloki

Subscribers: agoose77, lordloki

Differential Revision: https://developer.blender.org/D1091
2015-03-27 06:11:23 +01:00
Severin
c8f95cbb60 Only enable IME for supported translation contexts
For me, weird characters are drawn if IME is enabled but translation
is not set to a supported language.
Could become an utility function if needed later.
2015-03-26 22:16:00 +01:00
Severin
065e5896c4 IME: Minor API cleanup 2015-03-26 21:24:01 +01:00
Severin
6e72f06069 Fix duplicated IME input
AFAIK a few IMEs were affected by this so I guess we can now add a
few more IMEs to the "officially supported" list.

Patch by @randon (thanks again!), minor edits by me.
2015-03-26 21:16:43 +01:00
3dd78fc48f quiet warnings (increase int size for bitshift) 2015-03-27 04:32:08 +11:00
d26c18c05e Project directory proxies:
Use BL_proxy if directory is blank to avoid filling the whole folder
with files.
2015-03-26 18:25:25 +01:00
ef7755bacb Merge branch 'master' into gooseberry 2015-03-26 17:54:47 +01:00
4c7876c740 New option proxy placement, project directory.
There are two per-editor settings now, the Per-Strip setting (default)
and the Project setting.

The per strip setting basically uses the previous, per-strip options for
storing the proxies.
The project setting though will use a specified directory for -all-
proxies, or the blend file directory if no directory is given.
2015-03-26 17:54:16 +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
d084967627 Revert "Change Enables proxy operator to Copy proxy operator."
This reverts commit ec03ab021f.

Changing this since it looks like Mattieu does not really like the change.
Will be adding another way to tweak the directories
2015-03-26 15:44:51 +01: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
c0ef4e9b78 Fix T44122, rendering OpenGL preview movie with audio has wrong audio
range and extra frames.

Issue here is that the movie backend would unconditionally use the start
frame of the scene instead of the preview frame. Solved by passing an
explicit "preview" argument.

Strictly speaking, the preview argument is part of the renderdata
struct, that is also passed to the code, but when rendering the final
result we want to unconditionally render the full range regardless of
the preview setting of the render structure.

However, OpenGL rendering does use the preview range so we need to
account for that when making those exports.

This is also a nice chance to correct the filenames, which still used
the full range.
2015-03-26 14:50:18 +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
f80064f2d2 Fix compiling after sound changes 2015-03-26 13:19:33 +01:00
59132e6481 Fix building with audaspace disabled after 828c85a 2015-03-26 16:33:20 +05:00
dc3b869c9a Missed those last commit 2015-03-26 11:39:08 +01:00
828c85a1bf sound module: Append functions with BKE (makes it easier to make them
out from local functions)
2015-03-26 11:35:41 +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
d97b97460c Fix T44138: Crash in DataTransfer modifier when selecting a source with no loops.
Simply check and early return in case we have no source or destination items
(verts/edges/loops/polys) available...

Also, fix an assert in `BKE_mesh_calc_normals_poly()`, when called with no poly.
2015-03-26 09:20:37 +01:00
b87eaef1f7 Fix T44137: bpy.path.is_subdir fails
`bpy.path.is_subdir("/abc/def/ghi","/abc/de")` incorrectly returned True
2015-03-26 16:32:16 +11:00
770b109deb Fix: AUD_OpenALDevice::getPosition returns negative values
Reported by Antony Riakiotakis. The problem was the seeking code.
2015-03-26 14:45:21 +13:00
Julian Eisel
92f305a490 A more forward thinking version of previous commit
Basically same as 581afa9da3, but I guess we can assume that scopes added in future
to the image preview may also want to use the viewrect from the original ibuf.
2015-03-25 22:15:56 +01:00
Julian Eisel
581afa9da3 Fix T44121: VSE Preview scaling issue when using proxies and Show Overexposed 2015-03-25 21:52:54 +01:00
ad3e6ecfb4 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/render/render_opengl.c
2015-03-25 20:10:02 +01:00
4dc141f933 Yet another fix for crashing particles. 2015-03-25 20:09:02 +01:00
5e2cc06518 minor cleanup: alignment 2015-03-25 14:29:08 -04: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
d4ac58d049 Fix T43694, by Krzysztof Rećko (chrisr), reviewed in D1177.
Added some guards to prevent clumping to non existing particles. Also, adjusted threaded child path evaluation, so each child is evaluated once - previously virtual parents were done twice.
2015-03-25 18:34:52 +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
9fc1a29de3 Fix 2 typos ( shakin' hands ) 2015-03-25 16:56:51 +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
4fd2f678ea Fix T44133 SSAO in OpenGL rendering from orthographic camera did not
work

Safe to include in final release
2015-03-25 15:05:36 +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
1a866d55ac Fix crash with computers not supporting high quality depth of field. 2015-03-25 14:43:28 +01:00
1c329af74c Fix T44026: ID prop delete leaves names in _RNA_UI 2015-03-26 00:12:28 +11: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
0ef9f61410 Attempt to fix an error in compilation of geometry shaders in Intel 4000
cards (see T44072)
2015-03-25 13:05:52 +01:00
7bc8ddc6e2 use BKE_mball_tessellate.h include
also remove unused includes
2015-03-25 22:40:09 +11:00
3d20bf75cb BKE_mball: split tessellation into its own file
this has a lot of its own local structs, functions,
better to keep isolated from general metaball selection/library logic.
2015-03-25 22:40:09 +11:00
7f822bb4dd Merge branch 'master' into gooseberry
Conflicts:
	source/blender/gpu/intern/gpu_buffers.c
2015-03-25 12:39:38 +01:00
ec03ab021f Change Enables proxy operator to Copy proxy operator.
Allows to change and copy settings much easier, also allows things like
directory settings etc to be copied over.
2015-03-25 12:36:43 +01:00
8463e6cb41 Fix for crash when using particle emission with clump/roughness curves
in a smoke sim.

This interaction between sims is totally stupid and must be recoded
entirely in some utopian future.
2015-03-25 12:29:22 +01:00
a180c8e2ed Allow multiple strips to use the same directory when custom proxy
directory is used.

This is done by appending the name of the file as extra folder. Existing
projects may need to regenerate their proxies but it should be possible
now to have all proxies nicely in the same custom folder.

Next commits will include operators to copy directory settings between
selected strips, making the process faster.
2015-03-25 12:05:34 +01:00
22dfb50622 Fix T44128: Ray visibility only enables diffuse if glossy is also enabled
Issue was caused by accident in c8a9a56 which not only disabled glossy
reflection if Glossy visibility is disabled, but also Diffuse reflection.

Quite safe and should go to final release branch.
2015-03-25 14:53:20 +05:00
0561e18f81 Explicit CD type masks for each element.
Avoid storing redundant normals for vertices.
2015-03-25 10:32:57 +01:00
3cee9d6939 Simplify recent commit 2015-03-25 20:29:38 +11:00
b38b5846ba Fix T44124: Crash deleting brush 2015-03-25 20:16:27 +11:00
3eb33b804d Fix T44118: Rotated background image disappears
Image clipping didn't take rotation into account.
2015-03-25 19:49:14 +11:00
8d0b104f43 Fix T44064: Reroute two-node loop crash
Issue was caused by cycles in shader graph confusing it's
simplification stage. Now we're ignoring links which are
marked as invalid from blender side so we don't run into
such cycles and keep graph code simple.
2015-03-25 13:46:59 +05:00
917b8754f9 Tracking: Fix one frame memory leak when tracking last frame 2015-03-25 13:20:37 +05:00
87cff57207 Fix T44123: Cycles SSS renders black in recent builds
Issue was introduced in 01ee21f where i didn't notice *_setup()
function only doing partial initialization, and some of parameters
are expected to be initialized by callee function.

This was hitting only some setups, so tests with benchmark scenes
didn't unleash issues. Now it should all be fine.

This is to go to the 2.74 branch and we actually might re-AHOY.
2015-03-25 02:33:49 +05:00
41ed59e0eb Minor UI message fix. 2015-03-24 21:36:26 +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
Julian Eisel
2ba82d5729 Cleanup: Remove unwanted debug printf from 7293f6d486
Sergey said this kindof cleanup is good for commit ratio... noted! ;)
2015-03-24 15:54:02 +01:00
Julian Eisel
f98b84072e Remove redundant shortcuts from keyconfigs
These have been deleted recently (cd54f07a3c, fbd4dfb2c, 3f68a0aea)
2015-03-24 15:52:14 +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
fa09e152af Code cleanup: r_ prefix vs. _r suffix 2015-03-24 19:20:51 +05:00
Julian Eisel
b714b23443 Fix T44092: Maya preset doesn't allow attaching Nodes to Frames via D&D 2015-03-24 14:15:03 +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
7293f6d486 Cleanup - move proxy storage options to the proxy itself - also will
enable more storage options, since seq->flag is running out of space
2015-03-24 12:24:54 +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
765fd7044b Updating python API documentation for function bge.render.makeScreenshot 2015-03-24 10:17:55 +00: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
4685092fd8 Fix T44102: Mirrored objects render black with Blender Internal and Autosmooth.
Normals are not vertices, we cannot apply matrix's scale to them...
2015-03-24 11:03:05 +01:00
0f0e080a26 Fix T44110: Plane track doesn't work when built with scons
For some reason recent change in avoiding non-aligned eigen vectors
was behaving differently for cmake and scons. Made it a bit different
now by storing scalars. This is more robust approach anyway, because
it's not really guaranteed Mat.col() gives a pointer inside data,
depending on column-major vs. row-major storage.

This is to be backported to 2.74 branch.
2015-03-24 14:05:49 +05:00
cf365275c2 Fix T44089: All addons do not use same default for orientations.
Transformed 'OrientationHelper' class into 'orientation_helper_factory' function,
which returns an OrientationHelper customized class with specified default axes.
2015-03-24 09:57:11 +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
3030e2d1cb CMake: tweak recent py module changes
support installing portable builds to CMAKE_INSTALL_PREFIX
2015-03-24 19:09:51 +11:00
4560570f8a Fix for building blender as a Python module
Installation didn't work on debian distro's
now install into PYTHON_SITE_PACKAGES (which is detected and can be configured).
2015-03-24 17:06:12 +11:00
3bb7e14618 UI: remove UI_BTYPE_SEARCH_MENU_UNLINK
Internal change only,
use UI_BTYPE_SEARCH_MENU with an unlink flag instead.

They are really the same button type, one just happens to have the option to unlink.
2015-03-24 15:09:58 +11:00
a93f346ff4 Cleanup: unused function 2015-03-24 15:09:58 +11:00
22e222563a Blender world value viewport update
This patch will update the 3D viewport if a word value has changed.

This patch does not depends on an other patch, but should applied after https://developer.blender.org/D151 otherwise the the word value viewport update is be slow.

Reviewers: brecht

Reviewed By: brecht

Subscribers: thelasthope, darkxiv

Differential Revision: https://developer.blender.org/D159
2015-03-24 00:31:31 +01:00
ee57968461 BGE: Remove old world bge.render API
This patch can be used to remove the old world bge.render API if the new world API D157 is used.

If  the new world API is applied we can remove the old API because the old has newer worked.
The patch keep the two old working methods for backward compatibility.

Reviewers: campbellbarton, moguri

Reviewed By: campbellbarton, moguri

Subscribers: brecht

Differential Revision: https://developer.blender.org/D158
2015-03-24 00:27:45 +01:00
fd22a92939 BGE: Add new world API KX_WorldInfo (KX_Scene)
This Patch will add a the world API (mist, background, ambient)  to KX_WorldInfo.
The new API uses now attributes.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Subscribers: klauser, brecht

Differential Revision: https://developer.blender.org/D157
2015-03-24 00:23:40 +01:00
6c9502a6c1 BGE: Remove BlenderWorldInfo
This patch will remove the BlenderWorldInfo and move the source into KX_WorldInfo.

Reviewers: brecht, moguri

Reviewed By: brecht, moguri

Differential Revision: https://developer.blender.org/D156
2015-03-24 00:19:15 +01:00
ce40fb9ab2 BGE: World color management fix
This patch will fix the color management for the mist and global ambient color.
It will remove the old "Color Management" switch in the BGE "Render > Shading" panel and will use the "Display Device" setting in the "Scene > Color Management" panel instead.

Reviewers: moguri, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D154
2015-03-23 23:56:46 +01:00
931c3e6544 BGE: Code clean up for world (mist, background, ambient)
Code clean up for BGE world mist, background and global ambient color.
Move mist render update to BlenderWolrdInfo

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Differential Revision: https://developer.blender.org/D152
2015-03-23 22:49:38 +01:00
c73693d4a5 BGE: Fix T43592: World GLSL
This patch will fix the world GLSL (mist, background, ambient) update for the BGE.

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Subscribers: panzergame

Differential Revision: https://developer.blender.org/D151
2015-03-23 22:32:49 +01:00
da5fb82a63 CMake: readme.html version trick broke packages 2015-03-24 07:49:17 +11:00
0737f59f62 tweaks to packman build
remove --asroot arg to makepkg
2015-03-24 07:49:17 +11:00
e7ae96ad41 BGE: Fix T27322: World F-Curve
This patch fixes the world (mist, background, ambient) F-Curve for  for the BGE.

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Differential Revision: https://developer.blender.org/D150
2015-03-23 21:43:42 +01:00
d07c666a0e BGE: Add setMistType and setMistIntensity API.
This patch adds the missing setMistType() and setMistIntensity() to the API

Reviewers: campbellbarton, brecht, moguri

Reviewed By: campbellbarton, brecht, moguri

Subscribers: campbellbarton, dingto

Differential Revision: https://developer.blender.org/D149
2015-03-23 21:40:11 +01:00
2affbb437b BGE: Multitexture world (mist, ambient) fix
This patch fix the existing word API for mist and global ambient lighting.
Add deprecated message to disableMist()
Add setUseMist(enable).

Reviewers: dfelinto, campbellbarton, moguri

Reviewed By: moguri

Subscribers: solarlune, jta, brecht

Projects: #bf_blender:_next

Differential Revision: https://developer.blender.org/D148
2015-03-23 21:36:08 +01:00
38321faa8d cleanup: use spaces for alignment
while studying GPU lib
2015-03-23 15:40:44 -04:00
722ddaaccd Remove 'lorem ipsum' operator
its a very specific function, and not hard to paste body text from elsewhere.
We can make an addon if its important to some users.
2015-03-24 06:17:30 +11:00
6af89c9913 compile fix 2015-03-23 15:04:11 -04:00
1bee77b77a Disable high quality depth of field for GPUs that don't support it,
system will fall back to low quality depth of field.

Also add check in case some of the errors are caused by crappy
framebuffer object support.
2015-03-23 19:24:01 +01:00
ddf58004c4 BGE: LoD Hysteresis clean up
Move scene hysteresis value to KX_Scene where it should be (instead of
KX_GameObject)
2015-03-23 19:03:56 +01:00
f65e3c7f1b Fix T44076, SSAO in solid mode will disable antialiasing in wireframe
mode.

Yes it will, because those modes stay active. So on user side, expose
depth of field option always (I don't see why not), but disable SSAO in
wireframe/bounding box mode. It is a known limitation that compositing
does not support antialiasing yet, but better give users some more
control.

This could be included in final release but it's not that serious
either.
2015-03-23 18:54:56 +01:00
1b71279adc Versioning code to correct socket naming after
340b76b42c

Reported by formerly Old_Demon on blenderartists.

Apparently this caused old files to lose their links to material sockets
(noob own mistake from inexperience with node system).

This should either be included in release with version checking being
set to version 2.73 and subversion 10, without tweaking the
BKE_blender.h file

OR

340b76b42c should be reverted for this
release.

Thanks to Lukas for checking this out.
2015-03-23 18:37:50 +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
b13770215c Use linear filtering for final pass of high quality depth of field, no
need to get nearest point anymore.
2015-03-23 17:07:21 +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
f5c33a2d48 Shader errors:
Count line from beginning of the whole shader source instead of each
string sepatately since it helps with finding out the error line in most
tested platforms
2015-03-23 15:20:12 +01:00
4d5e41280e Missing include path for scons build files of the gameengine player. 2015-03-23 15:04:47 +01:00
e8b6d86f95 Fix T44093: Color picker SV+H order wrong.
Based on HSV ordering, SV+H had S<>V swapped.
2015-03-24 00:18:57 +11:00
0febcc745a Missing library linking in the blenderplayer. 2015-03-23 14:09:05 +01:00
befaf86a99 Allow bg-image rotation for camera views 2015-03-24 00:03:51 +11: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
b8a6cd0140 Cleanup: comments, style 2015-03-23 22:52:33 +11:00
c48ebb44ae Tidy up the user interface for depth of field based on feedback by
NudelZ on irc, thanks!
2015-03-23 12:48:19 +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
fd2b4a74c8 Use same rgb -> greyscale for BLI_math as imbuf 2015-03-23 22:26:00 +11: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
3c21885ec4 Change coefficients to 4 digit precision only.
Need to match convention and sum up to 1.0 (previous set had a minor
10^(-10) overflow) Thanks to Campbell for taking notice.
2015-03-23 12:18:42 +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
0884c174b3 Make sure matcap icons are within range.
Basically out of range could happen when opening files made in 2.72 when
the new icons for texture painting were added. Apparently some more
caution is needed here.
2015-03-23 12:00:34 +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
c451dba550 Mitigate T44035: Proportional editing lag
Calculating connected data can be slow,
it still lags with heavy meshes but perform some optimizations (nearly twice as fast)
2015-03-23 20:03:14 +11:00
ed7e593a4b Fix T43926: Volume scatter: intersecting objects GPU rendering artifacts
Fix T44007: Cycles Volumetrics: block artifacts with overlapping volumes

The issue was caused by uninitialized parameters of some closures, which
lead to unpredictable behavior of shader_merge_closures().
2015-03-23 12:48:33 +05:00
572489ec89 Fix wrong sizeof() in new ghash hashing helpers code.
Spotted by Coverity.
2015-03-22 21:14:39 +01:00
059d5bc809 OSX: fix 1 leak ( found and fixed by marcclintdion ) and 1 possible leak in dragndrop, backport to 2.74 2015-03-22 19:29:42 +01:00
e7d051043d BGE: New hysteresis offset to improve LOD level transitions
This change introduces a new hysteresis parameter that it will be added
or subtracted to/from the LOD distance to avoid popping when a LOD
object moves close to the LOD transition continuously.

Then, we have the following:

- a new LOD Hysteresis setting per scene (default 10%) which is located
in Scene context --> Level of Detail panel. This scene parameter also
will active/deactive the scene hysteresis.
- and a new LOD Hysteresis setting per object (default 10%) which is
located in Object context --> Levels of Detail panel. The LOD hysteresis
setting per object (if active) will overwrite the hysteresis setting per
scene value.

For the new blends: the hysteresis setting per scene would be active by
default and the per object would be inactive by default.
For the old blends: both hysteresis settings (per scene and per object)
would be inactive by default. A quick way to take advantage of this
feature for old blends would be to activate the hysteresis parameter in
the scene context -> Level of Detail panel

Reviewers: campbellbarton, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: nonamejuju, lordodin

Differential Revision: https://developer.blender.org/D957
2015-03-22 18:19:49 +01:00
0b4a71b072 BGE: Add physics constraints replication
This patch will add a physics constraints replication for group instances
(dupli group).
It also fix crashing when when a group instance is made from a linked
group instance and both are on the active layer.

Initial patch T31443 from moerdn (Martin Sell).

Reviewers: lordloki, sergof, moguri, sybren

Reviewed By: moguri, sybren

Differential Revision: https://developer.blender.org/D658
2015-03-22 17:56:26 +01:00
2744ce77de Revert part of D1074 related to acceleration taked into account.
It has been reverted because it was affecting obstacle avoidance
(T44041).

This fix should be backported to 2.74
2015-03-21 17:54:49 +01:00
e183199022 Cleanup: instantiate arg once in context macro 2015-03-22 03:35:13 +11:00
9ff3d8eafa Cleanup: minor edits to project generators 2015-03-22 03:35:13 +11:00
8e9c9fde42 OSX/GHOST: need one more release in error case 2015-03-21 17:15:38 +01:00
d21018b334 Fix T44065: fixed vehicle constraint
Commit ffee7f1a58 broke vehicle constraints; this fixes that.
2015-03-21 14:42:57 +01:00
d28bfb5022 Cleanup: constify view3d/camera 2015-03-21 22:44:13 +11:00
6e50bdd870 Cleanup: constify scene/modifiers 2015-03-21 22:44:00 +11:00
0025d90b98 Cleanup: use tabs 2015-03-21 16:40:43 +11:00
e0611ca832 View3D: fix view-selected zoom logic
- Correct logic converting radius to view distance.
- Wasn't taking view-zoom into account converting lens to angle.
- Support framing the selection in the camera bounds (for camera locked views).

Add ED_view3d_radius_to_dist to handles these details.
2015-03-21 15:33:10 +11:00
e88cfc28b2 View3D: use defines for default zoom-levels 2015-03-21 15:24:36 +11:00
997c0c837b Fix indentation in last commit, tab slipped in 2015-03-20 20:26:51 +01:00
ed61017391 Really fix scons with new glsl shaders 2015-03-20 20:24:30 +01:00
d5abff589e Fix scons build 2015-03-20 19:47:06 +01:00
0582aa6f13 Partly fix T44025, pixelFormat retain was left, for 2.74 backport 2015-03-20 17:57:35 +01:00
6d495cc4ef WIP Commit 2015-03-20 17:27:25 +01:00
919a665497 Cycles: Avoid memcpy of intersecting memory
Could happen when assignment happens to self during sorting.
2015-03-20 21:14:50 +05:00
8ff4c53e63 Correction to previous commit, initialization of needs_free got lost by accident 2015-03-20 21:09:52 +05:00
f91850d564 Disable IME for headless builds 2015-03-21 03:02:09 +11:00
b999ed2efd Merge branch 'master' into gooseberry 2015-03-20 16:36:34 +01:00
b9dc4f851b Fix link error with GLEW 2015-03-20 16:35:41 +01:00
94a3924eab Correct recent commit 2015-03-21 02:25:28 +11:00
63ab5b0883 Fix for building win32 headless 2015-03-21 02:17:27 +11:00
d12ab9a9a8 Remove unused armature code
ED_armature_deselect_all now simply de-selects
2015-03-21 02:17:27 +11:00
7e79651a56 Get rid of old panel for GPU depth of field settings 2015-03-20 15:56:49 +01:00
62b31a6e99 Avoid per-draw allocation when drawing currently rendering tiles 2015-03-20 19:56:09 +05:00
a568de8a83 Merge branch 'master' into gooseberry 2015-03-20 15:45:11 +01:00
339e43e1e8 Only create vertex buffers if supported and clean them up properly. 2015-03-20 15:43:34 +01:00
07b2508305 Fix high quality depth of field on the Mac.
Quite a few things wrong here:

* Mac did not support EXT_draw_instanced, only ARB_draw_instanced
* Draw instanced did not work unless data came from vertex buffer, which
is second time we see weird things with vertex arrays in mac
* There were a few stupid mistakes by me as well, such as binding to
uniform locations for the wrong shaders (it's a wonder it ever worked
:p)
2015-03-20 15:26:13 +01:00
3d6642db83 Fix race condition and bad memory access highlighting render tiles
Is was possible that interface will be refreshed at thesame time
as render engine will start freeing render parts.

Not sure if we can get away without RW mutex here, seems we need
one way of synchronization or another..
2015-03-20 17:51:05 +05:00
c0be69f7fd Fix/Improve FKey bone creation
- new bone is now made active
- previous selection cleared
- bone direction places the tip on the active bone (if available)
2015-03-20 23:48:27 +11:00
6786ef6783 Fix T43986: VSE Mask Modifier don't move with video-Clip.
Now mask animation is offset to start of strip, instead of staying at frame 1!

Warning: this may break existing files, in case some would be using (hacking around!)
current bad behavior...
2015-03-20 12:39:25 +01:00
03d945095a Cmake: Some more tweaks to building from branch without upstream 2015-03-20 14:07:56 +05:00
6f51df5384 SCons: Attempt to deal with branches without upstream configured 2015-03-20 14:03:54 +05:00
6de12b1b43 CMake: Suppress unconfigured branch upstream error in the output 2015-03-20 13:59:05 +05:00
1cd4070e35 Fix T43786: Cycles bake disregards Auto Smooth (vertex per-face normals)
Added an utility function which performs vertex split based on the loop
normal so now backing API matches to what's happening in Cycles and BI
in terms of autosplit.

Reviewers: dfelinto, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1174
2015-03-20 12:47:19 +05:00
56edaf7867 Fix stupid strict flags in math_color_inline.c
It was unleashed with recent ghash commit and issue seems to
be the same as fixed in 69065b5b.
2015-03-20 12:25:14 +05:00
35ea7efbca Add missing update adding a shape-key
Noticeable when pin is enabled.
2015-03-20 15:50:56 +11:00
cf29010bd4 Cleanup: warnings bit-shift int overflow 2015-03-20 15:41:36 +11:00
f51a3aedc9 Cleanup remove unused variable 2015-03-19 21:11:33 +01:00
fd559ed94f Missed this last commit. 2015-03-19 21:10:41 +01:00
05e3c261a4 Fix T43989: Sequencer - Ctrl snapping a sequencer strip does not work if you specify the x axis.
New 'strip' snapping was simply not computed in case of constrained transform, hence init
'0' value was used as frame offset in this case.

This commit reorganizes a bit that snapping, to keep it more 'confined' into `snapSequenceBounds()`
dedicated function. It still needs a minor hack (setting snapping mode to something else than
defualt `SCE_SNAP_MODE_INCREMENT`, to avoid this snapping to be called by contraint code).

Thanks to Antony for review and enhancements.

This fix should be backported to 2.74.
2015-03-19 20:53:34 +01:00
ea12b87afd Fix cycles dof settings 2015-03-19 20:49:18 +01:00
81472aff2b Remove deleted list for palette colors
was used because of UI memory access only.
2015-03-20 06:08:38 +11:00
eee538f0d2 UI: minor re-organization of dof options 2015-03-20 06:08:22 +11:00
bd1e5eeab7 Blender will now use trilinear filtering by default 2015-03-19 20:05:31 +01:00
2941b4ad9b BLI GHash: add some basic gtests.
We could likely add much more, but those already covers basic behavior and should be able
to catch most errors when editing this code.

Also added some performances tests as well (timing ghash insert/lookup under heavy loads,
for different kinds of keys).
2015-03-19 19:50:51 +01:00
cfdd27381c GHash - code reorganization, performance enhancements, add a few missing utils to API.
This patch is the root of the GHash rework, all other diff will be based on it:

Reduce average load from 3.0 to 0.75
----------------------------------

This is the big performance booster part, e.g. makes tracing a dyntopo stroke between 25% and 30% faster.

Not much to say about it, aside that it obviously increase memory footprint (about 25% - 30% too).

Add optional shrinking
----------------------------------

I.e. ghashes/gsets can now shrink their buckets array when you remove enough entries. This remains optional and OFF by default.

Add code to use masking instead of modulo
----------------------------------

Buckets indices are obtained from hashes by “reducing” the hash value into the valid bucket range. This can be done either by bit-masking, or using modulo operation.
The former is quicker, but requires real hashes, while the later is slower (average 10% impact on ghash operations) but can also be used as a 'fake' hashing on raw values, like e.g. indices.

In Blender currently not all ghash usages actually hash their keys, so we stick to modulo for now (masking is ifdef’ed out), we may however investigate the benefits of switching to masking with systematic very basic hashing later…

Add various missing API helpers
----------------------------------

I.e. a way to deep-copy a ghash/gset, and a way to (re-)reserve entries (i.e. manually grow or shrink the ghash after its creation).

Various code refactoring
----------------------------------

* Get rid of the 'hack' regarding ghash size when used as gset (it’s simpler and safer to have two structs defined here, and cast pointers as needed).
* Various re-shuffle and factorization in low-level internal code.
* Some work on hashing helpers, introducing some murmur2a-based hashing too.

Thanks a bunch to Campbell for the extensive review work. :)

Reviewers: sergey, campbellbarton

Subscribers: psy-fi, lukastoenne

Projects: #bf_blender

Maniphest Tasks: T43766

Differential Revision: https://developer.blender.org/D1178
2015-03-19 17:37:54 +01:00
881e05fc54 Armature select-hierarchy now uses connected bones
Traverse down connected child bones (when available)

Also remove redundant bone loops.
2015-03-20 01:40:45 +11:00
3e9947c4d4 Depth of field high quality:
A new checkbox "High quality" is provided in camera settings to enable
this. This creates a depth of field that is much closer to the rendered
result and even supports aperture blades in the effect, but it's more
expensive too. There are optimizations to do here since the technique is
very fill rate heavy.

People, be careful, this -can- lock up your screen if depth of field
blurring is too extreme.

Technical details:

This uses geometry shaders + instancing and is an adaptation of
techniques gathered from

http://bartwronski.com/2014/04/07/bokeh-depth-of-field-going-insane-

 http://advances.realtimerendering.com/s2011/SousaSchulzKazyan%20-
%20in%20Real-Time%20Rendering%20Course).ppt

TODOs:

* Support dithering to minimize banding.
* Optimize fill rate in geometry shader.
2015-03-19 15:18:14 +01:00
93048873f1 Fix compilation error of blenderplayer after recent constraint commit 2015-03-19 19:10:40 +05:00
7c65b75d01 Correct recent armature symmetrize
Duplicating part of a chain could have invalid 'connected' flag.
2015-03-20 00:42:17 +11:00
15b37a4a4d Speedup for constraints update from python script
General idea is to avoid actual calculation from property update()
callback and tag things for update later instead.

That said, pose constraint flags are now tagged for update and
handled as a part of object update. In the new depsgraph it'll
be a nice dedicated operation node.

Also avoid updating disabled flags for all the modifiers. This
part of the path is not totally optimal since it'll still need
to iterate over bones in order to get pchan, but to optimize it
further would be nice to find a way to avoid pchan requirement
all together.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1191
2015-03-19 18:28:49 +05:00
c69b5e0276 Fix T44040: Blender crashes when nodes are muted
It was actually an old issue with wrong conversion happening for muted
nodes, which wasn't visible before memory optimization commit.

This is to be backported to the final release.
2015-03-19 16:04:49 +05:00
52d72a37cd Cleanup 2015-03-19 20:34:02 +11:00
ad95cb72bc Transform: Shift for precision PET adjustment
Patch T36753 by @hjaarnio
2015-03-19 20:11:33 +11:00
156921114e Armature Symmetrize tool
D1147 by @julien, with fixes/improvements

Duplicate bones where needed, otherwise use existing.
Keeps parent relations intact, can operate on parts of an armature.
2015-03-19 19:26:48 +11:00
c6ee43d384 Cleanup: style (armature duplicate) 2015-03-19 18:13:47 +11:00
8b6e777736 Fix out-of-bounds read BKE_deform_flip_side_name 2015-03-19 18:13:47 +11:00
4b88541d59 CMake: unbundle eigen3
Optionally use systems eigen3 library.

T41989 by @hasufell with edits
2015-03-19 15:41:41 +11:00
2df4444def CMake: exclude Colamd when OpenNL's disabled 2015-03-19 14:48:52 +11:00
2a2bf3c1ab Freestyle: pass Main struct to new/copy 2015-03-19 14:34:14 +11:00
9b54c88e0f Cleanup: spelling grey -> gray 2015-03-19 14:14:48 +11:00
4f602ff943 Revert part of recent color-management commit
This adds back rgb_to_grayscale,
not all color is managed or depends on the current loaded blend file's CM options.

Noted in comments that this is only to be used outside the CM pipeline.
2015-03-19 14:12:51 +11:00
255b07681a Color managed luminance for shader ramp-in-energy 2015-03-19 12:59:36 +11:00
ce11e1c878 Cleanup: better not pass function call to FTOCHAR
also use rgb_uchar_to_float
2015-03-19 12:42:34 +11:00
c31aae0487 Use fabsf for floats 2015-03-19 06:13:50 +11:00
1dd1d286c6 Select nth option to skip steps
Patch T43752 @codemanx, added matching curve option.
2015-03-19 04:40:43 +11:00
64451f0928 Fix for crash adding mask modifier 2015-03-19 01:10:44 +11:00
9231d35caa Simplify math in mix_linear glsl function. Thanks to valentin for
pointing out on irc.
2015-03-18 14:09:03 +01:00
72419eebc2 Fix T44029 textures disappear in viewport if GPU mipmap generation is
off.

GPUs need a full tree of mipmaps up to dimension 1xn to work. This will
make it so for all imbufs but cost is negligible and it's unlikely that
something could break due to that.
2015-03-18 13:48:49 +01:00
3e5cd52783 Fix bad memory access freeing viewport which uses movie clip 2015-03-18 17:17:04 +05:00
aff4aa173a Support UV island selection in UV synch and face select mode.
Enough said, people wanted this for ages, enjoy!
2015-03-18 12:41:03 +01:00
ff1ed872d9 Fix crash using "Copy to selected" on ID-props 2015-03-18 18:53:32 +11:00
2919519714 RNA: palette colors api
Methods so Python can manage colors.
palette.colors.new()/remove()/clear()/active
2015-03-18 16:10:43 +11:00
a975a3ca63 RNA: move palette into its own file 2015-03-18 15:57:53 +11:00
db710e6c0d Fix crash using removed data as function arguments 2015-03-18 15:52:36 +11:00
d0fcbab152 Fix RNA active spline assignment 2015-03-18 15:15:52 +11:00
63897304a9 Fix T44028: Vertex Colors Baking error
Was wrong color management flag used for some bakers.
Actually goes back to 7997e38.
2015-03-18 00:10:58 +05:00
2ab4489f17 Fix T44027: Normal Edit Mod : Radial from object normals affected by target object scale.
The way we were getting diff to apply to vcos from target object was just bad!

Also, fixed another related issue - negated scale would be clamped to nearly zero,
now only consider absolute version of size (we do not care about its sign here anyway).

This should be backported to 2.74 (with previous commit too).
2015-03-17 19:57:16 +01:00
6ceb84c217 BLI math vec: add 'abs' functions to get absolute values of a vector.
Unseful when handling e.g. scale, sometimes.
2015-03-17 19:57:16 +01:00
948bc66a00 Cycles: Improve readability of dumped graphs 2015-03-17 21:15:17 +05:00
a43d00d51e Cycles: Fix displacement code creating cyclic dependencies in graph
Bump result was passed to set_normal node and then set_node was connected
to all unconnected Normal inputs, including the one from original Bump
node, causing cycles.
2015-03-17 19:39:09 +05:00
dd38dce7f0 Part 2 of D1082 by Troy Sobotka, remove our functions that do luma
calculations and use the OCIO one instead.
2015-03-17 15:20:33 +01:00
42aac45d7f Part 1 of D1082 by Troy Sobotka, add API in OCIO for luminance
calculation.
2015-03-17 14:15:05 +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
bf8ea6b60e Kick particle systems to force redistribution, needed for reliably
applying recent jitter fix.
2015-03-17 11:04:44 +01:00
07f53d6454 Fix T44020: Crash exporting fluid sim to fbx
The issue is coming from wrong fluid modifier copy callback,
which might have left some pointers shared across original
and target fluid modifiers.
2015-03-17 12:59:44 +05:00
1724513fc6 Fix T44021: Crash switching Rendering Engines while viewport rendering + animating
Make sure preview render job is cancelled before freeing the render engine
associated to the viewport.
2015-03-17 12:02:10 +05:00
f138666f68 cleanup: Mac #include
Don’t need all of Cocoa, or any of Carbon here.
2015-03-17 01:18:52 -04:00
c0fa864e24 Cleanup: bool & const
Using bool when we're asking yes/no questions such as whether some GPU
feature is supported.

Consolidated these simple functions into gpu_extensions.c and grouped
them in the header.

Const-ified some args where the functions don't modify the pointed-to
data.
2015-03-16 22:57:56 -04:00
b0bbd34ac2 I18n: update for new akward algo names in UI messages... 2015-03-16 20:55:01 +01:00
ef70d644d6 reverting unintentionally changed value of enum OBJ_TEXT 2015-03-16 18:58:58 +01:00
9ed5a1073e fix D1130 renamed the enum OBJ_FONT to OBJ_TEXT to avoid naming conflicts in Windows 2015-03-16 18:46:40 +01:00
77bc623bc4 Get rid og gluBuild2DMipmaps on game engine. 2015-03-16 16:18:37 +01:00
664c611fc8 Get rid of gluBuild2DMipmaps on rna API.
Code here is a bit weird/simpler than GPU_draw, but we can reuse the API
here, albeit with a few restrictions (no high resolution, custom
filtering mode - which will probably get lost next time blender reloads
textures)
2015-03-16 16:07:21 +01:00
6d03e94491 Get rid of gluBuild2DMipmaps on gpu_draw.c (use our own imbuf scaling
functions instead)
2015-03-16 15:45:34 +01:00
86c828d9fd Make sure disabling attribute arrays also resets the counter so we don't
do it twice.
2015-03-16 12:14:23 +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
2fa593a6f7 Fix T43853: Audio animation bug (fcurves)
For a detailed bug explanation see the comments in the report.
2015-03-16 23:02:04 +13:00
19ce78fb3b Code cleanup: Comment 2015-03-16 14:52:54 +05:00
9542cf041a Fix an incorrect assert in lnor code.
There is one case where we do can have only two edges for two loops...
2015-03-16 10:38:45 +01:00
30527e3e55 Fix T43178: BGE has hard-coded 60 Hz as frame rate
Two areas of the BGE use a hard-coded 60 Hz as frame rate. However, this 60 Hz is just a default setting, and can be changed in the Blender interface.
This setting is now used instead of the hard-coded 60 Hz.

CcdPhysicsEnvironment::SetFixedTimeStep() is actually never called, as we don't even support a true fixed-timestep simulation.
2015-03-16 10:12:37 +01:00
6aaedc7cfd Refer to Task 43975: Deleting a Shapekey can break the relative pointers
This patch would reassign the relative of all keyblocks to the relative
of the deleted keyblock. And it fixes the misalignement of the index values
after the keyblock is deleted.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1176
2015-03-16 10:03:23 +01:00
60df4d10ff Fix T43999: MIS for environment broken after multi-threading commit
Typo in task start row calculation.
2015-03-16 13:31:27 +05:00
ce009c8019 PyConsole: double-click to select word
patch T43641 by @v-disp with own edits
2015-03-16 16:03:32 +11:00
4c58cb8bd9 Correct assert 2015-03-16 13:39:27 +11:00
f03e004c23 Fix T43997: Paste fcurve keeps handle selection 2015-03-16 13:08:26 +11:00
927306d60a Cleanup 2015-03-16 11:46:20 +11:00
13dc766148 PyAPI: bpy.ops enum error was cut short 2015-03-16 10:16:16 +11:00
06cc89d744 Fix T43976: Edit-mode crash /w (scene/screen.scene) mismatch 2015-03-16 09:57:15 +11:00
d49eeabae7 Cleanup: warnings 2015-03-16 09:37:00 +11:00
15374d31d5 Update themes for 2.74 2015-03-16 09:29:26 +11:00
2140cb60cb Fix T39184: Multisegment bevel profiles should curve in-plane sometimes.
When the multisegment profile joins two unbeveled edges, all in the same
plane, users desire that rather than the current behavior of linear
interpolation between those edges, the profile should curve.
This changes behavior to do that.  The old behavior can be obtained
by setting the profile parameter to 0.25, if desired.
2015-03-15 18:24:36 -04:00
Julian Eisel
3e6cfcca86 Nodes: Shortcuts for Snap and Snap Element Menu
Added Shift + Tab for Snap and Ctrl + Shift + Tab for Snap Element Menu (consistent to
3D View)

NOTE: Exit Group is now Ctrl + Tab instead of Shift + Tab
2015-03-15 22:35:26 +01:00
Julian Eisel
62070ae6e1 Fix T44003: Flatty Light: GPencil vertices and timeline keyframes black
I noticed our version code and subversion got out of sync in the past, maybe
that's what the issue was here.
Deleting the entries from the .xml makes it fall back to the default values.
2015-03-15 22:13:05 +01:00
225027ce5d BGE - new read-only attribute in KX_GameObject python api (LOD level)
Added a new "current_lod_level" property to the python api of
KX_GameObject. The property returns the current lod level of the game
object. The purpose of the property is activate logic routines only when
an object is at a certain lod-distance from the camera, avoiding to
separately recomputing the same distance in the logic script. Usage in
python script might look like:

owner = bge.logic.getCurrentController().owner
lod_level = owner.currentLodLevel
if lod_level == 0: ...do something
else: ... object might be too distant

Reviewers: dfelinto, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D978
2015-03-15 17:26:49 +01:00
dd3ade250d BGE: Fix for T43994 Steering actuator bug with Navmesh
Now the facing option is taken into account as before

This is a regression and to be ported to the final release branch.
2015-03-15 11:38:04 +01:00
176ecd9c9c BGE : Fix for T43724 and T41599 addObject() with KX_FontObject and
overlay scene

GetGameObjectType is overwritten in KX_FontObject to differentiate a
font object into AddNodeReplicaObject function. Now, in this function,
we add fonts in the appropriate list.

Reviewers: campbellbarton, moguri, dfelinto, lordloki

Reviewed By: lordloki

Subscribers: lordloki

Projects: #game_logic, #game_engine

Differential Revision: https://developer.blender.org/D1130
2015-03-15 10:50:59 +01:00
3824e0f124 Cleanup: style 2015-03-14 12:10:09 +11:00
6e17420548 BGE: Fix for T43788 Light casts shadow when use_shadow unchecked
Makes use_shadow usage consistent across supported lamp types (Spot and
Sun)

Differential D1148

Reviewers: Moguri, Brecht
2015-03-13 23:47:15 +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
fc3de690ac RNA: avoid inefficient array printing 2015-03-13 23:52:47 +11:00
e1815ce69e Merge branch 'master' into gooseberry 2015-03-13 17:47:41 +05:00
a1a7317f6b 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-03-13 17:46:55 +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
2ef2f085fb 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-03-13 17:39:21 +05:00
0e18a56432 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-03-13 17:38:03 +05:00
79393cb7a2 Fix T43959 jittering in 2D texture painting.
This is still not perfect,
but should work smoother now. Previously there was visible wobbling
while painting.

This can be included in final release.
2015-03-13 13:10:38 +01:00
a0a6cb129e Fix unstable particle jittered distribution.
This was never working for threaded distribution.
2015-03-13 13:07:23 +01:00
63ea8dd156 Initial compilation support with C++11 featureset enabled
This commit makes some preliminary fixes and tweaks aimed to make blender
compilable with C++11 feature set. This includes:

- Build system attribute to enable C++11 featureset.

  It's for sure default OFF, but easy to enable to have a play around with
  it and make sure all the stuff is compilable before we go C++11 for real.

- Changes in Compositor to use non-named cl_int structure fields.

  This is because __STRICT_ANSI__ is defined by default by GCC and OpenCL
  does not use named fields in this case.

- Changes to TYPE_CHECK() related on lack of typeof() in C++11

  This uses decltype() instead with some trickery to make sure returned type
  is not a reference.

- Changes for auto_ptr in Freestyle

  This actually conditionally switches between auto_ptr and unique_ptr since
  auto_ptr is deprecated in C++11. Seems to be not strictly needed but still
  nice to be ready for such an update anyway/

This all based on changes form depsgraph_refactor branch apart from the weird
changes which were made in order to support MinGW compilation. Those parts of
change would need to be carefully reviewed again after official move to gcc49
in MinGW.

Tested on Linux with GCC-4.7 and Clang-3.5, other platforms are not tested and
likely needs some more tweaks.

Reviewers: campbellbarton, juicyfruit, mont29, lukastoenne, psy-fi, kjym3

Differential Revision: https://developer.blender.org/D1089
2015-03-13 16:47:40 +05:00
278871db5b error in last commit 2015-03-13 22:46:15 +11:00
bb825d02f8 CMake: unbundle LZO library
Patch T41989 by @hasufell
2015-03-13 22:36:01 +11:00
61eab743f1 Cycles: Optimization for CMJ in CUDA kernels
Two things:
- Use intrinsics for clz/ctz (ctz is implemented via ffs()).
- Use faster sqrt() function which precision is enough for
  integer values.
2015-03-13 12:38:14 +05:00
aa4cb95a5c Pass proper bmain to the updateDepgraph() of modifiers
This is mainly to make physics modifiers being able to work
with it. For other cases this main is not needed.
2015-03-13 12:03:23 +05:00
1cac8c23b5 Fix T43803: Crash playing smoke animation, when linked as group instance
The issue was caused by missing relations between smoke domain and flow/source
objects. This happened because smoke's modifier only iterated base objects and
ignored cases when flow/source could be linked to scene via dupli-group and
does not have real base.

The same seems to be still needed for fluid and dynamic paint modifiers,
will do it as a separate commit.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1172
2015-03-13 12:03:23 +05:00
73ad76970e BGE: Fix for T43980 MouseLook (actuator) triggers MouseMovement (sensor)
on other objects permanently

only trigger mouse event when it is necessary, this way we avoid
conflicts with other mouse sensors.
2015-03-13 00:50:25 +01:00
3db0e1ef6a Cycles: Simplify volume light connect code. 2015-03-13 00:09:13 +01:00
0ed914a194 Cleanup: Use differential helper class. 2015-03-12 23:35:01 +01:00
90f36d4ec8 BGE: Fix for T43793 Increment frame_start/end value to 255 frames
Currently, for animated textures we were allowing 16x16 tiles but we can reproduce 128 frames only.

Reviewers: moguri, sergey, campbellbarton

Reviewed By: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1164
2015-03-12 22:07:35 +01:00
e160da30ea View3D: Quad-view opposite axis switching
Pressing Numpad9 now orbits to the opposite side in any viewport,
with the advantage that it can switch locked-quadview axis to their opposite side.
2015-03-13 04:48:23 +11:00
f8de442a35 Cleanup: remove unused viewnumpad code 2015-03-13 03:40:58 +11: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
a8f6d51ebc D1171: Use GHash for BHead idname lookups
This patch avoids looping over bhead's linked list when looking up values by name.

Used during appaned and library loading.
Gives noticeable overall speedup loading files that used libraries. (nearly 2x on some Mango files)
2015-03-13 01:55:49 +11:00
f2d4f6b086 Cleanup: use realloc for entry-array-resizing 2015-03-13 01:55:48 +11:00
1ce256cb8f Cleanup: refactor header lookups into functions 2015-03-13 00:41:21 +11:00
b007fa41c6 Cleanup: use POINTER_OFFSET macro 2015-03-13 00:41:21 +11:00
03c77fbb99 Readme: tweaks to make it less hassle to edit
also remove "this is the Nth release" text, not so helpful and easy to forget to update.
2015-03-13 00:34:27 +11:00
dce16d57dc Revert "Fix T43865: Cycles: Watertight rendering produces artifacts on a huge plane"
The fix was really flacky, in terms during speed benchmarks i had
abort() in the fallback block to be sure it never runs in production
scenes, but that affected on the optimization as well. Without this
abort there's quite bad slowdown of 5-7% on the renders even tho
the Pleucker fallback was never run.

This is all weird and for now reverting the change which affects on
all the production scenes and will look into alternative fixes for
the original issue with precision loss on huge planes.

This reverts commit 9489205c5c.
2015-03-12 18:24:53 +05:00
c4b3b60aad Fix T43974: Alpha output of movie clip node crashes blender
Issue was caused by a bug in the memory optimization commit,
should be backported to the final release branch.
2015-03-12 18:24:53 +05:00
13d443496c Partial fix for T43967: Background is wrong in 2.74
Was missing do-versions code after rotation order change in Cycles.

This is a regression and to be ported to the final release branch.
2015-03-12 18:24:53 +05:00
cef379242b Cleanup: style 2015-03-13 00:07:26 +11:00
92d77b250e makesrna: move extern prototypes into own header
Patch T36049 by @jeske
2015-03-13 00:05:11 +11:00
ae45496812 OpenEXR 2.2 add support for Dreamworks DWAA / DWAB compression
This patch makes it possible for the user to select all supported compression types in OpenEXR 2.2

Discussion points:
 - B44 is only defined for half's it compresses to a fixed representation of 44% of the halfs. We do currently not reflect in the UI that in the case of float32's it will be equal to compression = NONE
 - ZIPS is single scanline zip and is supposed to be useful in cases where importing in Nuke happens.
 - The new Dreamworks formats, are the worth exposing etc etc

Reviewers: campbellbarton, sergey

Reviewed By: sergey

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1050
2015-03-12 14:02:33 +01:00
2814039ee3 Remove version from readme, (replace on install) 2015-03-12 23:52:48 +11:00
4b3641ec99 Fix loading of indexed .bmp files
D1173 by @rdb

Support for 1,2,4 bit images
2015-03-12 23:52:09 +11:00
064fa4baae Cycles / Decoupled Ray Marching: Skip consecutive empty steps.
This merges consecutive empty steps in the decoupled record function,
which can lead to fewer iterations in the scatter functions.

Only helps slightly though (1%), but doesn't hurt to have this.

Differential Revision: https://developer.blender.org/D873
2015-03-12 13:50:12 +01:00
cdb47b9dfc Cycles: Make Background MIS building threaded
Use multiple threads for building the MIS table, if the
resolution is higher than 512.
Also replace division by cdf_total, with a inverse multiplication by
cdf_total_inv. This gives further speedup.

On my Macbook (8 CPU threads) this improves the time to build the table:
Resolution 4096: From 0.16s to 0.03s
Resolution 8096: From 0.61s to 0.11s

This especially helps to reduce the scene update time, when tweaking world
shader while viewport rendering is running.

Patch by Sergey and myself.

Differential Revision: https://developer.blender.org/D1159
2015-03-12 13:50:11 +01:00
583466fccf Blender 2.75 release cycle start: BCon1 2015-03-12 13:50:11 +01:00
26a2b7b38f Py/RNA: add bpy.data.palettes 2015-03-12 23:49:15 +11:00
42c7200248 CustomData: don't calloc when duplicating layers 2015-03-12 23:49:15 +11:00
56f794fce6 Cleanup: de-duplicate view3d clipping 2015-03-12 23:49:15 +11:00
17d96ca2aa GuardedAlloc: safer MEM_SAFE_FREE
only instantiate the argument once,
so MEM_SAFE_FREE(array[i++]), won't cause incorrect behavior.
2015-03-12 23:49:15 +11:00
57646cb2ce Py Tests: manual URL validator
Support for URL checker to use locally generated manual.
2015-03-12 23:49:15 +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
4aa51096a7 Point submodules to RC1 tags 2015-03-11 20:49:46 +05:00
b40b6431c8 2.74 splash
by Manu Järvinen
2015-03-12 02:38:57 +11:00
124a226eaa 2.74 release: update HTML
Also remove unneeded metadata
2015-03-12 02:38:56 +11:00
639a3dd53b 2.74 version bump 2015-03-12 02:30:55 +11:00
99ed95bba2 Fix really stupid issue reported by Campbell, code retry to render
without VBOs would return prematurely and leak.
2015-03-11 12:19:16 +01:00
72f86ad046 Fix typo in RNA definition of "shape_key_add"
Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D1167
2015-03-11 16:17:13 +05:00
527302bc0b Fix 8bit BMP palette reading
part of D1173 by @rdb, load BGR -> RGB
2015-03-11 21:26:29 +11:00
cf385caf92 Fix flip node making unsigned int out-of-range 2015-03-11 15:39:58 +11:00
62faffc800 Cleanup: style 2015-03-11 13:15:52 +11:00
6b610500b9 Cleanup: indentation 2015-03-11 13:14:24 +11:00
0d053158ec Fix T43342 bad rendering of normal maps on NVIDIAs on the MacOS
This is not limited to normal maps, it's just that normal maps cause a
mix of interleaved vertex arrays + non interleaved vertex arrays + GLSL,
which could confuse the GL. Possible explanation is that it may be
clobbering the vertex index of the shader somehow but this is difficult
to know without extensive tests and the Mac is needed by Francesco in
the morning :).

Do brute force solution instead, just force legacy drawing on Macs when
VBOs is off. On the plus side VBOs work fine, so we should be fine when
we update.
2015-03-10 23:08:43 +01:00
26d7b6c517 Fix T43831: Image Editor: Render info not displayed
Issue was caused by b62c2a9 and root of it goes to the fact that text
info is stored in the "main" scene, not the currently rendering one.

This is a bit annoying but making it so text and result are coming
from the same scene is a bit dangerous to do now. Will re-visit this
change after the release and see if it might be done in a more clear
fashion.
2015-03-11 00:04:59 +05:00
56c0a3faef Fix T43953, make opengl render work like before, basically, if we render
transparent, it will render sky/transparent, regardless of the "show
world setting".
2015-03-10 16:47:50 +01:00
edc8a4c484 Fix memory leak when using two bump maps on the same material 2015-03-10 15:27:24 +01:00
51a60cbaf8 Fix T43887: Quick Fur duplicate particle system on edit
Forbid add quick fur operator from adding fur to objects in edit mode.

Fur is not visible for them anyway and because of local undo stack used
in edit mode tweaking values of this operator does not lead to proper
operator redo.
2015-03-10 17:02:29 +05:00
9d72c9e7e5 Tests: Print counter with operator test 2015-03-10 22:00:24 +11:00
8a551394e5 Fix crash in mesh data transfer 2015-03-10 19:46:24 +11:00
95a1cc20dc Fix crash extruding an empty curve 2015-03-10 18:22:08 +11:00
81b50bcf5f Fix crash enabling dyntopo in background mode 2015-03-10 18:21:26 +11:00
f1a0c2a4f0 Fix T43941: Grease pencil eraser outline vanishes 2015-03-10 18:17:02 +11:00
afa8a0ac19 Fix for yet another assert fail of particle dmcache index.
This is totally broken, just making sure Blender does not crash and devs
can investigate other issues that are actually fixable.
2015-03-09 18:45:27 +01:00
e2471ea96a Attempt to fix T43919, avoid using GPU_framebuffer_slots_bind just in
case a system does not support drawing to many framebuffers.
2015-03-09 18:27:27 +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
219937fc5d Fix T43674: Smoke collision does not detect obstacles reliably.
The smoke obstacle detection was using a maximum distance for BVH
checks to find mesh elements that define boundary cells in the grid.
This BVH test was using an arbitrary value of 0.6 cell units. It should
be `sqrt(3)*0.5` to account for the maximum possible distance of mesh
elements inside a cell. Otherwise some cells that should form the
boundary are not detected as such (no closest mesh element found inside
the radius), so you get gaps in the smoke obstacle.
2015-03-09 15:23:52 +01:00
Julian Eisel
b14e2876a7 Fix T43937: Changing Texture Brush doesn't update toolbar 2015-03-09 14:48:56 +01:00
8662dbee63 Merge branch 'gooseberry' into temp_motionpaths 2015-03-09 14:44:48 +01:00
b21e0cccfa Fix T43872: Adding a constraint to a bone of a proxy armature resets all bones' transformations.
Temp hack for until new depsgraph is here. Thanks the Joshua and Sergey for their help.
2015-03-09 13:02:30 +01:00
fd94d2d80f T37832: OpenCL compositing bug in defocus node
The issue seems to be caused by the integer overflow. It's actually
still needed to investigate why exactly buffer contained such a huge
value, but the patch is still legit and seems to be solving the issue
just nicely.
2015-03-09 16:56:37 +05: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
a1549bc47a Image Space: enable zoom/cursor warping 2015-03-09 21:01:43 +11:00
40ef25d000 Fix T43891: Skin modifier inverts some faces 2015-03-09 20:26:09 +11:00
9ffc66b1c0 Math Lib: add mid_v3_v3v3v3v3 2015-03-09 20:26:09 +11:00
d4c1e98dd4 Fix T43484: Motion blur fails in certain circumstances
The issue was caused by mismatch in how aligned triangles storage was
filled in during BVH construction and how it was used during rendering.

Basically, i  was leaving uninitialized storage for triangles when
there was deformation motion blur detected for the mesh. Was likely
some sort of optimization, but in fact it's still possible that regular
triangles would be needed for rendering.

So now we're storing aligned storage for all triangle primitives and
only skipping motion triangles (the deformation motion blur flag from
mesh is now ignored).
2015-03-09 14:15:35 +05:00
b13b900d50 Cycles: Improve logging in object motion detection
Reporting mesh name is not really useful, since it's name does not
any relation with the original object/mesh names.
2015-03-09 13:25:27 +05:00
2ae0f1e70b Fix T43908: Mask render bug, one pixel black line
This was a regression caused by attempts to fix T42844 and there were
some red-herrings which lead me to the wrong way to fix it. It's some
deeper issue than just interpolation offset, it's mainly how the node
resolution is being mapped to each other.

It could be actually a part of canvas awareness project..
2015-03-09 12:48:42 +05:00
36df8cc1e5 Fix T43421: bisect_edges returns insufficient data 2015-03-09 18:33:24 +11:00
09e072a245 Fix T43858: Collision Bounds Display Bug
Was using draw-type when drawing BGE collision bounds.
2015-03-09 17:24:14 +11:00
29e5de3728 Fix BGE: calling ReleaseInstance on NULL joystick 2015-03-09 16:36:35 +11:00
c44f489d24 Fix for clamping large UV coords in UV-panel
Would clamp value ranges in UI when outside hard coded range.
2015-03-09 15:49:45 +11:00
60f7f93c16 Freestyle: Fix for a few line style properties left not copied. 2015-03-09 12:53:16 +09:00
Folkert de Vries
7d38d85340 Freestyle: Fix for references of deprecated texture stroke shaders.
Removed all references of deprecated texture shader.  Also deleted
several lines of dead code.

Since texture_shader.py no longer does what it was supposed to do,
the file itself was removed.

Patch reviewed by Tamito Kajiyama (kjym3).
2015-03-09 12:53:13 +09:00
a0fa3de267 Fix T43624: Freestyle uses wrong colour on second Line Set with textured lines in Cycles.
This is a regression introduced by rBd8b00a3bf5c1 (Freestyle: memory
consumption optimization in stroke rendering).

The issue was caused by uninitialized MPoly::mat_nr values.  Before the
stroke rendering optimization, individual Freestyle strokes were
represented by distinct mesh objects, and thus MPoly::mat_nr was left
unset (i.e., was always zero).  Now that the stroke rendering optimization
has been done and mesh objects may represent multiple strokes of different
materials, MPoly::mat_nr had to be properly set to the material index that
refers to the material of the poly face.
2015-03-09 12:53:11 +09:00
ec18021867 Fix T43337: Group object disappear after append
Relying on user-count of 1 wasn't reliable because of custom-bones.
2015-03-09 14:33:27 +11:00
Severin
573783259d IME: Disable IME for number buttons 2015-03-09 02:27:11 +01:00
Severin
7d5d971dea Fix T43920: Crash when clicking into different area during IME composition
Fix by @randon
2015-03-09 02:27:11 +01:00
a7855f81d4 Fix T43332: Adding polygon int layer failed 2015-03-09 12:23:58 +11:00
Julian Eisel
1a0e6336d6 Fix blenderplayer not compiling after modifier d&d commit 2015-03-08 16:23:56 +01:00
fee0e6e211 BMesh Py API: calc_edge_angle functions
Make consistent with calc_edge_angle,
take an optional fallback arg for non-manifold edges
otherwise raise an exception.
2015-03-09 00:47:53 +11:00
b4fccce1f6 BGE: Fix for regressions T43883 and T43456 (and T43876 likely). SDL joystick related
Only to create and destroy joystick devices for connected joysticks

Reviewers: campbellbarton, sybren, moguri

Reviewed By: sybren

Maniphest Tasks: T43883, T43876

Differential Revision: https://developer.blender.org/D1161
2015-03-07 21:27:30 +01:00
c32ded3654 Cycles: add better specializations for SSE shuffle function and few more wrappers. 2015-03-07 17:25:21 +00:00
c8fb488b08 Fix T41066: An actual fix for curve intersection on FMA-enabled CPUs 2015-03-07 16:20:34 +00:00
b7a759502f InstallDeps: Fix stupid typo which broke OIIO building (and nobody reported it :| ). 2015-03-07 14:42:03 +01:00
8dbbb60e8a Fix T43910: Unpack fails when stored filename is broken (empty, or no file part...).
Now we have an helper that will generate local/global paths and ensure they are valid.

Note: We currently have no way to 'generate' a valid extension in these cases, so just
using raw (file-safe) ID name.
2015-03-07 14:41:43 +01:00
cf1227d4ad Fix edit-lattice leaving incorrect point-size 2015-03-07 03:53:08 +11: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
1c3b2c58af 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 14:22:00 +01:00
e95732bced Fix broken "force setting multisamples only once", introduced in b5b359b48f 2015-03-06 13:07:02 +01:00
9794facab3 Fix metaball->mesh removing all metas in the scene
Assumed the entire scene used the one motherball.
2015-03-06 22:46:45 +11:00
d9e703ef5d Merge branch 'master' into temp_motionpaths 2015-03-06 11:57:59 +01:00
6405aa4e9c 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 15:22:25 +05:00
3f572fe7d2 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 14:58:16 +05:00
f682129d62 PyAPI: clarify fallback docstring 2015-03-06 19:02:57 +11:00
8638142c3b 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 18:55:36 +11:00
7df60becb9 BMesh: Add extended BM_vert_calc_edge_angle that takes a fallback value 2015-03-06 18:45:00 +11:00
d17e6c10df Cleanup: quiet minilzo warnings 2015-03-06 17:47:23 +11:00
2f21dbf38b Cleanup: unused warnings 2015-03-06 17:30:05 +11:00
a9b7d5e4e8 Cleanup: unused macro warning 2015-03-06 14:17:21 +11:00
b1f4301deb Fix typo in "Add" and "Subtract" mode of Vector Math node.
Differential Revision: https://developer.blender.org/D1003
2015-03-06 02:34:03 +01:00
Julian Eisel
d6a6950547 Correction to previous commit
Calling ensure_lookup_table for each face is stupid! :/
(Noted by Sergey - thx)
2015-03-05 20:36:58 +01:00
Julian Eisel
61aede4305 Fix T43900: "Operator Mesh Add" template fails
Another script that was missing the lookup_table call.
2015-03-05 20:26:41 +01:00
37d7b2d3b6 Revert "COLLADA - support for shadeless material (SHADER_CONSTANT)"
This reverts commit 04b0a9f4b8.
2015-03-05 19:44:23 +01:00
bd56eca825 Merge branch 'master' into gooseberry 2015-03-05 19:15:31 +01:00
e2d4a93a00 Fix T43880 really stupid mistake from fixing stick mode selection 2015-03-05 19:14:38 +01:00
6f3629607b Make limits of sequencer scaling a bit more sane 2015-03-05 19:05:39 +01:00
7c38ba0a9e Audio library, early exit when animation is found 2015-03-05 18:50:44 +01:00
a7d292394e Fix T43898, correct all uv layers in bevel, not only the active one 2015-03-05 18:50:44 +01:00
04b0a9f4b8 COLLADA - support for shadeless material (SHADER_CONSTANT)
This patch make it possible to export and import shadeless material.

Reviewers: sergey, sauraedron

Subscribers: sergey

Projects: #collada

Differential Revision: https://developer.blender.org/D1094
2015-03-05 18:44:04 +01:00
23af8984bb Compositor: Add sanity check around pass element size and compositor data type
Only happening in the debug builds, avoids issues like recent AO one from happening.
2015-03-05 20:24:41 +05:00
6e1ea04ada Fix T43894: Wrong alpha with bilateral blur node
The issue was caused by AO operation reporting it's a color operation
(which means it's expected to output RGBA) but internally it's RGB
only in the render engine, which caused some memory to be uninitialized.
2015-03-05 20:21:55 +05:00
73d0749a59 Compositor: Fix compilation error with COM_DEBUG enabled 2015-03-05 20:12:28 +05:00
9489205c5c Fix T43865: Cycles: Watertight rendering produces artifacts on a huge plane
The issue was caused by numerical instability whrn having ray origin close to a huge
triangle, which could have aused bad ray distance check.

Watertight Woop intersection isn't really addressing such cases, it's dealing with
small triangles far away from the ray origin instead, so it's a bit tricky yo make
it working reliably.

While we're quite close to the release it's safer to do check in Pleaucker coordinates
if ray close to a huge triangle. Likely this additional check combined with some other
tweaks to the code doesn't cause measurable slowdown in the scenes tested here.

After the release we can play a bit more with this code in order to make it more
stable without Pleucker fallback.
2015-03-05 18:55:30 +05:00
eb16b04b9d CMake: Need to find pugixml.hpp instead of pugixml.h
That's how file is actually called in the upstream.
2015-03-05 17:23:23 +05:00
6883a9bad9 Recent changes broke SDL/GHOST 2015-03-05 21:01:48 +11:00
37771e8fff Cleanup: unused var 2015-03-05 17:58:22 +11:00
61215999b5 Update install_deps for recent CMake change 2015-03-05 17:45:21 +11:00
da0176614b Fix T43672: Cycles preview stalls when out of view 2015-03-05 15:42:01 +11:00
1e817cceb0 CMake: rename LLVM_DIRECTORY -> LLVM_ROOT_DIR
Matching convention with all other libs
2015-03-05 15:42:01 +11:00
acfc0d4a18 CMake: was defaulting to an old LLVM version
Made finding LLVM fail.

only use LLVM_VERSION if set, else set to installed version
2015-03-05 15:42:01 +11:00
30d6589069 CMake: mark lib/debug options advanced 2015-03-05 15:42:01 +11:00
90e1b83696 Fix T43890: Crash, Alt-D over operator redo button 2015-03-05 09:10:16 +11:00
ffee7f1a58 BGE: Fix crash when a constraint misses its reference object
Blender allows you to create a constraint without specifying its reference
object, even when the constraint requires such a reference. The BGE would
crash on this. This change simply ignores such a constraint.
2015-03-04 14:15:41 +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
6efcd9e8fe Math Lib: redundant axis flip decomposing a plane
Also add a faster, non-normalized version of the function.

(Neither are used currently used).
2015-03-04 20:11:49 +11:00
b1e48ab4e4 Fix T43879: Autokey ignore pref /w viewlock-camera 2015-03-04 17:15:11 +11:00
cf2876b77a Fix for snap to cursor /w parents (object/pose)
Also don't use pose-bone transform unless the user is in pose-mode.
2015-03-04 15:13:10 +11:00
d48c3666da Snap: ignore unselected items, /w snap from active 2015-03-04 15:13:10 +11:00
27fe640104 Own error in recent commit (Snap active) 2015-03-04 13:28:45 +11:00
c755d8fbb5 RNA: rename mesh validate argument
cleanup_cddata -> clean_customdata
2015-03-04 12:58:14 +11:00
85c38e7389 Fixed wrong label and hint text in Collada exporter 2015-03-03 23:42:33 +01:00
7f25da6509 fix T43094 Added check for out of bounds in vertex color array 2015-03-03 23:42:32 +01:00
d544bc5cd5 Cycles: Fix embarrassing type remained after getting rid of utility SWAP() 2015-03-04 00:16:21 +05:00
ed5df50192 Cycles: Fix/workaround for toggling world MIS causing CUDA to fail
Seems it's just another issue with the compiler, worked around by explicitly
telling not to inline some function.

In theory we can unify this with CPU, but we're quite close to the release
so better be safe than sorry.
2015-03-03 18:48:37 +05:00
19656233dd Style cleanup 2015-03-03 13:43:47 +01:00
d58a15c0a6 Windows: Add stacktrace support when unhandled exception occurs.
We need to register the exception handler slightly differently here, as
well as adding DbgHelp as a library, but according to docs it should be
supported in recent Windows editions (Win XP included even).

We can try it first and revert if there are issues.
2015-03-03 13:39:15 +01:00
6ae390decc Merge branch 'gooseberry' into temp_motionpaths 2015-03-03 11:37:58 +01:00
b42a3d2485 Another stability commit for legacy users - don't crash when toggling
dyntopo just notify user that their system doesn't support it.
2015-03-03 11:34:23 +01:00
3224749763 Merge branch 'master' into gooseberry 2015-03-03 23:09:31 +13:00
f2bc3dd678 Grrr, missed those ones in previous commit! 2015-03-03 10:44:14 +01:00
82cafcfdb7 UI messages fixes... 2015-03-03 10:40:52 +01:00
23330473e3 Cleanup: remove unused collada conversion 2015-03-03 15:40:34 +11:00
26a251202b Fix mesh-validate for polys using successive verts 2015-03-03 15:32:35 +11:00
34003dd034 Fix T43151: Collada meshes crash Blender
We have multiple reports of collada files crashing, run all meshes through validate.
2015-03-03 15:30:45 +11:00
6d5ab8fdb7 Cleanup: collada had own defined Global (why?)
Wasn't needed and made linking fail here
2015-03-03 15:07:19 +11:00
6856ea0642 Bugfix T43866: 'Purge all' button in the outliner
The cleanups in 08a2101 forgot to modify the UI code which was using these values.
2015-03-03 12:52:18 +13:00
e2c24a18e3 Knife: fix glitch dragging mouse outside the face
Had a small gap between the last-vertex & new-cut
2015-03-03 09:29:44 +11:00
Julian Eisel
c271a9fa8b Fix T43864: Saving from top area in fullscreen changes wrong area into File Browser
We now always use the actual fullscreen area.
2015-03-02 22:38:59 +01: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
d2b6c6fd9b Fix T43862: Knife fails with concave ngon 2015-03-03 00:26:20 +11:00
8c6073db11 BMesh: BM_loop/edge_point_side_of_loop_test
change behavior to use a negative number when outside,
and return the signed, squared distance.
2015-03-03 00:26:13 +11:00
e38dc33f80 Fix dist_signed_squared_to_corner_v3v3v3 with concave corners 2015-03-03 00:20:53 +11:00
cea3892813 Revert "Reshuffle applying of solver results a bit to ensure it works exactly"
This reverts commit 4c723eb80e.
2015-03-02 12:18:57 +01:00
bc20a745be Fix T43859: Texture baking crashes blender
The issue was caused by particles using billboard distribution, which
requires either object to be specified or camera in the scene to be
existing.

This commit prevents backing from crash, but bake result might not be
totally expected because of the thing mentioned above.
2015-03-02 16:08:23 +05:00
4c723eb80e Reshuffle applying of solver results a bit to ensure it works exactly
as complicated as before cloth solver changes.

Still doesn't solve the collapsing cloth cube issue mentioned in T43406,
probably the bending springs work somewhat differently now.
2015-03-02 11:47:42 +01:00
1adfa36f88 Fix missing newline in the button cycle error print 2015-03-02 14:26:52 +05:00
520646b421 cleanup: whitespace 2015-03-02 16:51:01 +11:00
3281c3f3ce error in last commit 2015-03-02 16:51:01 +11:00
6373078321 Fix T43848: Wrong direction recalculating normals
Face islands furthest faces could face towards the center point when connected to sharp edges.

Now check the furthest edge of the furthest face, to test for face winding.
2015-03-02 15:51:07 +11:00
9d85e32ee3 BMesh: calc normals, use area weighted center
Prevents many small faces skewing center calculation.
2015-03-02 13:04:46 +11:00
56935e23c4 cleanup: float/double promotion, redundant casts 2015-03-02 11:05:34 +11:00
2058505da4 Bugfix T43851: Creating a new action after stashing crashes blender 2015-03-02 05:05:04 +13:00
2cacb22422 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-03-01 15:41:10 +01:00
f076eb482b Use the old double-step collision method only for cloth.
This method does not work for hair anyway. Even though hair collision
needs work at this point, it's still better than nothing.
2015-03-01 15:37:55 +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
dfefd36837 Fix T43406: Bring back cloth collisions.
This was disabled during the course of hair dynamics work. The cloth
collision solution is based on a secondary velocity-only solver step.

While this approach is usable in general, the collision response
calculation still does not work well for hair meshes. Better contact
point generation is needed here (Bullet) and preferably an improved
solver for unilateral constraints.
2015-03-01 12:33:30 +01:00
9f6f151536 I18n: Do not skip Polish anymore, translation work has started on it. 2015-02-28 21:51:17 +01:00
4ad31d5bab NLA Drawing Tweaks
* Strips in muted tracks are also drawn with dotted borders now to make it clearer
  that they are not contributing.

TODO:
* Perhaps dotted should be used for protected, and opacity for muted instead?
2015-03-01 02:34:54 +13:00
46ad5b6f67 Tweaks for NLA and newly added Action Stash Tracks
* Do not make Action Stash Tracks or their strips active/selected
* Lock the track to prevent accidental editing/adding of other strips

* Prevent strips from being added into locked tracks by the pushdown operator.
  This is mainly to prevent pushdown actions from getting into the stash tracks.
2015-03-01 02:34:53 +13:00
ea84b0e4ac Action Editor: "New Action" operator now stashes old actions, and is used by default again
This commit modifies the "New Action" operator to always stash the old action
before it creates a new one. As a result, the old active action will now have
a proper user of sorts after the new one is created, preventing previously
created actions from being lost.

Now that the New operator does this, it can be used for the Action Editor header AND
NLA Editor (Animation Data Panel -> Active Action) again. The "stash and create"
operator is somewhat redundant at this point as a result.
2015-03-01 02:34:52 +13:00
741a66e472 Action Editor WIP: Adding new actions in Action Editor now uses the "stash and create new" operator
In constrast to the old "new" operator, this operator will stash the existing action
in the stack to prevent it from being lost. This situation isn't totally ideal yet,
since the NLA Editor still calls the old method.
2015-03-01 02:34:51 +13:00
13a0dce51c Action Stashing: Don't allow an action to get stashed more than once 2015-03-01 02:34:50 +13:00
b16fbabd61 Reshuffle code 2015-03-01 02:34:49 +13:00
7c611e2204 Code Cleanup: Deduplicate logic for getting AnimData block associated with Action Editor modes 2015-03-01 02:34:48 +13:00
2b51eab69d Code cleanup: Split off the creation and setting logic for new actions into different functions
This is also just as prep for the next step
2015-03-01 02:34:47 +13:00
9c82a0478f UI Tweak: Display labels for Push Down and Stash
I'm still not sure which version is better, but I suspect that with the labels,
this might help users figure this out more than if they were just unlabelled
icon buttons...
2015-03-01 02:34:46 +13:00
8d2fc99618 Code Cleanup: Separate out the logic for stashing actions into a separate function 2015-03-01 02:34:46 +13:00
ac30378e3e Action Editor: Stash Action Operator
This operator (the snowflake icon, beside the pushdown button on the Action Editor
header) adds the currently active action to the NLA stack in a muted track, then
creates + loads a new action ready to be populated with new keyframes.
Since the NLA is being used to hang on to all the actions here, no actions are
getting lost.

Usage Notes (there will be some additional tweaks to make this nicer):
* To preview different actions that have been "stashed", simply click the "Solo"
  toggle for the track containing the action in question. Playing back the NLA will
  now show the stashed track
* To edit a previously stashed action - simply enter tweakmode on it in the NLA
  while the "Solo" toggle is enabled.

Todo:
* Add some more operators here to polish up the Action <-> NLA bridge to make the
  layered and stash workflows smoother. Examples include some tools to easily
  switch between the different actions layers in the stack, as well as making it
  easier to get out of tweakmode (and sync up the action lengths)

* Review and cleanup the behaviour of the "new" operator here to avoid the old
  problems that users were running into

* After the next release - Implement the full Action Libraries functionality, with
  ways to bridge the stashed strips over to a full-blown library.
2015-03-01 02:34:44 +13:00
7af4690295 NLA: Auto-Blends option is no longer enabled on all newly added strips
This may be put back again later, but currently, this is a bit too trigger-happy
to have it on. It tends to mess up results more than it helps.
2015-03-01 02:34:43 +13:00
b44201d8b9 Fix for NLA Solo/Mute behaviour
The Solo and Mute functionality for the NLA system should really be mutually
exclusive features. They both affect whether a given track applies or not.
The only difference is that the Solo option mutes all the others, while the Mute
only does this on a per track basis.

Before this fix, muting a strip and then making it solo meant that the solo'd
track would not play at all, which isn't really what we want.
2015-03-01 02:34:43 +13:00
bb7ce9173a Fix for previous commit: Pop up a warning in cases where the operator will refuse to do anything 2015-03-01 02:34:42 +13:00
b28a24091f Action Editor: Added "Push Down" operator to send the current action on to the NLA Stack
This commit exposes the "Push Down" button/functionality found in the NLA Editor
to the Action Editor, so that actions can be added NLA Stack from here too. The
main point of this for now is to make the whole layered-animation workflow nicer
more efficient, but not requiring the second editor be visible in common cases.
It also conveniently sets things up for the next few changes (already hinted at
here)...
2015-03-01 02:34:41 +13:00
cec1691a91 Code Cleanup: Clarify some comments regarding usercount management
(Note for the uninitiated looking at the diffs: this is very much *not* what
 you're probably thinking right now, if you're looking at the line in
 act_new_exec())
2015-03-01 02:34:40 +13:00
8bb3e2a3ea gameengine physics: moving collision filtering inside the collision panel and relabeling some parts 2015-02-28 09:09:55 +00:00
b00fecc85d UI: place camera DOF buttons to be more compact 2015-02-28 17:26:05 +11:00
08a2101eb6 Outliner: rename "Orphaned Datablocks" menu item
Makes the drop-down push searchbox out of the view (which is already quite cramped)
change to "Orphan Data".
2015-02-28 16:24:54 +11:00
38c30c41d7 BGE: Fix ShowDeprecationWarning macro.
Reviewers: lordloki, brita_, sybren, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D1144
2015-02-27 23:10:43 +01:00
fff8a519b8 Py Enum props definition: 'default' parameter cleanup/fix.
* There was no real default value for this parameter (neither "" nor None would work the same as
  not specifying that parameter). Now, 'None' is considered as default value, and you get
  exact same behavior with this value and if not specifying it. This is important at least for
  consistency, and potentially too in some esoteric cases (like generated code or so).
* Add a warning about the fact that 'default' parameter shall not be psecified when items
  are given a callback function.
2015-02-27 23:02:13 +01:00
12f60e7825 Fix T43834: Text object looses one char after another by entering/leaving edit mode.
Own mistake in refactoring of `BLI_strncpy_wchar_as_utf8()`, if given size was exactly
the one needed, we'd lost last char (off-by-one error).

Many thanks to plasmasolutions (Thomas Beck) who found the issue and did
all the investigation work here!
2015-02-27 21:31:54 +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
15957a9e4d Get rid of gluScaleImage in our game engine as well. 2015-02-27 14:47:39 +01:00
55e7d726c4 Make some adjustments to the units for viewport camera dof.
This is still not so correct, to make it work we really have to do a
blurring pass based on the real coc (currently we are just blending 3
levels of blur)
2015-02-27 14:11:26 +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
d7a877b69c Fix WPaint inactive when painting on a vgroup and the only other vgroup is locked.
`enforce_locks()` would reset weights of non-locked modified vgroups if it could not
find any other non-modified non-locked vgroup to 'distribute' weights into.
Sounds rather stupid, yet I hope I did not break something else, this code
is rather convoluted to say the least.

Side-reported by zeauro (ronan ducluzeau) in T43814, thanks!
2015-02-27 11:46:55 +01:00
a7e80a9470 Fix T43814: Skinning : set parent with automatic weights doesn't take into account locked vertex groups.
Simply skip a bone's vgroup when it already exists and is locked.
2015-02-27 11:46:55 +01:00
af032873a2 error in last commit 2015-02-27 20:58:32 +11:00
9ab28727ac Fix T43605: Spot Cone+Curve creates odd shadow
Curves could leave glFrontFace in an unknown state.
2015-02-27 20:54:57 +11:00
9683c2b129 Fix T42833: Kink on nurbs curve
Threshold for normalizing was too big.
2015-02-27 20:16:51 +11: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
0b67c21077 Fix T43807: invalid mesh from 2-sided cyclic curve 2015-02-27 17:43:10 +11:00
7293291a40 cleanup: typos 2015-02-27 15:57:59 +11:00
cfd176bcb1 MEM_SAFE_FREE caused issues /w const & GCC5 2015-02-27 15:26:22 +11:00
5520b8df4b cleanup: double promotion 2015-02-27 14:52:58 +11:00
2a5e92c989 cleanup: use GHOST_PRINT instead of stdio
Mostly from my own NDoF stuff.
2015-02-26 21:21:11 -05:00
6cb692f48e cleanup: ghost Win32 event processing functions
Removed window arg from key conversion functions.

Removed processModifierKeys declaration since that function was
apparently never implemented.

Using Win32-specific classes instead of their generic superclass -- this
helps in a few cases like WinTab.
2015-02-26 19:53:55 -05:00
a6ebc9a813 Compile fixes for mingw64
* m_hDC was always included after m_hWnd in all the constructors and other functions,
  but the order was reversed in the struct, meaning that they would not get initialised
  correctly

* Got rid of the gotos for the error handling case in initializeDrawingContext()
  This was causing "jump to label ... crosses initialisation" errors for the calls
  to get GL version string info (i.e. const char *vendor = ...;  etc.)  I wasn't sure
  if those glGetString calls needed the rest of the context to be defined first, so
  I decided to leave them where they are now, and got rid of the gotos (which were
  making this particular piece of code a bit confusing) instead.


TODO:
There are still a bunch of warnings about around 660, which I haven't managed to solve
(but at least they won't prevent Blender from compiling)

  narrowing conversion of '(stereoVisual ? 1063 : 1061)' from 'int' to
  'DWORD {aka long unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]
2015-02-27 13:14:09 +13:00
7aa91f5fbc cleanup: ghost Win32 IME
Took out lots of redundant function calls (getters). Also wrapped more
code in WITH_INPUT_IME guards.
2015-02-26 18:40:34 -05:00
87dc01e690 Fix T43806: Knife project crashes
Need to re-create the bmbvh after executing the cut.
2015-02-27 09:53:23 +11: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
90cc2643e9 cleanup: spelling & typos
Comments only, no functional change.
2015-02-26 14:12:24 -05:00
eaabe9d6c6 BGE: Fix for CreateConstraint API
This patch fix two bugs related to CreateConstraint().
1. Disable linked collision only working with 6DoF constraints.
2. If all pivot axis rotations setted to zero the linked object disappears.

{F101374}

Reviewers: moguri, sybren, brita_, lordloki

Reviewed By: lordloki

Subscribers: p9ablo

Differential Revision: https://developer.blender.org/D704
2015-02-26 20:08:22 +01:00
0aa258117d Fix T43303 impossible to select a joint in stick bone edit mode.
Things here are simple, selected bone joint could have same priority as
unselected bone, so bone would always win. Gave joints a little more
priority than bones, usually user will be more precise just to select
the joint anyway.
2015-02-26 15:44:06 +01:00
84f314c875 Remove redundant glInitNames calls (shouod be handled in selection code
now.)
2015-02-26 15:20:30 +01:00
46fe39ff31 Fix T43479 animated textures lost after going to a frame before animated
frame start.

Issue here is that if we failed to get an image from the cache, we would
try to load from file. This would fail when the queried frame was less
than the animated sequence start frame, and invalidate the OK state of
the image.

Solution is that when loading from cache succeeds, we also reset the OK
state of the image for animated textures.

The fix might be relevant elsewhere too, but kept it isolated just in
case.
2015-02-26 15:10:19 +01:00
13c275ce84 Fix T42506 sequencer not limiting zoom.
Fix by Campbell thanks!
2015-02-26 14:27:33 +01:00
60679a171d Revert "Cleanup: Simplify camera sample motion blur code."
This reverts commit 8197f0bb64.
2015-02-26 13:27:02 +01:00
f159ed7746 Workaround T43491: Python readline causes crash
loading 'readline' module could crash blender if 'libedit' was already linked (via LLVM).

Workaround the problem for now since we don't even need readline,
a _real_ fix likely involves changing how LLVM or Python are built.
2015-02-26 22:54:18 +11: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
d9fa9bffd5 Grmll, sorry for the noise, fix stupi cpoypaste typo in previous commit. 2015-02-26 11:46:05 +01:00
ac26a61385 Attempt to fix BGE build on windows.
Caused by rBb5b359b48f7f35a79b3eec, better to try a full build before pushing that type of commit. :/
2015-02-26 11:42:22 +01:00
98e3694c39 Fix T43817: issue with non-utf8 encodings in Windows paths, again...
We need to use 'W' widechar variants of win funcs and convert wchar to utf8-encoded bytes
in those cases, sigh...

Note: theoritical fix only, need org reporter to test it...
2015-02-26 11:27:58 +01:00
88facb8876 Fix potential buffer overflow in BLI_strncpy_wchar_as_utf8(). 2015-02-26 11:27:58 +01:00
8197f0bb64 Cleanup: Simplify camera sample motion blur code. 2015-02-26 10:30:01 +01:00
31f6e621b8 Fix T43643: Solidify crashes with 'only-rim'
When verts were shared by 2+ face-islands, the number of allocated edges was wrong.

Cleanup the logic for new verts/edges.
2015-02-26 18:48:22 +11:00
d282728f1d mesh_validate: don't add invalid edges into the hash 2015-02-26 17:49:21 +11:00
466c532ba6 RNA: correct limits 2015-02-26 15:53:28 +11:00
7708012b9d Change samples variable for SSAO - now it is actual samples, not squared
- spiral scheme is much more intuitive here. Also use float number for
spirals to avoid having samples on the same radial direction when sample
number is divisible by spiral number.
2015-02-25 23:30:50 +01:00
22ab4e6e13 Use spiral mapping for SSAO - it reduces banding a lot, especially in
higher sample counts. Probably a blurring pass might be a good addition
here as well.
2015-02-25 23:10:01 +01:00
442664e02c SSAO: sampling coordinates go out of screen, reject the sample
Previous behaviour would get occlusion at borders which could create
over occlusion at edges of the screen.
2015-02-25 22:05:03 +01:00
6a65bc91e2 Minor message fixes - thanks to S.J.Bennett for the heads up 2015-02-25 14:41:54 +01:00
df258c9054 Fix silly mistake with flags which would make stereo buffers unsupported 2015-02-25 14:15:07 +01:00
5d01db8035 Make the message even more clear in case someone does not know what GPU
is

(we are talking about people who won't have installed a driver -
anything is possible)
2015-02-25 14:09:40 +01:00
b5b359b48f Warning messagebox for windows when an unsupported implementation of
OpenGL is detected:

Hoping to decrease the frequency of by far one of the most frequent bug
reports by windows users.

There is some reorganization of the GHOST API to allow easy addition of
further OpenGL options in the future. The change is not propagated too
deep to keep the size of the patch managable. We might reorganize things
here later.

For OpenGL we do two checks here:
One is a combination of GDI generic renderer or vendor microsoft
corporation and OpenGL version 1.1. This means the system does not
use GPU acceleration at all. We warn user to install a graphics
driver and of cases where this might happen (remote connection, using
blender through virtual machine)

The other one just checks if OpenGL version is less than 1.4 (we can
easily change that in the future of course) and warns that it is
deprecated.

Both cases will still let blender startup correctly but users should now
have a clear idea of the system being unsupported.

A user preference flag is provided to turn the warning off.

Now stop posting those bug reports without installing a driver first -
please?
2015-02-25 13:51:53 +01:00
1da5e8df6f error in last commit 2015-02-25 18:19:39 +11:00
83caabebd2 CMake: error making get_blender_version a function
Incorrect use of PARENT_SCOPE meant the vars would be used uninitialized elsewhere.
2015-02-25 18:15:54 +11:00
37556d9a9a Fix T43798: Individual origins disabled object PET 2015-02-25 13:41:02 +11:00
565df1559f T43771: Fix
There is a difference between the socket order of the BokehBlur node and
the BokehBlur operation. Socket[2] and Socket[3] have switched their
order.
2015-02-24 20:28:12 +01:00
6ddd2549ed Fix T43535 - weight paint issues
Two issues in this report:

* Shift-F key conflict between painting and selecting mirrored bone
(moved select mirrored to ctrl-shift-F)
* It was possible to display texture overlay in weight painting, even
though the mode does not support textures yet.
2015-02-24 20:12:49 +01:00
cc388ccca4 Add Inset Faces to the mesh edit mode toolbar.
Inset has been missing from the toolbar for a long time, even though it's a fundamental mesh tool. It now lives, happily, alongside Extrude.
2015-02-24 12:19:24 -06: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
2dd37614bc Cleanup leftover code from previous commit 2015-02-24 17:28:43 +01:00
50e9868abe Fix T43785 crash with border select.
Naming here is slightly misleading. We have:

* Number of elements (objects) that can be picked
* Buffer size
* Number of integers in buffer.

Interestingly enough, bufsize in OpenGL (as far as I could find in
examples on the web) and in most of the code refers to the latter and
actual buffer size is only used whenever we do allocations on the heap.
Added an extra defines here to make things a bit clearer:

* MAXPICKELEMS refers to the number of objects that can be picked
* MAXPICKBUF   refers to the number of integers in the selection buffer

Also made all buffers use MAXPICKBUF where some used MAXPICKBUF * 4.
That means that some parts of blender will use less space for selection
now. MAXPICKBUF is set to 10000 for 2500 object selection, which can be
changed at any time, but I think 10000 integers on the stack touches the
borders of uglyland anyway.
2015-02-24 17:19:07 +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
340b76b42c Patch D843 by Alexander Romanov, fixes to the naming of the material
node so it's more similar to the names in the material properties
2015-02-24 16:15:46 +01:00
831a111353 Fix T43792: Connect faces fails with ngons
Complex ngons that intersected the path multiple times would fail to connect.

Now find closest intersections in both directions.
2015-02-25 00:08:39 +11:00
6c96113d5f Modifier: no need to calloc (immediately filled) 2015-02-25 00:08:38 +11:00
07c61e9389 Fix T43743 R key not working after recent rake/random source
refactoring.

Use a new menu instead of old enum key.
2015-02-24 11:56:26 +01:00
77faefb453 Fix T43634: Selecting 'Drop Color' from spacebar menu causes instant close
This is an internal operator, should not be invoked manually.
2015-02-24 14:38:49 +05:00
625101da99 RNA: correct enum flag callback
Was returning NULL, auto-completing:

    bpy.types.Material.bl_rna.properties["type"].

Would crash, accessing 'default_flag', thanks to @lukastoenne for investigating.
2015-02-24 19:45:56 +11:00
a585cbd2af Fix T43783: Cycles clipping doesn't match viewport when camera is inside volume
Ray length adjustment got lost in some refactor commit back to 2.71 days.
2015-02-24 13:07:52 +05:00
4c75f77669 Fix T43784: Compositing scale node border error
This was still the known issue with pixel center, original commit didn't cover all the
cases by the looks of it.

Should be all fine now, but much more intense testing is welcome.
2015-02-24 12:42:31 +05:00
1f527c6033 Fix BKE_mesh_validate_arrays, ignored do_fixes 2015-02-24 13:10:15 +11:00
cdd14ea96d Cleanup: use bit-shift for bmesh_elem_check 2015-02-24 13:10:15 +11:00
Dalai Felinto
abd630de62 Disable Bake Jitter code (recently added)
The following commits were supposed to add anti-alias and help with OSL
baking:

7b16fda379
1b92dfa961

However they introduced other issues (artifacts mostly), see T43550 .
Leaving the code ifdef'ed for now.
2015-02-23 17:50:44 -03:00
4f86f62f32 RNA: use 0/1 for pose layer operator 2015-02-24 07:43:04 +11:00
225f68c324 Fix interpolation functions ignoring number of components when doing early output 2015-02-24 00:36:33 +05:00
5de381ce5b Merge branch 'master' into gooseberry 2015-02-23 18:50:10 +01:00
2081fd1d7d Gooseberry request:
Show World will now influence if world is rendered in opengl rendering.

This is a little undefined according to blender history, since sky used
to always be drawn when offscreen rendering, as if "Only Render" was
ticked. Since if we don't draw sky in that case there's no valid color
really (and using theme colors is not so nice) we just draw transparent
background.
2015-02-23 18:49:29 +01:00
67fcf5256d Move allocation of imbuf from array to allocimbuf.
Skip allocation of temporary imbuf
2015-02-23 17:19:31 +01:00
97422ea64f Cleanup: Simplify brick texture code a bit. 2015-02-23 16:49:50 +01:00
Dalai Felinto
249f2b9ccf RNA: use 1/0 for move layers operator
internal api Consistency.

For the records, I suspect there are still a few cases of this. I found
this by chance (moving an object to a different layer), and I ran into
the previous one (fixed by Campbell) as well (by adding a cube).

Anyways, since it only happens when building with crash on asserts is
not a big issue. But by the time we change RNA to use bool instead of
int it would be nice to do a call for test to prevent those breaks.
2015-02-23 12:34:15 -03:00
9626f4fdf5 GPU module: get rid of gluscaleimage - game engine also uses that but
commit to remove from there will be done separately due to issues with
linking.
2015-02-23 16:33:18 +01:00
1940cf5a0b After discussion on irc change new function to only allocate from a
buffer only. scaling can be done separately
2015-02-23 16:30:37 +01:00
041f706506 IMB library: Add function that scales an array of byte or float pixels.
Function just wraps the array in an imbuf and does regular imbuf
scaling.
2015-02-23 15:51:30 +01:00
eacc3debb7 Fix compilation error after recent GPU debug changes 2015-02-23 18:09:28 +05:00
ced19783fd Fix mismatch (missing 'const' to mactch funcs declarations).
Was breaking windows compile, reported by bdancer over IRC, thanks.

Also, quite some annoying 'unused vars' warnings (debug-only vars).
2015-02-23 13:57:02 +01:00
fed61d50c7 Debug GPU functionality from soc-viewport_fx by Jason Wilkins
patch number D706 with changes:

- WITH_GPU_DEBUG just creates a debug context (and enables the debug messaging
system functions) but leaves the checks we had intact. Old patch
added the debug functionality only if we had the flag on to save some
performance.

Rationale here is that we might not want to recompile blender just to get
the extra information, and having users start blender with a -d flag to
get the extra information is also useful for bug reports. Those checks already
existed and most expensive ones are hidden behind a debug mode check
so performance should not be that bad.

- Did some cleanup of existing functionality:
When things go wrong blender side, just print the error,
don't check for GL errors first.

- Did not port changes needed for GLES to regular glew.h

- Got rid of duplicate or very similar new functionality.

Generally, code is more moving things around/cleanup and should work exactly
as before apart from the debug context, so it's safe to add even now.

It also provides a nice substitute function for glu error descriptions
2015-02-23 13:35:57 +01:00
34479d8b63 Snap to Active: missing armature/pose/mball/curve
de-duplicate active center calc between transform & snap-to-selected.
2015-02-23 23:05:54 +11:00
17b8479101 Fix T43774: Snap to Cursor ignores active pivot 2015-02-23 22:26:19 +11:00
ec36e3ae80 Fix T43776: Rigging : Clear User transform is not working when mesh is in weight paint mode.
Use same trick as for regular 'clear transform' operators to get a valid armature
in weight paint mode (where active object is weight-painted one).
2015-02-23 12:23:13 +01:00
8ee2b01b04 Fix T43740: 'Back to Previous' failed on reload
Would restore with the file-selector where the 'info' header should be.
2015-02-23 21:33:14 +11:00
b497eae0a8 Screen: remove redundant NULL check in ED_area_prevspace 2015-02-23 21:06:55 +11: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
86cfbeec6a Partial fix for T43740
ED_area_data_swap would put the screen in an invalid state and crash.
(SpaceLink.spacetype didn't match ScrArea.type)

However behavior is still odd in the instance of the report.
2015-02-23 20:02:54 +11:00
96c452bdf6 Fix T43769: Envmap Texture copy looses image 2015-02-23 18:22:09 +11:00
7c03ef295b CustomData: const correctness 2015-02-23 16:17:16 +11:00
0c4fb47edd BLI_utildefines: correct comment 2015-02-23 16:17:16 +11:00
64b328f22b Edge/Vert Slide: avoid redundant loop angle calls
No need to calculate loop angle for each layer
2015-02-23 15:44:28 +11:00
bc876f9ea4 Error in last commit
Accidentally left in malloc/free
2015-02-23 15:40:43 +11:00
5a372dbd89 Fix error in recent vert/edge-slide commits
`CustomData_bmesh_interp_n` was expecting the 'dest' arg not to have its offset applied.

This was a bit confusing since the source args have it applied,
and in some cases we only have the destination with the offset.
2015-02-23 13:57:06 +11:00
50c977b54d CustomData: replace calloc -> malloc
stack array is uninitialized, relying on calloc here would just hide bugs.
2015-02-23 13:57:06 +11:00
d580c90469 CustomData: const correctness for interp() 2015-02-23 13:54:33 +11:00
c26fa67bcd BLI_utildefines: add pointer offset macro
Handy since it keeps the type of the original.
2015-02-23 13:50:12 +11:00
765b842f95 Subsurf: missing NULL checks on free 2015-02-23 08:34:20 +11:00
Julian Eisel
0f1ffd4792 Fix T43768: Pointcache end frame ignores preview range
Fix for T43768

This way it works consistent with cloth, softbodys, etc.

Reviewers: lukastoenne

Differential Revision: https://developer.blender.org/D1134
2015-02-22 17:14:19 +01:00
63b0a7feb2 Cycles: Make it survive if preview_cycles.blend uses persistent data
Currently should be no functional changes, but nice thing to have fixed
for some further experiments.
2015-02-21 19:18:20 +05:00
6d9c99422b Fix T43748: MouseLook actuator raises an Assert error
An assertion seems to be inverted by mistake, as MT_assert(!m_mouse); is followed
by using m_mouse->XXXX.
2015-02-21 14:39:04 +01:00
813dcb9feb GPencil: Another fix for the "big square dots" problem
Strokes containing only a single point are now drawn so that they respect the
pressure values too. Previously, they were getting drawn at a fixed size based
on the thickness of strokes. Thanks to @kekeljevic for posting a screenshot which
made the problem here easy to identify!

(On a side note: Perhaps it's a combination of the drivers I'm using, or the
multisampling goodness at work, but after applying this change, the dots are
now appearing as round circles as originally intended, and can also be scaled
up quite a bit too. And that's for 3D points which couldn't be affected like
this earlier! I'm not sure what's going on here, but whatever it is, I like it ;)
2015-02-22 02:09:52 +13:00
6ec05eb3e6 Code cleanup: Use bools instead of int 2015-02-21 17:50:05 +05:00
578cc2143d Cycles: Add note about autodiff in OSL wireframe shader 2015-02-21 17:31:41 +05:00
888d810185 Cycles: Use lower progressive update timeout for preview rendering
This ways previews are refreshing with the same ratio as job was expecting
this to happen, giving more instant feedback on the changes.
2015-02-21 17:30:29 +05:00
a97bc1bedf Fix T43755: Wireframe attribute doesn't work with displace
This attribute missed derivatives calculation.

Not totally sure what's the proper approach for algebraic derivative
calculation, so calculating them by definition. This isn't fastest
way to do it in this case and could be replaced with some smarter magic
in the wireframe calculation loop.

At least currently implemented approach is better than nothing.
2015-02-21 17:30:29 +05:00
3445ff0f93 scene conversion: style cleanup 2015-02-21 12:16:21 +00:00
4c0adb95dc gamengine: removing useless comment 2015-02-21 12:16:21 +00:00
9bfdcc4d32 gameengine: removing addInitFromFrame hack 2015-02-21 12:16:20 +00:00
5785df431b gameengine: dataconversion import and whitespace cleanup 2015-02-21 12:16:20 +00:00
f15bb2b793 doxygen: updating blender version and link to tracker 2015-02-21 12:16:20 +00:00
7501bdc52e python bge.types module - Updating documentation to close T40778 2015-02-21 12:16:20 +00:00
8db9b07cb3 Fix T33762 - texture fonts were not using the material color (gameengine) 2015-02-21 12:16:20 +00:00
f1a65a9fab makeScreenshot - adding frame number to the filename 2015-02-21 12:16:20 +00:00
cf4646b95f commiting patch to fix T30173 2015-02-21 12:16:19 +00:00
c391a67830 gameengine: KX_Scene comment cleanup 2015-02-21 12:16:19 +00:00
cfec320f1e BGE cleanup: removing unused async logic bricks
This code was never run and is an outdated copy from the code above.
If someday this is needed again, it is better to start clean.
2015-02-21 12:16:19 +00:00
e0187ec0c3 Documentation update: references to OpenGL tutorials in the python bgl module 2015-02-21 12:16:19 +00:00
7bd4c78a1a Cleanup: Put all Bump dx/dy code in the beginning here, same as with other nodes. 2015-02-21 12:55:19 +01:00
913e109f14 Correction for RNA getter of use_save_buffers 2015-02-21 12:47:29 +05:00
09893ec7fc Cycles: Workaround for NVidia OpenCL compilation
It was complaining about explicit __constant to __private memory conversion,
which is now worked around using implicit conversion.

It's not a real fix i'm afraid and i'm still failing to build OpenCL kernel
with latest Linux drivers, but maybe it'll let someone else to investigate
what causes compiler to run out of memory?
2015-02-21 12:35:06 +05:00
87572091fb BGE: Fix T43215: Rigidbody constraints deletion.
Deleting an object was deleting all rigidbody constraints in the scene.
Bug was introduced with D701.

Reviewers: agoose77, sergof, moguri, lordloki, sybren

Reviewed By: lordloki, sybren

Subscribers: sybren, hbar, blueprintrandom, sergof, agoose77

Differential Revision: https://developer.blender.org/D1007
2015-02-20 23:37:32 +01:00
1b92dfa961 Fix T43550: Bug in Cycles Bake Texture
Issue was caused by the changes in 7b16fda which changed the initial
state for rng. This commit makes it so the same initial hash is used
(which solves the regression without distorting AA-looking image.

It also makes it so OpenCL compiler is happy about this code (before
this change it'll complain about trying to cast private variable to
global one).
2015-02-21 01:56:48 +05:00
f7a2a36b31 RNA: use 1/0 for object layers
internal api Consistency.
2015-02-21 02:10:08 +11: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
8e955449a8 Yet another commit to get rid of missing faces in fill brushes.
We are now guarding against some divisions by small values.
There are still issues here but they are not on boundary faces
anymore so they must be related to some other issue such as
the triangle intersection test.
2015-02-20 15:11:24 +01:00
bcf88bf242 Merge branch 'master' into gooseberry 2015-02-21 00:10:38 +11:00
d12eba61a5 Sequencer: allow scene volume above 1 2015-02-21 00:08:56 +11:00
de4dcda545 Fix T43651: New pointiness attribute doesn't work with displacement
Simple fix: just make pointiness aware of bump offset.
2015-02-20 17:20:24 +05:00
51b0ae8a85 Fix T43739: bad documentation for bmesh py intersect_face_point()
Previous text could make think this func was checking whether a point was
inside and on the face, while it actually checks whether the projection
of that point onto the face is inside its boundary...
2015-02-20 10:54:26 +01:00
185e301229 RNA: correct bool callbacks 2015-02-20 19:54:51 +11:00
d0978103ae Revert "Cast result of rna_RenderSettings_use_game_engine_get to {0, 1}"
There are more flags that trigger this assertion, so I want to discuss
an appropriate way to fix it before changing them all.

This reverts commit b1191e5caf.
2015-02-20 08:41:31 +01:00
b1191e5caf Cast result of rna_RenderSettings_use_game_engine_get to {0, 1}
rna_RenderSettings_use_game_engine_get() in rna_scene.c would return 0 or 2,
whereas the assertion in rna_access.c:1843 indicates that boolean values
should only be 0 or 1.
2015-02-20 08:36:50 +01:00
f9a5dab529 RNA: calloc -> malloc when fixbuf is uninitialized 2015-02-20 17:18:41 +11:00
919e38cfc8 Fix for unlikely NULL pointer dereference
Potential crash reading freestyle modifiers from future blend-files
2015-02-20 17:18:41 +11:00
1ec83f41c1 Fix possible (unlikely) memory leak 2015-02-20 17:09:40 +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
83220ab7fb Cycles: Use size_t for aligned allocator
Seems it got changes by accident to int during guarded allocation work,
causing bad memory allocations.
2015-02-19 22:19:29 +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
2ddfd3a123 Skip flip check in cases where it's not needed. 2015-02-19 16:58:35 +01:00
f56fd1c47a Remove flipping for colinear case/ In such cases it is doubtful whether
face orientation is really meaningful
2015-02-19 16:51:51 +01:00
b1d02f3d57 Projective painting: Only dither if factor is more than zero 2015-02-19 16:48:51 +01:00
efb20dacc6 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:48:17 +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
7f406a53c7 Cycles: Cleanup for indentation in device_cpu.cpp
Perhaps became broken after rather recent change about which entry point
to kernel to use.
2015-02-19 19:05:04 +05:00
3bc9ac19f5 Cycles: Free memory used by intermediate BVH vectors earlier
Ideally we should get rid of those temporary vectors anyway, but
it's not so trivial because of the alignment. For untl then we'll
just have a bit worse solution. This part of code is not the root
of the issue of memory spikes for now anyway.

But since we're getting rid of temporary memory earlier actual spike
is a bit smaller as now. For example in franck_sheep file it's now
5489.69MB vs. previously 5599.90MB.
2015-02-19 18:58:21 +05:00
0f652501c7 Cycles: Reduce memory used by background light update
Simple change: just get rid of intermediate data a bit earlier, before
final pixels array is being allocated. This gives around 30% of memory
save during light update (this is about 60meg in the frank sheep file
i'm using here).

This isn't really visible by artists a lot, because actual spike happens
on BVH construction. But it doesn't mean we shouldn't be accurate with
memory usage in other areas.
2015-02-19 18:18:04 +05:00
a199460495 Merge branch 'master' into gooseberry 2015-02-19 13:28:18 +01:00
27d1446d24 Cleanup: Restructure curve settings code a bit.
This is a bit more logical, as it better represents the 3 primitive types we have.
2015-02-19 12:37:56 +01:00
ebdc1cde3f Fix 2d paint issue with textured brushes: Multiply brush color with
texture in the right space
2015-02-19 12:37:47 +01:00
528514c393 bge physics: disallowing compound collisions for soft bodies
Closes D610, T40427, T30630

Cherrypicked from local squash
Conflicts:
	release/scripts/startup/bl_ui/properties_game.py
2015-02-19 11:20:18 +00:00
b7033e3d4e BGE physics: adding links to bullet documentation 2015-02-19 11:20:18 +00:00
d2c2b10aeb gameengine physics: removing triangle mesh collision option for character controllers 2015-02-19 11:20:17 +00:00
938fa934c8 gameengine physics: removing compound option for character controllers
Cherrypicking c31d921 onto 117edbb
Conflicts:
	release/scripts/startup/bl_ui/properties_game.py
2015-02-19 11:20:17 +00:00
0049c22ad9 Animation ghosting: when tweaking start-end values don't clamp user
input, instead make sure the end-start values are sane instead
2015-02-19 12:10:44 +01:00
9fc2c37328 Guardedalloc: Reset peak memory should set peak to currently allocated memory
Otherwise statistics could be really funny looking.
2015-02-19 13:14:06 +05:00
3e534833e3 Cycles: Make sphere and tube image mapping friendly with OpenCL
OpenCL doesn't let you to get address of vector components, which
is kinda annoying. On the other hand, maybe now compiler will have
more chances to optimize something out.
2015-02-19 12:52:48 +05:00
5004b58262 Cycles: Make util_math_fast.h compatible with OpenCL 2015-02-19 12:29:06 +05:00
5721863805 RNA: pass only 0/1 to RNA_property_boolean_set 2015-02-19 12:33:14 +11:00
eee79641c3 RNA: poll functions restricting object types
D1100,D1105,D1106 by @lichtwerk
2015-02-19 11:59:24 +11:00
a74bd1bec7 Generate correct Cycles node setup for quick smoke "fire" preset.
Patch by Gottfried Hofmann.
Differential Revision: https://developer.blender.org/D1103
2015-02-19 00:18:27 +01:00
5ed2cc8070 Fix T43652: X11 "_NET_WM_PID" not set by Ghost
D1107 by @kevindietrich
2015-02-19 09:54:11 +11:00
f0527d9631 Ghost/X11 cleanup (reduce variable scope) 2015-02-19 09:54:11 +11:00
5d0696052a BGE: Fix T41502 Path following jumping
New Lock Z velocity parameter was added. This parameter avoid the micro-jumping.
By default it is actived except when you load an old file that it is deactived to keep former behaviour.

Additionally it was solved another issue related with the acceleration: That is the acceleration value was not taked into account and we had always the maximum linear velocity from the beginning of movement. Now the acceleration is taken into account until we reach the maximum velocity.
When you load an old file, the acceleration value is set to the maximum range (1000.f). This way we simulate a maximum velocity constant from the beginning of movement (former behaviour).

{F142195}

Reviewers: moguri, dfelinto, campbellbarton

Reviewed By: campbellbarton

Subscribers: sergey

Differential Revision: https://developer.blender.org/D1074
2015-02-18 23:24:02 +01:00
bd5154bb2c Fix Cycles OpenCL error with scons, util_math_fast.h was missing.ø 2015-02-18 22:44:17 +01:00
f1a9dbb0d7 Fix minor mistake - only increase size of compositing when stencil -is-
set.
2015-02-18 22:16:20 +01:00
b5a14c381c Report total unfreed memory size on exit
Previously only number of unfreed blocks would have been printed,
which might not be totally enough during investigation process.
2015-02-19 02:08:09 +05:00
6c5f63b476 Guardedalloc: Add extra logging and checks in MEM_freeN()
We don't like when NULL is send to MEM_freeN(), but there was some
differences between lockfree and guarded allocators:

- Lockfree would have silently crash, in both release and debug modes
- Guarded allocator would have printed error message, abort in debug
  but keep working in release build.

This commit makes lockfree allocator behavior to match guarded one.
2015-02-19 01:58:49 +05:00
0f2adc0817 Cycles: Make aligned allocation to respect WITH_BLENDER_GUARDEDALLOC
Title pretty says it all actually. Can only briefly mention that we're
indeed entering that state when after applying some WIP patches having
much fuller statistics about memory usage would help giving exact memory
benefit.
2015-02-19 01:50:46 +05:00
ee9ac4e4fc CMake: remove expression in endif(...) 2015-02-19 07:45:59 +11:00
54994740bd CMake: indent & missing header 2015-02-19 07:15:55 +11:00
483fa4c387 CMake: picky style edit
'cmake_consistency_check.py' relies on this formattng.
2015-02-19 07:15:00 +11:00
bbc7dc169d RNA: assert when non 0/1 values used as bool
Prepare for using 'bool' type.
2015-02-19 07:08:10 +11:00
86e04c4ca9 RNA: assert on over-sized array index access 2015-02-19 07:01:49 +11:00
9d464a7538 RNA: use __func__ for alloc-id's 2015-02-19 06:57:45 +11:00
4ed8b70870 BGE: Fix T42437: Physics/Compound bug
Null check to verify that parent has a character controller. Otherwise (i.e empty) it will crash.

Reviewers: moguri, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1115
2015-02-18 19:59:21 +01:00
9bd2a7c0a8 BGE: Fix T41570: Blender crash when physics createConstraint
Move physicsid type to unsigned long long to avoid crashes on Windows 8.1 64bits.
Other systems also modified to put them inline with this solution.

Reviewers: dfelinto, brita_, moguri, juicyfruit, campbellbarton

Reviewed By: juicyfruit, campbellbarton

Subscribers: juicyfruit

Differential Revision: https://developer.blender.org/D1122
2015-02-18 19:52:54 +01:00
839a6b22d6 Fix T43716 regression in mask modifier - edges could access out of
bounds indices of vertices.

Issue here is that if we copy edge customdata the MEdge data that were
previously written get overwritten, solution is to write indices and
flags last (probably writing flags is superfluous here).
2015-02-18 17:59:16 +01:00
c9fa37fbcd Cycles: Initialize "headless" flags on engine initialization
This flag is global for all the sessions and never changes. so it doesn't
really make sense to pass it around to all sessions and synchronization
routines.

Switched to a static member of BlenderSession now, but it's probably more
logical to introduce some sort of BlenderGlobals. Doesn't currently worth
a hassle for a single boolean flag tho.
2015-02-18 21:52:51 +05:00
6f3500db05 Cleanup: Remove unused SD_PHASE_HAS_EVAL flag.
We only have a non-singular volume closure and therefore no need to distinguish it.
2015-02-18 16:33:31 +01:00
a2366a3a2e Cleanup for Cycles hair shader ifdefs.
sc->T and sc->data2 were behind __HAIR__ ifdef, now they are not anymore, so we can always assign the correct value.
2015-02-18 15:57:39 +01:00
bf0a001e61 Cleanup: Remove support for Boost filesystem 2.
This is deprecated since Boost 1.48.
2015-02-18 13:49:49 +01:00
55fd389a70 New filebrowser bookmarks: Some minor fix/optimization from latest coverity report. 2015-02-18 13:18:04 +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
2967253ae4 Fix Windows build.
Mighty M$VC never heard of 'strcasecmp' family of functions, it prefers its
own names, as usual...
2015-02-18 12:22:58 +01:00
6920735cff Include SDL information in system info text.
Adds bpy.app.sdl to expose SDL version information.

When SDL is not available on a Linux system, certain Blender features
are silently disabled (like joystick support in the BGE). This change
is the first step towards making it more obvious why something isn't
working.

SDL information is exposed to Python via bpy.app.sdl, in the same way
as OCIO and OIIO information is exposed.

Generated system-info.txt contains SDL loading method (linked or
dynamically loaded by Blender) and SDL version number.

Reviewed by: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1112
2015-02-18 12:08:20 +01:00
7f7413bce2 Cleanup: Use bools in BVHParams class. 2015-02-18 12:05:59 +01:00
6fe23b60dd Use clamp to border for brushes or textures can "leak" after rotating
texture coordinates of brushes (in rake mode).
2015-02-18 11:59:55 +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
fda119866d GPencil: RMB menu tools in Outliner works for GP Layers now
It would be even better if these used their own dedicated menu which could include
the protect values too, but this one at least works now
2015-02-18 14:49:42 +13:00
c7c711bb72 GPencil Fix: Added checks to ensure that copy/paste doesn't paste incompatible strokes
There was a problem with the copy/paste functionality, where it would be possible to
paste 3d strokes into 2D editors, or 2D strokes into the 3D view. The problem with
that though is that these will not show up, and because there's no feedback at the
time, users may end up doing this pasting several times.
2015-02-18 14:49:41 +13:00
bd92168643 Cycles / BVH: Remove unused temp copy of prim_object.
This will save some memory during BVH Build.
2015-02-18 01:14:59 +01:00
5eecfbd980 Quiet uninitialized mem use for blank cursor
harmless but may as well initialize.
2015-02-18 10:44:28 +11:00
1fa98b374f Fix free'd memory use removing constraint 2015-02-18 10:44:17 +11:00
b337cc1c21 Do not allocate an XRay buffer if compositing is dnot one for offscreen
rendering.
2015-02-17 23:38:28 +01:00
d74189a78a cleanup & missing break 2015-02-18 09:08:24 +11:00
17a4f326b0 Merge branch 'master' into gooseberry 2015-02-18 02:26:48 +05:00
ef11be0e77 Cycles: Avoid over-allocation in decouple ray marching
It could have happened with really long rays and small steps.

Step size will be adjusted to the clamped number of steps in order
to preserve render result compatibility as much as possible.

We should probably reformulate this a bit, so it will give the
same looking results without step tweaks. But this new behavior
should already be much better that it was before.
2015-02-18 02:26:24 +05:00
a9dbaf3755 Ensure BLI_stat() return value is checked.
also add function attrs on BLI_fileops to ensure they're used correctly.
2015-02-18 07:27:27 +11:00
e089b0e911 Amend to previous own Fix T43684: only use hack on WIN32, and use case-insensitive comparison.
Thanks to Campbell for the headup.
2015-02-17 21:10:08 +01:00
fd0732b5fa Merge branch 'master' into gooseberry 2015-02-18 00:59:50 +05:00
5115e86246 Fix T38808: Re-opening an image makes absolute 2015-02-18 06:39:28 +11:00
9d879c43f3 Fix T43708: Wrong manipulator in individual origin
Manipulator and actual behavior were out-of-sync with a single edge selected.
2015-02-18 06:08:59 +11:00
6133d14028 BMesh: calc_manipulator_stats can only check verts
Code assumed selection wasn't correctly flushed, which we ensure now.
2015-02-18 05:41:13 +11:00
07ba8b96e5 Tweak to new UIList bookmarks & co: extend up to ten entries before using scrollbars.
But again, what we really need to fix is UI saving for that temp area...
2015-02-17 19:27:14 +01:00
7e73b6aa25 Cleanup: Add comment about light_p being modified in one case. 2015-02-17 19:24:37 +01:00
1aa93dd9fd Cycles: Cleanup after recent changes 2015-02-17 23:21:53 +05:00
21a2b73a1e Fix T43684 (again!): Mighty Windows thinks it’s perfectly sensible to block everyone during 5 seconds for a mere stat() call on "A:\" path...
For now, just always consider those floppy entries ("A:\" and "B:\") as valid... sigh.
2015-02-17 19:13:22 +01:00
e6f40b4ceb Some tweaks to last commit, this is better. 2015-02-17 19:03:50 +01:00
f3e831f02d Cycles: Fix for hair transmission BSDF not returning proper label 2015-02-17 22:40:00 +05:00
6f820664c4 Cleanup: Deduplicate area light sampling code. 2015-02-17 18:39:37 +01:00
f05f99f9d4 Fix crash when rendering to offscreen OpenGL, fix scons build 2015-02-17 18:35:56 +01:00
ff7220349d Compositing works with X-Ray.
Basically, before drawing X-Rays, we now bind a second depth buffer.
After drawing XRays, we do an extra resolve pass where we overwrite the
non-XRay depth buffer in pixels where the depth is not maximum (which
means background pixel, since depth is cleared before drawing X-Ray
objects).

This ensures both scene and X-Rays keep their depth values and are ready
for compositing. Well, the odd effect due to depth discontinuities can be
expected, and X-Rays are a bit more expensive (extra buffer + resolve pass)
but at least X-Rays won't invalidate depth values anymore. Whee!
2015-02-17 18:11:22 +01:00
a0d7db503d Cycles: Small tweaks for Henyey Greenstein closure code.
* Avoid duplicative fabs(g) check in sample code.
* Avoid dot product in eval code.

Helps like ~1% when Scatter Anisotropy is 0.
2015-02-17 17:48:18 +01: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
ea2fc5b9d6 Fix for particle path drawing with black tips.
The last path segment can be shortended due to randomized path length.
In that case the last segment's color vector was not defined.
2015-02-17 15:22:02 +01:00
9b845359a6 Quick fix/hack for too small 'operator' panel in filebrowser
Real issue is that temp area used to draw modal filebrowser is never saved,
so non of UI 'edits' (like UIList resize, regions resize, panels reorder, etc.)
are ever saved. Should be addressed, but no time for that currently.
2015-02-17 15:18:02 +01:00
18e849b05d GPencil: On the fly switching between Drawing and Erasing when using "Continuous Drawing"
It is now possible to switch between drawing and erasing strokes when in
the modal "Continous Drawing" sessions. This makes the drawing experience
just a little more fluid, saving some unncessary steps to get out of
the editing mode to activate the intended tool.

TODO: Is there interest for tablet support for this too?
2015-02-18 03:16:33 +13:00
bf878d3c3d Cycles: Remove empty closure blur code and the corresponding entries in the switch.
Most compilers will probably optimize that out, but I still don't see a reason to keep it.
2015-02-17 13:44:25 +01:00
4660c00ac5 Cycles: Make blender session aware of rendering from command line
This way we can do some more aggressive policy about releasing temporary
data during synchronization.
2015-02-17 16:25:16 +05:00
7307f3b485 Fix T43706: Creating a directory in the file browser (by typing it in the file path) crashes Blender
Issue was caused by 2e9105c, free() does nothing if pointer is NULL, but guarded
allocator expects you to not free NULL.
2015-02-17 15:55:18 +05:00
2c1b0536c9 Fix T43697, grid drawing over wires and grease pencil. Props to Julian
for figuring out a simple solution to that :)
2015-02-17 11:37:20 +01:00
cdc1dab073 Fix T43685: New pointiness attribute error with auto-smooth enabled
Simple fix: all vertex attributes should be filled in before split.
2015-02-17 13:49:11 +05:00
587d8771e0 Cycles: Minor code cleanup in recent attributes changes 2015-02-17 13:46:25 +05:00
86a2e9d0e4 etch-a-ton: off by one error
was writing past the buffer when inserting strokes
2015-02-17 17:12:19 +11:00
28f31bdfd8 etch-a-ton: fix crash selecting strokes 2015-02-17 16:49:30 +11:00
a8487fc7fe etch-a-ton: fix uninitialized memory use 2015-02-17 16:48:53 +11:00
Julian Eisel
0294327615 Hide 3D Cursor in Paint Modes (with exceptions)
= Hide 3D Cursor in Paint Modes (with exceptions)

In paint modes, the 3D Cursor mostly is rather useless so it's more annoying than useful. This patch aims to hide the cursor in cases it's not used.

Included exceptions (cases where cursor is drawn in paint modes):
* Active object is in weight paint mode and a selected bone in pose mode can be found
* Clone brush (only if //Clone from paint slot// is disabled)

There might be more exceptions where the cursor should be shown in paint modes, but those are all I could find for now. Feel free to hint me for more.

Note: After D1110 was rejected, Campbell and me discussed this a bit more on IRC and agreed that this behaviour might be a good solution.

Reviewers: psy-fi, campbellbarton

Reviewed By: psy-fi, campbellbarton

Projects: #user_interface

Differential Revision: https://developer.blender.org/D1113
2015-02-17 03:26:03 +01:00
4bb331dfd5 RNA API: reuse property lookups 2015-02-17 13:13:59 +11:00
Julian Eisel
691cb61835 Fix for another missing update from GPencil in Outliner 2015-02-17 02:12:23 +01:00
Julian Eisel
89412028ce Fix T43669: Grease Pencil visibility toggle not working in Outliner 2015-02-17 02:12:23 +01:00
070f516b52 Fix FileSel globbing including dirs & ".." 2015-02-17 12:01:47 +11:00
8cb4011220 Revert "Fix file size not drawn using Link/Append"
This reverts commit 4ca4f04c75.

Was running an fs-stat on redraw, on every file! (every mouse motion!).
Could become very slow on network-fs

also caused crash (T43631)
2015-02-17 11:36:41 +11:00
9f008d17fe assert when BLI_exists is called with NULL path 2015-02-17 11:36:35 +11:00
00133ba8f0 Subsurf: Use guarded allocator for non-arena CCG
Our new guarded allocator implementation has much smaller memory
block size overhead and doesn't have any locks now. So in order
to make fuller track of what's happening in blender and avoid
confusion why certain circumstances reports much less memory than
others we'll now switch to guarded allocator.

This was actually one of the biggest reasons of the confusion in
the recent memory usage investigation. There's still some overhead
is happening due to non-freeing nature of arena allocator but the
things are not nearly as bad as they looked before: memory overhead
is measured in tens of megabytes, not hundreds as it looked before.

Plus with some smarter allocation policy we can almost eliminate this
overhead.
2015-02-17 03:42:16 +05:00
1e00e87e3a FileSpace selection didn't call op.check sometimes
(de)select all & globbing didnt run operators check callback.

D867 by @igel with edits
2015-02-17 08:54:25 +11:00
fa9311c9a4 Cleanup: Update comments and make it more clear what volume interpolation is for. 2015-02-16 22:11:41 +01:00
652b2b656a Fix bake action visual-keying option
Disabling did nothing
2015-02-17 07:19:48 +11:00
00a3c9afc8 UI messages fixes and cleanup. 2015-02-16 20:38:07 +01:00
0dfdca6d13 Fix T43684: File Browser is unusable on Windows Machines (do not BLI_is_dir() in draw loop!)
Did not had any issue on linux, but looks like on some windows can slow things as Hell.
Or maybe just the presence of some network FS?

Anyway, not a good idea, so now fsmenu entries' valid status is stored and only evaluated
on startup (reading of bookmarks & co) and when opening file browser (refresh, like
for system bookmarks).
2015-02-16 15:58:57 +01:00
fd4f0ed39e Cleanup: Remove unused code from hair BSDF. 2015-02-16 15:23:01 +01:00
bbe1b54818 Fix T43689, viewport compositing does not respect alpha settings for
background.

For SSAO supporting this is no problem, for DOF we would ideally do
blurred alpha, but alpha channel in blurred buffers is occupied by coc
field, so use original color alpha instead. It's not entirely correct
but it's better than nothing.
2015-02-16 14:42:36 +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
6e08aa0a9e Tracking: Expose Filter Tracks operators to the Cleanup panel
Not totally happy with this, but it's better than nothing for until
we've got real outlier detection. Also made it more cleat how exactly
filtering happens, so users don't expect something the operator is not
intended to do.
2015-02-16 17:16:14 +05:00
5a14dd7476 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/editors/space_sequencer/sequencer_draw.c
2015-02-16 13:02:00 +01:00
7c3d5a3337 Cycles: Use some more bools in microfacet code. 2015-02-16 12:32:42 +01:00
e7d2e5ffbc Extended RNA support for mesh customdata property layers.
Support for user-defined customdata layers (named int, float, string
layers) was limited to polygon customdata. This is not accessible in
cycles because only tessfaces are used there. Furthermore the polygon
attributes were simply described as MeshFloatProperty, MeshIntProperty,
MeshStringProperty, omitting the distinction by element type.

The patch only adds vertex attributes so far. However, the code now
explicitly defines polygon and vertex attributes, so adding edges, loops
and tessfaces is much easier should the need arise.

Problem is that the RNA definition, which is already much more
complicated than the basic DNA/BKE definition of custom properties, now
becomes extremely bloated and cumbersome. A simpler solution would be
preferable but may not be possible within the constraints of RNA.
2015-02-16 12:26:25 +01:00
9daac198f5 Cycles: Correction for C++11 compilation error after recent vector changes 2015-02-16 15:38:13 +05:00
9a10b208ba Ensure CMake finds SDL 2.0
CMake 2.8 doesn't search /usr/include/SDL2, which is the include directory
for SDL 2.x on Ubuntu Linux (and possibly others). This results in SDL 1.2
headers being found when WITH_SDL_DYNLOAD=OFF, and our shipped SDL 2.0
headers when WITH_SDL_DYNLOAD=ON. This patch ensures that in both
cases the correct SDL headers are used.

Reviewers: sergey, campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1112
2015-02-16 09:27:50 +01:00
58652301de Vert/Edge Slide: better UV interpolation
Ignore faces which the sliding vert is outside of.
2015-02-16 18:49:18 +11:00
421d0f3bde Math Lib: add dist_signed_squared_to_corner_v3v3v3
Can be used to check if a point is inside the 2-planes defined by a face-corner.
2015-02-16 18:47:15 +11:00
81be1c7a21 Correct crash /w vertex slide with no faces
Error in recent commit
2015-02-16 13:41:46 +11:00
7975c0d35a cleanup: split VSE view-size into own function 2015-02-16 13:19:22 +11:00
5c747e7196 Fix T43681: VSE draw glitch with no-display
Missed clearning the backdrop
2015-02-16 13:05:59 +11:00
b1dbda143d BMesh: Connect path, use select order
Could connect a pair of verts previously,
now connect all vertices along the path, running a second time closes the loop.

Can also be used for without faces to connect edges between selected points.
2015-02-16 09:44:30 +11:00
e2573aea9b Compilation error fix for strict compiler flags 2015-02-15 23:12:54 +05:00
478d67e858 Cycles: Hopefully compilation error fix for OSX 2015-02-15 23:11:33 +05:00
a98fc4f8f9 Fix T43671: Playing with Mix Factor of Data Transfer Modifier Is Overwritting Data of Base Mesh
The issue was actually affecting all data types that are not regular CDLayer ones, since by default
DerivedMesh references mesh data (verts, edges, etc. - modifying custom normals often implies
modifying edges' sarpness too).
Modfying edge/face sharpness etc. could directly affect the mesh in this case, **bad**!

So we detect whether we are copying data types that may affect non-CDlayers data, and whether
verts array of org dm is same as mesh one - in which case we copy the DM. This avoids
useless copying in most cases.

Note Edit Normals was quite obviously suffering the same issue.
2015-02-15 19:00:06 +01:00
1c64543aef Cleanup of SpaceFile, from asset-experiments branch mostly.
Helps keeping diff with branch relevant and clean...
2015-02-15 16:35:42 +01:00
f1ee11fcca Fix for previous commit, sorry for the noise. 2015-02-15 15:55:13 +01:00
2e9105cc96 Cleanup: BLI_listdir (direntry): get rid of usage of raw malloc/free here.
No reason at all not to use MEM_xxx as everywhere else, especially confusing
when members of direntry **are** MEM_-allocated (relname, etc.)!
2015-02-15 15:07:48 +01:00
35567d563d Possible todo notes for more polished UI? 2015-02-16 01:21:48 +13:00
263518ec49 Outliner: "Purge All" function for Outliner in "Orphaned Datablocks" mode
Many users have been requesting a way to remove unused datablocks from the file/session
"without closing and reopening" Blender (or at least that's the impression I'm getting).

This commit adds a new operator (exposed as the "Purge All" button in the header of
the "Orphaned Datablocks" mode in the Outliner, which seems to be the logical
place for this) for doing so. It does so by wrapping up the save and "revert"
(i.e. reload the saved file from disk, without needing to quit Blender) operators
along with a confirmation prompt for good measure.

Caveats:
* Ultimately, we still cannot really cleanly delete any datablocks from the current
  session outright without reloading the file/data at some point. Thus, we do need
  to reload the file again before it can be used.
* This does mean that this operation is irreversible. Notably, Undo history is lost
  is doing this operation. Hence the warnings...   (Then again, undo/redo actually
  reloads the entire scene DB from memory, so it's not anything uncommon ;)

Other Notes:
* The addition of this operator brings this mode more into line with being a kind of
  "Trashcan" place, with this new operator being the manual "Empty Trash" button.
  If the "Orphaned Datablocks" name is too obscure, maybe we could rename this
  mode to "Trash" or something similar?
2015-02-16 01:21:47 +13:00
0688f6e012 Code Cleanup: Reshuffle libraries and orphaned datablocks views to a more appropriate place in the file 2015-02-16 01:21:46 +13:00
d0609d09e4 Outliner: Do not show RMB menu for "ID Base" entries 2015-02-16 01:21:45 +13:00
16689a1db0 Outliner: Use restriction columns in "Orphaned Datablocks" view to manage usercounts
When in "Orphaned Datablocks" mode, the restriction columns are used to display
usercount indicators and toggles to manage whether datablocks get saved or not.

* The first column shows an icon to indicate whether that datablock is going to get
  saved. A tick indicates the datablock will be saved, while a cross indicates the
  opposite. Clicking on this changes whether the datablock will get saved.

* The second column shows the usercount.

* The third column shows whether the datablock has a fake user.


Notes:
* The second and third columns are pretty much redundant (functionally speaking).
  While it is possible to also toggle fake users by clicking in the third column,
  its role here is more as information for power users (and hopefully to allow others
  to connect the relationship between the saved/not saved status and fake users)

* I'm not sure whether the use of the X here for the "not saved" state stands out enough
  to draw user's attention to items which are "in the danger zone".
2015-02-16 01:21:44 +13:00
030b0aab43 Outliner: Added new mode for displaying "orphaned" datablocks
Orphaned datablocks are those which have either:
* 0 users
* A "fake" user only

In the case of the former, they will be quietly discarded from the file on the next
save + reload. Hence, it is helpful to have a view where you can confirm which ones
fall into this category and might be worth saving.

We also include datablocks with a fake user only so that datablocks given a user
above can have that easily turned off again (in case the user makes a mistake).
Another benefit of showing these is that it become easier to remove fake users from
datablocks you no longer want retained without having to hunt for them.
2015-02-16 01:21:43 +13:00
Julian Eisel
0ff56ca2aa Revert/Remove "Auto View" Feature
Turned out that I misinterpreted the feature request, plus there are some
minor issues with the commit that would need to be corrected.
After all, I decided to just remove it again as it seems to not be really
useful for the users.
2015-02-15 04:29:11 +01:00
c439d14a9a missed this second last commit 2015-02-15 14:11:05 +11:00
fa2f7c69ac mathutils: Implement __hash__() functions
- all mathutils types
- only works on frozen data (so vectors can be used in sets/dict keys)
- uses same method as CPython, (matches hashing a tuple)

D1104 by @juicyfruit with own modifications
2015-02-15 14:02:08 +11:00
a9d979c8ef mathutils: add freeze() method, is_frozen attr
This allows you to make any mathutils object immutable.
2015-02-15 14:01:59 +11:00
ce85aef0d9 mathutils: remove redundant read callback 2015-02-15 13:46:47 +11:00
4feb77cf03 mathutils: avoid extra alloc for Vector.lerp 2015-02-15 13:46:47 +11:00
24f9ed0b34 Fix crash setting Euler.order to a non-string 2015-02-15 13:46:47 +11:00
bf157ce927 Fix T42919 & T42218: BGE: Python-driven armature animation got buggy
Due to changes in the way animation updates were handled,
BL_ArmatureObjects were no longer registering to KX_Scene as animated.

Moguri says: It might have been relying on the deformer update which
moved rom being called on every object in the render step. Now
armature deformers are only updated if they need to be.

Fix T42919 & Fix T42218
2015-02-15 02:00:56 +01:00
a83b2d3fd9 Cycles: Fix wrong attribute count calculation in prevous commit
The workaround for generated texture coordinates is to be done before
calculating number of elements for attribute, otherwise counter wouldn't
include those attributes.
2015-02-15 02:55:18 +05:00
1862fbf203 Cycles: Optimize memory usage when creating mesh attributes
The idea behind the change is to pre-allocate attribute arrays in advance,
which avoids re-allocation of arrays later for each of meshes being handled.

This reduces peak memory used by Cycles database from 1.3G to 0.9G for
victor.blend from Gooseberry.

It doesn't mean every file will benefit from this change since peak memory
usage is happening in the different places of the rendering code.

Also, unfortunately, attributes export might not cause the peak of render
preparation stage. That said, it's actually object_to_mesh() which causes
the memory to peak in the same test file. So we really need to optimize that
part first in order to get visible results for artists. But in any case it's
now quite easy to track hotspots in Cycles itself which is good.
2015-02-15 02:01:48 +05:00
18937f6fb5 Cycles: Add ifdef switch to use blender's guardedalloc for vector allocation
It's actually a bad level call, but it's inside ifdef block and disabled by
default and only intended to be used for development purposes.

Main idea of this change is to combine statistics coming from Cycles and
Blender during scene synchronization step, to see if further changes are
actually reducing memory footprint.
2015-02-15 02:01:48 +05:00
d0cc1180b0 Cycles: Add utility method to vector which totally frees memory used the vector
The method is called vector::free_memory(). Use with care since it'll invalidate
all the pointers to vector memory, all iterators and so on.

Currently unused, but might become handy when clearing unused data.
2015-02-15 02:01:48 +05:00
aad96506c1 Cycles: Report system memory usage and peak after scene device update
This only happens when built with WITH_CYCLES_DEBUG flag, memory statistics
is coming from guarded STL allocator.
2015-02-15 02:01:48 +05:00
a445e49186 Cycles: Implement guarded allocator for STL classes
The commit implements a guarded allocator which can be used by STL classes
such as vectors, maps and so on. This allocator will keep track of current
and peak memory usage which then can be queried.

New code for allocator is only active when building Cycles with debug flag
(WITH_CYCLES_DEBUG) and doesn't distort regular builds too much.

Additionally now we're using own subclass of std::vector which allows us
to implement shrink_to_fit() method which would ensure capacity of the
vector is as big as it should be (without this making vector smaller will
still use all previous memory allocated).
2015-02-15 02:01:48 +05:00
01067fe51c Cycles: Replace own aligned allocator with system one
This replaces our own implementation of aligned malloc with system calls,
which depends on which operation system you're on.

This is probably really minor noticeable change, but in the same time it
might reduce amount of wasted memory.
2015-02-15 02:01:48 +05:00
Julian Eisel
24976dd29d Outliner: Toggle restrict buttons only for selectable child objects
D404 by @rupp with minor edits by me.
2015-02-14 21:54:31 +01:00
354cf76803 Cleanup: Comment block for sse helpers. 2015-02-14 20:57:21 +01:00
d979f39cf1 Cycles: Small improvement for volume render (decoupled)
Simplify branching here a bit, helps ~3% in volume_light_sampling.blend (Branched MIS scene).
2015-02-14 20:44:30 +01:00
2fad3132a3 Cycles: Fix compilation error of Cycles standalone with Libmv disabled 2015-02-14 21:33:14 +05:00
db297e7ea3 Revert "Fix T43471, based on patch submitted by @sean_loh."
This reverts commit b2b54b0902.

The patch breaks particle distribution even in simple cases, not worth
doing this for keeping a hackish loophole open.
2015-02-14 16:40:57 +01:00
cfa1fd1c1f object drawing: only use halo-draw in object mode 2015-02-14 22:29:45 +11:00
dd6edac803 Bring copy/free operations into line with changes in previous commit 2015-02-15 00:06:19 +13:00
ec2ede4302 Bugfix: Referencing actions from Action Actuator was not setting a user
This reverts the change made in 8872cba7e9
which was contributing to actions being lost in some cases [1], even when
they were assigned to those actuaters, which needed them to be able to
function. Now there's one less case where users are needed but were missing :)

Note that this still doesn't solve the core issue where nothing is responsible
for associating actions created for a particular datablock (and not currently
being used in its active action slot, or in the NLA stack) with that datablock.
That issue is the cause of most action disappearances as well as for other problems
(such as renaming bones being unable to fix unreferenced/unused actions) where there
are diifferences between users' mental models and the data model. Proper fixes are
coming soon (restoring fake users here isn't a proper fix, as it only masks the
fundamental mismatch/problem here).


[1] http://blenderartists.org/forum/showthread.php?357021-BGE-loses-actions
2015-02-15 00:06:18 +13:00
dde0765de2 CMake: Enable JeMalloc by default
It's really handy to have blender linked against jemalloc because of
much better memory fragmentation handling by that library.

To be noted: if jemalloc library is not found it'll be disabled with
message about that, no compilation error should happen.
2015-02-14 15:13:48 +05:00
a439c8026a CMake: Add search path for jemalloc which corresponds to own and studio setup 2015-02-14 12:29:48 +05:00
7a977df6d4 Refactor array_utils out of BLI_array
BLI_array.h is for resizing array macros, where as array_utils can operate on any arrays.
2015-02-14 08:00:41 +11:00
2af905391d cleanup: doxy comments 2015-02-14 08:00:41 +11:00
2c1143aa2f Comments: use doxy sections for nodes header 2015-02-14 08:00:41 +11:00
3ec9b8e0c2 Purge temporary files on abort
This way both BLI_assert() and abort() called directly shouldn't
leave any files in the temp folder.

Previously it was really possible to have gadzillions of files
left over because of assert failures and debug aborts during the
development process.
2015-02-14 01:30:36 +05:00
ab77466105 Fix T43585 XRay + transparency broken
We need to turn off restore depth mask in transparency.
2015-02-13 14:38:38 +01:00
Julian Eisel
ef2f31028e Revert "Fix T43646: VSE preview allows displaying channels down to -5"
This reverts commit e652f781a3.

@schlaile, mentioned in T43646 that this was an intended feature. Checked git
history and it's seems like he's right.
2015-02-13 13:57:48 +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
90a9415c9a No need to use "SSAO" for SSAO color 2015-02-13 12:15:57 +01:00
c01a2aa4bb Alleviate grid creating shadows in Ambient Occlusion effect.
Draw the grid last with depth masking disabled. That should have no ill
effects otherwise as far as I can tell except from some exceptional
cases (axis lines over grid) but this is hardly annoying.

Generally to properly solve such issues we need to have a better render
pipeline with wire objects/materials being drawn after compositing. This
is not impossible but for now doing it the simple way.
2015-02-13 11:56:41 +01:00
Julian Eisel
e652f781a3 Fix T43646: VSE preview allows displaying channels down to -5
Maybe just another typo (tm). (Checked with @psy-fi)
2015-02-13 11:53:29 +01:00
261cd7f6bf Fix T43649: Geometry node breaks GLSL shading
The issue was caused by the recently added attribute, which is to be
added to the shader function even tho it's not supported.
2015-02-13 15:24:35 +05:00
e63594a6e5 Fix again tablets with linux!
Yes, for me tablets (both wacom and no-name) were again broken - curse X11!
So now, we want ButtonPress, Button1Motion does not work anymore...

Anyway, this patch makes things much cleaner, storing each event type
in its own variable!

Patch by cedricp (Cédric PAILLE) from T43367, thanks a bunch!
2015-02-13 10:57:26 +01:00
46151a6a69 Fix issue with some files having non-unique modifier names
Originally the files are coming from ancient early-2.4x epoch, but in
theory such setups might have been re-saved multiple times already with
more recent blender versions.

So the verisoning code is applied on all the files, including very
recent ones.

Bumped subversion, because this check si not really cheap.
2015-02-13 13:51:10 +05:00
67fa545ed0 Make modifier_unique_name return whether modifier was renamed or not 2015-02-13 13:46:51 +05:00
270bbc89ec Fix Cycles compilation on x86, without SSE. 2015-02-13 09:29:16 +01:00
34e9f6b956 Fix (revert) mistake in rB1ae2098a6e04359b, causing broken UI (see e.g. Scene buttons).
Reported by  sebastian_k through IRC, thanks!
2015-02-13 09:10:53 +01:00
616eb6818f cleanup 2015-02-13 16:17:00 +11:00
1ae2098a6e cleanup: ui, use bools 2015-02-13 11:43:28 +11:00
4132ca1ac2 UI: show check-boxes pie-menu bool/enums 2015-02-13 11:33:11 +11:00
29e19cecd8 BMesh: avoid ugly macro for loop interpolation
Compiler optimizes to practically the same output
2015-02-13 11:06:16 +11:00
1af042d9ed BGE: Fix for T42285 & T38935 crashes. They are Rayhit related.
We make sure that good values are passed to GetPolygon() and we check that the visual mesh doesn't have a wrong displacement when it passes over a object which has a mesh triangle as compound bound.

Reviewers: dfelinto, sergof, agoose77, moguri

Reviewed By: moguri

Subscribers: agoose77

Differential Revision: https://developer.blender.org/D979
2015-02-13 00:12:21 +01:00
2b847d1e65 BGE: Remove translation and rotation constrains subpanel from dynamics type
The translation and rotation locks subpanel was not used by dynamic physics type to avoid inestability in the application of forces and/or torques. Therefore it is better to remove it from UI (for dynamics) to avoid misunderstandings.

Reviewers: moguri, dfelinto, campbellbarton

Reviewed By: campbellbarton

Subscribers: panzergame

Differential Revision: https://developer.blender.org/D1090
2015-02-13 00:05:16 +01:00
9e217ccb2e BGE Fix T39026: No collisions detected with parented rigid body object
Fix for T39026. Preliminary investigation by blenderscripter on D446.
Also it solves bug T41285 (Parenting object leave collission box).

Refactor commit b90de0331d introduced a
regression bug.

Reviewers: sergof, campbellbarton, moguri

Reviewed By: moguri

Subscribers: blueprintrandom, blenderscripter

Differential Revision: https://developer.blender.org/D1064
2015-02-12 23:56:50 +01:00
eda2d563bc Cleanup horrible artifact of Greek to English translation. 2015-02-12 22:05:47 +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
8de421bbf1 Use the RNA for overriding the name instead. 2015-02-12 19:59:34 +01:00
d0a91eb1b4 More naming refinement GPU fstop -> Viewport f-stop 2015-02-12 19:50:19 +01:00
090623c6b6 Revert "Add missing trailing '}' in GLSL files"
This reverts commit ebd4a6e0dd.

Trailing '}' is added in C, also we add some extra code as needed.
2015-02-12 19:39:10 +01:00
f20fa24ba1 Add DOF fstop property for cycles, also don't grey it out when object is
set as focused
2015-02-12 19:35:43 +01:00
ebd4a6e0dd Add missing trailing '}' in GLSL files 2015-02-13 05:12:15 +11:00
5e613198e5 Viewport compositing - first code
This commit introduces a few ready made effects for the 3D viewport
and OpenGL rendering.

Included effects are Depth of Field, accessible from camera view
and screen space ambient occlusion. Those effects can be turned on and
tweaked from the shading panel in the 3D viewport.

Off screen rendering will use the settings of the current camera.

WIP documentation can be found here:

http://wiki.blender.org/index.php/User:Psy-Fi/Framebuffer_Post-processing
2015-02-12 18:54:41 +01:00
d40ac45610 Fix (unreported) load_file() func from creator.c not setting G.save_over correctly.
This was rather annoying, since if you were script-editing a .blend file in background
mode, opened through this commandline option system,  and wanted to save over,
a mere `bpy.ops.wm.save_mainfile()` *would not* overwrite expected file,
but instead write/replace the dummy `untitled.blend` one!
2015-02-12 17:30:19 +01:00
d70c7c06e7 Removed the cloth preroll feature.
This feature has been totally broken for a long time. It was added
originally because negative frames were not supported.

Giving simulations (cloth and others) time to settle before animation
starts needs to be solved in a much better and more generic way.
2015-02-12 16:30:07 +01:00
912b4659ec Tracker operators: filter & copy track settings
D1069 by @sebastian_k
2015-02-13 02:22:39 +11:00
719fd5a1ce GPencil: Alt-S can now be used to adjust the pressure values (i.e. thickness) of strokes 2015-02-13 02:48:50 +13:00
d92d8c3768 GPencil: Some tweaks to make GPencil UI more compact when there are 0 or 1 layer(s) only
As brought up in T43595, the Grease Pencil layers list could sometimes end up
taking up too much space when there are no layers. Another issue raised there
was that the up/down buttons are redundant when there is only a single layer.
This commit makes some changes to get these a bit more compact for the case where
you have an empty GPencil datablock left over from previous work.
2015-02-13 02:48:49 +13:00
4f3f9cb280 GPencil: LKEY can now be used for Select Linked too now 2015-02-13 02:48:49 +13:00
5c02afb698 Bugfix: Old NLA Strips from 2.4x got converted with no names (since they didn't use to have any) 2015-02-13 02:48:48 +13:00
7221fbe9dd cleanup 2015-02-12 23:51:02 +11:00
e408e632a1 Addons: print short message if an addons missing
Was printing full traceback, harmless but verbose.
2015-02-12 23:44:37 +11:00
3b68a74c2a Follow functionality: Scrubbing with the arrow keys and during jumps,
will update the editors range.

Offsetting to a certain direction will put the editors min/max to the
new frame if the frame is out of the editor bounds while jumping will
set the new frame at the editor's center.
2015-02-12 13:08:40 +01:00
d266733dad Fix T43612: VSE crash clearing proxies 2015-02-12 22:59:48 +11:00
dce59530d0 Fix part 1 of T43239, multisegment vertex bevel on 2-edge vertices.
Implemented multisegment rounding of vertices with two edges.
Works both with wire edges and edges that have one or two faces
attached.
2015-02-12 06:55:30 -05:00
7f47cd9b17 Correct fix for T43424
Would crash undoing adding a new scene in camera view.
2015-02-12 21:33:59 +11:00
b2b54b0902 Fix T43471, based on patch submitted by @sean_loh.
Particle textures always override timing information of particles.
Previously particle times could be scripted, but now these changes are
discarded by the texture evaluation function.

The patch disables texture overriding when no textures are defined, this
way at least some old scripts can keep working.
2015-02-12 10:15:25 +01:00
a9d09ff7ae BGE: Improve UI of Anisotropic Friction subpanel
Little patch that introduces X: Y: and Z: texts over anisotropic friction sliders

Reviewers: moguri, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1073
2015-02-12 06:38:21 +01:00
e60259c1cd Fix for previous commit - since it's for non-debug unused vars, name it UNUSED_VARS_NDEBUG.
This commit was proudly crafted by the Commit Rate Raising Committee!
2015-02-11 22:22:40 +01:00
e1bdf5333d Add new UNUSED_VARS_DEBUG utils, which is NOP in debug build, but tags given vars as unused in non-debug builds.
Helps handling cleanly pure-debug variables.
2015-02-11 22:10:09 +01:00
fbe5282c1e Outliner: use enum for outliner_group_operation()
No functional changes.

D1067 by @lichtwerk
2015-02-12 07:43:32 +11:00
23214ecad0 Outliner: ContextMenus for constraints/modifiers
Context menu to toggle render, visibility & delete

D996 by @lichtwerk
2015-02-12 07:29:31 +11:00
27b2ab8cf4 Fix VSE strip channel skip overlapping strips
D1096 by @mangostaniko (with some edits)
2015-02-12 06:20:36 +11:00
ced2f75554 Merge branch 'master' into gooseberry 2015-02-11 20:01:51 +01:00
26d7ac5077 Full screen mode did not remember the follow mode of previous screen.
Also make follow mode do something similar in reverse play.
2015-02-11 20:01:21 +01:00
de85d6cdbf cleanup: rename enum type to blender convention 2015-02-12 03:30:01 +11:00
ab4eb7a714 Merge branch 'master' into gooseberry 2015-02-11 17:27:08 +01:00
b9ffd70960 FileBrowser Bookmarks: fix issue with invalid bookmarks.
Reported by maxon through IRC, thanks.

Invalid (inexistant) bookmarks would not be selectable, hence not removable.

First, made invalid bookmarks grayed out in lists, so that user knows when there are some.

Then, added a new 'cleanup' operator that removes all invalid bookmarks.

This solution may not be completely satisfaying, but should do the work for now.
I do not want to add back those ugly 'X' delete buttons for each entry in list,
so better solution would be to make UIList able to select several items at once...
2015-02-11 17:13:16 +01:00
f60b4228b9 BPY RNA: add is_property_readonly().
This property may be defined dynamically, so mere access to static flag value
through `bl_rna.properties[...].is_readonly` is not enough.
2015-02-11 17:13:16 +01:00
cde1ef403b Fix (unreported) disabled items in UIList not grayed out.
Since we override widget's theme colors in this case in widget_state,
we have to redo 'disabled' alpha shading...
2015-02-11 17:13:16 +01:00
2613bfadb2 RNA: sequencer channel range was incorrect
Broke since 2.4x, zero sequence channels shouldn't be allowed
2015-02-12 02:36:33 +11:00
3b5eac548f Fix depth-eyedropper crashing outside 3d view
Also set the eyedropper operators as internal.
2015-02-12 02:17:03 +11:00
44f09c93d1 Use line curve for cavity mask instead of sharp as default when no curve
is found during loading
2015-02-11 15:29:24 +01:00
743a67c6cb Cavity option active even in fill brushes 2015-02-11 15:09:11 +01:00
f7e131a6ac Cavity masking - add curve control to cavity mask and move relevant
structs to paint struct (might be useful for vertex paint too in the
future)

Cavity masking now has a curve control. The control will set the amount
of masking for positive cavity ("pointness") or negative cavity
("cavity") with x axis being the amount of cavity and 0.0 = full cavity,
1.0 = full pointness, 0.5 = no cavity and the y axis being the amount of
alpha.
2015-02-11 15:07:24 +01:00
Julian Eisel
b7bac19aca Fix T43621: Layout only using 65% of available width
Not really a bug, more like a silly typo.
2015-02-11 14:41:35 +01:00
ae7d197c93 Merge branch 'master' into gooseberry 2015-02-11 18:29:11 +05:00
88efcdc376 Compositor: Expose Alpha socket for multilayer EXR node
This way re-mapping scene nodes to EXR files becomes much easier,
no extra trickery with separate RGBA setups is needed.

Plus makes it more consistent with regular EXR files.

This uses EGBA pass to get alpha from.
2015-02-11 18:28:41 +05:00
Dalai Felinto
560c05e8bd Fix T43628: Circular dependency error preventing multiple highpoly objects to bake
Throwing an RPT_ERROR was stopping baking after the first object.
2015-02-11 11:23:03 -02:00
259d47a15e Minor code cleanup: move some duplicated texpaint code into function
Reviewers: psy-fi

Reviewed By: psy-fi

Differential Revision: https://developer.blender.org/D1098
2015-02-11 13:33:47 +01:00
2d1e072686 UV Island support for vertex & edge slide
This ensures slide with `Correct UVs` enabled, keeps UV's (any loop custom-data) contiguous.

Adds 2 key functions `BM_vert_loop_groups_data_layer_create` and `BM_vert_loop_groups_data_layer_merge`

They work by collecting matching loop custom-data around the vertices loop-fan,
and merging the custom-data after edits are made.

Thanks to @mont29 for review!
2015-02-11 21:30:13 +11:00
f2951c23cf Cleanup: Remove unused Cycles cpuid code. 2015-02-11 11:28:42 +01:00
9adb6daa8c Merge branch 'master' into gooseberry 2015-02-11 11:19:13 +01:00
8668006519 Fix crasher in own UIList bookmarks commit.
Immediate crash in merged asset-experiments branch, no idea why it did not show in master too?
2015-02-11 11:16:32 +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
d4934f8f6d cleanup: style/indentation 2015-02-11 18:39:28 +11:00
387d91829d Fix T43149: Grease Pencil fill areas look divided by multiples ray lines
The problem here was caused by the usage of GL_POLYGON_SMOOTH (thanks Campbell
for the help tracking this down!). Apparently the issue is that this option
ends up doing some nasty accumulation with whatever is in the framebuffer for
each *tesselated* polygon (instead of the whole polygon as intended/expected).

** IMPORTANT USER NOTES **
With the removal of this option, filled areas and volumetric strokes will now
have jagged edges again. To resolve these artifacts, it is necessary to enable
Viewport Multisampling (found in the User Preferences, under the System tab),
and restart Blender to see the effects of this change.
2015-02-11 17:54:14 +13: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
4ae6d58999 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:39:50 +11:00
ca04eef4f2 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-02-11 00:29:31 +01:00
9e2abbc9ba FileBrowser: Editable Bookmarks.
Bookmarks are now editable (i.e. you can rename them, and reorder them).
They are also listed in regular UILists, so you can filter/sort them as usual too.

Also, FileBrowser 'T' side area is changed to something similar to 3DView one,
in this case because we need op panel to remain at the bottom, and later because
we'll more than likely need tabs here!

Thanks to Campbell and Sergey for reviews.

Differential Revision: https://developer.blender.org/D1093
2015-02-11 00:09:45 +01:00
4f1e387588 UI: add optional tip callback to uiBut, and use it for per-item tooltips in UIList.
When defined, uiBut->tip_func is called when button's tip is generated. This allows
for advanced, dynamic generation of tooltips.

For now, only used by UIList, which can now optionaly use a given string property
of each item for its tooltip.

Thanks to Campbell for the reviews!
2015-02-11 00:07:09 +01:00
d18993d4e4 Fix T43297 The Exporter assumed ANSII encoding but we need to support UTF-8 instead 2015-02-10 22:14:31 +01:00
4b04a4e2ff Cycles: Control CPU capabilities via environment variables
Purely developers-only feature which allows to disable some of the CPU
capabilities. This way it's easier to test different kernels on the
same machine.
2015-02-11 01:56:58 +05:00
28e76bbb93 Remove legacy color transform functions.
Differential Revision: https://developer.blender.org/D1095
2015-02-10 21:34:19 +01:00
1d64dff671 Fix recent vert-slide UV's when cancelled
Added support recently, but wasn't cancelling correctly.
2015-02-11 07:30:11 +11:00
2b01b71339 Fix T43565: BGE removed unneeded if/else in BL_KetsjiEmbedStart 2015-02-10 21:28:18 +01:00
59c0a1e7c8 Typo fix + clarification in mathutils.Vector example 2015-02-10 21:25:01 +01:00
bb08502cf4 Cycles: Fallback to bottom-top tile order when rendering from the command line
In the worst case it'll do nothing, in the best case it might give some percent
of speedup because of better cache coherency.

Currently it's all handled as an override on blender_python level, don't really
see reason to penetrate the boolean flag further into sync code. This can always
be done later if needed.
2015-02-11 01:11:57 +05:00
5cef36e6e2 Merge branch 'master' into gooseberry 2015-02-10 20:24:35 +01:00
a3b7f83cb5 Cavity mask support for texture painting.
Title says it all, options can be found in the options panel,

A slider controls the amount of cavity masking that is applied while
it's also possible to invert the mask and paint outside or inside
cavities.

Again we might greatly benefit from caching of the cavity result, but
that should only affect startup time for the stroke.
2015-02-10 20:23:43 +01:00
13ad69c68e Cycles: Add print functions for sse3f, sse3i and sse3b 2015-02-11 00:20:34 +05:00
5646a9f759 Cycles: Add utility functions to print ssef, ssei and sseb
Nothing special, just really handy for debugging.
2015-02-11 00:11:04 +05:00
4e37b29631 Cycles: Move mesh attribute creation into separate functions
This makes overall code of create_mesh() much cleaner and easier to follow.
2015-02-10 23:41:54 +05:00
bc218cf4d2 BLI_linklist: Add a new helper to move an item (identified by its current index) to a new position in the list. 2015-02-10 19:20:36 +01:00
fe610b7437 Merge branch 'master' into gooseberry 2015-02-10 17:40:46 +01:00
a9c5d0ba51 Slip tool: add enter and space to confirm the operation 2015-02-10 17:40:11 +01:00
0b1a886292 Cycles: optimize one normalization out from the previous commit 2015-02-10 21:32:44 +05:00
6f9982a13c Merge branch 'master' into gooseberry 2015-02-10 21:01:22 +05:00
227a94077f Cycles: implement pointiness geometry attribute
This attribute means how "pointy" the geometry surface is, which allows to do
effects like dirt maps and wear-off effects on render geometry. This means the
attribute is calculated for the final mesh which means no baking (which implies
UV unwrap) is needed. Apart from this the behavior is quite close to how vertex
dirty colors works.

The new attribute is available as an output socket of Geometry node.

There's no penalty for the render time, only some delay on scene preparation
(the delay is linear of the mesh complexity).

Reviewers: brecht, juicyfruit

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1086
2015-02-10 20:33:41 +05:00
1dba2cd025 Add second widget call in-scene 2015-02-10 16:12:26 +01:00
1ebf95bfd7 Tests: Disable failing import/export tests for until they're fixed 2015-02-10 19:29:18 +05:00
edb7195f27 Cycles: Bring back distance check in re-intersection
From more investigation of the numeric failures in the kernel it appears
the check was rather correct. But in theory it;s also needed for the motion
triangles.
2015-02-10 19:07:55 +05:00
b03ac83843 Cycles: Correction to glossy shaders not handling total internal reflection
The issue was caused by lack of check for whether fresnel term is actually
giving total internal reflection in refraction BSDFs. This lead to usage of
arbitrary vector of (0, 0, 0) as reflection, giving numeric issues in other
areas of the kernel.

This gives some visual changes of sharp reflection but it seems to be rather
proper now. Which also corresponds with rough glossy reflection with sharpness
set to 0.001 (previously it was totally different from sharpness of 0.0, which
is just weird).
2015-02-10 18:20:36 +05:00
298d8681a0 Fix T43596: Refraction BSDF crashes blender on pre-sse4 CPU
This is the same issue T43475: SSE4 code is more robust to non-finite values
in the ray origin/direction. So for now added a check before doing BVH traversal
for pre-SSE4 CPUs.

For sure actual root of the issue is a bit different and much more tricky to
solve, especially without disturbing render results too much. Still looking
into this.

In any case, it's kinda fine to have such a check, we might later make it to be
a kernel_assert() instead of just a return.
2015-02-10 17:36:05 +05:00
e7d20b0be4 Fix grease-pencil crash without clip/track data 2015-02-10 23:34:16 +11: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
1cfe0c1fb2 UI: scale timeline cache-height by DPI/pixelsize
D602 by @blakenator with edits
2015-02-10 22:33:52 +11:00
27f81bf6ce correct last commit 2015-02-10 22:03:10 +11:00
040b510df1 Fix: Grease Pencil datablocks can be copied using the ID.copy() API method now 2015-02-10 23:30:30 +13: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
d21668de5c Synchronize changes from buildbot server 2015-02-10 13:47:28 +05:00
258c2286cd Merge branch 'master' into gooseberry 2015-02-10 13:19:17 +05:00
6971bd9a4f Fix T43611: Collision shape of rigid bodies changes inadvertently
The issue was caused by the fix for T34108, which modified DNA in order to
get a fallback box collision shape. Not sue why it's needed, we can just get
box shape directly, without modifying user's settings.
2015-02-10 12:56:25 +05:00
julianeisel
25412d8ae2 Nodes: Various UI cleanups for Image and Environment Texture Nodes
Mainly consistency changes and smaller fixes.

* Environment Texture Nodes:
** show image info
** split layout for menus (showing menu title on the left)
** hierarchical button order

* Image Nodes:
** disable Alpha Mode menu if Use Alpha is disabled
** Don't show "+" icon/button if an image is already loaded
** Consistent alignment of menu buttons (see Input Color Space menu)

Requested and approved by @venomgfx
2015-02-09 23:17:33 +01:00
julianeisel
64ef6e74f7 Nodes: (Un)pack, filepath, refresh buttons for Environment Texture nodes
The same buttons are already used for other image textures and since the
environment tex node does only allow images as well, it makes sense to
have this here too.

Approved by @lukastoenne and @venomgfx,
requested by @venomgfx
2015-02-09 23:17:33 +01:00
53c4033b5b CMake cleanup: Move OSL detection code into FindOpenShadingLanguage.cmake
Should be no functional changes.
2015-02-10 02:45:59 +05:00
julianeisel
4ca4f04c75 Fix file size not drawn using Link/Append
For linking/appending, .blends get the type S_IFDIR added which prevents
the size from being drawn. BLI_is_dir gets the type from the OS so it's
better suited for this case.

Reported by @sergey.
2015-02-09 22:06:45 +01:00
4edc1bbe02 BGE - Vehicle Controller - add background and API checks for arguments of function calls
Fixes T41570 crash
For readability, attachDir was renamed to downDir and the Python API docs renamed accordingly
2015-02-09 20:58:15 +00:00
a088b9488d Recreating bge python modules instead of using existing
All of the initXPythonBinding functions are changed to always creating the module instead of importing if previously existing.
I can instead only remove the module return when the import is ok, so that it always inits. But then, I don't see the point in importing.

I make sure that these functions are called only once per run, inside initBGE.
This was not the case with GameTypes. I moved initPyTypes inside of initGameTypesPythonBinding due to that.

I reorganized initGamePlayerPythonScripting and initGamePythonScripting so that they run things in the same order.
initGamePlayerPythonScripting imports mathutils and aud, the other only aud. Shouldn't it be the same for both?

Reviewers: campbellbarton

Subscribers: sybren

Projects: #game_engine, #game_python

Differential Revision: https://developer.blender.org/D1070
2015-02-09 20:56:38 +00:00
31e26bb83b Fix T43424: undo changes the active scene
Using different scenes with 2+ windows broke entirely using undo.
Now keep track of the current windows scene in each undo-file,
and ensure the undo-scene is on a visible window when undo is executed,
switching the scene only when its not in a visible window.
2015-02-10 05:51:05 +11:00
60927ae2e0 WIP code to use in scene drawing for widgets. 2015-02-09 17:52:39 +01:00
2fe9e3c1f0 more direct fix for last commit 2015-02-10 03:00:37 +11:00
c4e8d74563 Fix T43498: New curves fails /w radius & rotation
Scaling matrix assumed no rotation,
also remove unused apply_diameter arg.
2015-02-10 02:50:59 +11:00
3c755fd6a5 Fix outliner crash renaming library /w filter
D1045 by @a.romanov
2015-02-10 02:05:22 +11: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
b83d851901 Cycles: Another attempt to solve 32bit CUDA kernel
Previous fix didn't quite work well. For some reason everything worked fine when
using native nvcc in 32bit environment, but cross-compiling from 64bit platform
it was still running out of memory.

For now just made it so all the kernels are slower on 32bit CUDA as a temporary
solution. Either it'll be solved in next CUDA releases (by dropped 32bit? =\) or
we'll find better workaround.
2015-02-09 16:14:44 +05:00
5544ded2b5 Fix ImBuf leaked by Image from View operator
Running this operator and and closing Blender gives this:
Error: Not freed memory blocks: 2
ImBuf_struct len: 2480 0x69ba4f8
imb_addrectImBuf len: 1048576 0x6ccc2d8

Fixed with added call to IMB_freeImBuf in BKE_image_add_from_imbuf.
Could be fixed in the operator instead, but I think the BKE function
is the correct place since the comment says it should take ownership
of the ImBuf.

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D1084
2015-02-09 12:02:59 +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
567e147f61 Code cleanup: remove unused function BKE_image_assign_ibuf
Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D1083
2015-02-09 11:28:38 +01:00
9c90c559fe SpaceFile: rework filelist_find, was looping way too much. 2015-02-09 10:10:20 +01:00
12ed439d8e GPencil: Show color swatches for GPencil layers in Outliner
Instead of showing a meaningless "dot" icon or having to come up with an arbitrary
icon, the Outliner now shows the stroke/fill color swatches for each layer to
match every other place where these are shown.

NOTE: Like many other widgets in the outliner though, these are not editable.
2015-02-09 12:48:00 +13:00
7df0a19d63 GPencil: Viewport visbility and editability toggles for layers in Outliner
* Viewport visibility and locking are currently exposed
* Later on, visibility in renders can also be included
2015-02-09 12:47:59 +13:00
julianeisel
6b107daf23 Fix T43554: Zoom to mousepos makes 2D Views pan after zoom limits are
reached

There are a couple of things that I don't like here, but it seems like
the best way to handle this for now.
2015-02-08 22:35:33 +01:00
a19229b80c ndof: detect new 3Dx devices on Linux
Was filtering for Logitech's USB vendor ID. 3Dconnexion now uses their
own vendor ID for new products. Mac & Windows don't look for specific
vendors so they should be fine.

Also added a note to eventually make USE_FINISH_GLITCH_WORKAROUND
available on all platforms.
2015-02-08 15:01:18 -05:00
f0f3554e17 GHOST: fewer virtual functions
Reined back over-use of virtual functions in GHOST, especially in
"leaves" of the inheritance hierarchy. This eliminates vtables for many
classes and (in some places) turns virtual function dispatch into direct
function calls.

I'll be around to fix things if other coders think this change is too
much.

Still lots of virtual in GHOST_TaskbarWin32 since it just loves virtual.
2015-02-08 14:18:53 -05:00
8aeb9d2158 minor Windows include tweak
Needed a minor change to test committing from a new development system.
2015-02-08 12:41:45 -05:00
0d766aa532 Some minor fixes from latest coverity scan, nothing crucial here. 2015-02-08 16:26:45 +01:00
dd65a44c9a BGE physics: When colliding, report first contact point to Python
This patch adds two parameters to the functions in the
collisionCallbacks list. The callback function should thus be like
this:

```
def on_colliding(other, point, normal):
    print("Colliding with %s at %s with normal %s" % (other, point, normal))

game_ob.collisionCallbacks.append(on_colliding)
```

The `point` parameter will contain the collision point in world
coordinates on the current object, and the `normal` contains the
surface normal at the collision point.

The callback functions are checked for the number of arguments
`co_argcount`. The new `point` and `normal` arguments are only passed
when `co_argcount > 1` or when `co_argcount` cannot be determined.

Reviewers: brita_, campbellbarton

Subscribers: sergey, sybren, agoose77

Projects: #game_physics

Differential Revision: https://developer.blender.org/D926
2015-02-08 15:52:13 +01:00
51b645a655 Initial vertex slide UV-correct support
Still need to adjust for contiguous UV's
2015-02-08 17:58:11 +11:00
8ff099bc7b BoxPack: avoid using static vars (make threadsafe) 2015-02-08 17:07:47 +11:00
c6abfa6114 Fix for mask modifier invert UI missing
D1066 by @gregzaal
2015-02-08 16:30:27 +11:00
d989d8a374 CMake: only quiet warnings for generated rna files
also minor warning cleanup
2015-02-08 15:08:31 +11:00
9c9dab095d RNA: use FUNC_USE_MAIN to avoid 'G' global 2015-02-08 02:20:55 +11:00
e7c7f57481 RNA: packing functions for vfont & sound
D389 by @kevindietrich
2015-02-07 22:35:32 +11:00
5ebae1c0c0 GPencil: Initial support for GP Layers in Outliner
This is still very rudimentary, and lacks many things.
* This needs a better icon. Perhaps we can look into using colour swatches here
  too like in all the other places?
* The "active" check needs to be implemented still
* Various restriction toggles to come still
2015-02-07 12:50:22 +13:00
68fc2e210e GPencil: Initial support for Grease Pencil in the Outliner
This commit just adds entries for the Grease Pencil datablocks in the Outliner.
Currently, there's not much more to see here, but the following commits will see
to that.
2015-02-07 12:28:17 +13:00
ca06c3343e Fix T43515: Initial velocity for fire bug
Visual representation of fire was generated before simulation step took place. This caused fire to essentially lag one simulation step behind, even though all emission areas were up to date.
2015-02-06 22:05:09 +02:00
1b85ca6fc0 Fix T42950: Smoke particle flow doesn't work with high res and subframes unless "set size" option is ticked. 2015-02-06 21:23:43 +02:00
a42553f986 Fix T43579: FBX Export shading issue (Broken normals?)
Error in custom split normals work, non-autosmooth normals != vertex normals!
Loops from flat faces shall take normal of their face, not their vertex.

Tsst...
2015-02-06 20:14:18 +01:00
b12f3cbee7 cleanup: style 2015-02-07 04:50:21 +11:00
fa9e42b57d UserPrefs: increase max undo steps to 256 2015-02-07 04:26:57 +11:00
8ab1188e39 rename SIPO_AUTOVIEW -> SIPO_AUTO_VIEW_SELECTED
The term auto-view on its own isn't very meaningful
2015-02-07 03:47:06 +11:00
017e2fb284 Merge branch 'master' into gooseberry 2015-02-06 17:41:15 +01:00
0e049e88e2 One more crashing instance for hashes 2015-02-06 17:39:26 +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
14dbe1c261 Slip tool accepts numerical input. 2015-02-06 16:38:32 +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
bf54867ff1 Get rid of no scaling for proxies for master, it causes FX to crash,
will code another workaround for gooseberry.
2015-02-06 15:58:50 +01:00
julianeisel
dffdde4cdc 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 15:53:13 +01:00
31170ec19e 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 15:11:34 +01:00
28587f9134 Merge branch 'master' into gooseberry 2015-02-06 14:31:20 +01:00
f4f468fc48 Fix sequencer crashing after recent GHash refactor.
Code frees hash element while iterating - I don't think that's a good
idea but this should keep things working for now at least.
2015-02-06 14:28:08 +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
24edab07cc Add a precision to 'show group color' tooltip, that fcurve/action editors option was confusing users a bit. 2015-02-06 12:38:33 +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
c62c44bdc1 Fix for scons + mingw64 warning flags fix
So, it turns out my changes here the other day were a bit too over-eager:
  -Wdeclaration-after-statement and -Wstrict-prototypes only applied to C code
and not C++ (which that set of flags was getting included for too).

  However, -Wno-char-subscripts is fine where it is now, so I've left it in place
2015-02-06 23:51:31 +13:00
bf4c44491a Cycles: Some more constants fixes for fast math 2015-02-06 15:40:07 +05:00
460681bd62 Cycles: Use proper constant name for 1/pi in fast math 2015-02-06 15:15:55 +05:00
40f237675f Some tweaks to support upcoming OSL-1.6
Doesn't mean we're 100% ready for the transition, but need to start somewhere
anyway. Changes:

- OSL is no longer supporting cpp and requires usage of Boost Wave.
  So now Wave component of Boost is optionally demanded when looking for the
  Boost libraries if OSL is enabled.

  Only did this for Linux, MSVC seems already using Wave. Not sure about OSX.

- Because of the same reason OSL should be moved prior Boost for linker.

- Whole archive trick makes it so linking fails with duplicated symbols, so
  removed it for the new OSL. Didn't see issues with this so far.

- Added some code to check OSL version on Linux. Would need to move all that
  to FindOpenShadingLanguage.cmake which we can get from Cycles standalone
  repository.

  So in theory no affect on current stup would be made at all.

- Added some tweaks to buildbot files. It now seems to be happy with the new
  OSL libraries, but again, those tweaks are not in action yet.

All this was tested on Linux only. Win/OSX might still need some tweaks to
support new OSL.

P.S. This doesn't mean we're pushing OSL update yet, just making some
preliminary tweaks to avoid entropy of PITA when we'll actually want to
switch.
2015-02-06 14:57:32 +05:00
580bb26213 Fix some UI messages from own recent merge, and RNA code checking for final '.', was a bit too rough. 2015-02-06 09:52:31 +01:00
61c66a996c Outliner: DragDrop objects to groups
Support drag&drop objects to groups in the outliner.

D989 by @lichtwerk
2015-02-06 19:03:09 +11:00
b752597805 cleanup: use bool args & redundant casts 2015-02-06 18:19:29 +11:00
f9f04726e5 GHash: no need to malloc iterators 2015-02-06 15:34:36 +11:00
4cbf2ebdc9 Cleanup: style 2015-02-06 13:55:20 +11:00
ced4c5fe22 Animation play: Follow feature. Enabled from playback menu in the
timeline.

When enabled, ipo, dopesheet, NLA, timeline, clip and sequence editors
will follow the current frame during animation. When the cursor reaches
the end of the screen, then the next range of frames of the same width
is displayed.
2015-02-05 22:14:38 +01:00
d5b1dfa9c6 More fixes for high DPI:
* Radial operators were completely wrong
* Dynamic topology detail was also using unscaled number
2015-02-05 19:15:24 +01:00
77698f6010 Fix T43556 clamp brush size before setting it after division by DPI,
avoids nasty zero size brushes.
2015-02-05 19:11:00 +01:00
a1ec1b3974 Fix part of T43556 brush increase/decrease size operators do not update
the UI sliders.
2015-02-05 18:14:05 +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
15ff730b9b Change movie cache to use vectors instead of lists.
Runtime costs were horrible. On gooseberry in some sequencer edits using
proxies of small size, a cache with about 2000 elements would slow to
about 6 fps once cache was full and system tried to find smallest
element available.

There are still improvements to be done here, like requesting a number
of good candidates to avoid rerunnung through the list, or even using
some heap or ring buffer scheme to sort data, but nothing suits all
needs so for now that should bring the cache back to usable state (25fps
here at the studio)
2015-02-05 15:06:25 +01:00
f6e7989460 Custom Loop Normals: Add NormalEdit modifier
Nothing much to say here, basic tool to make normals point toward a target,
or to make them point 'outward' as if object was a spheroid (useful for game bushes etc.).

Also, forgot a big thank you to Campbell for the extensive review work he has done on this project!
2015-02-05 14:59:52 +01:00
2c3e4fbd7e Add Custom Loop Normals to Data Transfer.
Titles says everything, just two notes:
* We have to actually transfer plain *normals*, not 'compressed' clnors,
  so had to add pre/post process to transfer to make the conversions.
* Also added interpolation and advanced copy/mixing to CD_NORMAL, for same reasons.
2015-02-05 14:38:59 +01:00
138c9dba9b Add Custom Loop Normals.
This is the core code for it, tools (datatransfer and modifier) will come in next commits).
RNA api is already there, though.

See the code for details, but basically, we define, for each 'smooth fan'
(which is a set of adjacent loops around a same vertex that are smooth, i.e. have a single same normal),
a 'loop normal space' (or lnor space), using auto-computed normal and relevant edges, and store
custom normal as two angular factors inside that space. This allows to have custom normals
'following' deformations of the geometry, and to only save two shorts per loop in new clnor CDLayer.

Normal manipulation (editing, mixing, interpolating, etc.) shall always happen with plain 3D vectors normals,
and be converted back into storage format at the end.

Clnor computation has also been threaded (at least for Mesh case, not for BMesh), since the process can
be rather heavy with high poly meshes.

Also, bumping subversion, and fix mess in 2.70 versioning code.
2015-02-05 14:32:57 +01:00
7bae9ee6b6 Mesh validate: add an option to not clean temp/cache CDLayers.
This is mandatory for incoming custom normal imports from io scripts, because
often geometry here is corrupted, so we need to call mesh.validate() to clean it up.

Issue is, we cannot set custom normals before geometry is clean, so we need to store
temporary plain loop normals in a CD_NORMAL layer, validate, and then set custom normals.
So we need a way to prevent 'temp' lnors to be freed by validate.
2015-02-05 14:03:01 +01:00
e442b9916e BLI_math vectors: add minmax_v3v3_v3_array to get min and max values on each components of an array of 3D vectors. 2015-02-05 14:00:58 +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
25f33e058a Fix T43562: Cycles gets stuck with camera in volume in certain setup
The issue was caused by the way how we shoot the ray to see which rays we're
inside which might start bouncing back-n-forth between two close to parallel
intersecting faces.

Real solution would be to record all the intersections when shooting the ray,
but it's kinda tricky on GPU because of needed sorting and uncertainty of
how huge intersection array should be.

For now we'll just limit number of steps in the check so in worst case we'll
have some samples not being correct which will be compensated with further
sampling. Shouldn't be an issue since probability of such a lock is quite
small actually.
2015-02-05 16:10:50 +05: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
0527fc5fb8 Fix T43566: Missing update event for VSE
VSE was missing NC_ANIMATION | ND_KEYFRAME events.
Also need to invalidate cache on those, else keyframe editing do not get reflected in VSE preview!
2015-02-05 11:54:47 +01:00
e922903ae8 Use MAX_CUSTOMDATA_LAYER_NAME for size of GPUInput.attribname array
Before this was hardcoded to 32, which I think was incorrect because
this is used to store a customdata layer name.

Reviewers: psy-fi, campbellbarton, sergey

Reviewed By: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D1040
2015-02-05 11:20:24 +01:00
bec7d62218 CMake: add PLATFORM_LINKFLAGS to CMAKE_(SHARED|MODULE)_LINKER_FLAGS
D750 by @leszekswirski

Need for compiling Blender as a Python module in Windows.
2015-02-05 19:49:46 +11:00
343ddc52dc UI: UVWarp-Modifier had duplicate names
D1047 by @lichtwerk
2015-02-05 19:30:02 +11:00
f8c650aa7a Fix T43561: Wrong include path to standard OSL headers
Issue was in fact only visible in certain circumstances:

- OSL was compiled with Boost Wave
- or system's cpp didn't handle space between -I and path

Now made it so both wave and cpp code paths are always happy.

Original patch from Shane Ambler with own modifications to
mimic what variable holds on more verbose.
2015-02-05 12:34:29 +05:00
57e1a5373f Fix T43531: Wrong object center-dot color
Write objects center point to the nearest depth.
2015-02-05 17:01:58 +11:00
4e27f63828 Fix T43560: crash when loading old (2.45 here) file whith multires.
Was trying to free a NULL pointer...
2015-02-04 21:43:01 +01:00
37ae32870e Fix T43567: Freestyle On/Off keyframe is being ignored.
That kind of stuff shall not be animated! :)
2015-02-04 21:21:45 +01:00
ac2f608fa3 Fix T43450: Texture node tree failed to clamp
Clamping routine was not implemented. This fixes T43450.

Reviewers: #nodes, #rendering, sergey

Reviewed By: sergey

Maniphest Tasks: T43450

Differential Revision: https://developer.blender.org/D1038
2015-02-05 01:20:35 +05: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
363a044b4c Sequencer, scaling and audio synch
Don't scale proxies, same as we do in gooseberry, also for sound synch
give a small window around sound where frame is just pushed forward.
Avoids video jumping in the cases when video renders faster than sound
(yes, weirdly enough it happens sometimes). There might be a few jumps
but results looks smoother here.
2015-02-04 20:38:56 +01:00
Dalai Felinto
035d14c029 small typo in a code comment, fixing this before someone does it to prevent uneeded merge conflicts in branches 2015-02-04 17:19:40 -02:00
a78a17bad5 Fix T43366 export/import materials inconsistent 2015-02-04 19:07:28 +01:00
f75d2fdd24 Port fix from gooseberry that doesn't load the full res file if a proxy
is requested.
2015-02-04 18:48:55 +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
4339caf7cb Cleanup: name flip x/y 2015-02-05 03:56:24 +11: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
292444e3f5 RNA image.pack(): fix possible memleak, add possibility to pass raw bytes data.
Note passing data assumes user knows what he is doing, else segfault is guaranted
(there is no good ways to pass raw bytes data to RNA func currently, and using
int array is way too heavy in this case).

And image->packedfile was never freed...
2015-02-04 15:40:28 +01:00
fe03bc2a02 Support rotation and flipping for background images, patch by Andre D.
(T34583) with minor changes. Thanks for the patch!
2015-02-04 15:05:36 +01:00
32482aadb8 BGE physics: allow higher values for maxlogicstep and maxphystep
Increasing those values beyond 5 is important for exact physics
simulation. Soft limit is increased to 50, hard limit to 10000.

To be able to set different values for hardlimit and softlimit,
RNA_def_property_range needs to precede RNA_def_property_range, hence
the swapped order.
2015-02-04 14:16:10 +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
31425f9225 Compiler warnings tweak for scons + mingw64
The warning flags in C_WARN were not actually getting included
(most notably, the one disabling the pointless + braindead one
about using chars to index into arrays - given that we only use
unsigned chars everywhere). Maybe this should get done for the
other scons platforms too?
2015-02-05 00:50:50 +13:00
810c7ee825 Fix T43552: Cannot jump between GP keyframes in dopesheet 2015-02-05 00:04:46 +13:00
66eacc2abb Fix for recent LANG locale workaround
Need to get a copy of the string since stored pointer is affected
by subsequent calls of setlocale().
2015-02-04 16:02:47 +05:00
3b0c4d888c GLSL: On some cards '>' can't operate on 'float' and 'int'
So make it so comparison doesn't imply type-cast.
2015-02-04 15:54:42 +05:00
da06dab4e5 Cycles: Use pre-aligned triangle vertex coordinates for subsurface intersection
This gives small speedup (around 2% in quick tests) for ray scattering.
2015-02-04 14:49:19 +05:00
d16ac1e152 Compositor: Code cleanup, trailing whitespace and wrapping 2015-02-04 13:04:09 +05:00
becce54286 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/blenkernel/intern/image.c
2015-02-04 07:19:16 +11:00
1dddcfbaff Compositor: Implement sampled motion blur for plane track deform node
Quite striaghtforward change, and in theory we can even try supporting motion
blur for the corner pin node (which is tricky because coordinates actually
coming from sockets, but with some black magic should be doable).
2015-02-04 01:17:59 +05:00
c69458985c Hook Modifier: add falloff & radius options
- Add falloff types & curves (matching warp-modifier)
- Add uniform scale option,
  important when adding hooks to non-uniform scaled objects,
  especially for use with lattice objects which can't avoid uneven scaling.

  This uses relative transformation set when the hook is assigned,
  when measuring the distances.
2015-02-04 07:16:20 +11:00
a66a54c06d New Hook's now use the objects center
When adding a hook to an existing selected object/bone,
Use the location for the hook (instead of the selected vertices).
2015-02-04 07:16:20 +11:00
37a08ae5c5 UI messages: minor fixes... 2015-02-03 20:25:14 +01:00
f4535c1a7a Install_deps: update to new exr/oiio versions, and (hopefully) fix ILMBase mess
Root of the issue is an (hidden!) parameter in ILMBase cmake options, that
is enabled by default, and force the generation of those ugly lib names
(Imf_2_2.so & co). Why why why enable such thing by default?

Anyway, it should be simpler to build again even on linuxes having the openexr -dev
package installed.

Also, cleaned up a bit things, now we can switch between repo and plain release archive
building from a single place for each lib, instead of commentting/uncommenting everything
each time (for libs where we have some git repo set up for some reason).
2015-02-03 19:59:07 +01:00
c2f6a07531 Fix possible (unlikely) buffer overrun
Translated strings didn't check fixed length for PET id's
2015-02-04 05:51:48 +11:00
02acfdab9e Add inverse-square blending for PET and warp
Similar to 'Root' but without noticeable spike/pinch in the center.
2015-02-04 05:45:30 +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
15cd222270 BGE: python API initialization cleanup
The goal of these changes is to Close T40132 and to get rid of the 'PyRun_SimpleString'

Hilighted changes are:
- consistent naming and initialization of BGE submodules
- initialization of the 'bge' module as a proper module
- using PyDoc_STRVAR instead of static char*
- generic cleanup (unused arguments, logica ordering, naming and whitespace)

Reviewers: campbellbarton

Maniphest Tasks: T40132

Differential Revision: https://developer.blender.org/D983
2015-02-03 15:32:55 +00:00
2699866720 BGE: python API cleanup - initialization for bge with submodules, closes D615 2015-02-03 15:32:55 +00:00
0e0af4f772 BGE: python API cleanup - adding proper initialization to GameTypes 2015-02-03 15:32:55 +00:00
e67bd30bdf BGE: python API cleanup - replace BLI_program_path with BKE_appdir_program_path 2015-02-03 15:32:55 +00:00
ba0978c1a9 BGE: python API cleanup - bge submodules definitions 2015-02-03 15:32:54 +00:00
a7b0330c13 BGE: python API cleanup - using PyDoc_STRVAR instead of static char*
Cherry-picking d503f8a onto 117edbb
Conflicts:
	source/gameengine/Ketsji/KX_PythonInit.cpp
2015-02-03 15:32:54 +00:00
95425bc97a BGE: python API initialization cleanup
-Removing unused parameters
-Updating some parts to match bpy_interface.c initialization

Cherry-picking 14fceb6 onto 117edbb
Conflicts:
	source/gameengine/Ketsji/KX_PythonInit.cpp
2015-02-03 15:32:54 +00:00
c48c20b498 Fix T43530 using blender on remote connection crashes
Issue here is that remote connection will use OpenGL 1.1.
There was a call here that would free VBOs always without a check,
however the VBO free function pointer is NULL on such contexts causing a
crash.

This must have been causing some of the crashes with old contexts. While
I think supporting those systems is not such a good idea in general,
they can have a few more moments of support I guess.

Things might be better now for systems using OGL 1.1 though there are
still things that could be done better here - for instance going to
dyntopo can crash immediately because we don't have a fallback
implementation there. It might be worth reimplementing sculpting with
vertex arrays for the legacy case too, but I guess if we move on to
OpenGL 2.1 soon this is a bit of a wasted effort.
2015-02-03 16:18:19 +01:00
2d4980e68e Fix T42510: bake animation wrong result.
Caused by own rBfb7ff31315a1c9 - not surprising code using Object.matrix_local
in other contexts than mere Object parenting fails, since it was using a broken
implementation before...

Note that whole NLA_OT_Bake op would need some love, it is quite brittle in many aspects.
2015-02-03 15:44:20 +01:00
3ff9e52dca Fix T43380 modulo operation in GLSL does not return negatives.
Make it so by checking operand sign.
2015-02-03 15:08:42 +01:00
8186214c39 Fix T43514: Environment map doesn't update 2015-02-03 18:52:01 +05:00
a01501443b Bugfix T43541: Inserting keyframes using sliders in Action Editor doesn't respect NLA time remapping 2015-02-04 02:22:57 +13:00
445eed8e38 Fix T43403: Compositor does not respect interlaced video
This is actually issue with Image datablock, which had obscure Fields settings
but didn't allow to de-interlace the video.

Now added the option to de-interlace Image with Movie input type.
2015-02-03 18:17:12 +05:00
701a7dcc87 Fix T43544: Runtime Error when Locale is not valid
This is not a real fix and only prevents crash, textures IO might be not
working totally correct if they're unicode path or so. Proper solution
would be to detect which locale we can use and set LANG, LC_ALL and friends.
2015-02-03 17:36:15 +05:00
1667e68797 Revert "Keep mingw specific includes ifdef'd"
This reverts commit ba8b9ae307.

Turns out this is needed on other systems, just happened to be indirect included on them.
2015-02-03 23:24:31 +11:00
ba8b9ae307 Keep mingw specific includes ifdef'd 2015-02-03 22:54:57 +11:00
529ca92975 MinGW still uses SDL1 - will need to change this of course but no need
to keep compilation broken for now
2015-02-03 12:51:12 +01:00
7345d558f9 MinGW64 complains about clock, include time.h 2015-02-03 12:31:51 +01:00
488b342741 BMesh: optimize selection flushing
De-selecting a face would do flushing checks on each vertex 3 times, now only do once.
2015-02-03 19:59:39 +11:00
af2d75b9a7 cleanup: inconsistent BMesh select checks 2015-02-03 19:08:25 +11:00
faaaf7ee1f Possible NULL de-reference on fullsceen check
Also quiet some other minor warnings
2015-02-03 16:42:22 +11:00
32125c40d3 Fix own mistake unlinking text (recent commit) 2015-02-03 16:39:32 +11:00
27cfd291c6 Fix copypaste error in x11 tablet init 2015-02-03 16:37:37 +11:00
75249259f4 BMesh: optimize edge select
It's called a lot, so avoid using a generic iterator for edges of vert.
2015-02-03 09:33:04 +11:00
052a021711 cleanup: indentation & redundant casts
also use 'const' bucket rect args
2015-02-03 09:33:04 +11:00
5678691fe4 cleanup: use bools in drawobject 2015-02-03 09:33:04 +11:00
ce6e71ea90 Make MSVC 2013 win32 also use new OpenEXR 2.2 2015-02-02 21:30:28 +01:00
d7ad64cc5e Bump OpenEXR to 2.2 for windows MSVC 2013 2015-02-02 19:44:49 +01:00
9f874ddb99 Warp modifier: remove redundant NULL check 2015-02-03 04:38:59 +11:00
72f02437e7 Warp modifier: avoid sqrt checking radius 2015-02-03 04:35:40 +11:00
d0ae2624f5 Fix T43524: Warp modifier curve clamped to 0-1 2015-02-03 04:35:40 +11:00
e224b5b9ca Cycles: OSL kernel now also ignores maybe-uninitialized
This is a bit of a mess because of the header dependency hell, but
since the tweak is small enough it's gonna be fine.
2015-02-02 22:15:33 +05:00
432e478f43 Cycles: Further tweaks to T43511 to solve compilation error on 32bit platforms 2015-02-02 22:09:02 +05:00
30e4009f0a Cycles: Solve dependency between camera and object synchronization
IN theory object might depend on camera location (spatial adaptive subdivisions
for example) which became not possible to achieve after camera in volume support.

Should be no functional changes for artists.
2015-02-02 22:09:01 +05:00
ddba5c27a7 Cycles: Ignore -Wmaybe-uninitialized from the kernel in release builds
This warning provided too much false-positive issues in release version of the
kernel, making it really easy to miss actual warnings.
2015-02-02 22:09:01 +05:00
23e3dbb726 Selection: avoid uninitialized memory read with occlusion queries 2015-02-02 17:45:07 +01:00
7e4e99c294 Merge branch 'master' into gooseberry 2015-02-02 14:48:13 +01:00
2c82e748c1 Fix for hair child roughness.
The fixed-function roughness was not getting used once the curve
roughness has been enabled at least once.
2015-02-02 14:47:50 +01:00
750506be97 Adjust GLSL drawing of window coordinates from camera view (use camera
bounds instead of window bounds). Fixes remaining part of T43346
2015-02-02 14:26:05 +01:00
92fdd1efdf Merge branch 'master' into gooseberry 2015-02-02 14:23:35 +01:00
14755dde97 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:19:05 +01:00
159124726e Fix for unfreed memory due to unnecessary early exit in the free
function.
2015-02-02 14:19:05 +01:00
961b7e78b4 Fix for unfreed memory of internal hair cloth modifier pointcache. 2015-02-02 14:19:04 +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
5030daf2a8 Cycles: Remove redundant calculation of w in recent cubic commit
Was rather harmless since compiler will optimize it out, but nice to get
rid of this anyway.
2015-02-02 17:35:57 +05:00
31263192bb Fix T43511: Major slow down with many instanced objects in cycles GPU
Slowdown was caused by watertight intersection commit and follow-up workaorund
for compiler crash which uninlined utility function which rotates the ray.

Now it's only uninlined for sm_50 and sm_52 experimental kernels which are the
only ones which failed to compile.

Rendering still might be a bit slower but at least shouldn't be that dramatic.
2015-02-02 17:35:57 +05:00
81f97692ae cleanup: style/spelling 2015-02-02 23:29:53 +11:00
783b41a55d Fix for unfreed memory of internal hair cloth modifier pointcache. 2015-02-02 12:51:22 +01:00
7b369080d0 Avoid warping the pointer when doing constrained texture painting
strokes
2015-02-02 11:29:01 +01:00
7ea7c2aab2 Cycles: Fix inconsistent command line used for runtime kernel compilation
Basically build-time compiled kernels were using --fast-math (which is correct)
but run-time compiled did not.
2015-02-02 15:00:21 +05:00
8cd106f12a minor edits to last commit 2015-02-02 19:21:26 +11:00
julianeisel
f12c17abfe Fix T43501: Crash on custom node tree creation 2015-02-02 03:04:31 +01:00
0305b208eb Fix for Freestyle view map caching not properly updated upon changes of render resolution and scale.
Problem reports independently by Light BWK and Folkert de Vries, thanks.
2015-02-02 10:00:12 +09:00
64124ba904 BMesh: tool to ensure all faces are convex
Access from Mesh -> Cleanup
2015-02-02 09:23:44 +11:00
d655a8f168 BMesh: BM_face_triangulate take edge array
To access edges created between the tris.
2015-02-02 09:22:54 +11:00
b757f04a15 Cycles: Indentation fix for the previous commit 2015-02-02 02:04:47 +05:00
3b9d455a90 Cycles: Implement cubit image interpolation on CPU
Basically title says it all. Could be not totally optimized but the code is there now.
2015-02-02 02:02:10 +05:00
0827441c32 Add extra Cycles regression tests
This new tests are aimed to issues/regressions reported to the tracker.
2015-02-02 02:02:10 +05:00
77e6f2212f Cycles: Allow paths customization via environment variables
This is for development and test environment setup only, not for
regular users usage hence no mentioning in the man page needed.
2015-02-02 02:02:10 +05:00
60c643d66a error in last commit 2015-02-02 05:01:48 +11:00
8350f7a587 RNA: add readonly pixelsize to userprefs 2015-02-02 04:57:41 +11:00
253cb97862 Cleanup: Moved particle interpolation code into own file. 2015-02-01 18:25:46 +01:00
baa8b63111 Documentation: updated mathutils documentation
Added descriptions of the constructors, and improved the module-level
documentation.
2015-02-01 18:16:12 +01:00
fd75796afe cleanup: use const 2015-02-02 01:23:08 +11:00
2e6e92cf50 Documentation: Support documenting constructors in class __doc__
Python types defined in C can now start their docstring with a
`.. class:: TypeName(args)` line, to document their constructor.
In that case the documentation writer is responsible for indenting the
remainder of the docstring by 3 spaces, matching the generated
documentation.
2015-02-01 14:00:43 +01:00
9fa628f35b mathutils: added exponential map to Quaternion
Added conversion to and from exponential map representation. This
representation is useful for interpolation of > 2 quaternions, or in
PD controllers.

Implementation in C functions quat_to_expmap,
quat_normalized_to_expmap, and expmap_to_quat with Python API, unit
tests and documentation.

Added Quaternion.to_exponential_map() and Quaternion(3-vector) to
Python API.

Reviewers: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1049
2015-02-01 13:06:00 +01:00
8c7e1b648b Fix: correctly describing Quaternion.normalize()
The original comment seems to suggest that only the rotation vector
is normalized, leaving the rotation angle alone. This is not what happens,
though. The new comment matches the actual implementation, and the
implementation matches what is commonly understood as quaternion
normalization.
2015-02-01 10:34:49 +01:00
01ec66423c BMesh: remove redundant connect-nonplanar loop 2015-02-01 19:18:39 +11:00
26f9a92453 WM: empty menu so addons can extend the splash 2015-02-01 04:19:55 +11:00
595675ea7a Cleanup: style 2015-02-01 04:19:55 +11:00
5ac7e23e88 Blender metadata changes to accommodate non string data
Work towards T42418

For now got rid of linked list holding key,value pairs for metadata in favour of ID properties.

Reviewers: campbellbarton, sergey

Reviewed By: sergey

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D872
2015-01-31 17:15:43 +01:00
f90891d87e Add PIL_check_seconds_timer_i to avoid casting
note, win32 casts still casts from double.
2015-02-01 02:00:08 +11:00
9e9cd77b8d Compiler warning: double-promotion 2015-02-01 01:17:21 +11:00
535de7ec1f Comment for math defines, also add M_PI_4 2015-02-01 00:37:55 +11:00
03cb146afa Fix T43496: Infinite loop in kernel when using surface attribute for volume
The issue was caused bu the optimization in surface attributes for cases when
there's only a volume shader used. Some attributes doesn't make sense in that
case and were skipped from calculation.

However, it is possible that kernel would still try to access them (because of
the shader setup etc). Prevented an infinite loop in the kernel now, which
should not have much affect on regular renders.
2015-01-31 14:39:19 +05:00
3f5771475d Cycles: Don't perform re-intersection if ray distance is zero
It is possible that ray distance will be zero which would make intersection
refinement return NaN as the refined position which would later lead to all
sort of mathematical issues.

Don't think there are ways to improve intersection accuracy for such rays
so just return original intersection coordinate.

This should fix T43475.

TODO: Need to look into possible issues in Ashikhmin BSDF which might return
zero-length reflected/transmitted ray?
2015-01-31 01:49:48 +05:00
cb2007906f Cycles: Use bool for is_lead array
This way we save 3 bytes per BVH node while building BVH, which overall
gives 100Mb memory save when preparing Frank for render.

It's not really much comparing to overall memory usage (which is 11Gb
during scene preparation here) but still doesn't harm to have solved.
2015-01-31 01:49:41 +05:00
d632ef7c66 Cycles: Use fast math functions in hair BSDF
Precision of the fast functions seems to be enough in there and
since the code was heavily using inverse trigonometric functions
this change gives few percent speedup on Victor's hair.

From the tests files from ctests storage doesn't have any meaningful
difference, hair on Victor is all below 4% absolute error and only
few pixels are exceeding 1% absolute difference.

In any case, let it be as it is currently so it allows us to have
fast math file in sources for it's further evaluation and possible
usage in other areas as well.
2015-01-31 01:49:41 +05:00
dc1043dda0 Cycles: Add fast math function module
It is based on fmath.h from OIIO and could be used to give some speedup
in areas where absolute accuracy is not so critical.
2015-01-31 01:49:41 +05:00
3dbfebc42c First version of constrained line strokes - there's some flickering
still, will look into it later.
2015-01-30 19:47:58 +01:00
0da38ada07 Operator that sets proxies needs to cater for all supported strip types 2015-01-30 16:09:55 +01:00
b0c5622a97 Merge branch 'master' into gooseberry 2015-01-30 16:03:39 +01:00
b58b182753 Get rid of the file touch hack.
If user cancels, there's an issue with leftover files.
Instead use a hash to record files that have akready been registered for
generation and skip them if so.

That should guarantee things will go smoothly and when a file exists it
is assumed to be valid.
2015-01-30 16:00:30 +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
f7e8da6f5a Proxy enable operator:
* Enable operator for proxies now becomes set operator for selected and
can unset-set all options.
* Properties become read-only labels, only use operator to set proxies.
2015-01-30 15:13:59 +01:00
cb6c0663e1 Merge branch 'master' into gooseberry 2015-01-30 14:30:57 +01:00
7760e97c6b More hacks for proxy generation:
Touch the proxy files if they do not exist so subsequent strips
referencing the same source file won't regenerate it.
2015-01-30 14:30:24 +01:00
d8c20fbb66 Fix T43324: Shrinkwrap projection issue in editmode.
Nice stupid error in low-level `get_cddm` helper, was probably affecting other
modifiers too actualy!
2015-01-30 12:50:38 +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
7d543e7310 Corrections to Cycles ctests
- Apply VERBOSE to idiff result as well
- Don't treat verification failed error as unknown
2015-01-30 15:13:09 +05:00
a3c13fa9e8 Cycles: Remove confusing labels usage in hair BSDF
BSDF sampler function shouldn't give labels it's not intended to do.
That said reflection shouldn't give transmission ray and transmission
give reflection ray.

Added an assert in the transmission sampling but reflection still
needs some investigation because even after recent fixes the check
for projection onto the reflected ray could give both positive and
negative values.

It shouldn't have any affect on renders just makes internal logic
consistent and unleashes an issue to be investigate further.
2015-01-30 14:00:24 +05:00
bd10b72ad3 Fix T43458: Crashes with hair transmission BSDF
Hair BSDF did not have proper behavior because of non-normalized
tangent direction (which it expected to be normalized).This lead
to wrong labels being returned by the hair BSDF samplers.
2015-01-30 13:03:01 +05:00
6b81ee6bea Committing the impressive RTheme to the default collection 2015-01-29 23:24:30 -06:00
c6d4a3f3ba Correct location of 'text' button in frame-node 2015-01-30 13:41:07 +11:00
d56c9fb420 Fix T43472: IMBuf: crash on loading top-to-bottom bitmaps.
Height of bitmap may be negative, which indicates a 'top to bottom' line storage.

Also, fixed header handling, bitmaps using other header than 'BM' would most likely
have lead to errors/crashes too...
2015-01-29 20:42:34 +01:00
b3ca0e21a5 Merge branch 'master' into gooseberry 2015-01-29 19:35:43 +01:00
cff7ef6ee8 Fix texture sampling getting srgb color after fix for subsurf sampling. 2015-01-29 19:34:51 +01:00
ebc064f5c0 Gooseberry request: Dithering support for byte images when painting on
projection painting (2D will be separate commit).
2015-01-29 19:23:57 +01:00
12a38abac6 Fix T43473: mathtutils.geometry.interpolate_bezier returns only 2d coordinates
Fixed/enhanced a few usages of `mathutils_array_parse()` in this file actually...
2015-01-29 18:11:13 +01:00
d2e526a82d Cycles: Fix for bump node not working with object texture mapping
This was intended to be in the original patch of texco copy from object.
2015-01-29 21:48:22 +05:00
a0e8b98b61 Fix T43207 fill brush fails in perspective mode
Divide only the length of the edge by the homogenous coordinate, not the
final coordinate. Also fix the swapping (though it's still a bit
doubtfull if it's really needed)
2015-01-29 17:45:43 +01:00
43fab448f3 Followup for previous commit: fix mismatches between menu entry and shortcut properties.
For now, did most of the changes in menu entries (i.e. py space UI scripts).

Note we do not get 100% same results as previously, but current situation is
globally better than previous one, though the whole system to retrieve shortcuts
remains a bit weak...
2015-01-29 17:34:05 +01:00
945ea40887 Fix T41757: Inconsistent hotkey label with setting.
Issue is double here:

* Quite a handfull of menu entries actually diverge slightly from their shortcut
  counterpart (often one has a prop explicitely set to its default value,
  when the other keep it unset).
* Current code was actually basically sending 'is_strict' option into canal,
  by doing a second check in `wm_keymap_item_find` setting unset op props
  to their default value!

Now, is_strict mostly says one thing: "never consider an unset property as
equal to a set one". Even if set property matches default value. Default values
are not always the same things as unset ones, as demonstrated by this report.

So we are being much stricter now, and also have to check shortcuts and
menu entries definitions actually matches, added some code (triggered by
--debug-wm option) that prints when it finds some (potential) issue.

There is one exception though - Macros. Those have their whole prop set defined
in menu entries currently, this shall probably not be the case, but is another issue,
so for now for macro operators we always do non-strict comparison (pretty much
the same as previously, in this case).

Also 'enum' operators are still tricky. Currently, shortcut extraction relies on
`ot->prop` being set, so even if this is not aboslutely needed anymore (when defining
UI you can specify an arbitrary enum property by name), `ot->prop` shall be set.

Note fix commit for mismatches between menu entries and shortcuts is needed next.
2015-01-29 17:32:34 +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
79ba5e52dd Revert "mathutils: let Vector.normalize() return the original length."
Please discuss changes to core mathutils functions first.

Changes like this should be considered and applied to all areas of the API (or not at all).
Missed quaternion, matrix normalize for eg.
2015-01-30 02:12:07 +11:00
7ce7cb5e0f Fix T43454 color is washed out in textured brushes
Yet another color space issue, we multiplied texture color with srgb
brush color and retrasnformed it to srgb. Now use the linear brush color
for the multiplication.
2015-01-29 15:46:49 +01:00
6912fe132f mathutils: let Vector.normalize() return the original length.
The length has to be calculated for normalization anyway, and it is already
returned by normalize_vn(vec, size).
2015-01-29 15:29:01 +01:00
76e7528cb1 Comment out the proxy fix to test if it makes things better, 2015-01-29 14:40:49 +01:00
4a99c1ad75 Add override setting to proxy enable operator 2015-01-29 14:40:16 +01:00
46024a14bb Merge branch 'master' into gooseberry 2015-01-29 16:58:49 +05:00
87986ed139 Sequencer: Report proxies which are being skipped to the console 2015-01-29 16:58:18 +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
a863261ee8 Whitespace cleanup 2015-01-29 12:37:57 +01:00
e0fa282340 Add some convenience operators to sequencer proxy panel:
Enable proxies for all selected movie strips (won't do recursive
enabling for metastrips yet)
Generate proxies operator here, as well as in strip menu
2015-01-29 12:37:57 +01:00
c602fada48 Merge branch 'master' into gooseberry 2015-01-29 22:05:51 +11:00
eb150ef337 Node UI: add support to show text-blocks in frames
Some node setups benefit from being documented like this.
2015-01-29 22:04:32 +11:00
c44d7b0340 BGE: Remove duplicated audio panel from Render context
This commit removes the audio panel from Render context as it exists a similar panel in Scene context.
Also, it gives to the Distance Model a similar UI layout as it was in the removed render->audio panel
2015-01-29 18:26:28 +11:00
3cf7a8008e Fix crash on joystick access (if SDL's not found)
D985 by @pgi
2015-01-29 17:17:29 +11:00
072d80a9de Fix T42858: Non uniform gamelogic names on copy
Use generic function for consistent behavior

D949 by @lordloki
2015-01-29 16:43:20 +11:00
65574b0b03 cleanup: shebang lines
D888 by @sambler
2015-01-29 15:56:23 +11:00
1738d4acc9 Bone calculate roll (pos/neg options in menu)
This change means you can see the option to do +/- aligned axis when calculating roll
(in that case the flip-axis option is ignored).

This is added since you mostly don't want to set the option in the toolbar each time.
2015-01-29 15:46:38 +11:00
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +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
d434815ff7 Audaspace: Fix typo in speed of sound initialization value by lordloki (Jorge Bernal) 2015-01-29 12:20:41 +13:00
julianeisel
d183e9b43b File Browser: Remove unused fileselect event value
This was initially added for a later support of making the automatic File
Browser fullscreen optional. As this idea was rejected for now (D1037) it
doesn't really make sense to leave these things in.
2015-01-28 23:35:46 +01:00
dd673337f1 BGE: draw contact points + normals in yellow
Red was used with different semantics in the physics visualisation,
switching to yellow to prevent confusion.

A screenshot can be found at http://www.pasteall.org/pic/80766 -- it's
the yellow balls + lines.

Reviewers: brita_, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: lordloki

Projects: #game_physics

Differential Revision: https://developer.blender.org/D925
2015-01-28 22:09:58 +01:00
e5a852c3f3 BGE: draw contact points as sphere + line indicating the surface normal.
A screenshot can be found at http://www.pasteall.org/pic/80766 -- it's the yellow balls + lines.

Reviewers: brita_, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: lordloki

Projects: #game_physics

Differential Revision: https://developer.blender.org/D925
2015-01-28 22:09:58 +01:00
773d85ab32 Based on Sergey's suggestion, use spinlocks for threaded loading of
waveforms.
2015-01-28 19:45:29 +01:00
424100cecb Update scons build documentation
- fix dead blender.org link (build dependencies)
  - rewrite $BLENDERHOME/{config,tools}/* to $BLENDERHOME/build_files/scons/{config,tools}/*

Patch by David Creswick, thanks!

Reviewers: jesterking

Differential Revision: https://developer.blender.org/D798
2015-01-28 23:40:41 +05:00
66f85d3487 Added default install location from install_deps.sh to FindOpenEXR.cmake
Patch by Oliver Weissbarth, thanks!

Differential Revision: https://developer.blender.org/D907
2015-01-28 23:36:51 +05: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
cde9b1b948 Fix clicking into texpaint slots not changing active image in blender
internal when using nodes.

Using nodes in blender internal is not well supported, but there's no
harm in allowing this and it will help manu do his texturing better :)
2015-01-28 15:34:11 +01:00
17cb55e442 Fix warning from previous commit:
Set slot to NULL when no active slot is found.
2015-01-28 15:24:37 +01:00
1a0ef58bdf Code cleanup: break up project_paint_begin() into smaller functions
This initialization function was massive with lots of local variables,
quite hard to follow. Splitting up doesn't make it perfectly clear,
but a bit better.

The changes are mostly quite mechanical splitting apart code, plus a
few new temporary structs for passing data without too many confusing
args. No intentional changes to functionality.

Reviewed By: psy-fi

Differential Revision: https://developer.blender.org/D1035
2015-01-28 14:49:44 +01:00
b52530f104 Merge branch 'master' into gooseberry 2015-01-28 14:44:12 +01:00
5d04470851 Texture painting, support cycles UV Map nodes:
Support UV Map nodes for determining active UV layer. Now when an image
node is enocuntered, the system will recursively search the node's input
sockets for any UV Map nodes. Obviously this won't fetch any coordinate
transforms into painting, and it will only choose the first UV Map node
encountered if more than one UV Map nodes are combined.

However it should allow custom UV setups per materials and tweaking of
the UV Map node's UV layer from the Slots panel.
2015-01-28 14:43:07 +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
7c72ba60d7 Sequencer: Option to skip strip proxy generation if they already exists
This is a per-strip option next to the build proxy size which tells blender
whether to skip building proxy size if the file for it already exists or not.
The option is called "Overwrite" for simplicity.

This option is enabled by default to avoid changes in the file behavior.

TODO: Would be nice to do something like that for movie clips as well.
2015-01-28 17:32:33 +05:00
7a6d757a3b Add theme option for cliping border 2015-01-28 13:03:42 +01:00
6dc4664efb Merge branch 'master' into gooseberry 2015-01-28 11:49:39 +01:00
1678cb9af2 Fix dreaded black screen for missing proxies - if requested proxy size
is not found, use the original footage instead
2015-01-28 11:48:22 +01:00
420d381037 Requiring COMPAT_ENGINES for particle panels is stupid. 2015-01-28 11:09:56 +01:00
0451934538 Properly decrease users of images when deleting a paint slot. 2015-01-28 11:09:30 +01:00
ce52e781b0 Switch windows MSVC builds to OpenAL-soft 2015-01-28 10:36:19 +01:00
e17c6f79a5 cleanup: py imports 2015-01-28 16:50:51 +11:00
julianeisel
3e59092348 Stacked fullscreen area support (proper implemenation)
Adds support for stacked fullscreens. This basically means, if a user opens a
temporary fullscreen mode, such as the File Browser or the Image Editor render
view, from a different fullscreen, the "Back to Previous" function or the other
ways to escape those temporary fullscreens don't return to the split screen
layout but to the previous fullscreen he has been in.

I already committed something similar (f7e844570f) but that was only
supposed as a fix, it didn't work for the "Back to Previous" operator and the
implementation wasn't really reusable. This one looks a bit nicer + makes some
older hacks unnecessary :)
2015-01-28 02:52:49 +01:00
01cebb6e91 OSL: Updates for OSL 1.5 API changes.
* create() and destroy() are deprecated since OSL 1.5, use regular constructors / destructors.
2015-01-28 01:07:59 +01:00
Dalai Felinto
7b16fda379 Fix T43388 Cycles Baking gives different results than Cycles Render
Reported and nailed down by Michale (MeshLogic).
The code that fixes this was commented out, but Brecht gave the go ahead to use it even if it is not the real solution
2015-01-27 18:20:42 -02:00
86d2765ebe Interface get rid of some quadstrips in favor of trianglestrips
If we ever want OpenGL 3.2 core context quadstrips need to go anyway and while there is much more things that need to be done this is something that can be tackled without any mayor surgery.
And without losing any kind of compatibility with ancient GL.

Reviewers: psy-fi

Reviewed By: psy-fi

Subscribers: psy-fi

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1027
2015-01-27 20:18:59 +01:00
1bfeabf4c5 Correction to tooltip, object texture space is supported by both SVM and OSL 2015-01-27 23:54:24 +05:00
9aefe08711 Fix T43398: Viewport "Renderend" ist not updated when a material is assigned to a face
The issues goes back to eb016eb and now it becomes clear object could be tagged for
update from the edit mode as well.
2015-01-27 22:41:56 +05:00
d92f5918b1 Merge branch 'master' into gooseberry 2015-01-27 18:19:51 +01:00
3f8f4175c3 Fix T43309 saving takes longer.
Issue is that world shader compilation and loading may take long so we
just draw file previews with premultiplied background. Should create the
old familiar transparent background files.

Thanks to Sergey for figuring out the issue.
2015-01-27 18:02:08 +01:00
937c2d8473 Followup fix for T43394: Reconnect feature was using identity matrix for
transforming hair into world space, but this is already happining due to
the global flag.

Still is a horrible mess, legacy code headache as always ...
2015-01-27 17:51:21 +01:00
3b50d3a04f Fix T43346: Window mapping is wrong in preview render
The issue was caused by the whole viewplane used for mapping calculation
which would for sure lead to differences between final camera render and
viewport render from the camera view.

This commit makes it so window texture mapping is the same as final render
when viewing from the camera in viewport render.

It's not totally clear what's the right thing to do when viewport is not
in the camera view mode and that part is left unchanged.
2015-01-27 21:47:00 +05:00
332cf291e4 Fix T43250, lamp node did not use energy when used with nodes in blender
internal.

Similar to fix for T42074 we need to multiply with energy -after-
texture application.
2015-01-27 16:34:40 +01:00
2d86f58e0f And one more infamous BPlayer Fix (tm).
Seriously, please build complete Blender when you change some public func signature...
2015-01-27 16:28:54 +01:00
0d5ebabe43 Fix T43367: Non-wacom tablets broken on Blender in linux?
Looks like with some versions of Xlib (at least the 1.6.2 currently used on Debian testing)
and/or evdev generic driver (2.9.0 currently on Debian testing), you have to also 'select'
DeviceButton1Motion with the extended tablet's motion event, otherwise you won't get any
tablet motion event once pen is pressed, leading to no pressure (each stroke keeping its
init pressure until the end). Crap!
2015-01-27 16:23:56 +01:00
77848f23a4 Fix T43371 lamps not updated on appenidng. Remove GPU materials on
appeniding.
2015-01-27 15:41:45 +01:00
d687625ad8 Correct path to mingw64 libs so some minimal blender subset is possible to be compiled with older gcc 2015-01-27 19:29:22 +05:00
58f7deca58 Fix T43429: bpy.ops.render.render() not working with scene in VSE
Was a mistake in threading conflict prevention condition.
2015-01-27 17:14:14 +05:00
9e48f010c4 Proxy job: make user cancelling actually matter 2015-01-27 12:30:00 +01:00
e4b7084bf6 Merge branch 'master' into gooseberry 2015-01-27 16:19:14 +05:00
d9c77a490c Fix T43427: Particle system children sometimes not generated on reload
The issue was caused by the conflict between preview render which would set
R_NO_IMAGE_LOAD flag on the renderer and texture samplers called outside of
the render pipeline trying to use this flag.

Now the sampler functions accepts extra argument so render pipeline can
still skip image load, but calls outside of the pipeline will nicely load
all the images.

Not cleanest change in the world but good enough to unlock gooseberry team,
and assuming we already had pool passed all over the place it should be all
fine.

Will need to reshuffle arguments into SamplerOptions structure later.
2015-01-27 16:14:53 +05:00
3a6e8ec938 Merge branch 'master' into gooseberry 2015-01-27 13:47:15 +05:00
df07a25d28 Cycles: Support texture coordinate from another object
This is the same as blender internal's texture mapping from another object,
so this way it's possible to control texture space of one object by another.

Quite straightforward change apart from the workaround for the stupidness of
the dependency graph. Now shader has flag telling that it depends on object
transform. This is the simplest way to know which shaders needs to be tagged
for update when object changes. This might give some false-positive tags now
but reducing them should not be priority for Cycles and rather be a priority
to bring new dependency graph.

Also GLSL preview does not support using other object for mapping.

This is actually correct for BI shading as well and to be addressed as
a part of general GLSL viewport improvements since it's not really clear
how to support this in GLSL.

Reviewers: brecht, juicyfruit

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1021
2015-01-27 13:36:30 +05:00
ddc0d28031 Fix T43408: Putting steps and keys properties into an inactive sublayout
based on the interpolate property does not make any sense at all.

These settings are still totally confusing - this code has not been
touched since 2009 at least! Go figure ...
2015-01-27 09:09:07 +01:00
f202dab0f2 Merge branch 'master' into gooseberry
Conflicts:
	source/blender/makesdna/DNA_customdata_types.h
2015-01-26 17:43:02 +01:00
59e2f919ac missed last commit 2015-01-27 03:41:05 +11:00
b94efe0e8b BGE: remove Py3.1 workaround 2015-01-27 03:29:45 +11:00
7bc6fbf158 Cleanup: current/parent paths: add helpers in BLI_path_utils.
Also, avoid calling ugly strcmp with '.' or '..', making direct char checks is
much cheaper here!
2015-01-26 16:59:24 +01:00
fca515838e Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
d44890ee75 Code cleanup: de-duplicate codegen texid assignment
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:10 +01:00
c5f5012c5a Code cleanup: use GPUDynamicType instead of int
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:07 +01:00
8174ea2684 Code cleanup: use GPUDataSource enum instead of int
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:04 +01:00
3a3d68cd88 Code cleanup: use bool instead of int
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:36:01 +01:00
fdb55e3719 Code cleanup: use an enum for GPUNodeLink.image
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:59 +01:00
6cfc55c4f9 Code cleanup: use enums instead of defines
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:55 +01:00
42eaf82d10 Code cleanup: move struct GPUFunction and related code out of header
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:53 +01:00
4c3a49ef34 Code cleanup: use lowercase "gpu" prefix for static functions
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:50 +01:00
548d222d81 Code cleanup: remove do-nothing function GPU_node_end
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:47 +01:00
2233a3556d Code cleanup: remove some UNUSED parameters from static functions
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:44 +01:00
d1f88c05aa Code cleanup: retype various fields/parameters from int to GPUType
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:40 +01:00
a59e590e7f Code cleanup: remove parameter from GPU_node_link_create()
In all but one call the value 0 (aka GPU_NONE) was passed in. Clearer
to just default to GPU_NONE and change the one caller that sets a real
type to do it explicitly.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:34 +01:00
27284e4f34 Code cleanup: minor comment improvements
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:35:31 +01:00
8cafa0afa6 Code cleanup: give anomymous enum used for CustomData.type a name
Used this in GPU module to clarify what some "ints" really are.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026
2015-01-26 16:34:39 +01:00
d1e1fb2239 UV Unwrap: Correct aspect was inverted 2015-01-27 01:05:51 +11:00
4013ae6382 Fix T43409: Particle instancing on hair sometimes doesn't have a path
cache available.
2015-01-26 14:58:15 +01:00
895fa8bc79 Timeline: Draw keyframe lines at 60% height
This patch updates the timeline editor. Ordinarily, it draws the
yellow keyframe lines at 100% of the available height. This becomes an
issue when there are keyframes for every frame, which can happen when
importing motion capture data or recording animations from the BGE. In
such cases, the green "current frame" indicator becomes very hard to
see.

This patch restricts the drawing to the bottom 60% of the available
space, thereby making the "current frame" indicator more visible.

Reviewers: aligorith

Reviewed By: aligorith

Subscribers: Severin

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1033
2015-01-26 14:49:12 +01:00
6f2034cead Fix T43394: hair remapping needs to handle "global" hair correctly.
The function was checking the psys flag for this, but since for
disconnect/connect the same psys is used as source and target, the flag
must be passed explicitly.
2015-01-26 14:38:58 +01:00
e0ee74a171 Fix T38619: Confusing logic for Keying Set keyframing Settings
The logic used for determining whether certain keyframing settings (i.e. visual,
only needed, xyz -> rgb) got applied was wonky. The original intention here was
that the Keying Set settings would override the global settings, and the path
settings would override what was used for the Keying Set. However, that was not
happening in all cases previously, as it was only possible to add flags and not
to turn them off.

This commit fixes that by introducing separate toggles to control whether the
Keying Set/Path's settings override the settings inherited from its parent
(i.e. the Keying Set for the Path, and the User Prefs for the Keying Set).
The icons used for these toggles could get revised a bit (we need something
which communicates "override this"; the current one is the closest I could find)

WARNING: If you have old keying sets, this may cause some breakage!
2015-01-27 02:10:26 +13:00
b648ba4103 Fix T43345: Dirty Vertex Colors - odd behavior
was cancelling when the dynamic range was zero, but gave odd behavior,
using the last value, not the values from the UI.
2015-01-26 22:44:59 +11:00
027361c898 Fix T41834: Ctrl+LMB, Extrude Curves 2+ splines
Extrude and Ctrl+LMB now support multiple selected vertices.
Also maintain active vertices.

D964 by Tyler Sliwkanich with own modifications
2015-01-26 21:08:43 +11:00
9415976d17 Change exception syntax to be more modern and hopefully fix buildbot issue in the process 2015-01-26 08:48:55 +01:00
5d61cbf008 Curves: BKE_nurb_copy left duplicate arrays
While callers accounted for this, its quite error prone. Just NULL instead.
2015-01-26 18:22:54 +11:00
8db4a24e4e Bugfix T43343: Buttons for Keyframing Settings are Mutually Exclusive
Since 1c3f2354f8 the keyframing settings on
Keying Sets have been incorrectly displayed as a clump of toggle buttons,
which are usually only used when only one of the options apply.

Reverting this back to how it was, while leaving bl_options in place still for
the one case where it makes sense to do it that way (i.e. for KeyingSetInfo)
2015-01-26 19:19:33 +13:00
julianeisel
146a0e9447 UI: macro for checking modifiers
Useful for UI handling where its common to check multiple modifiers at once.
2015-01-26 13:34:30 +11:00
julianeisel
b636599fde Correction to c792e54699: OS-Key should be checked as well 2015-01-26 02:51:09 +01:00
julianeisel
b554bcf124 Cleanup: Remove ugly ELEM checks in modifier key handling
Campbell once told me such checks can cause warnings on some compilers, so
let's try to avoid them.

From the theoretical view, this check works quite different than the old
one, but in this case everything should work just like previousely.
2015-01-26 02:38:39 +01:00
julianeisel
c792e54699 If a modifier key is held, don't open context menu
D1019 by @gregzaal (minor edits by me).

Thanks for the patch!
2015-01-26 01:57:58 +01:00
ce6ba965dc cleanup: warnings, spelling 2015-01-25 21:15:27 +11:00
f4a418b031 Crash when deleting NlaTrack
Steps to reproduce:
1) Create an object, animated with shape keys
2) Copy it with Alt-D
3) Push action down to nla track
4) Select that track and delete it

In attached file 1-3 steps are completed.
{F138559}

Alexander (Blend4Web Team)

Reviewers: aligorith

Subscribers: yurikovelenov, Evgeny_Rodygin, valentin_b4w, AlexKowel

Differential Revision: https://developer.blender.org/D1015
2015-01-25 18:55:05 +13:00
julianeisel
b112ea3d76 Fix T43315: Minor Conflict in Maya Key Configs
Alt+Mousewheel was used for frame scrubbing which isn't really good as users
may often use this by accident while using Alt for Viewport navigation.

Frame scrubbing/frame_offset() is now called by Ctrl+Alt+Mousewheel (shift +
Mousewheel was already used for scrolling up/down)
2015-01-25 03:25:25 +01:00
julianeisel
2855485565 Fix T43399: VSE - don't show fps info when stopping animation with ALT+A
Caused by a missing notifier on the animation_play operator.
2015-01-25 02:43:57 +01:00
julianeisel
492b9ab5e3 Fix T43335: Node Editor: name doesn't update
Update Node Editor info (drawn on the bottom left) on redraw if needed
2015-01-25 01:59:49 +01:00
julianeisel
c2af749ac3 Cleanup: Ugly typo (retore->restore) 2015-01-24 23:39:06 +01:00
julianeisel
f7e844570f Fix T43008: Support stacked fullscreen areas 2015-01-24 23:01:39 +01:00
31219415d6 Fix BGE compilation after recent renames in BKE_image (tsst...). 2015-01-24 14:57:57 +01:00
d036ad552f BKE_image: use BKE_image_*** prefix
use bools for return values and some api naming consistency.
2015-01-24 17:26:59 +11:00
fcda27cdae Cleanup: style 2015-01-24 17:09:24 +11: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
ae213d740d Don't add Cycles tests if tests folder does not exist
Also print message about those tests being disabled.
2015-01-23 20:56:03 +05:00
433ecb88bd Revert "New cycles tests require buildbot to checkout tests of have test succeed if we test 0 files."
This reverts commit d390e24c49.

Forcing tests to success is really bad idea. It'll only lead to cases when
you see PASSED and will think everything is OK.

Long story short: never force tests to pass!
2015-01-23 20:48:55 +05: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
d390e24c49 New cycles tests require buildbot to checkout tests of have test succeed if we test 0 files. 2015-01-23 16:29:06 +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
6d78936c43 cleanup: style 2015-01-24 01:59:09 +11:00
e40387b1e2 Keep proper bone active group after removing first one
Previously active bone group would be set to NONE after removing the first
one even if there are more groups in the armature.
2015-01-23 17:00:18 +05: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
3ff3f563e5 PyAPI: don't adjust prefs when an fails to load
Recent addons commit meant that addons would be enabled even if they weren't found.
This would give an error (which is fine), but also remove from preferences.
2015-01-23 21:18:35 +11:00
2dfe5e30ac Cycles: Don't re-generate blackbody/beckmann tables on every shaders update
This commit makes it so blackbody and beckmann lookup tables are stored on CPU
after being generated and then only being copied to the device if needed.

This solves lag of viewport update when tweaking shader tree by using 266KB of
CPU memory.
2015-01-23 14:00:48 +05:00
892eb413f5 Removed parent path drawing code for hulls, this is never used anyway. 2015-01-23 09:47:28 +01:00
7733bd5efc PyAPI: avoid scanning all addons on startup
Gives small speedup
2015-01-23 16:38:29 +11:00
783b4cd1ca PyAPI: use set.discard instead of set-subtraction 2015-01-23 16:37:56 +11:00
2242022653 PyAPI: Replace importlib.reload, not 'imp' 2015-01-23 16:37:30 +11:00
3e8c0027a3 Cleanup: replace deprecated imp -> importlib 2015-01-23 12:37:58 +11:00
6a6e4a9d47 Set bAction.chanbase to deprecated 2015-01-23 10:52:20 +11:00
87fb7ee7e9 Theme Flatty Light
As discussed, welcome flatty light to master!
2015-01-22 23:52:14 +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
a730cda72f Fix: Joining armatures fixes up the drivers accordingly
Finally! At long last, I've gotten this working! This ended up being far trickier
to get right than anticipated; the normal remapping API's cannot be used as-is
as they will just clobber over subtleties whenever datablock changes are involved.
So, for now, we have to duplicate the logic a bit.
2015-01-23 02:33:32 +13:00
99a5f376a2 WIP: Attempt to get driver links remapped correctly when joining armatures
Now, RNA Paths and driver targets get corrected, but at the expense of this
always happening (i.e. even for those affecting drivers which existed before).
2015-01-23 02:33:31 +13:00
6248381783 Fix: Joining armatures wasn't updating Action Constraints properly
The code here was still trying to access ancient 2.4x "action channels" to rename
them. Now, this renames the relevant FCurves instead.
2015-01-23 02:33:31 +13:00
9617446be2 Cycles: Fix compilation error with some compilers
Not sure why this was not visible previously, but the change is
logical anyway.
2015-01-22 17:04:01 +05:00
8142e13d1a quiet py exception 2015-01-22 22:14:04 +11:00
cae72caa82 CTests: Add render tests for Cycles
The idea is to use the set of really small images from the lib folder
and run Cycles render on them comparing render output to reference
images in the tests repository.

For sure same thing could become more generic for BI or Freestyle
render engines.

Thanks Campbell for review and code tweaks!
2015-01-22 15:57:20 +05:00
90f2febbf4 CMake: Auto-detect path to idiff application in FindOpenImageIO.cmake
Not used at this moment, but will be real soon with new ctests.
2015-01-22 15:53:15 +05:00
4d4456015c Quit blender with non-zero exit code if tryign to use non-existing render engine via the command line 2015-01-22 15:23:09 +05:00
fa46f5a289 Fix T43357: Cycles crash with spatial splits after recent changes
When doing BVH leaf node split we can't rely on leaf size limit from
BVH parameters in case there's spatial split enabled.

This commit basically reverts previous optimization change here which
used stack-allocated memory and uses heap-allocated vector now.

It's possible to boost this code up again by using own allocator.
2015-01-22 14:56:00 +05:00
1841b12900 Cycles: Add assert check to triangle packing
Handy for troubleshooting.
2015-01-22 14:27:13 +05:00
a1ffb49e49 Fix T43120: Cycles mapping node rotation order is different from viewport
Root of the issue goes to the fact that since the very beginning Cycles was
using ZYX euler rotation for mapping shader node but blender was always
using XYZ euler rotation.

This commit switches Cycles to use XYZ euler order and adds versioning code
to preserve backward compatibility.

There was no really nice solution here because either we're ending up with
versioning code or we'll need to deal with all sort of exceptions from blender
side in order to support ZYX order for the mapping node. The latest one is
also creepy from the other render engines points of view -- that might break
compatibility with existing bindings or introduce some extra headache for them
in the future.

This could also become a PITA for us with need of supporting all sort of weird
and wonderful exceptions in the refactored viewport project.

NOTE: This commit breaks forward compatibility, meaning opening new files in
older blender might not give proper result if Mapping node was used.

Also, libraries are to be re-saved separately from the scene file, otherwise
versioning code for them wouldn't run if scene file was re-saved with new
version of blender.

Reviewers: brecht, juicyfruit, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D973
2015-01-22 14:12:22 +05:00
1aa8f0d3c0 Cleanup / Cycles: Code de-duplication for graph node relinking.
Differential Revision: https://developer.blender.org/D1018
2015-01-22 09:59:16 +01:00
82702db407 Expose shading node shading compatibility to the RNA
This way it is possible to probe shading compatibility of a given node from
python, making things like versioning code much easier to perform.

it's only valid for shading nodes, for other nodes the property also exists
but reads as an empty enum.

To access this compatibilities:

  node.shading_compatibility
2015-01-22 13:52:17 +05:00
21eb3ce44a Fix: Audaspace threw an exception for files it could not open. 2015-01-22 19:06:23 +13:00
Dalai Felinto
5c6ef95b71 Docs: touch ups in the bge.render doc introduction 2015-01-22 03:20:39 -02:00
Dalai Felinto
8ed439b89e bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE
This function allows the user to run specific code for each of the
rendered stereoscopic eyes in the Game Engine.

The initial use case is to set the camera projection matrix in
a scene.pre_draw callback function for each eye, to be used in VR
(Virtual Reality) installations.

Reviewed by Mitchell Stokes and Campbell Barton, thank you guys.

Sample Test Python Script:
"""
import bge
import bgl
import blf

def init():
    """init function - runs once"""
    scene = bge.logic.getCurrentScene()
    scene.post_draw.append(write)

def write():
    """write on screen - depending on the eye"""
    width = bge.render.getWindowWidth()
    height = bge.render.getWindowHeight()

    # OpenGL setup
    bgl.glMatrixMode(bgl.GL_PROJECTION)
    bgl.glLoadIdentity()
    bgl.gluOrtho2D(0, width, 0, height)
    bgl.glMatrixMode(bgl.GL_MODELVIEW)
    bgl.glLoadIdentity()

    eye = bge.render.getStereoEye()

    if eye == bge.render.LEFT_EYE:
        blf.position(0, (width * 0.2), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Left")

    else: # bge.render.RIGHT_EYE:
        blf.position(0, (width * 0.7), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Right")
"""
2015-01-22 03:00:24 -02:00
1b1a6e0c92 error in last commit (missed in review) 2015-01-22 10:56:52 +11:00
64e869ed35 Outliner: use enum for outliner_data_operation()
No functional change, D997 by @lichtwerk
2015-01-22 10:49:10 +11:00
47618d0393 Merge branch 'master' into gooseberry 2015-01-22 00:53:29 +05:00
dda355442d Cycles: Support tube projection for images
This way Cycles finally becomes feature-full on image projections
compared to Blender Internal and Gooseberry Project Team could
finally finish the movie.
2015-01-22 00:41:42 +05:00
12ccac657f Cycles: Support sphere mapping for the image texture 2015-01-22 00:41:42 +05:00
cd72396797 Cycles: Optimization for black world backgrounds
* If a Background node is set to a black color or zero strength,
it now gets removed from the shader graph.

* In case the graph is empty (no background node), the kernel will skip
evaluating it and save some rendertime. This can help quite a bit in scenes,
where the majority of the image consists of a black background.

Example: http://www.pasteall.org/pic/show.php?id=82650
In this case the render is ~16% faster.

Differential Revision: https://developer.blender.org/D972
2015-01-21 20:16:18 +01:00
7165db53f2 Cleanup of BGE code CcdPhysicsEnvironment::CallbackTriggers()
Refactored some code to be easier to read. Semantically the code is
identical.

  - Some conditions were negated to be able to return/continue early,
    rather than having the majority of the code inside an if-body.
  - Conditions were simplified (!(a == b)) turned into (a != b);
    repeated conditions calculated only once.
  - Unnecessary variables and one unnecessary condition were
    eliminated.

Reviewers: campbellbarton, lordloki

Reviewed By: lordloki

Projects: #game_physics

Differential Revision: https://developer.blender.org/D954
2015-01-21 18:43:05 +01:00
684942c2fe CMake/MSVC: Quotes around the path
D940 by @TeeTrizZz
2015-01-22 01:53:12 +11:00
3df93d063e Fix: Joining armatures loses drivers
Currently, when joining two armatures, the drivers of the armatures being merged
in are lost. This commit introduces a new AnimData API function for merging
animation data into another AnimData block.

NOTE:
* For now, this only copies the drivers over. As a result, manual effort will
  still be needed to go through and fix the drivers.

  I am working on automating that process, but it's more important that the
  drivers don't have to be created from scratch for now (since this is needed
  for the Goosberry rigging work).
2015-01-22 02:09:16 +13:00
5662864e5b Merge branch 'master' into gooseberry 2015-01-21 14:05:35 +01:00
f087e9930d Added new debug flag which can be used to lazy-init the SimDebug drawing.
A development addon can be used now to enable the debug drawing, without
the need to add UI code for this in the release files.

The SimDebug feature should also get an overall build flag and use
function stubs unless enabled. That way any possibility of overhead in
releases is eliminated.
2015-01-21 14:00:59 +01:00
Martin Ettl
f23338e107 Fix limit check before accessing array in opennl
Please note that opennl is already modified (for double precision)
so re-integration is not really easy. Also, we'll eventually switch
to Eigen.

For until that let's just solve the condition in our bundled opennl.
2015-01-21 17:19:39 +05:00
a86482f81c Fix T43158: pixels in the 3d-view was mis-aligned
Change the pixel offset for regions, it make oversampling blurry when drawing pixel aligned values.
See T41749
2015-01-21 23:15:39 +11: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
47bf0934f5 Removed generic debug1..4 values from the cloth data.
These were used as UI buttons during development. If such parameters are
needed again later they should instead be added in the (now global)
SimDebugData and made accessible with a dev addon or so.
2015-01-21 10:07:11 +01:00
4422ecbb96 UI: support alt+wheel for expanded enums 2015-01-21 16:27:58 +11:00
julianeisel
17422124ec Fix T43247: Don't open pulldown when a popup overlaps it
Auto-opening of pulldown menus didn't take overlapping popups into account.
2015-01-21 03:51:18 +01:00
12bf84cbe4 BKE_screen: add BKE_screen_find_area_xy
Use from eyedropper & screen operators
also define SPACE_TYPE_ANY for readability.
2015-01-21 13:43:46 +11:00
bb4c34fe78 Fix Python CTest's, ignore 'addons_contrib'
Too many contrib addons are in an unstable state making the test not so useful.

Thanks to Sergey initial patch: D1012, redid mostly - but outcome is the same.
2015-01-21 12:56:30 +11:00
88222fac63 Remove 'addons_extern' was used before git move 2015-01-21 12:56:03 +11:00
6b655ca62c Cleanup: style 2015-01-21 11:57:11 +11:00
280ed325a2 Update icons after recent cleanup in svg file.
Note differences in those five icons are invisible by eye, just for sake of consistency.
2015-01-20 21:53:06 +01:00
f67c6445e1 Cleanup SVG icon file, pass II.
Name each icon group from its define in Blender.

Simplifies searching for a given icon (in one way or the other), and could also be
useful one day in some scripting.

Also, removed/fixed more empty and stray groups...

Finally, found that we have several svg icons not linked to any defines, and one define
with no icon (dyntopo), would be nice to sort this one way or the other too.
2015-01-20 21:53:06 +01:00
fc6d10f5e8 Cleanup SVG icons file: pass I.
Made sure each icon has its own, 'private' group.
Removed empty groups, and some stray paths and rects (among other benefits,
'make icons' do not generate anymore that half o dozen of empty icons one had to remove
by hand before committing ;) ).

Note: double checked, only five generated icons differ (on binary level) from before,
with no actual visual diff.
2015-01-20 21:53:05 +01:00
9d9dc06014 Made SimDebugData into a single global instance.
This way it doesn't have to be stored as DNA runtime pointers or passed
down as a function argument. Currently there is now no property or
button to enable debugging, this will be added again later.
2015-01-20 18:32:06 +01:00
julianeisel
3356f3f0bb Outliner: "Show Active" - if active is a child, open tree to show child
Previously, if the active object was a child, "Show Active" only showed the
parent object. Now it also opens the tree to take children into account.

Patch D974 by @lichtwerk with some minor edits, reviewed by me.
2015-01-20 17:32:54 +01:00
408adfae8a Fix for BI rendering of hair spirals: Was not taking the extra points
into account.
2015-01-20 16:38:47 +01:00
8604ec9053 De-duplicate large block of shared code for GL vert attribs
Code in ccgdm_draw_attrib_vertex() was entirely the same as the top
portion of the code in cddm_draw_attrib_vertex(). Moved this code to a
new function, DM_draw_attrib_vertex().

ccgdm_draw_attrib_vertex() was removed in favor of calling
DM_draw_attrib_vertex(). cddm_draw_attrib_vertex() still does a couple
extra things, so it still exists but calls DM_draw_attrib_vertex().

In the interest of easy code review, no changes made to the code in
DM_draw_attrib_vertex() other than the new name and an added comment.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1010
2015-01-20 14:17:08 +01:00
58e5509da0 Fix UI glitch: Ctrl/Shift didnt refresh the UI 2015-01-20 23:16:03 +11:00
dfaf26412d Fix transform glitch: Ctrl/Shift didn't refresh 2015-01-20 23:16:02 +11:00
664ef69c9f Cleanup: use const 2015-01-20 23:16:02 +11: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
4a132abd9d Fix for crash when using virtual parent hairs and clumping.
The paths for parents and children are generated using the same function
with a rather obscure test to distinguish them. Modifiers (clump, kink,
roughness) should not be applied to parents though.
2015-01-20 11:42:33 +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
6e44e4181f Cleanup: warnings 2015-01-20 21:07:35 +11:00
06160adbf8 Code cleanup: Unused variable in RNA callback 2015-01-20 15:05:39 +05:00
02fad7dca4 Fix T42844: Compositor scale offset
Different interpolation methods in compositor could lead to 0.5 pixel offset in
final renders. This is because of some inconsistency in integer coordinates
which might mean pixel corner or pixel center.

Should be all fine now.
2015-01-20 15:02:35 +05:00
bffd824800 Fixed missing import in particles UI script. 2015-01-20 10:36:05 +01:00
967f93d1c1 Fix error in freestyle api 2015-01-20 20:00:31 +11:00
b22a38786d Fixed merge errors. 2015-01-20 09:38:39 +01:00
c8912073e6 Fix for incorrect DNA field name in versioning, causes constant
resetting of clump noise size on reload.

Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-01-20 09:30:33 +01:00
8ac20d1dee Use separate flags to enable/disable clump and roughness curves for
child hairs.

This allows disabling the curves temporarily without losing the setup.

Conflicts:
	source/blender/blenkernel/BKE_blender.h
2015-01-20 09:30:32 +01:00
1a918cb66e 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-20 09:30:12 +01:00
755734c12f 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-20 09:30:11 +01:00
6d65107656 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-20 09:30:11 +01:00
04226e324e 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-20 09:30:11 +01:00
53135f91d2 Removed debugging code. 2015-01-20 09:30:11 +01:00
0666de06f3 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-20 09:30:11 +01:00
2a41d8ebdc Added a "specials" menu button next to the particle systems list for
accessing the copy operator.
2015-01-20 09:30:11 +01:00
2a3279bb87 Changed the workflow for the particle system copy operator to the common
active-to-selected pattern.
2015-01-20 09:30:11 +01:00
91b70d3c56 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-20 09:30:11 +01:00
8f9f55498e Removed unused particles pointer from particle edit data. 2015-01-20 09:30:11 +01:00
2fe96f3f88 New texture influence option for particle kink amplitude (as opposed to
frequency).
2015-01-20 09:30:11 +01:00
9698182227 Renaming "Kink" texture influence to "Kink Frequency" to be more
specific.
2015-01-20 09:30:11 +01:00
68608c5428 Spiral rotation axis was not always fully normalized, avoid an assert. 2015-01-20 09:30:11 +01:00
dcfa75bc89 Make random child length work again with the spiral kink mode. 2015-01-20 09:30:11 +01:00
c2a7f26cbc Add missing stub to the player, so buildbot keeps delivering gooseberry builds 2015-01-20 09:30:10 +01:00
6c908790e7 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-20 09:30:10 +01:00
90e46ae6c0 Optional randomization factors for the spiral radius and axis orientation. 2015-01-20 09:30:10 +01:00
76c7d693d9 Support in Cycles for the extra spiral keys in hair paths. 2015-01-20 09:30:10 +01:00
6edeb43c16 Nicer calculation of the kink axis and result of the spiraling for
negative radius.
2015-01-20 09:30:10 +01:00
9f3a840df2 Removed unused old code. 2015-01-20 09:30:10 +01:00
374188cdfe 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-20 09:30:10 +01:00
14af65b3ef Fix for calculation of the key velocity on the last child hair segment. 2015-01-20 09:30:10 +01:00
307c4a4df9 Another crappy approach to spirals on hairs, crazy expensive though.
Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-01-20 09:30:10 +01:00
9bf7633936 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-20 09:30:10 +01:00
c2306919b7 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

Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-01-20 09:30:10 +01:00
7f219137cf 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-20 09:30:09 +01:00
d1246969ed Curve-based control for "roughness" (noise displacement) of child hair. 2015-01-20 09:30:09 +01:00
c86d55d5e7 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-20 09:30:09 +01:00
4c82367fd8 Moved kink, clump and roughness functions into the dedicated source file. 2015-01-20 09:30:09 +01:00
4f1c0a181d 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-20 09:30:09 +01:00
b292d783f2 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-20 09:30:09 +01:00
1727a165dd Properly register the mathutils.interpolate submodule. 2015-01-20 09:30:09 +01:00
1b6f5ecbf4 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 ...

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:09 +01:00
bb76e96339 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.

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
2015-01-20 09:30:09 +01:00
db2ac79fc7 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.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:09 +01:00
f0e8690526 Fix for wind force function call. 2015-01-20 09:30:09 +01:00
5c7adf5be2 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.

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:09 +01:00
658fc3ddbc 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
2015-01-20 09:30:09 +01:00
3b938f3d7f Fix for missing library linking in blenderplayer. 2015-01-20 09:30:08 +01:00
3f3c19e391 Another fix for particle instance child lookups, was not subtracting
parent amount.
2015-01-20 09:30:08 +01:00
c3c19509b3 Fix for invalid particle pointer access in mixed particle/child loop. 2015-01-20 09:30:08 +01:00
790b931956 Better update function for particle settings affecting nested cloth
modifier.
2015-01-20 09:30:08 +01:00
60bf6c123f 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.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:08 +01:00
d031831a05 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 ...)

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:08 +01:00
64a4d4ed25 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.
2015-01-20 09:30:08 +01:00
bd033721c2 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.
2015-01-20 09:30:08 +01:00
674c98bd06 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.

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:08 +01:00
52384179f4 Some tweaking of value ranges for hair target density and removed
density factor (already included in grid velocity).

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:08 +01:00
2da21b30ae Inverted effect of target density was unstable, the divergence term
needs to be substracted instead.
2015-01-20 09:30:08 +01:00
325990ff6e Use dedicated debug values in cloth settings instead of abusing unused
other values.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:08 +01:00
faa112cd27 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.
2015-01-20 09:30:08 +01:00
d73de8f277 Hair grid code was using an invalid hair segment at each hair end with
zero vectors, leading to bad density values.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:07 +01:00
95f9726173 A bunch of debug drawing changes.
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:07 +01:00
7c153c3a3d 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.
2015-01-20 09:30:07 +01:00
42fc88de43 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.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:07 +01:00
e73df249c7 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.
2015-01-20 09:30:07 +01:00
e6b80eb179 Fix for merge errors and leftover unused code lines. 2015-01-20 09:30:07 +01:00
b3cbafb966 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").

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:07 +01:00
a754c0af40 Another fix for off-by-one hair grid resolution errors. 2015-01-20 09:30:07 +01:00
9c660f18ac Rewriting the grid rasterization function for hair segments. 2015-01-20 09:30:07 +01:00
e56bda4a02 Draw actual hair keys when the "Guide Hair" setting is enabled.
Without this certain debug tasks become very hard to visualize.
2015-01-20 09:30:07 +01:00
62d9aa05ab Fix for grid drawing in 3D view, was using one less grid cell. 2015-01-20 09:30:07 +01:00
046510fcf9 Merge branch 'hair_immediate_fixes' into gooseberry
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:07 +01:00
be24adc9ef Implemented PIC and FLIP methods for combining the fluid grid simulation
with the Lagrangian hair model.
2015-01-20 09:30:07 +01:00
926a674fe8 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).

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:06 +01:00
7740b1671c Pampering the stupid MSVC compiler again, it fails to build valid C code. 2015-01-20 09:30:06 +01:00
aa16b5c222 Added new header for Eigen utility classes.
These make passing data between Eigen vector and matrix types and plain
C arrays more convenient.
2015-01-20 09:30:06 +01:00
74d6f31879 Updated a few comments. 2015-01-20 09:30:06 +01:00
9cd8e9f146 Compile hair volumetrics code as C++, so we can use Eigen easier. 2015-01-20 09:30:06 +01:00
46db288832 Minor debug code fix.
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:06 +01:00
bf96400558 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.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:06 +01:00
8dbb6f0d5d Removed unused voxel_filter_size DNA property.
This is an artifact of earlier attempts to implement velocity smoothing,
but doesn't work anyway.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:06 +01:00
e3dcbc3679 Renamed HairVertexGrid to HairGrid, since it's not actually storing
hair vertex data.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:06 +01:00
dddf088375 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.
2015-01-20 09:30:06 +01:00
d05c653ade 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.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:06 +01:00
c37de38716 New debug element "circle" for simulations, which is quite useful for
visualizing scalar fields.
2015-01-20 09:30:06 +01:00
7dda1ea396 Debug grid drawing for hair volume was drawing one subdivision too many. 2015-01-20 09:30:06 +01:00
211be0ae6e Unused leftover debug variable. 2015-01-20 09:30:06 +01:00
d42525a9b5 Reimplemented the voxel texture type for displaying hair continuum grids.
Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:05 +01:00
cd717f145d Expose hair grid info in the RNA (read-only); it can be useful for
debugging purposes.
2015-01-20 09:30:05 +01:00
9d27b53d41 Debug visualization code of a slice of the hair velocity vector field. 2015-01-20 09:30:05 +01:00
9be290c92e 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.
2015-01-20 09:30:05 +01:00
54c69c4ed8 Fill the hair volume grid with the _new_ velocities from the first
solver step, instead of using the previous step's velocities.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:05 +01:00
c3968861b3 Debug drawing feature to visualize the hair continuum grid. 2015-01-20 09:30:05 +01:00
aea309779f 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)

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:05 +01:00
4381fa3157 Minor fix for lost variable declaration during cherry-picking. 2015-01-20 09:30:05 +01:00
4ff68d031d Fix for warnings/errors
Conflicts:
	source/blender/blenkernel/intern/key.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/makesrna/intern/rna_particle.c
2015-01-20 09:30:05 +01:00
a351e8b6ef 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.

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
2015-01-20 09:30:05 +01:00
edc9baaae4 Moved render simplification function for particle distribution into the
distribution code.
2015-01-20 09:30:05 +01:00
34762de38f Removed unused variable. 2015-01-20 09:30:05 +01:00
09f171c525 A little bit of code sanity by splitting particle distribution function
by type.

Instead of squashing totally unrelated code into the same monster
function.
2015-01-20 09:30:04 +01:00
0f43ba8235 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.
2015-01-20 09:30:04 +01:00
f03fc27bf7 Removed unused line. 2015-01-20 09:30:04 +01:00
c01ed4875b 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.
2015-01-20 09:30:04 +01:00
117f4bbe66 Switched back to blender implicit solver for merge. 2015-01-20 09:30:04 +01:00
4cdf0ab5cf Unified the main Eigen solver function a bit for constrained/unconstrained
solver variants.
2015-01-20 09:30:04 +01:00
2356264ca9 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.
2015-01-20 09:30:04 +01:00
4eac83da66 Updating Eigen implicit dynamics solver implementation to adhere to the
new mass-spring solver API.

Conflicts:
	source/blender/physics/intern/implicit_eigen.cpp
2015-01-20 09:30:04 +01:00
35d09c7ab6 Fix for inverted condition: hair data needs to be rebuilt when the
cloth DM does not exist.
2015-01-20 09:30:04 +01:00
4a16242e60 Cleanup: Removed the unnecessary cloth solver abstraction (there is only
one solver anyway), and split some particle cloth functions for clarity.

Conflicts:
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/particle_system.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/makesdna/DNA_particle_types.h
	source/blender/makesrna/intern/rna_particle.c
2015-01-20 09:30:04 +01:00
0b0acb6124 enum instead of #define for cloth vertex flags. 2015-01-20 09:30:04 +01:00
ce53303f61 Removed accidentally committed debug print. 2015-01-20 09:30:04 +01:00
fe8fad54b1 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 ...
2015-01-20 09:30:03 +01:00
c1f4542f0f 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.
2015-01-20 09:30:03 +01:00
a5f207de79 Removed unused force arguments for angular bending springs and avoid
redundant calculation for counterforces.
2015-01-20 09:30:03 +01:00
173bdfe05e 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.

Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-01-20 09:30:03 +01:00
acf4506299 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.
2015-01-20 09:30:03 +01:00
64b9ba06a7 Cloth solver data for edit mode is unused, removed it. 2015-01-20 09:30:03 +01:00
6097de2db9 Fix for scons files missing physics include folder. 2015-01-20 09:30:03 +01:00
48e67c49a5 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.
2015-01-20 09:30:03 +01:00
e694b7c04b 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.
2015-01-20 09:30:03 +01:00
43424a639b Fix for outdated root array size when changing the particle amount
during simulation.
2015-01-20 09:30:03 +01:00
d613c38171 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.
2015-01-20 09:30:03 +01:00
577150c635 Completed the implementation of bent rest shapes for hair.
Basically follows the Pixar approach from "Artistic Simulation of Curly
Hair".
2015-01-20 09:30:03 +01:00
520922876a 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.
2015-01-20 09:30:03 +01:00
7d4799b41d Have to include BLI_utildefines before BKE_collision now to have bool
defined.
2015-01-20 09:30:02 +01:00
6394189e68 Clear forces and constraints together at the start of the time step,
easier to verify.
2015-01-20 09:30:02 +01:00
e44187cd5f Fix for missing initialization of local cloth modifier inside particle
systems.
2015-01-20 09:30:02 +01:00
c036c72284 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.
2015-01-20 09:30:02 +01:00
3a8ef0ef6c Unused function declaration. 2015-01-20 09:30:02 +01:00
491e7493c7 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.
2015-01-20 09:30:02 +01:00
00bb836e17 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.
2015-01-20 09:30:02 +01:00
e5ae13b809 Simple debug drawing support inside the implicit solver. 2015-01-20 09:30:02 +01:00
14bd99b0f3 Added a damping term for angular bending springs. 2015-01-20 09:30:02 +01:00
7a7778d003 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.
2015-01-20 09:30:02 +01:00
86a4da1c54 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.
2015-01-20 09:30:02 +01:00
fa1c2ba7c6 More scons fixes for physics lib. 2015-01-20 09:30:02 +01:00
09ad433179 Fixed scons build files for new physics subfolder. 2015-01-20 09:30:02 +01:00
f03d253f55 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.
2015-01-20 09:30:02 +01:00
226beb9866 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).
2015-01-20 09:30:01 +01:00
bbae8f88b8 Made the voxel grid size for hair interaction configurable and increased
the default to 32.

Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-01-20 09:30:01 +01:00
be016daf15 Reduced the length threshold for disabling short hairs from 0.1 to 0.01. 2015-01-20 09:30:01 +01:00
0ddea77b1a Fix for rB71271bb, was replacing the force vectors entirely instead of
adding.
2015-01-20 09:30:01 +01:00
59d76a406e Fix for effector force fields on hair, using the world-to-root
transformation.
2015-01-20 09:30:01 +01:00
d43170d09d 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.
2015-01-20 09:30:01 +01:00
8876429edd 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.
2015-01-20 09:30:01 +01:00
a8cf092160 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.
2015-01-20 09:30:01 +01:00
6623395638 Minor fix when gravity code is disabled. 2015-01-20 09:30:01 +01:00
58e33ab279 Removed unused code.
Conflicts:
	source/blender/physics/intern/implicit_blender.c
2015-01-20 09:30:01 +01:00
d0379f82d1 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
2015-01-20 09:30:01 +01:00
a49b170b27 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).
2015-01-20 09:30:01 +01:00
02c8bf99c9 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.

Conflicts:
	source/blender/physics/intern/implicit_blender.c
2015-01-20 09:30:01 +01:00
dd0a7444d8 Main cloth force calculation function outside of implicit core code.
Still misses spring forces.
2015-01-20 09:30:00 +01:00
64de714a08 Hair volume calculation is now in its own file.
Code is currently disabled until the other main forces are in place.
2015-01-20 09:30:00 +01:00
b9b784f039 Moved the unused goal force calculation function to the main mass-spring
source file.
2015-01-20 09:30:00 +01:00
2901d6ab21 Moved most of the main cloth solver function out of implicit code core.
Force calculation is disabled, will follow shortly.
2015-01-20 09:30:00 +01:00
ac071de405 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.
2015-01-20 09:30:00 +01:00
d2e8a72d8a 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.
2015-01-20 09:30:00 +01:00
0d60337a83 Renamed functions to make them explicitly refer to cloth, and split the
create/free functions for solver data off from the cloth solver.
2015-01-20 09:30:00 +01:00
5322def57c 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.
2015-01-20 09:30:00 +01:00
1c8a33ab92 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.
2015-01-20 09:30:00 +01:00
3007fc6eb7 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.
2015-01-20 09:30:00 +01:00
8532cf206e 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.
2015-01-20 09:30:00 +01:00
3119d718f8 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.
2015-01-20 09:30:00 +01:00
2b06b899b0 Correction for inverse constraint matrix rotation. 2015-01-20 09:30:00 +01:00
0f3cbf3f56 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.
2015-01-20 09:30:00 +01:00
bc6fa4fa11 Use identity transform in the solver data roots to avoid possible errors
when this data is used outside the transform functions.
2015-01-20 09:29:59 +01:00
b391e963a9 Option for disabling the root frame transformation altogether, mostly
for testing.
2015-01-20 09:29:59 +01:00
c5038b12c3 Ported root frame transformation to the old cloth solver. 2015-01-20 09:29:59 +01:00
3ad7974373 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.
2015-01-20 09:29:59 +01:00
9f28ced756 Implemented gradient transformation for forces in the root frame (dFdX,
dFdV).
2015-01-20 09:29:59 +01:00
2410dc32ff Removed unused variable. 2015-01-20 09:29:59 +01:00
55a5351a03 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.
2015-01-20 09:29:59 +01:00
d496b308db 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.
2015-01-20 09:29:59 +01:00
d115bdb505 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.
2015-01-20 09:29:59 +01:00
da01c884e5 Cleanup, removed unused old code. 2015-01-20 09:29:59 +01:00
d91a4cd1a1 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.
2015-01-20 09:29:59 +01:00
e55d11478d Added back external effector forces for the cloth solver. 2015-01-20 09:29:59 +01:00
ace1b5050b Reenabled goal springs and removed the arbitrary structural scaling
factor.
2015-01-20 09:29:59 +01:00
c7932e93fa Fixed bending forces for cloth springs. 2015-01-20 09:29:58 +01:00
6d4c704f17 Correctly implemented and verified gravity, drag, structural springs. 2015-01-20 09:29:58 +01:00
f336ca5952 Minor fix in debug print, so solver prints can be diff'ed. 2015-01-20 09:29:58 +01:00
b241f23b19 A couple of defines to disable various influences on the cloth sim for
debugging.
2015-01-20 09:29:58 +01:00
1819cbd02c Debug printing code for large sparse vectors and matrices, to compare
solver input/output of the old and new methods.
2015-01-20 09:29:58 +01:00
8283122cda Added a new internal header for implicit solver defines.
Should become its own intern wrapper library eventually.
2015-01-20 09:29:58 +01:00
7896827f75 Reenabled air drag force for cloth sim. 2015-01-20 09:29:58 +01:00
e0b46b136e 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.
2015-01-20 09:29:58 +01:00
8163fca264 Switched to the modified CG method that supports constraints, and
added back structural stretch springs.
2015-01-20 09:29:58 +01:00
c6a65ff5b8 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.
2015-01-20 09:29:58 +01:00
722fd30a9f 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 ...
2015-01-20 09:29:58 +01:00
d2c0503f19 To make gravity a true force vector, multiply by the mass. 2015-01-20 09:29:58 +01:00
83137358c0 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.
2015-01-20 09:29:58 +01:00
396f7ea158 Don't try to enforce a velocity change for pinned vertices; their
velocity is defined externally by hair root motion.
2015-01-20 09:29:58 +01:00
d1cb8b08bd Use squareroot of the current epsilon error target for CG, since we
square this value anyway.
2015-01-20 09:29:57 +01:00
8ec4c31d9c Disabled collision culling on the inside of the collider faces for now,
this seems to remove too many contact points somehow ...
2015-01-20 09:29:57 +01:00
4bfd3c8f0c Fix for collision response, the impulse response was far too small. 2015-01-20 09:29:57 +01:00
27ecda9995 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.
2015-01-20 09:29:57 +01:00
02ab74eb55 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.
2015-01-20 09:29:57 +01:00
93194eb0e9 Fixed for hair collision detection, old/new positions were swapped. 2015-01-20 09:29:57 +01:00
971419c27d Reduced minimum for cloth solver substeps to 1.
This is not very useful for artists, but helps with debugging.
2015-01-20 09:29:57 +01:00
b8a9579954 Removed own debug print. 2015-01-20 09:29:57 +01:00
ae162f61e7 Added a comment and use the new CG solver as the "official" version now. 2015-01-20 09:29:57 +01:00
c6e5f6afe0 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).
2015-01-20 09:29:57 +01:00
b38663338e 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.
2015-01-20 09:29:57 +01:00
fc083b4e5b 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.
2015-01-20 09:29:57 +01:00
0f45f4a3e2 Cleanup: added some comments to the members of Implicit_Data. 2015-01-20 09:29:57 +01:00
c6db1d0858 Cleanup: No point in passing all the implicit solver arguments
individually.
2015-01-20 09:29:56 +01:00
e9849bdf17 Cleanup: removed the unused olddV vectors from implicit solver data. 2015-01-20 09:29:56 +01:00
ccad968e26 Some more debug elements for hair collisions. 2015-01-20 09:29:56 +01:00
f98d388fd3 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.
2015-01-20 09:29:56 +01:00
dbf7840643 Fix bounce/repulse calculation. 2015-01-20 09:29:56 +01:00
d43f760892 Hair debugging: use "categories" (strings) for grouping debug elements
and support clearing for categories.
2015-01-20 09:29:56 +01:00
70df8f8dd6 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.
2015-01-20 09:29:56 +01:00
a580be6399 Use repulsion forces in combination with the one-time penalty forces
in collision.
2015-01-20 09:29:56 +01:00
67fdd5e01a 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.
2015-01-20 09:29:56 +01:00
f757364fc0 Clear debug_data pointer in local cloth modifier data of the particle
systems on blend file load.
2015-01-20 09:29:56 +01:00
1ed88bb24e 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.
2015-01-20 09:29:56 +01:00
d8cf12fe5a 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.
2015-01-20 09:29:56 +01:00
5a43e8493e 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).
2015-01-20 09:29:21 +01:00
ba8b8ec998 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.
2015-01-20 09:29:21 +01:00
345c7b144d 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.
2015-01-20 09:29:21 +01:00
b331a82910 Support for various data properties of the hair grid in the voxel
texture.
2015-01-20 09:29:21 +01:00
efc0cd1658 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.
2015-01-20 09:29:21 +01:00
5f41b19463 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.
2015-01-20 09:29:21 +01:00
4cd6111159 Code cleanup: Use a variable-sized array for the hair volume velocity
smoothing and collision code, split into multiple functions.
2015-01-20 09:29:21 +01:00
9e5c3a1fa9 Fix for Trusted option, loading new file
Would use the setting of the previously loaded file, now re-initialize from preferences.
2015-01-20 16:38:31 +11:00
1d56f456f7 Fix glitch in view-axis (order of drawing) 2015-01-20 16:37:07 +11:00
289960787e Fix UI glitches drawing text at different sizes
Font height was ignoring DPI in some cases (camera-name & eyedropper).
2015-01-20 15:50:20 +11:00
09eec627ed UI: cleanup UI_fontstyle_string_width, UI_draw_string
Both were maked as temp, but used often.

Now pass uiFontStyle to both, rename UI_draw_string to UI_fontstyle_draw_simple,
since its a variant of UI_fontstyle_draw that skips shadow, align... etc.
2015-01-20 15:50:20 +11:00
f8c52402d6 BLF: remove paranoid checks for unset default font 2015-01-20 15:50:20 +11:00
a1f4821b94 Fix T42212: Singular reflection pass is incorrect in regular path tracer
Issue seems to be caused by not totally proper pdf and eval values for this
closure. Changed it so they reflect to ggx/beckmann reflection with roughness
set to 0, which is effectively the same as the sharp reflection.
2015-01-20 03:03:45 +05:00
4a4297ba02 I18n tools minor update. 2015-01-19 20:49:36 +01:00
35d3b6316b D627: Memory usage optimization for the compositor.
The compostor used a fixed size of 4 floats to hold pixel data. this
patch will select size of a pixel based on its type.
It uses 1 float for Value, 3 float for vector and 4 floats for color
data types.

When benchmarking on shots (opening shot of caminandes) we get a
reduction of memory of 30% and a tiny speedup as less data
transformations needs to take place (but these are negligable.

More information of the patch can be found on
https://developer.blender.org/D627 and
http://wiki.blender.org/index.php/Dev:Ref/Proposals/Compositor2014_p1.1_TD

Developers: jbakker & mdewanchand
Thanks for Sergey for his indept review.
2015-01-19 18:17:50 +01:00
a8fa291b8c Fix two potential bugs reported by latest coverity scan. 2015-01-19 17:51:25 +01:00
50cbff1851 Fix a crasher in recent own mesh remap code ('island' area... :/ ). 2015-01-19 15:51:21 +01:00
0af11a1742 Make use/computation of lnors consistant.
Issue was, when requesting (building) lnors for a mesh that has
autosmooth disabled, one would expect to simply get vnors as lnors.

Until now, it wasn't the case, which was bad e.g. for normal projections
of loops in recent remap code (projecting along split loop normals
when you would expect projection along vertex normals...).

Also, removed the 'angle' parameter from RNA's `mesh.calc_normals_split`.
This should *always* use mesh settings (both autosmooth and smoothresh),
otherwise once again we'd get inconsistencies in some cases.
Will update fbx and obj addons too.
2015-01-19 15:51:20 +01:00
694806a9cf Cycles: Correction to camera in volume detection after clipping commit
The check should also become aware of the fact were using clipping plane
instead of clipping sphere now.
2015-01-19 19:28:28 +05:00
7fd4c440ec Fix T43311: using displacement shader crashes blender
Issue was caused by wrong order of scene device update, which could
lead to missing object flags in shader kernel.

This patch solves a bit more than that making sure objects flags are
always properly updated, so adding/removing volume BSDF will properly
reflect on viewport where camera might become being in volume and so.
2015-01-19 19:23:21 +05: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
18ae259cc4 Cleanup: unused Global flags. 2015-01-20 01:07:12 +11:00
45dfb3b742 Fix for security issue loading blend's
Auto-Execute option could be overridden by opening a startup.blend
2015-01-20 00:58:32 +11: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
4c74fb24a2 Fix: ActionGroups.new() UI description copy-paste error 2015-01-19 12:58:48 +01:00
2f4aef9f3b Cycles: Avoid crash in statistics when canceling BVH build
Also add missing render_time initialization in progress.
2015-01-19 13:39:35 +05:00
32ffc63d20 Bugfix T43293: Crash when editing shared GPencil datablock in VSE
The problem here was that when a Grease Pencil datablock is shared between
the 3D view and another one of the editors, all the strokes were getting handled
by the editing operators, even if those strokes could not be displayed/used
in that context. As a result, the coordinate conversion methods would fail,
as some of the needed data would not be set.

The fix here involves not including any offending strokes in such cases...
2015-01-19 19:11:18 +13:00
0a128af21d GPencil: Added asserts for checking when trying to convert coordinates for invalid stroke types (for current editor)
Added for checking on the cause of T43293, and to aid in setting up a fix to
remedy the situation.
2015-01-19 19:11:17 +13:00
09c83d6fea Viewport: Add adjustable safe areas, 3d-view & VSE
Also adds safe-area presets.

D325 by Diego Gangl with own edits.
2015-01-19 16:47:57 +11:00
9f54a73b32 WM: add a notifier for camera/viewport options
Added so viewport options only used in a camera view wont cause all 3d-views to redraw.
2015-01-19 15:42:18 +11:00
e91148e463 RNA/API: name outliner sort option like UIList 2015-01-19 14:22:02 +11:00
704494e8cd Fix own error in freestyle api 2015-01-19 11:31:23 +11:00
julianeisel
ffe56536f1 Outliner: Make alphabetical sorting optional
A new option to the Outliner's View menu is added to enable/disable sorting of items.
2015-01-19 01:01:23 +01:00
6e5b21f808 Merge branch 'master' into gooseberry 2015-01-18 18:51:08 +01:00
90b5697459 Fix mathutils.barycentric_transform()
Dummy typo, we need a 3D vector here...
2015-01-18 18:41:47 +01:00
ecc58da8f1 Documentation: fixed documented types to match actual types
The BGE API uses Vectors, but often this was documented as list.

Maniphest Tasks: T43240

Differential Revision: https://developer.blender.org/D1006
2015-01-18 11:08:33 +01:00
6e97db7b30 Fix T43301: Three of the 'mirror keyframes' tools were mirroring along wrong axis.
Names are rather confusing here... :/
2015-01-17 23:09:41 +01:00
119ff676e1 Fix T43283: Crash on undo/redo/ and save/reload after (new) weight transfer.
Mesh stores its dvert in a specific pointer too, in addition of regular CD layer...
That whole vgroup handling is really breaking apart the 'universality' of CD system. :(

Also added some DAG and WM updates in operators...
2015-01-17 17:42:45 +01:00
c9e5d9226b Fix T43090: Cycles + Freestyle + border render = black render.
The reported problem was due to a special case where there are no strokes
to be rendered.  Since rendering an empty scene is a waste of time, the issue
was addressed here by skipping the stroke rendering process entirely.
2015-01-18 00:39:03 +09:00
448d143ad0 Fix T43273: vector math cross product inconsistent
GLSL missed the normalization step.

Reviewers: psy-fi, sergey, mont29

Reviewed By: mont29, sergey

Subscribers: mont29

Maniphest Tasks: T43273

Differential Revision: https://developer.blender.org/D1000
2015-01-17 14:58:48 +01:00
Torsten Rupp
82223270a8 Fix T23942: Add "Delete Hierarchy" to outliner context menu.
Patch by rupp (Torsten Rupp), review and minor style edits by mont29 (Bastien Montagne).
2015-01-17 14:55:18 +01:00
f65b369f16 Fix compilation error with strict compiler rules 2015-01-17 00:22:46 +05:00
89e562e19b Cycles: Fix compilation error with latest OSL
They went back from string_view to string for compiler options.

Still having linking errors here, but maybe others will be more lucky to fully
compiler blender with new OSL.
2015-01-17 00:15:47 +05:00
09ac6cae09 Cycles: Cleanup and optimization comment update 2015-01-17 00:15:47 +05:00
eff2fe9a72 Cycles: Minot cleanup, save some cpu tics per curve segment export 2015-01-17 00:15:47 +05:00
585275325e Fix T43275: Crash on Render when using 'save buffer' and render layer name contains a '/'
Added a new BLI_path_utils func, `BLI_filename_make_safe()`, which for now simply
replaces unsafe chars for paths (like '\' or '/') by an underscore...
2015-01-16 18:48:59 +01:00
4dec17b48c Merge branch 'master' into gooseberry 2015-01-16 17:34:19 +01:00
da8f16e288 FCurve RNA API: add funcs to convert to samples/to keyframes.
So far, we had an operator to 'bake' keyframe curves into samples, but no
way to make the fcurve editable again (i.e. to convert it back into a keyframes one).

Needed to fix mocap addon (see T43259).

Also, fixed a glitch in `fcurve_store_samples()`, since given end frame is included in range,
it is valid to give same start and end frame (in case you want a single point in samples,
not much practical cases, but...).
2015-01-16 17:26:28 +01:00
913e2bae19 Show buttons for particle system modifiers render/viewport toggles
in the particle buttons list.

This is much more convenient than having to switch back and forth
between particle and modifier buttons. The modifier box for particles
does not contain anything useful other than these two toggles anyway.
2015-01-16 17:08:07 +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
5685c43586 Select appropriate folder for MinGW-w64 gcc 4.9 2015-01-16 15:04:02 +02:00
9bb06c99f3 Cycles: Minor typo fix in debug print 2015-01-16 18:03:58 +05:00
b60e52f7cc Merge branch 'master' into gooseberry 2015-01-16 16:41:56 +05:00
5d5077957e Cycles; Correction to previous debug print to survive prints from multiple threads
This commit basically makes it so statistics print from different BVH trees are not
being interleaved with each other. Glog ensures this when debug print is done as a
single put to stream operator.
2015-01-16 16:39:02 +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
5684ad8072 Cycles: Report BVH statistics after build 2015-01-16 15:05:53 +05:00
fd58f5ac9d Fix T43271: Sequencer: RNA's 'add_effect' was not updating effect strip len correctly. 2015-01-16 10:41:38 +01:00
e5c1f28372 Merge branch 'master' into gooseberry 2015-01-16 02:29:32 +05:00
3f60d665bb Cycles: Fix stupid typo in the previous commit 2015-01-16 02:21:35 +05:00
b48b8938c3 Merge branch 'master' into gooseberry 2015-01-16 01:45:20 +05:00
146eb7947e Cycles: Tweak to leaf creation criteria in all BVH types
Since leaf node gets split further into per-primitive type leaves old check
for number of curves became a bit ridiculous -- it might lead to two leaf nodes
each of which would contain only one curve primitive (one motion curve and one
regular curve).

This lead to quite dramatic slowdown for Victor model -- around 40%, which is
totally unacceptable.

This commit is aimed to prevent such situation and from quick render test it
seems victor is now back to normal render time. Further testing is needed tho.

There are also other ideas about splitting the node, will need to look into
them next.
2015-01-16 01:42:58 +05:00
f02dba58ff Nodes: Put Blended Box Mapping properties next to each other. 2015-01-15 21:23:22 +01: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
ed8dc78691 BGE physics: get/set linear and angular damping
This patch adds the following R/W properties and method to `KX_GameObject`:

  - `linearDamping`  -- get/set linear damping
  - `angluarDamping`  -- get/set angular damping
  - `setDamping(linear, angular)` -- set both simultaneously

These allow runtime changes to the same properties that are accessible at design time in Blender's UI via `game.damping` and `game.rotation_damping`. The names of the properties were chosen to mirror the internal names of the BGE physics engine, as these are (AFAIK) also the commonly used names in physics literature.

Reviewers: campbellbarton

Projects: #game_physics

Differential Revision: https://developer.blender.org/D936
2015-01-15 18:37:22 +01:00
8793d9dac5 Merge branch 'master' into gooseberry 2015-01-15 22:36:26 +05:00
b675418d01 Sequencer: Allow generating proxies from script without having sequencer space active 2015-01-15 22:35:34 +05:00
1994e843d6 Sequencer: Don't crash when trying to rebuild proxy without having sequence edits 2015-01-15 22:27:58 +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
197dcfdc19 Cycles: Fix compilation error happened after recent render time commit 2015-01-15 21:28:04 +05:00
b8dd68cfc4 Cycles: Fix equiangular textures after recent commit
Just wrong constant used, names are indeed too close to each other.
2015-01-15 21:21:58 +05:00
1568a4b295 Bugfix: Wrong flags used in Spline IK eval for bounds limits 2015-01-16 03:02:28 +13:00
4b0007cf82 Prevent waveform drawing from continually retrying bad files
If sound_read_waveform() cannot read the file (i.e. info.length is
zero), set the sound's waveform to a valid waveform of zero
length. This indicates that reading the waveform is done so that it
doesn't get tried over and over again.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D988
2015-01-15 14:01:04 +01:00
b41ce0d1b9 Remove 'locked' parameter from sound_read_waveform()
This parameter was confusing in three ways:

1. It should have been named "lock" because it was used to take and
   release the sound mutex, not to indicate whether it was locked.

2. In the one place this function gets called the locked argument was
   set to "true", so not much point in having it optional.

3. I can't imagine that it would ever be a good idea to skip taking
   and releasing the mutex.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D988
2015-01-15 14:00:51 +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
588656a568 Review for the gsoc UI cleanup for the BGE
Review for the gsoc UI cleanup for the BGE.
Surviving commits are:
 - Game Engine UI cleanup: removing Scene/Active Clip
 - Game Engine UI cleanup: Adding missing 'not available' labels in empty panels
The rest was reverted for being subjective and polluting the UI code with an if for every button:
http://wiki.blender.org/index.php/User:Brita/GSoC_BGE_cleanup_and_support/reports/final#UI_Review

Reviewers: kupoman

Subscribers: dingto

Projects: #game_ui

Differential Revision: https://developer.blender.org/D982
2015-01-15 10:47:02 +01:00
1ec44b22e9 Make grumpy gcc happy (double to float conversion...). 2015-01-15 10:29:14 +01:00
a0fd7ab28d Revert "Make version_update() callback being invoked when linking/appending datablocks"
This reverts commit fbc2909cef.

The reason for revert is that the commit made it so bpy.data is not set to any
of the new main (on both file open and file link/append) which basically totally
broke versioning code.

Needs some smarter solution there.
2015-01-15 14:22:28 +05:00
08cc4bfa61 Small change for the new Lat/Long properties.
We use upper case for properties.
2015-01-15 08:23:27 +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
4118c1b4e6 Cycles: Adding field-of-view options to the equirectangular panorama camera
This patch adds the option to set minimum/maximum latitude/longitude values for
the equirectangular panorama camera in Cycles, as discussed in T34400.

The separate functions in kernel_projection.h are needed because the regular
ones are also used as helper functions for environment map sampling.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: dingto, sergey, brecht

Differential Revision: https://developer.blender.org/D960
2015-01-14 23:22:24 +05:00
193871ae7d Cycles: Ignore preprocessing time in ETA calculation
This patch makes Cycles ignore the time spent in BVH construction etc. when
estimating the remaining time. Considering that the remaining time is calculated
based on the average time per tile so far, as far as I understand it makes no
sense to include the preprocessing time.

Reviewers: sergey, #cycles

Reviewed By: sergey, #cycles

Subscribers: sergey

Projects: #cycles

Differential Revision: https://developer.blender.org/D895
2015-01-14 23:14:16 +05:00
0d6e88b446 Fix operator tooltip MBALL_OT_duplicate_move 2015-01-14 15:57:32 +01:00
bcd9b29a0d PyAPI: name OrientationHelper (io prefix in module name already) 2015-01-14 23:55:16 +11:00
ca0605b3ae cleanup: minor edits 2015-01-14 23:53:39 +11:00
edad3f93f6 Py IO utils: Add helper class to handle orientation (axes).
Also 'fix' T43243, since we can easily add a common better behavior now
when both axis settings are incompatible, by systematically changing
the other axis.

Will update 'main' addons in next commit, contrib ones I'll let to the authors
(old behavior is still possible anyway).
2015-01-14 13:10:18 +01: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
c8a9a563a7 Fix T42621: Glossy world ray visibility affects on transmission rays
There seems to be inconsistency in flags checks in Cycles kernel. In the interface
glossy means "Glossy Reflection" and it is properly taken into  account when doing
visibility check in BVH traversal.

The check in indirect background/light emission was treating this flags as "any of
glossy reflection or transmission" which is kind of weird.

Made it so emission code follows ray visibility assumptions in other parts of the
kernel now.
2015-01-14 15:33:38 +05:00
90a8aa2dab Fix T43201: Update the "in use" flags of sockets before drawing,
so value buttons are displayed when the link is not used.
2015-01-14 11:15:55 +01:00
dd5d31b515 Ignore "unavailable" links in the compositor, where one or both sockets
are unavailable (hidden).
2015-01-14 11:15:55 +01:00
197e889104 Transfer Data: resurrect fake AND/OR when transferring 'boolean' values like UVSeam, Freestyle marks, etc. 2015-01-14 10:51:41 +01:00
c84bd7fb0e Make random child length work again with the spiral kink mode. 2015-01-14 10:09:16 +01:00
e88936a128 cleanup: bScreen (char for bools) 2015-01-14 19:11:02 +11: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
e0075f93e4 Remove redundant pad flag 2015-01-14 18:05:05 +11:00
julianeisel
f19013158a Workaround/Fix T43139: Calling bpy.ops.screen.screen_full_area() multiple times in python console causes Blender to crash
This was sort of a chicken<->egg dilemma, because after a maximized screen was restored, the screen handling used region
coordinates which weren't updated yet. I'm still not sure why, but this resulted in area coords that go beond INT_MAX.

To fix this I made sure the first screen handling after restoring a maximized screen is skipped, so that it's delayed to
the next call of wm_event_do_handlers (since this is called from main loop there shouldn't be a noticable delay or any
handling glitches).
2015-01-14 01:29:17 +01:00
3d503ea8d6 UI: Eyedropper for view-depth
Currently this is mainly useful for picking camera DOF depth.

- EKey over a distance field prompts you to pick a depth from the camera.
- WKey (Specials menu) to pick from the 3D view (when the active camera's selected).
2015-01-14 08:46:55 +11:00
54fd3f36a0 Fix T43195: Cycles uses clipping sphere instead of clipping plane
Basically the title tells it all, now Cycles uses proper clipping plane,
matching other render engines.
2015-01-14 02:34:49 +05:00
e6c79b7369 Cycles: Fix QBVH refit nodes not setting primitive type properly 2015-01-14 02:17:28 +05:00
cfd2af0d48 Fix UI messages (own stupidness even :/ ). 2015-01-13 21:03:43 +01: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
653c6f2edd SDL wrangler: Support loading SDL2 libraries of different names
Seems different distros might have different naming rules, so need
to adopt our code for that.
2015-01-14 00:26:43 +05:00
9e95e65be8 Optional randomization factors for the spiral radius and axis orientation. 2015-01-13 19:41:25 +01:00
45d131ff08 Recent extrude rework caused bug with single faces
extrude_discrete_faces doesn't duplicate faces on extrude, see: T43237
2015-01-14 05:24:16 +11:00
fa0a2d8127 Support in Cycles for the extra spiral keys in hair paths. 2015-01-13 19:18:46 +01:00
b09563ca8c Cleanup: fixes for building with recent clang 2015-01-14 05:11:20 +11:00
ef80914c99 error in last commit 2015-01-14 05:11:19 +11: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
3f0113be4d Fix T43156: Cycles incorrect final render, proper viewport with moblur disabled
Really stupid issue caused by typo in bitfield bit lead to bit conflict,

Not sure how it was done, could be some bad merge conflict resolve in the
original commit or just pure man stupidnes.

This is a nice example when having set of small test render scenes hooked
to the ctest would really help.

It's probably not that stopper issue (even tho still quite bad) since it
was made 2 months ago. But if we ever do 'a' this time it's a nice change
to include.
2015-01-13 20:56:34 +05:00
be2994a6f1 FileBrowser: minor tweak/UI consistency: add 'viewzoom' icon to search field. 2015-01-13 16:43:55 +01:00
0d7c41d789 FileBrowser: Add an 'hidden file' icon, and use it instead of named checkbox for 'show hidden' param. 2015-01-13 16:37:27 +01:00
a97c5d1f9f Fix T42459: Knife fails at small scale
Occluding geometry failed when near overlapping (or cutting small objects).
2015-01-14 01:36:03 +11:00
a2a7260915 BMesh: option to filter out faces during raycast
This allows us to more easily cast from the surface of a mesh
without normal offsets (Which can give precision issues).
2015-01-14 01:36:03 +11:00
bd00770715 Cleanup: consistent arg order in bmesh 2015-01-14 01:36:03 +11:00
fbc2909cef Make version_update() callback being invoked when linking/appending datablocks
This way addons and render engines which needs to do versioning code on files will properly
do it when something is being linked or appended to the scene. Previously that callback was
only called for the local main only, making it impossible to do tweaks on linking.
2015-01-13 18:24:53 +05:00
117edbbf88 Fix T40616: Deformation Motion Blur for modifiers
Added extra checks for constructive modifiers which might in theory cause deformation
motion blur. it's still not totally perfect but we're getting really close to what we
can do in the best case scenario.

This commit might cause some extra time being spent on scene synchronization because
there might be now some false-positive results, but render time should stay quite the
same as before (apart from cases when there is deformation happening which was not
detected before).
2015-01-13 15:41:34 +05:00
b77dd13004 Fix T43229: Knife-project regression (broke knife-project)
There have been quite a few issues with knife precision,
tested reports (T43229, T42864, T42459, T41164) and this works with all.
2015-01-13 21:28:58 +11:00
98ad7c21c0 Blender-Internal: avoid redundant area check 2015-01-13 19:10:15 +11:00
3debcc8b51 Math Lib: improve area calculation
- area_quad_v3 now works correctly with concave quads.
- add area_squared_*** functions, to use when comparing to avoid a sqrt().
2015-01-13 19:10:15 +11:00
00ef77c1a2 Fixes for SplineIK:
* Ensure that when new constraints are created, the new settings have sensible
  default values.
  TODO: we need to version-patch old files

* Fix problem with variable shadowing (which wasn't causing problems AFAIK)
2015-01-13 19:30:31 +13:00
8787532184 Bugfix: The "bulge_min" setting for the Stretch To constraint prevented bones from shrinking below 1.0 scale
From the looks of things, this was a typo. The result was that if you had a bone
with the minimum volume restriction in place, the bone would not get any thinner
when it was stretched out.
2015-01-13 18:13:57 +13:00
f0361fcf54 Pataz-Gooseberry Request: Limits on Volume Preservation for Spline IK
This commit adds a new type of volume preservation mode to Spline IK
which makes it possible to set limits on the minimum and maximum
scaling of bone "fatness".

* The old volume preseving mode has been kept but renamed, to avoid
  breaking old rigs. "Volume Presevation" uses the new method, while
  "Inverse Preservation" is the old one.

* The code and settings for this new xz scale mode are directly lifted
  from the improved Stretch To constraint
2015-01-13 18:06:53 +13:00
julianeisel
f453df5b03 Fix T43128: Headerless panels are reorderable on Windows
Seems like a weird issue, but to sort panels "qsort" is used, which works slightly different on Windows. So all I had
to do was cleaning up the logic in find_highest_panel so that headerless panels are sorted, but that it absolutly not
allows headerless panels to be above normal panels.
I made sure it works fine on Linux as well.
2015-01-13 03:29:25 +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
aca329ba64 Cleanup: add missing MovieClip entry in RNA's id_type_items, and respect alphabetical sorting (on UI names for enums, on ID codes otherwise). 2015-01-12 19:56:18 +01:00
d47804cb06 correct last commit: less cryptic camera check 2015-01-13 05:55:10 +11:00
a4366497db Fix T43206: region_2d_to_origin_3d has no ortho offset
With ortho views the value would be aligned to the 'rv3d->ofs'
Now it works in camera ortho & regular ortho views.
2015-01-13 05:41:56 +11:00
dcd662c695 BMesh: Tweak behavior for select more/less
Stepping over faces gives overall nice results but it stopped wire edges from working.
Now step over wire too.
2015-01-13 02:36:51 +11:00
0996ee3bb8 Fix: Don't show filesel buttons when no operators running 2015-01-13 02:08:26 +11: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
c6d28a94be Fix T42754: File-Selector lost on fullscreen exit
There  was a hard-coded check to exit the fileselector when restoring a view.

Now, when space types differ, flag areas as temporary and switch back to the previous type only in this case.
This means you can select a file while having a file-selector space type open, and not loose it every time.
2015-01-13 01:44:40 +11:00
301433fe9d Fix OpenGL Context freeing 2015-01-13 01:44:40 +11:00
3027ff8b13 Second try to fix missing previews of mat/tex/etc. in .blend files.
This time, it's a dedicated operator user has to run before saving the file.

And it recursively check all IDs linked from each scene, therefore rendering
materials etc. previews using a scene they are used in.

Note the renderengine issue is not completely addressed this way
(existing code for icon previews seems to ignore completely other engines,
and IDs not linked anywhere (fake-user ones) will be rendered with current scene's engine
as fallback, also you can get a material linked to an hidden object in a scene, etc.).

Reviewers: sergey, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D980
2015-01-12 15:13:46 +01:00
51779d9407 Cycles: Fix crash after recent BVH changes on empty BVH trees
It's apparently not nice to access 0th element of zero-size vector in C++.
2015-01-12 19:11:32 +05:00
f9a4f8ada4 BLI linkstack macros: do not prepend the 'anti-namespace-collision' to var name.
Issue was, in case of using such stack within a structure, the '_' underscore
would be added in front of struct variable
(e.g. `my_struct.my_stack` would lead to (try to) using `_my_struct.my_var_pool` ...).

Now underscore is appended to var names, ugly but working.

Note did not touch to the alloca variants of those macros, since in this case enforcing
a pure local use is best I think.
2015-01-12 14:37:59 +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
e8730af87f Cycles: Fix compilation error on platforms without SSE support
Overview this in one of the previous BVH commits.
2015-01-12 17:14:40 +05:00
a3bfaa481f Cleanup: rename BKE's 'object_data_transfer' to 'data_transfer' to avoid same file names with ED_object's one. 2015-01-12 12:05:47 +01:00
47e47e6760 Avoid type re-definition for as long C11 is explicitly enabled in compilers 2015-01-12 15:36:18 +05:00
9d02e2626b Fix typo in OCIO configuration file 2015-01-12 15:06:03 +05:00
5719ed1225 Cycles: Add leaf primitives sanity check asserts to the kernel
This way we'll notice that leaf splitting didn't happen correct pretty easily
in debug builds.

There'll be absolutely no impact on release builds.
2015-01-12 15:05:14 +05:00
bc7ff3c2b4 Cycles: Enable leaf split by primitive type and adopt BVH traversal for this
This commit enables BVH leaf nodes split by the primitive type and makes it
so BVH traversal code is now aware and benefits from this.

As was mentioned in original commit, this change is crucial to be able to do
single ray to multiple triangle intersection. But it also appears to give
barely visible speedup in some scene.

In any case there should be no noticeable slowdown, and this change is what
we need to have anyway.
2015-01-12 15:04:52 +05:00
c707b91ce6 Cycles: Optimize leaf splitting code by avoid vector allocation
Use variables allocated in the stack and avoid heap allocation which should make
leaf splitting code a bit faster.
2015-01-12 14:49:59 +05:00
b56f5900dc Cycles: BVH params option to split leaf node by primitive types
The idea of this change is make it possible to split leaf nodes by primitive
type, making leaf containing primitives of the same type.

This would become handy when working on a single ray to multiple triangles
intersection code, plus with careful implementation it might give some extra
benefits on BVH traversal code by avoiding primitive type fetch and check for
each primitive in the node. But that's a bit tricky to have benefits on this
change only because depth of BVH increases.

This option is not exposed to the interface at all and not used even secretly,
the commit is only needed to help working further in this direction without
messing around with local patches and worrying of them running out of date.
2015-01-12 14:49:56 +05:00
d8fc404415 Cleanup: style 2015-01-12 18:56:36 +11:00
bae5826b65 Fix T42069: Fonts /w non-ascii paths fail in win32
Workaround freetype's use of fopen by swapping FT_New_Face for our own version which uses BLI_fopen.
2015-01-12 18:30:11 +11:00
f9c7cbd989 revert part of 7a1dc20
These warnings are false positives & confuses intended logic to set dummy values.
2015-01-12 11:46:44 +11:00
1864253db0 Fix T43208 material flickering in edit mode.
Happens because material setting now occurs in the derived mesh drawing
routine as it should. However that means that it also happens during
selection and that influenced the drawing state somehow.

In 2.72 this did not occur because material setting happened during draw
setting (skip or draw) instead of after the draw setting passed (so
selection would skip it by use another draw setting function). Of course
this violated design but worked.

Made it now so backbuffer selection does not enable materials (it's
redundant in those cases anyway).

This could be ported to a possible 'a' release but as is classic with
display code there may be some other places that it could backfire.

Tested fix with texture/vertex painting and selection which use
backbuffer for both subsurf and regular meshes and it seems to work OK.
2015-01-11 21:29:51 +01:00
0a5ad65512 Modifiers shall be listed in alphabetical order in UI... 2015-01-11 21:23:43 +01:00
7a1dc20560 Cleanup: quite some harmless but noisy warnings from gcc... 2015-01-11 21:14:39 +01:00
5a535bb5b0 Merge branch 'master' into gooseberry 2015-01-11 18:51:01 +01:00
1b3b011354 Transfer data: cleanup: Remove 'vertex_group_transfer_weight' operator.
We can now use 'generic' data transfer instead.

Note new one is not an exact replacement, it should be able to do
everyting old op could do though, and more.
2015-01-11 18:33:12 +01:00
a628a8240e Data transfer: make operator able to work 'reversed' (i.e. transfer from selected objects to active).
Needed to replace weight transfer modifier in WeightPaint mode...

Note this is not exposed to users in UI, shall remain technical intern
parameter imho. Esp. since behavior when several sources is a bit 'random'
(merely uses each source in selection order...).

Also, this correct a bug, where 'lib' linked objects/meshes could not be used
as source...
2015-01-11 18:32:25 +01:00
599c8a2c8e Fix T43204: Shrinkwrap constraint, project mode: Space ignored in bone case.
Own fault in rBb154aa8c060a60d to fix T42447... Reverted that commit, and added
kind of not-so-nice hack instead.

Note root of the issue comes from the special case we are doing here re 'Local'
space of parent-less objects. In that case, local space should be the same as
world one, but instead we apply the object rotation to it... This is inconsistent
with all other cases and could very well lead to other issues as T42447, but afraid
fixing that properly would be rather hairy - not to mention it would likely break
all existing riggings etc. :(

Should be safe for a 2.73a, shall we need it.
2015-01-11 14:59:11 +01:00
cd2d84d91c Fix three issues reported by coverity in own recent code. Including two potential crashers. 2015-01-10 22:54:32 +01:00
5357474ad8 Fix building with very strict flags, use size_t rather than int for string length.
Reported on bf-committers.
2015-01-10 19:15:49 +01:00
ab3f037ccc GPencil Editing: FKEY now controls the eraser size when in Stroke Edit Mode 2015-01-11 02:15:18 +13: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
9590e77a59 cleanup: style & warnings 2015-01-10 12:40:09 +11:00
dec523da87 Fix for regression in bmesh connect-pair
T42563 fix wasn't right, fortunately this doesn't fail in most cases.
2015-01-10 12:32:14 +11:00
79d8617424 Transfer data: add modifier.
Not much to add, modifier uses same code as operator basically, only key difference
is that modifier will never create data layers itself, you have to use dedicated operator
for that.
2015-01-10 00:04:43 +01:00
8615977624 Fix: Delkey didn't activate the Grease Pencil strokes delete operator like XKEY does 2015-01-10 11:20:11 +13:00
ee4453f083 Transfer Data: add main core code and operators.
This add code needed to map a CD data layout from source mesh towards destination one,
and code needed to actually transfer data, using BKE's mesh remap generated data.

This allows to transfer most CD layers (vgroups, vcols, uvs...) as well as fake, boolean ones
(like smooth/sharp edges/faces, etc.). Some types are not yet transferable, mainly
shape keys, this is known TODO.

Data transfer can also use some advanced mixing in some cases (mostly, vgroups and vcols).

Notes:
* New transfer operators transfer data from active object towards selected ones.
* Modifier will be committed separately.
* Old weight transfer code (for vgroups) is kept for now, mostly because it is the only
  usable one in weightpaint mode (it transfers from selected object to active one,
  this is not sensible in Object mode, but needed in WeightPaint one). This will be addressed soon.

Again, heavily reviewed and enhanced by Campbell, thanks!
2015-01-09 19:32:44 +01:00
67b1412bc9 Radial operator number angle input should use angles.
Much more lenient if you are a human.
2015-01-09 19:23:27 +01:00
58d7153c6c BKE: Add 'mesh remap' code.
This is the (big!) core of mesh transfer data, it defines a set of structures
to represent a mapping of mesh elements (verts, edges, polys of loops) between
two arbitrary meshes, and code to compute such mappings.

No similarity is required between source and destination meshes (though results
when using complete different meshes are rather unlikely to be useful!).

This code is not bound to data transfer, it is defined to be as generic as possible,
and easy to reuse or extend as needs arise.

Several methods of mapping generation are defined for each element type,
we probably will have to adjust that in future (remove useless ones, add
new ones...).

For loops, you can also define islands (for UVs e.g.) so that loops of a same
destination polygon do not 'spread' across several source islands.

Heavily reviewed and enhanced by Campbell, thanks a lot!
2015-01-09 18:35:32 +01:00
e61a707869 Merge branch 'master' into gooseberry 2015-01-09 18:08:20 +01:00
b99687169d Fix texture sampling with generative modifiers - sample backbuffer
returns indices in mesh face range
2015-01-09 18:06:15 +01:00
326d7fd5fd Curve-based control for "roughness" (noise displacement) of child hair. 2015-01-09 15:58:18 +01:00
1187b98d48 Fix T43174: "Record animation" does not update fcurve handles
`INSERT_FAST` implies you call `calchandles_fcurve()` at the end...
For now, since we do not store edited FCurves nor can we get them easily
(requires RNA...), just update handles of all fcurves, it's much more
performant than removing usage of `INSERT_FAST` anyway.
2015-01-09 15:29:47 +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
ac619aaf38 BLI_string: BLI_str_ends_with -> BLI_str_endswith
Loosely following Python str convention.
2015-01-09 23:47:17 +11:00
73955e2566 Fix for GTest 2015-01-09 23:33:02 +11:00
32acaf1bc5 Merge branch 'master' into gooseberry 2015-01-09 13:28:15 +01:00
ca9bdf3f28 Fix rotate around selection only working if object is at origin for
texpaint
2015-01-09 13:27:49 +01:00
62cc4bab08 BKE bvhutils: cleanup and refactor to make it more flexible.
You can now use lower-level '_ex' versions of bvh creators to only use part of
the mesh's elements in the BVH, and/or create bvh from non-DM sources.

Needed for transfer data.

Note edges extend version of bvh creator is not added here, not needed so far.
2015-01-09 13:03:55 +01:00
1794186053 BLI_math: add vector's dot_v3v3v3() func, for when you have three points instead of two vectors. 2015-01-09 13:03:55 +01:00
2e72d756c4 BLI_rand: add a function returning a random point whithin given 2D triangle.
Needed by transfer data.
2015-01-09 13:03:55 +01:00
88ee44a9ac BLI: add 'A*' (AStar) shortest path solver algorithm.
Needed for transfer data.
2015-01-09 13:03:55 +01:00
2f16098d20 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.

Testing in gooseberry worked for the rigs there, commiting to master now
2015-01-09 12:16:58 +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
95847f6ac7 Fix T43159: Copying of linked datablocks using relpath leads to invalid paths in new copies.
Propper fix reverting most of rB60e70c0c6014e5, which was only partial specific fix.
This code uses generic `BKE_id_lib_local_paths()` func to handle all possible paths.

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D977
2015-01-09 09:53:58 +01:00
1b8240f5af Fix T43154: Extrude edges ignored isolated verts
Also cleanup extrude code.

- remove normal calculation.
- remove return values for transform type.
- use enums.

Thanks to Psy-fi for finding the initial fix.
2015-01-09 07:31:05 +11:00
db0b8017cb DDS missed newline printing errors. 2015-01-09 04:23:43 +11:00
e02af840e1 Fix gtest linking on ubuntu and do minor cleanup.
Generally for build systems, libraries that do not depend on other
libraries, such as system libraries, OpenGL etc always go at the end.

We could even get rid of some duplicate dependency libraries here but
auto duplication by build systems and differences between OSs make this
difficult.

GTest still duplicates all libraries twice to solve some issues which is
weird (maybe libs are not sorted correctly for some reason? needs
investigation)
2015-01-08 17:17:40 +01:00
60e70c0c60 Fix T43159: Copying of linked datablocks using relpath leads to invalid paths in new copies.
Simply have to rebase onto main filepath when copying, if source datablock is lib and path is relative.

Afaict, only affected Image and Text datablocks. MovieClip would also be a candidate, but has
no copy implemented currently.
2015-01-08 14:38:48 +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
72ca952641 correct permissions 2015-01-08 23:01:15 +11:00
37d748cd17 exclude git/arc files from tgz archive 2015-01-08 22:53:23 +11:00
b62c0315fa Merge branch 'master' into gooseberry 2015-01-08 12:48:18 +01:00
def2ef88b0 Fix crash in texture paint sampling when sampling materials without
textures slots
2015-01-08 12:47:19 +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
acce9f0841 Fix for wrong boolean flag check
This fixes obvious overflows when checking bitflags, who knows how much
undiscovered issues exists in the code still..
2015-01-08 14:43:18 +05:00
8f0b6a1dd1 Better check that preview seq is cleared on exit 2015-01-08 20:16:22 +11:00
4305950fc0 GHash: use reinsert instead of remove/insert 2015-01-08 19:58:01 +11:00
9fadacfd0f cleanup: style 2015-01-08 19:57:50 +11:00
8ebb552a95 Fix T40257: Frustum culling not working properly
Instead of getting fancy this time, we'll just use Mahalin's simpler
fix. This may have slight performance impacts, but it is a lot simpler
than the previous fix and shouldn't cause as many bugs.
2015-01-07 20:41:07 -08:00
4fac29ca0e Revert "Fix T40257: Frustum culling not working properly"
This reverts commit 315609ec0c.

This fix still causes more issues than it solves.
2015-01-07 20:38:05 -08:00
ae18fd5937 Fix invalid memory access in gradient brushes - could cause a crash in
MacOS.

This looks like an oldie and should not influence release, but if we do
make an 'a' build it's safe to include.

Report by Craig Jones, thanks!
2015-01-07 23:01:42 +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
ef05bc5dd7 Quite warning about unused func.
(not my day...)
2015-01-07 19:47:31 +01:00
cda149b9c8 Remove 'ensure previews' call from write code.
Sorry about that, should have checked this stuff more, with Internal material
renders are very fast (unoticable), but with Cycles it can take (a lot of) time,
like several minutes or more.

Will probably fall back to a dedicated operator users will have to fire themselves
when they want previews in their files.
2015-01-07 19:38:13 +01:00
7c53c3483c PyAPI docs: minor changes to sphinx docs. 2015-01-08 03:55:01 +11:00
70eee6a0ed Merge branch 'master' into gooseberry 2015-01-07 16:17:16 +01:00
19169de9f7 Recalculate particle pathcache stuff for all particles instead of
trying to be smart.

This breaks child interpolation otherwise because sometimes parent
paths are not calculated and give bad clumping results.
2015-01-07 16:16:40 +01:00
e0e9cd0163 PyAPI: Call to get the pixel x,y in a text block
This allows scripts to request the screen location of any (line, column) pair.
2015-01-08 01:22:11 +11: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
14f2597d7e More tweak to preview commit - do not 'render' non-used IDs either.
Thanks to Campbell for the headup.
2015-01-07 14:10:14 +01:00
5bbb8a0d9d Ugh, forgot to invert that one in previous commit, sorry for the noise... 2015-01-07 12:46:18 +01:00
820b6b3731 Ensure mat/tex/etc. previews are generated/saved in .blend files when enabled in userprefs.
Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D970
2015-01-07 12:31:31 +01:00
3f05797333 Followup to fe3e000: no need to exit pose mode on operator redo
This is to be backported to the release branch.
2015-01-07 15:38:32 +05:00
29d2c71117 Fix for bool flag use 2015-01-07 12:08:55 +11:00
848c00f7e7 cleanup: de-duplicate code 2015-01-07 12:08:54 +11:00
3bd01c6056 Fix: Segfault in Image Editor when transforming GPencil Strokes 2015-01-07 13:19:49 +13:00
45c7af6c9c Fix: Missing updates for UI panels and main region when using Grease Pencil in Image Editor 2015-01-07 13:12:37 +13:00
bafabf4eda Fix: Restored "Draw Poly" to D Ctrl RMB, as D Alt LMB was blocked by Alt-D (duplicate) keymap 2015-01-07 12:41:25 +13:00
257d513aa8 Cycles: Allow negative values in Combine XYZ node. 2015-01-06 22:53:15 +01:00
julianeisel
70f3a47d57 Event System Cleanup: Modifier Key Assignment Switch
Was quite messy previously, think this is much more readable and easier to follow.
2015-01-06 20:33:22 +01:00
c66d7359fd Submodules: Make them pointing to the master branch
Otherwise it gives all sort of weird and wonderful artifacts.
2015-01-07 00:18:18 +05:00
julianeisel
eefb393cfd Fix T40435: Fix event system modifier key handling
This partial reverts rBd800cffaf10cb7, but fixes T40435 (Background label is not
redrawn).

It now isn't possible to use single modifier keys as shortcuts anymore. But this
is something that's not really useful at all, since it breaks more than it allows.
2015-01-06 18:48:36 +01:00
8e73b770d4 Remove slurph shape-key feature
This is an old option which wasn't working in over a year without complaint.
2015-01-07 02:06:37 +11:00
66d03f8405 Merge branch 'master' into gooseberry 2015-01-06 15:50:37 +01:00
0527183090 Fix copy-paste of colors to generated color not being correct. '
Change generated color property to gamma space to match the add new
image operator.
2015-01-06 15:48:18 +01:00
Dalai Felinto
d36fb8e34e Logic Bricks *must* be kept in alphabetical order 2015-01-06 12:29:48 -02:00
bf168f0600 Fix T43137: vertex bevel percent mode wasn't implemented. 2015-01-06 09:13:38 -05:00
22c9979b51 Point submodules ot latest release tags 2015-01-06 18:48:04 +05:00
ba0d452357 Merge branch 'master' into gooseberry 2015-01-06 23:11:54 +11:00
e9d6350e7e Sequencer: show extensions when preview enabled 2015-01-06 23:11:20 +11:00
7c28022dc2 Merge branch 'master' into gooseberry 2015-01-06 12:17:47 +01:00
4b586895f2 Expose viewer panels also when backdrop is active. Allows to select
proxy size, render type etc.
2015-01-06 12:17:06 +01:00
a922be9270 Cycles: Repot CPU and CUDA capabilities to system info operator
For CPU it gives available instructions set (SSE, AVX and so).

For GPU CUDA it reports most of the attribute values returned by
cuDeviceGetAttribute(). Ideally we need to only use set of those
which are driver-specific (so we don't clutter system info with
values which we can get from GPU specifications and be sure they
stay the same because driver can't affect on them).
2015-01-06 14:13:21 +05:00
e961c06a6e Fix T43143: DPX header wrong, making it impossible to import to other software
The issue was caused by the single letter in header, which is expected to be
captial as per standard: http://www.simplesystems.org/users/bfriesen/dpx/S268M_Revised.pdf
2015-01-06 13:47:53 +05:00
77c926933b cleanup: warnings 2015-01-06 19:09:56 +11:00
1829c049be Correct args from recent mathutils refactor 2015-01-06 19:09:55 +11:00
bf0c8e116d PyAPI: add PyList_APPEND
This appends while giving ownership to the list, avoiding temp assignment.
This matches PyList_SET_ITEM which bypasses refcount's

Note, this also reduce code-size, Py_DECREF is a rather heavy macro.
2015-01-06 19:09:53 +11:00
9fd569a654 PyAPI: add utilities PyTuple_SET_ITEMS, Py_INCREF_RET
Setting all values of a tuple is such a common operation that it deserves its own macro.
Also added Py_INCREF_RET to avoid confusing use of comma operator.
2015-01-06 19:09:11 +11:00
ee58d44945 BGE: Fix for bugs T42520 and T42097 (mouse look actuator related).
With this fix the mouse actuator movement works well as with even screen resolutions as odd screen resolutions.
Also it fixed the movement when the border of the blenderplayer window is out of the screen limits.

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D946
2015-01-05 22:07:35 -08:00
2d2bfd416b Fix T43122: Shrinkwrap target, wrong linked object 2015-01-06 14:01:18 +11:00
62f2b751f8 UI: refactor button string get/set into functions. 2015-01-06 11:05:08 +11:00
julianeisel
ffd06de470 Correction to previous commit
Just realized menu buttons are using hardmin and hardmax for a bad hack which will make the assert fail :/
2015-01-06 00:02:57 +01:00
c91e64faa6 Fix/cleanup very ugly and unsafe usage of but->str in ui_but_update().
Currently, but->str should never be smaller than but->strdata, but code shall
not rely on this.

Further more, but->strdata is 'only' 128 chars, this could become limit with some
translations, if the org label is already rather long, leading to truncated str
(Chinese e.g. can only store about 40 chars in strdata).
2015-01-05 21:38:15 +01:00
julianeisel
e7a9bf88d2 Fix T43111: Node Editor (Slider) Draw Glitch
* don't allow Node Editor input max value to be less then min value
* avoid the num slider drawing glitch if softmin equals softmax
* assert if softmax/hardmax is smaller than softmin/hardmin

With this, we sort of allow softmin/hardmin and softmax/hardmax being the same.
2015-01-05 21:05:17 +01:00
22ce525bcd More border clamping removed. 2015-01-05 14:26:56 +01:00
8a547af2bd Remove border clamping. Usually we just want to clamp to edge instead.
Note - checked all glTexImage functions and we never use that. Border is
ifdefed out too here.
2015-01-05 14:25:22 +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
89b654dc56 FileBrowser: small tweak to new search feature: clear that string when changing dir.
In 99% of cases, you do not want to keep the same filter when changing dir,
and having to reset it by hand is *very* annoying!
2015-01-05 12:23:41 +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
caf5a325b0 Outliner 'Blender file' view: Show libs used both directly and indirectly both on main level and in nested tree.
Request from Gooseberry team. This eases a bit managing dependancies in complex .blend files.

Reviewers: campbellbarton

Subscribers: fsiddi

Projects: #user_interface, #bf_blender:_next

Differential Revision: https://developer.blender.org/D943
2015-01-05 11:28:48 +01:00
3414d01411 Use float format for high bit depth textures if available - storage
requirements are the same but we may avoid some clipping of float values
for HDRs when used in shaders.
2015-01-05 11:23:54 +01:00
1ef33968fd Recent fix for SDL2 broke joysticks for SDL1.2 2015-01-05 20:23:30 +11:00
e5063b0bd3 Cleanup: OSX: remove obsolete ppc/ppc64 sw-renderer kCGL attributes 2015-01-04 20:42:16 +01:00
a08c5e1183 Partial fix for T43113: Filebrowser: Empty folders do not contain go back arrow.
Do not allow going into un-readable directories at all.
Note we might want to reflect that 'state' in UI for users too, but that will be
for later.

Also, not quite sure this fix the windows case, will have to start my VM... :/
2015-01-04 17:57:39 +01:00
8abdc89912 Sequencer: Preview dragging playhead over strips
Bring back the 2.4x feature.

also show a highlight when a strip is being previewed.
2015-01-05 02:27:50 +11:00
c7eb83bc17 Fix sequencer border-flickering
Offscreen viewport drawing wasn't properly restoring the theme.
Add API calls to store/restore the theme so it can be temporarily overridden.
2015-01-04 23:23:17 +11:00
3447944c3f sequencer: don't return big values (fill pointer instead) 2015-01-04 22:46:54 +11:00
44e02651ab Fix for crash for 'Edit Source'
was accessing freed menu region.
2015-01-04 22:25:53 +11:00
026cb6bdeb FileBrowser: Cleanup: rename some (really ugly) enum names. 2015-01-04 12:04:47 +01:00
b240b8e231 Freestyle: reserve array sizes before filling
also use PyList_GET_ITEM when list size is known.
2015-01-04 21:23:26 +11:00
de6b546e15 Fix 8 memory leaks from bad PyList_Append use 2015-01-04 20:35:16 +11:00
e0db0f84ac Fix T43119: mathutils.intersect_point_line always returns a 2D vector as first value.
Trivial, safe for final 2.73.
2015-01-04 10:11:21 +01:00
8106a6b75d mathutils: refactor instantiation
remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.

also fixes unlikely memory leak if the data-array can't be allocated.
2015-01-04 17:43:57 +11:00
c41431f1e9 cleanup: use 'coords' abbreviation for functions. 2015-01-04 14:21:16 +11:00
fd9b25df75 cleanup: create cube, use index lookups 2015-01-04 14:21:16 +11:00
julianeisel
555c1d6a63 Fix T43114: File Browser - don't highlight '..' while using border select 2015-01-04 02:36:42 +01:00
dcc5997527 FileBrowser: add search field in header bar.
Not much to add, pretty straightforward...
2015-01-03 21:55:16 +01:00
d8b00a3bf5 Freestyle: memory consumption optimization in stroke rendering.
Previously individual strokes were represented by distinct mesh objects
no matter how many vertices and materials each stroke has, although
the vertex and material counts can be quite small depending on the input
scene data.  Now stroke meshes are packed into a minimum number of
mesh objects, so as to reduce the overheads of Blender object creation.
2015-01-03 21:54:56 +09:00
babfec9e8f Bump subversion so that version patches for theme changes work 2015-01-04 01:17:53 +13:00
Diego Garcia
f329ebe38a D824: Add themeing for keyframe lines in Timeline
Reviewed by: Joshua Leung (aligorith)
2015-01-04 01:17:51 +13:00
c50003cd09 Grease Pencil: Vertex size and colours are now themable 2015-01-04 01:17:50 +13:00
b137f06d7e Cleanup: rename 'filelist' BLI funcs to consistent naming.
Also, add an optional callback to `BLI_filelist_free()` to allow freein
void poin if needed (consistency with `BLI_filelist_duplicate()`...).
2015-01-03 12:41:36 +01:00
780bb88a7a Refactor 'fit in camera view' code, and expose it to RNA.
This changes BKE's fitting code to use `BKE_camera_params_compute_viewplane` instead of
`BKE_camera_view_frame`. This allows that code to work with orthographic projection too.

Also, two funcs were added to rna's Object, to resp. get the projection matrix of that
object (mostly useful for cameras and lamps objects), and return position this object
should be to see all (to fit) a given set of points.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D961
2015-01-03 12:05:23 +01:00
16ed20ff3c Add some BLI helpers needed by asset branch.
`BLI_strncpy_ensure_pad()` is also useful with current master code.

The two others (`BLI_strcmp_ignore_pad()` and `BLI_filelist_duplicate()`)
are only used in asset branch currently, but think they could be useful
in other places too, and simplifies handling of asset branch & future patch review.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D965
2015-01-03 10:13:44 +01:00
6b8b3badf5 GTest: test beautify with polyfill 2015-01-03 18:05:18 +11:00
0d7e8cc869 GTest was broken on Linux 2015-01-03 17:55:59 +11:00
f06335e12f Fix for view map cache not flushed by updates of edge detection options.
This fix should be considered for inclusion in the 2.73 release, since
it concerns a new feature of Freestyle introduced in 2.73.
2015-01-03 15:40:07 +09:00
8a288953cc Fix RNA Image.frame_duration.
If a video was loaded (e.g. from python) but never 'ibuf-acquired', its Image->anim
prop would still be NULL, returning useless '1' value as frame duration!
2015-01-02 22:51:51 +01:00
df877cc991 Merge branch 'master' into gooseberry 2015-01-03 00:11:50 +05:00
1369bd562c Cycles: Fix compilation error on AVX platforms with -arch-native
Was a conflict in headers between clew and util_optimization.h.
2015-01-03 00:11:28 +05:00
8e37a45ac0 Fix (unreported) 'pad9' not shown by UserPrefs' KeyBinding filter.
Minor glicth, but still... Safe for 2.73.
2015-01-02 18:24:25 +01:00
2a8a56929b Cycles: Fix unneeded int/float conversion happened in previous commit 2015-01-02 17:21:24 +05:00
4f2583ee13 Fix T43027: OpenCL kernel compilation broken after QBVH
OpenCL apparently does not support templates, so the idea of generic
function for swapping is a bit of a failure. Now it is either inlined
into the code (in triangle intersection) or has specific implementation
for QBVH.

This is probably even better, because we can't create QBVH-specific
function in util_math anyway.
2015-01-02 14:58:01 +05:00
da66a2c871 Fix T43099: Modifiers in edit mode might mess up materials
The issue was originall caused by 2e8ba17 by removing necessery call
GPU_enable_material(). It was probably removed because in some cases
material was enabled after calling setDrawOptions.

That wasn't always a case for edit mode.

This is absolutely to be included to 2.73
2015-01-02 14:28:58 +05:00
4abe548527 cleanup: style 2015-01-02 19:29:00 +11:00
bf169d6ca6 Fix T43066: Joystick broken in GE since 2.73rc
Caused by move to SDL2, fix thanks to jensverwiebe.
2015-01-02 17:14:33 +11:00
fdddd4ed66 Fix same operator (curve.separate) in double in Curve menu.
Reported by Leon Cheung on IRC, thanks.
2015-01-01 15:09:42 +01:00
aab4f2b762 cleanup: redundant casts & const cast correctness 2015-01-01 23:42:28 +11:00
4bdd4aa633 SpaceFile: Cleanup: fix stupid indices in filelist_from_main()
Dead code (currently), but still...
2015-01-01 11:11:37 +01:00
46bce66805 SpaceFile: Tweak thumbnail to avoid restarting the job needlessly. 2015-01-01 11:11:37 +01:00
950f2c84a3 SpaceFile: Refactor sorting and filtering of filelist.
New code shall be more easy to maintain and extend.
Sorting is now handled quite the same as filtering, and all filtering parameters
are now packed into a sub-struct to help extending it later.

Also done some optimizations in filelist refresh, and sorting/filtering area.
Now we should avoid re-sorting and re-filtering too often, also removed
calls to those in read_xxx funcs.

Note thumbnail job is still started basically on each call to `file_refresh()`,
will be addressed in next commit.
2015-01-01 11:11:37 +01:00
d8bb30d87e SpaceFile: Filelist: reorder a bit things, also cleanup some unused and pure-private funcs. 2015-01-01 11:11:37 +01:00
9de54da5a0 Fix T43079: Proxies of 100% size are ignored in sequencer 2015-01-01 15:06:22 +05:00
ec9a137bb2 Fix T43078: Strip custom proxy files did not respect color space settings 2015-01-01 14:52:37 +05:00
c24b694986 Add GPencil Copy/Paste to secondary pie + toolshelf 2015-01-01 12:50:00 +13:00
c0805722ed GPencil Editing: Copy and Paste selected stroke segments with Ctrl-C and Ctrl-V 2015-01-01 12:49:59 +13:00
e9596e5def Cycles: Post-reintegration tweaks to ensure things do compile
This commit contains all the tweaks which were missing in initial patch
re-integration from the standalone Cycles repository.

This commit also contains an utility cmake macro to help linking targets
with different libraries for release/debug builds, the name currently is

  target_link_libraries_decoupled

it gets a target and list of libraries and makes sure debug builds are
using libraries with "_d" suffix.

After all this changes it'll hopefully be easier to interchange patches
between blender and standalone repositories, because they're now quite
identical.
2015-01-01 01:31:08 +05:00
b8fc4fe5aa Cycles: Correction to previous SSE/AVX flags detection
Ensure AVX/AVX2 is not used when Cycles is configured with
WITH_CPU_SSE set to OFF.
2015-01-01 01:31:08 +05:00
93ca68b50c Cycles: Be ready for gflags namespace auto-detect
This way it is now possible to use gflags >= 2.1, where all the
functions were moved from google to gflags namespace.

This isn't currently used in blender, but for standalone repository
this change is essential.
2015-01-01 01:31:08 +05:00
405c0fddb4 CMake: Rework linking strategy a bit
Made it a dedicated macro to link release/debug targets against lib/lib_d
libraries which helps keeping code a bit more clean.

Also made it so MSVC is now happy about building debug Cycles with OSL
support.

Reshuffled code a bit and put some comments about what's going on, which
should make it a bit more clear.
2015-01-01 01:31:08 +05:00
2382c8decd Cycles: Fix compilation error with compilers which doesn't support AVX
For SSE checks still could be decoupled to be able to compile SSE2
kernel and not SSE4 depending on the CPU or so.
2015-01-01 01:31:08 +05:00
3b6b32d6a3 Cycles FTBFS: Send Boost after OIIO to the linker since the order matters 2015-01-01 01:31:08 +05:00
9b8942ac71 Cycles Standalone: Add initial support for compilation on Windows
This applies to an application comiling from the standalone Cycles repository
only.

There's still lack of proper install target, so currently pthreads
library is to be copied next to cycles.exe manually.
2015-01-01 01:31:08 +05:00
9e2e408323 Cycles: Add logging to OSL and CUDA initialization/compilation
This is what was handy troubleshooting issues in the studio,
plus this is exactly the same thing which would be helpful
when solving issues with paths to compiled shaders and cubins
for standalone repository.
2015-01-01 01:31:08 +05:00
bbf12722ed Cycles: Fully support WITH_CYCLES_LOGGING option
This commit generalizes logging module a little bit in making it possible to use
Glog logging in standalone Cycles repository.
2015-01-01 01:31:07 +05:00
f2665d52e2 CMake: Minor cleanup 2015-01-01 01:31:07 +05:00
e0a809fb1d Cycles: Fix compilation error when OIIO is compiled with external PugiXML parser
Basic idea is to check whether OIIO is compiled with embedded PugiXML parser
and if so use PugiXML from OIIO, otherwise find a standalone PugiXML library.
2015-01-01 01:31:07 +05:00
a4c3ca8671 CMake: use pthreads on all os's 2015-01-01 01:31:07 +05:00
b6c175b27a Cycles: Solve linking error caused by missing pthreads library
Not sure why it worked on Debian but didn't work on Arch, could have
been some indirect link dependency or so.

Anyway, we explicitly depends on pthreads, so need to do corresponding
find_package().
2015-01-01 01:31:07 +05:00
4497b6ac84 Cycles: Synchronize changes with standalone repository
This changes were done in original commit of the standalone Cycles repository
and needed here for easier patch synchronization.
2015-01-01 01:31:07 +05:00
7f356c20dc Modify shader for texture coordinates of objects to also match the
rendered result more closely (all three parameters should match now)
2014-12-31 15:48:16 +01:00
59742167ce Just another attempt to make MSVC happy
No idea why standalone libmv remo was all fine with the code..
2014-12-31 19:04:29 +05:00
f31f28c3f4 Corrections to world texture coordinates to match the rendered result
more closely
2014-12-31 15:00:18 +01:00
Dotsnov Valentin
01c187fb93 Gamma node support for Blender Internal
Patch by Blend4Web Team, thanks!

Reviewers: psy-fi

Subscribers: yurikovelenov, AlexKowel, Evgeny_Rodygin

Differential Revision: https://developer.blender.org/D899
2014-12-31 13:36:14 +01:00
a3e832e68b Fix T42984 detail flood fill not respecting mask values for smooth/sharp
curves.

Issue here is that brush curve could return negative values. This would
result in overflow of mask values. Those were not visible during real
time preview because result would be clamped.

We had two functions in the code, one of which allowed negatives but I
don't think that we really want that, users have no control over the
negative values at all anyway.

Thanks to the reporter, Leon Cheung for figuring out the issue :)
2014-12-31 13:11:54 +01:00
bca434de78 Hopefully fix compilation error after recent update 2014-12-31 16:42:40 +05:00
caa2306d16 Libmv: Update to latest upstream version
Main purpose of this is to bring new gflags library which is more likely
to have a fix for undefined order of static variables initialization and
also to bring new glog where some compilation error are fixed (which are
only visible with more strict checks with clang and c++11 enabled).
2014-12-31 16:02:04 +05:00
784517dfb9 Joystick: Suppress add/remove device events
Previously they'll be printed to the console as a totally unknown events
together claim this shouldn't have happened which is just misleading.
2014-12-31 14:56:42 +05:00
f3e7369d48 Compilation error fix for strict flags 2014-12-31 14:50:27 +05:00
f80eb37e21 Remove executable flag from the build configuration files
They're not intended to be executed directly and seems mode change happened
by accident.

Setting -x for this files to avoid possible incidents by trying to run this
files in shell.
2014-12-31 14:05:53 +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
d5f3aee41f Operator to duplicate the active Grease Pencil layer
TODO: this needs a proper "duplicate" icon, without the "ID" label
2014-12-31 14:20:44 +13:00
70b6c82fd3 Fix an odd line that slipped in my ghost_hack_first_file commit 2014-12-30 18:31:37 +01:00
9e950ea661 Fix issue in separate rake control commit:
Mask slot still depended on regular slot to check some capabilities.
Some angle capabilities now only depend on the texture slot, not the
brush, so separate them and use the slot where appropriate.
2014-12-30 18:07:12 +01:00
016bbc8793 Fix T42780: Object linking allows to have linked armatures in pose mode
This isn't so bad for until one goes re-posing the armature and then uses undo.

It is the same issue as with edit mode which was solved back in the days.
2014-12-30 21:33:15 +05:00
cefb764269 PyAPI: geometry.normal, support polygons
Previously this only supported tri/quads,
now arbitrary size poly lines are supported.
2014-12-30 22:49:52 +11: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
68600920ce PyAPI: allow non-vector args for geometry module
Previously only vector args were accepted,
now allow generic sequence of numbers.

Was annoying to create vectors just to pass in args.
2014-12-30 22:05:34 +11:00
d993bad5e7 Fix possible NULL pointer dereference
also remove redundant NULL check
2014-12-30 08:13:15 +11:00
4748e34642 I18n scripts: minor spelling exceptions update. 2014-12-29 21:55:51 +01:00
7778f0ff20 Cycles: Fix MSVC which desn't like condition to be split by preprocessor 2014-12-29 21:10:37 +05:00
fb7ff31315 Fix stupid handling of 'Object.matrix_local' in RNA.
The getter of this matrix (actually, `BKE_object_matrix_local_get()`) was only correct
in case of pure-object parenting, bone parenting and such did not gave valid results.

Also cleaned up a bit setter code, was using as temp storage ob->obmat itself,
which is supposed to be a world matrix!

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D958
2014-12-29 15:26:38 +01:00
c5927cd977 Revert "Fix T42888: Separate and Combine HSV distorts the hue value"
This reverts commit 1549fea999.

After some further discussion with other developers in the team it becomes
clear there's no correct solution here. It is just more matter of what's
more convenient in particular case.

We're just going back to old code to avoid possible frustration with the
older files in newer blenders. This also means all HSV/HSL is considered
to be "linear" in the shading nodes.

Would be ported to 2.73 final.
2014-12-29 18:14:08 +05:00
f392f56397 Small fix for QTCreator project script, by Sybren Stüvel.
Either ./blender-git or ~/blender-git should be used, but not
.~/blender-git. This patch fixes that, by choosing ~/blender-git,
in line with the last CLI argument.
2014-12-29 13:45:05 +01:00
18854a6506 Rotate around selection now will work on last stroke position in texture
paint too.
2014-12-29 12:35:03 +01:00
51a66a5a6e fix for doc generator 2014-12-29 22:16:44 +11:00
427fbc879e Move average stroke from sculpt session to unified paint settings so it
can be reused by other paint systems too.
2014-12-29 11:35:43 +01:00
e0cb67f740 CMake: Add check for whether OIIO has bundled pugixml library
Will become handy when we'll be re-integrating changes from Cycles standalone
repository back to blender.
2014-12-29 15:08:16 +05:00
936604e801 Cleanup: get rid of sculpt minmax and reuse last stroke function (code
did that anyway, just kept the result in an intermediate variable)
2014-12-29 11:01:10 +01:00
4088fad6dd Cycles: Add asserts around BVH stack pushes
This way we're kind of safer to troubleshoot possible stack overflow issues.
2014-12-29 14:02:15 +05:00
40517283ca Cycles: Bump stack size for QBVH traversal code
Traversal now can push up to 2x of nodes to the stack, so need some tweaks
to the stack size.
2014-12-29 13:37:18 +05:00
9c4aba11c9 Cycles: Add some sanity check asserts in the traversal code
This way we'll be sure (in debug builds) that regular BVH traversal is not used
for QBVH tree (could happen because of mismatch of logic in kernel and render).
2014-12-29 13:35:31 +05:00
0a76be81b7 cleanup: redundant call to BKE_object_apply_mat4 2014-12-29 19:34:40 +11:00
ba9453f46f Cycles: Disable QBVH on 32bit systems all together
The reason for this is that we don't sue SSE optimization for 32bit platforms
because of T36316.

Things to look into:

- Nail the root of the issue of that report
- Implement non-SSE traversal code for QBVH
2014-12-29 13:23:44 +05:00
c79c48cc93 Fix T40930: Add a new option to select faces by smooth/flat shading.
Org code by robschia (Roberto Schiavone), first review by campbellbarton (Campbell Barton),
final review and minor changes by mont29 (Bastien Montagne).

Reviewers: cambellbarton, mont29

Subscribers: mont29, campbellbarton

Maniphest Tasks: T40930

Differential Revision: https://developer.blender.org/D638
2014-12-28 19:08:43 +01:00
58ea1639da Cleanup: no need for hacks here, RNA allows for real read-only props, and if you define
a getter func, it won't rely on any DNA member either...
2014-12-28 18:30:33 +01:00
870941c87a Fix leak in cycles-bake 2014-12-28 16:00:08 +11:00
cadcb12292 Fix leak in select-similar regions 2014-12-28 16:00:08 +11:00
9686d3005c Fix buffer overrun calculating unique names 2014-12-28 16:00:08 +11:00
00197a668b BLI_string_utf8: add BLI_strncpy_utf8_rlen 2014-12-28 16:00:08 +11:00
e182d43d3e cleanup: avoid ref-counting None for a new matrix 2014-12-28 15:13:01 +11:00
b11a2f7075 Cycles: Mark visibility TODO as resolved 2014-12-27 23:38:29 +05:00
91bbaaa271 Cycles: Fix visibility check for instanced nodes
The issue is that only instance node contains proper visibility flags,
nodes from instanced BVH are not correct.
2014-12-27 23:33:50 +05:00
2b226d9578 Fix a very stupid memleak in own bpy_app_translations.c code...
Safe for 2.73.
2014-12-27 17:24:39 +01:00
155bb058f4 GPencil UI: Color swatches for both Stroke and Fill colors are now shown
The layers list and the Dopesheet channels now show color swatches for both the
stroke and fill colours now. This is useful when you've got layers that only
use either/or.

* Currently, these only get shown if the relevant opacity setting is high enough
  for that aspect to contribute to the result.

* The sizing of these items could do with some more tweaking (especially in the
  Dopesheet), as these may now be too small to accurately see and/or interact with.

* There are some potential issues when using near-gray (or actually, colours similar
  to the list backgrounds, but that issue exists in other areas of Blender anyway.


(NOTE: At this stage, these changes are still experimental, and not for 2.73 yet)
2014-12-28 03:05:11 +13:00
4ab5883766 Experimental fix for "random large dots" bug when using a stylus
Since I don't have a (pressure sensitive) tablet handy, I can't really test this
out, but apparently there is a bug which currently exists with the following description:
  "Small Dots, when you do just one click a single GP dot is created, it´s fine but don't recognize the pen pressure, always the maximum value of thickness, and
    It´s so easy create dots accidentally (even when you use the eraser, this dots appear spontaneously) and you start to have big screen-size-constant dots beside of you fine lines."

This commit just shuffles around the order of things a bit so that some of the misfiring
events might get skipped instead.
2014-12-28 03:05:10 +13:00
49052c61f8 Restoring all the whitespace! 2014-12-28 03:05:09 +13:00
01c04333f5 Fix T43034: beautify-fill leaves zero area tri's 2014-12-27 16:47:42 +11:00
8d7b2d69cf cleanup: redundant tri-normal calculation 2014-12-27 16:36:31 +11:00
5ea243bbec cleanup: knife tools, use generic sort function 2014-12-27 12:37:11 +11:00
b6aa936a8b Fix typo in angle commit, noticed by Kevin Dietrich, thanks! 2014-12-27 00:10:53 +01:00
eb2e4577f4 Only add a fill brush to default .blend if there isn't one already. For
some reason this happened twice here.

Likely candidate for 2.73 final
2014-12-27 00:08:58 +01:00
c7c10e5e28 Brush Texture Angle Goodies:
This commit includes a few things:

* It moves the Rake and Random flags from the brush to the MTex.
* The first change allows mask textures to have independent rake
support.
* Random rotation now has an angle value that controls the width of the
effect from the rake or default angle
* Rake and Random are now supported together.
2014-12-26 23:51:27 +01:00
e0cf86a9e2 Fix T43010 regression in material setting.
Caused by own fix for another display case.

Shoud be safe for 2.73 final.
2014-12-26 20:06:56 +01:00
julianeisel
fd47202043 GPencil: Picky whitespace cleanup 2014-12-26 20:00:52 +01:00
3253ed9e26 Put editor initialization before python.
Initially it was moved to allow setting keymaps of python defined menus
in C but looks like it breaks macro definition in python.

Thanks to Julian for tracking this down. It should fix T42485
2014-12-26 19:14:01 +01:00
julianeisel
6339ba1ee2 Fix T42977: Weights failed to display in Wireframe mode when using Face Select
D948, reviewed by @mont29 (thanks for that)
2014-12-26 16:53:40 +01:00
julianeisel
da78d2d742 GPencil: Use a different brush cursor for eraser
D783 with minor edits to increase contrast
2014-12-26 16:38:51 +01:00
cf178f71ac Fix T42641, Graphical fragments showing on Blender 2.71 and higher when baking.
Safe for 2.73...

This revert rB9b0ab890676790bb1e8e77797629b889ea66f69e - needed to set that threshold to a small
negative value to remove the last artefacts reported in T39735, but now I could not reproduce
any with the previous 0.0f value, so restoring it for the time being.

If this 'shadowed neighbor face' case re-appears, we can always choose a value in-between, like -1e-18f...
2014-12-26 13:00:36 +01:00
2b595579e3 Fix T43013: Flip with bridge aligned loops 2014-12-26 20:22:21 +11:00
836ea4b70f Fix T43019: Child of objectes used by duplis are visible in Cycles
Seems the parent check didn't go deep enough and only checked single parent.
Now it checks the chain of parents which seems to be correct but requires
much more intense testing.
2014-12-26 13:36:45 +05:00
53ec177b7f optimize interp_weights_poly_v2, v3
use line_point_factor instead of length between vertices.
2014-12-26 08:46:48 +11:00
f84defa9c0 optimize interp_weights_poly_v2, v3
halve sqrtf calls per per polygon corner.
2014-12-26 08:46:48 +11:00
445e50fd1e cleanup: use cross_tri_v2 when area isn't needed. 2014-12-26 08:46:48 +11:00
cd095aae13 Cycles: Distance optimization for QBVH
This commit implements heuristic which allows to skip nodes pushed to the stack
from intersection if distance to them is larger than the distance to the current
intersection.

This should solve speed regression which i didn't notice in the original QBVH
commit (which could have because i had WIP version of this patch applied in my
local branch).

From quick tests speed seems to be much closer to what is was with regular BVH.

There's still some possible code cleanup, but they'll need a bit of assembly
code check and now i want to make it so artists can happily use Cycles over the
holidays.
2014-12-25 22:40:02 +05:00
30e3aa1561 SCons: Don't regenerate icons if not changes
This is rather a handbook example how NOT to do things in SCons, ideally
it should be official SCons target so all the dependencies and source file
modification stops being our worry. Especially since for CMake we already
do have an app to do generate all the data.

I don't have time to clean this up now but this constant icons regeneration
just pisses me off atm.
2014-12-25 19:17:30 +05:00
c1f54bcdcc OSX: revive GHOST_HACK_getFirstFile cause it breaks things on older OSX versions.
Dunno exactly why this was done earlier, but propose not to remove code not understood.
2014-12-25 15:12:56 +01:00
3e034831de Refactor 'immediate search' feature
Currently, code just checks whether a text-edited button uses a given icon (VIEWZOOM) to decide to apply changes on each typed char.

This patch adds a propper button flag (UI_BUT_TEXTEDIT_UPDATE) and a dedicated RNA flag (PROP_TEXTEDIT_UPDATE) for that.
It's also now usable not only for text buttons, but also for example for num buttons when in 'text edit' mode, etc.

It also fixes an actual bug, which is for text properties, in 'immediate' mode, hitting escape would not restore org value, because `ui_apply_but_TEX()` would set its orgstr to NULL on first call (giving it to `but->rename_orig` instead of copying it).

Note no change in behavior is expected from user POV.
Update for addons using that 'VIEWZOOM' icon 'feature' will follow (if any).

Reviewers: campbellbarton

Reviewed By: campbellbarton

Projects: #user_interface, #bf_blender:_next

Differential Revision: https://developer.blender.org/D938
2014-12-25 12:55:29 +01:00
5f3dc592c8 Revert QBVH switch, after discussion with Sergey. 2014-12-25 12:18:51 +01:00
7bb29c5528 Fix T42938: image.save_render sometimes saved the wrong pass
Stupid mistake with non0initialized image user.

Safe for final 2.73 release branch.
2014-12-25 15:45:22 +05:00
9e57babd8d Cycles: Fix really bad bug with shadow rays on non-SSE CPUs
basically shadow rays were totally broken and most of the time did not record
any intersections, leading to really ad rendering artifacts.

This commit makes it so regardless of enabled optimization level render result
would be the same.
2014-12-25 14:30:05 +05:00
fe06ec82a9 Cycles: Workaround CUDA 6.5.16 error after watertight commit
This issue doesn't happen with 6.5.12 and there's slight piece of hope it'll be
fixed in next toolkit releases..

For now we're forcing CUDA to not inline ray precalculation. This could lead to
some speed regression, but wouldn't expect it to be huge -- this code does not
run that often comparing to actual triangle intersection.
2014-12-25 14:15:37 +05:00
010f3ee438 Cycles: Fix compilation error on non-SSE2 architectures 2014-12-25 14:11:37 +05:00
ee36e75b85 Cleanup: Fix Cycles Apache header.
This was already mixed a bit, but the dot belongs there.
2014-12-25 02:50:24 +01:00
4ab821c675 Cleanup: Typo fixes for comments. 2014-12-25 02:42:06 +01:00
6e7c2d2e43 Cycles: Expose QBVH on/off switch to the UI.
We might remove this again in the future, but for testing purposes
during the release cycle, this will be useful.

The setting defaults to QBVH, and can be found in the Performance panel.
2014-12-25 02:19:14 +01:00
deb06c457d Cycles: Correction for node tail copy on packing BVH
This is harmless for now because tail of the node is zero in there, but better
to fix it early so in the case of extending BVH nodes this code doesn't give
issues.
2014-12-25 02:50:49 +05:00
0feba652f7 Cycles: Enable QBVH optimization structure for SSE2 CPUs
This commit enables QBVH optimization structure automatically if rendering
with CPU and SSE2 support is detected.

This brings render time of agent shot back to the speed it used to be before
the watertight intersections commit, single koro and sponza scenes are about
7% faster here.
2014-12-25 02:50:49 +05:00
03f28553ff Cycles: Implement QBVH tree traversal
This commit implements traversal for QBVH tree, which is based on the old loop
code for traversal itself and Embree for node intersection.

This commit also does some changes to the loop inspired by Embree:

- Visibility flags are only checked for primitives.

  Doing visibility check for every node cost quite reasonable amount of time
  and in most cases those checks are true-positive.

  Other idea here would be to do visibility checks for leaf nodes only, but
  this would need to be investigated further.

- For minimum hair width we extend all the nodes' bounding boxes.

  Again doing curve visibility check is quite costly for each of the nodes and
  those checks returns truth for most of the hierarchy anyway.

There are number of possible optimization still, but current state is good
enough in terms it makes rendering faster a little bit after recent watertight
commit.

Currently QBVH is only implemented for CPU with SSE2 support at least. All
other devices would need to be supported later (if that'd make sense from
performance point of view).

The code is enabled for compilation in kernel. but blender wouldn't use it
still.
2014-12-25 02:50:49 +05:00
788fb8321a Cycles: Store proper empty boundbox for missing child nodes in QBVH
The idea is to make sure those childs would never be intersected with a ray
in order to make it so kernel never worries about number of child nodes.
2014-12-25 02:50:49 +05:00
30b12b1b27 Cycles: Code cleanup, de-duplicate definition of FEATURE
Previously every BVH traversal file was defining macro to check which features
should be compiled in, now this macro is defined in the parent header.
2014-12-25 02:50:49 +05:00
0476e2c87a Cycles: Rework BVH functions calls a little bit
Basic idea is to allow multiple implementation per feature-set, meaning this
commit tries to make it easier to hook new algorithms for BVH traversal.
2014-12-25 02:50:49 +05:00
ab8d9c4b88 Cycles: Add some utility functions and structures
Most of them are not currently used but are essential for the further work.

- CPU kernels with SSE2 support will now have sse3b, sse3f and sse3i

- Added templatedversions of min4, max4 which are handy to use with register
  variables.

- Added util_swap function which gets arguments by pointers.
  So hopefully it'll be a portable version of std::swap.
2014-12-25 02:50:49 +05:00
f770bc4757 Cycles: Implement watertight ray/triangle intersection
Using this paper: Sven Woop, Watertight Ray/Triangle Intersection

  http://jcgt.org/published/0002/01/05/paper.pdf

This change is expected to address quite reasonable amount of reports from the
bug tracker, plus it might help reducing the noise in some scenes.

Unfortunately, it's currently about 7% slower than the previous solution with
pre-computed triangle plane equations, but maybe with some smart tweaks to the
code (tests reshuffle, using SIMD in a nice way or so) we can avoid the speed
regression.

But perhaps smartest thing to do here would be to change single triangle / ray
intersection with multiple triangles / ray intersections. That's how Embree does
this and it's watertight single ray intersection is not any faster that this.

Currently only triangle intersection is modified accordingly to the paper, in
the future we would also want to modify the node / ray intersection.

Reviewers: brecht, juicyfruit

Subscribers: dingto, ton

Differential Revision: https://developer.blender.org/D819
2014-12-25 02:50:49 +05:00
57d235d9f4 Cycles: Optimize storage of QBVH node by one float4
The idea is to store visibility flags for leaf nodes only since visibility check
for inner nodes costs too much for QBVH hence it is not optimal to perform.

Leaf QBVH nodes have plenty of space to store all sort of flags, so we can make
nodes one element smaller, saving noticeable amount of memory.
2014-12-25 02:50:49 +05:00
a888b8beaf Cycles; Code cleanup, make it more obvious what #endif belongs to 2014-12-25 02:50:49 +05:00
144096faad Cycles: Make it more clear offsets in BVH construction
Previously offsets were calculated based on the BVH node size,
which is wrong and real PITA in cases when some extra data is
to be added into (or removed from) the node.

Now use offsets which are not calculated form the node size.
2014-12-25 02:50:49 +05:00
f27d87d300 Cycles: Replace magic constant in the code with actual node size 2014-12-25 02:50:49 +05:00
f4a959f734 Cycles: Avoid over-allocation in packing BVH instances
This solves quite an over-allocation in BVH instances packing code,
unfortunately, it's not a magic bullet to solve memory bump caused
by the recent QBVH changes.

For that we'll likely need to decouple storage for leaf and inner
nodes. However, it's not really clear for now if it's something
important since that'd still be just a fraction of memory comparing
to all the hi-res textures.
2014-12-25 02:50:49 +05:00
8cfac731a5 Cycles: Implement refit_nodes for QBVH
Title says it all, quite straightforward implementation.

Would only mention that there's a bit of code duplication around packing node
into pack.nodes. Trying to de-duplicate it ends up in quite hairy code (like
functions with loads of arguments some of which could be NULL in certain
circumstances etc..). Leaving solving this duplication for later.
2014-12-25 02:50:49 +05:00
fe4905288d Cycles: Use proper node counter to allocate QBVH nodes
Before all the nodes were counted and allocated, leading to situations when
bunch of allocated memory is not used because reasonable amount of nodes are
simply ignored.
2014-12-25 02:50:49 +05:00
345ed4dd10 Cycles: Don't do node visibility check in subsurface and volume traversal
Visibility flags are set to all visibility anyway, So there was no reason
to perform that test.

TODO: We need to investigate if having primitive intersection functions
which doesn't do visibility check gives any speedup here as well.
2014-12-25 02:50:49 +05:00
f4df3ec05a Cycles: Move triangle intersection functions into own file
This way extending intersection routines with some pre-calculation step wouldn't
explode the single file size, hopefully keeping them all in a nice maintainable
state.
2014-12-25 02:50:48 +05:00
43421e9c53 Cycles: Optimize vector math node without links to single values. 2014-12-24 22:45:08 +01:00
julianeisel
76b4fad6db Fix T42879: File Browser - disable selecting ".." entry (Parent Directory) 2014-12-24 19:51:42 +01:00
julianeisel
703bb0f62d Ref T42873: Print "Camera Pano" for panoramic camera view onto viewport 2014-12-24 19:35:12 +01:00
9d230298f1 Master branch is now alpha cycle of 2.74 release 2014-12-24 20:33:14 +05:00
607c45ae6b Fix T42997: Support RGBA output for HuffYUV
More like a feature request but was simple to support.
2014-12-24 18:54:38 +05:00
0fcf9b2672 Fix rna paint update callbacks assuming meshes 2014-12-24 14:51:35 +11:00
273fa0a4ef Blender 2.73 release candidate commit
This commit contains:

- Subversion bump to 2.73
- Release cycle is set to "rc"
- Submodules are pointed to appropriate tag now
  (addons contrib just points to the latest contrib repo)
- New shiny splash screen!
2014-12-23 20:42:01 +05:00
e483a21ce6 Fix T42994: Own recent regression in fix for T42945 (rB5cc199e49581),
side/front/top ortho views would no more adapt their snapping unit to zoom factor.

This code would need slightly more refactor actually, but this will be for after release!
2014-12-23 16:12:17 +01:00
20aed660f5 Add missing keymap for paint curve 2014-12-23 20:01:47 +11:00
35f153cdc3 Fix T42928: Drag-drop of generated files to compo reloads them, loosing edits
Origins of this issue goes back to T33402, where compo wasn't sure what kind
of image it is working with (compo should know if it's multilayer or regular
image).

Now we only reload images when dar-dropping from outside of blender.
2014-12-23 10:56:30 +05:00
646a96bf8e Fix T42952: Curve modifier not taken into account when curve is created from mesh
Curve and array modifiers requires curve path to be evaluated, dependency graph
will make sure that curve eval would create such a path, but if curve was already
evaluated we might miss path.

So what we do now is: if path was not calculated for target curve we tag it for
update.
2014-12-22 19:05:56 +05:00
f78490182e partial revert ab6417aa9f was too strict 2014-12-22 13:26:35 +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
abf39fa31f Quick fix for UI themes, by meta-androcto (Brendon Murphy), thanks. 2014-12-22 09:57:56 +01:00
cd4fedb285 Fix T42966: Py_Initialize: Unable to get the locale encoding
This only happened for SCons builds and caused by pure human stupidnes.
2014-12-22 13:43:23 +05:00
julianeisel
59a0c11ecc GPencil: Correction to rB071ec918f4cd
* correct API convention: in rB071ec918f4cd gp_draw_data drew mulitple data blocks, I added gp_draw_data_all which now calles gp_draw_data multiple times (if needed). This follows our normal convention, e.g. see UI_panel_category_draw_all
* Draw scene data first, users may expect it like this

Points raised by @aligorith, thanks for this!
2014-12-21 15:48:30 +01:00
1fe7b84c73 Fix T42973: Render viewport not updating when switching materials in Outliner
For now, do as RNA material update functions - tag object for update too.
2014-12-21 12:40:02 +01:00
julianeisel
071ec918f4 Fix T42961: GPencil - Refactor object/scene data behaviour
D937 with minor edits (whitespace only)

@aligorith, I double checked everything runs smoothly, blame me if I missed something ;). Sorry for just taking the initiative and committing without talking to you, but I wasn't able to catch you the last days. This should be fixed before the release IMHO, but I don't think it's important enough to be committed during BCon5, so sorry again, but hopefully everything is okay :)
2014-12-20 16:18:18 +01:00
c2e56a5267 RNA Object.matrix_local: Add a big warning this matrix is only relative to parent object.
So 'advanced' parenting like e.g. bones or vertices need further processing
to get a real parent-relative matrix...
2014-12-20 14:16:06 +01:00
296a92f5f3 Fix T42972: fcurve lasso select crash 2014-12-20 13:48:36 +01:00
93c4ba7b70 Force phony targets to build (even if file exists)
This is a convenience makefile only,
files if they exist by accident shouldn't ever be used.
2014-12-20 02:15:14 +01:00
7a04c7f6d0 Ensure no integer overflow happens in SuperLU solver on memory allocation
x
2014-12-20 00:23:42 +05: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
3b639b8b3d Minor cleanup to previous commit 2014-12-19 14:43:29 +01:00
1fd375fd30 Merge branch 'master' into gooseberry 2014-12-19 13:37:38 +01:00
3e0ff35b4b Fix for bad file name string matching in point caches, leading to
deletion of baked caches.

This happens when objects use file names with matching prefixes:

"CubeX"   -> not baked
"CubeXYZ" -> baked

The first objects cache should be discarded up to the current frame on
file load, but the second should be left intact. But because the cache
file names for both use the same prefix as well (based on hex name
representation) they both match the "CubeX" name and get discarded.
Adding the underscore terminator solves this issue, because it is never
part of the hex file name string.

WARNING: this solution does not work with custom names for point caches.
This feature is pretty much broken, users have to ensure their names
are unique themselves. Due to the possibility of underscores in names
and the ambiguity of point cache suffixes there is no reliable way to
encode filenames in that case.
2014-12-19 13:34:50 +01:00
ef5c036d1c Fix T42543 projection painting fails when faces are perpendicular to screen.
This is UV barycentric interpolation failing for triangles where vertices are
colinear in screen space. To fix this, we detect this early on so we do the
interpolation on edges instead of triangles.

Such triangles will never be painted on unless we have occlusion and culling
off (since, arguably they are self occluded and almost back-facing).

The code still does not fill the whole area but this can be checked separately.
2014-12-19 12:27:29 +01:00
76ccc1d26b Fix reversed args in function call (float, bool vs. bool, float).
Note 'same' values are kept for now, even though it was probably meant the
other way around, it's safer to keep current behavior for now.
2014-12-19 10:15:10 +01:00
5cc199e495 Fix T42945: rv3d->gridview was not set correctly in view3d_draw_objects.
This fixes both transform snapping in persp views, and 'snap cursor to grid' feature.

Was only really visible with Imperial units.
2014-12-19 10:09:17 +01:00
5e67779d80 Code cleanup: include directory for scons
This directory does not exist even.
2014-12-19 13:43:52 +05:00
27b58f0eb2 Fix mathutils docstring typos. 2014-12-19 00:43:41 +09:00
de0b9f34d7 Flood fill in projection painting does not do bounds checking anymore.
It should now fill the whole mesh with color even if parts of it are
outside the screen - still need to be in fron of the camera though.

Thanks @Campbell for the trick :)
2014-12-18 16:28:43 +01:00
85f6fc501c Fix T42943: Crash with multiple calls to rna_info.BuildRNAInfo()
Thanks to @nesse for the fix
2014-12-18 14:31:33 +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
f0f1c7995b PyAPI: disallow assigning members to 'bpy.ops' 2014-12-18 13:52:31 +01:00
9f61350a05 Sequener: Move waveform-draw option into view menu
also simplify preview/sequencer checks
2014-12-18 13:47:40 +01:00
d4aaa4f9b6 cleanup: use const for smallhash & minor edits 2014-12-18 13:12:25 +01:00
c1eec5582a Fix/workaround T42944: Crash adding a shortcut in properties space 2014-12-18 12:49:48 +01:00
8627d65951 Correction to previous render border commit
Was using wrong bitfield check.
2014-12-18 14:43:08 +05:00
20006e4a67 Cycles: Do some logging when motion is detected in the scene 2014-12-18 14:40:14 +05:00
2bdd44c87a Correction to set border from render image view
It did not fully support cases when setting border from a cropped render result
and it's not totally clear how it should behave. So for now just do nothing and
inform users about this.
2014-12-18 13:24:21 +05:00
0c5eb88451 Quiet warning (harmless) 2014-12-18 02:15:42 +01:00
0ae4d7d405 Fix for GPU_materials_free accessing NULL pointer 2014-12-18 02:14:51 +01:00
3da1a75b74 correct recent cleanup for id-property types 2014-12-18 02:06:57 +01:00
b3b9e08423 Sequencer: Select sideof failed for strips touching the playhead 2014-12-17 23:11:41 +01:00
3820d44979 Cycles: Add missing entries in the Integrator constructor and some updates
to the XML API.

(Changes from the standalone repo)
2014-12-17 22:28:33 +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
cd4d5dcb46 Fix T42932: Drag&Drop of groups from the outliner was using undefined
event->mval.

Calculating from event->x/y like object drag/drop does works. Also fixed
a missing notifier of the object instancing operator.
2014-12-17 13:50:31 +01:00
ad23e225c9 Merge branch 'master' into wiggly-widgets 2014-12-17 12:00:00 +01:00
a56e31c89c Fix triangulating concave quads
Resulting triangles could be pointing in opposing directions.
2014-12-17 11:34:16 +01:00
dc2617130b Fix: Never write previews for undo steps.
This may eat quite q bit of mem in the end (though nothing critical),
and icons (material ones e.g.) often ended up out of sync after undo.
2014-12-17 10:23:34 +01:00
b04d2f99f2 Fix T42927: Triangulate-beauty fails on quads
Regressions since 2.69.
2014-12-17 10:09:47 +01:00
15bde0dbea Docs: comments (hash table & beauty fill) 2014-12-17 09:58:23 +01:00
3e61478b1b Fix T42917 shadow maps not working on ATIs.
This is yet another issue with framebuffers. There are two issues: We
need the framebuffer fully bound to check for completeness and when we
bind a depth texture as frame buffer we need to disable read/write.
2014-12-16 21:52:55 +01:00
1b2fc74792 Fix typo in VBO 2014-12-16 20:20:41 +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
72330b97a2 Fix nasty typo in CPP RNA that would break on int or bool dynarrays... 2014-12-16 16:57:41 +01:00
1549fea999 Fix T42888: Separate and Combine HSV distorts the hue value
These nodes were assuming sRGB input/output which is for sure wrong for the
shader pipeline which works in the linear space.

So now conversion to/from linear space happens in these nodes which makes them
making sence in the shader context but which might change look and feel of
existing scenes.
2014-12-16 20:06:25 +05:00
137f557246 Remove NULL checking variable after using it. 2014-12-16 12:09:33 +01:00
72341537e8 Fix T42864: Knife-project fails with 'cut-through'
Removing edge-hit-doubles could incorrectly de-duplicate intersections between different edges.

Gave noticeable errors cutting through geometry that overlapped exactly.
2014-12-15 21:17:10 +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
76f50cd17a Fix for clip proxies builder reloading original footage frames
This isn't needed if the source is the image sequence.
2014-12-15 22:20:06 +05: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
f51b583ea0 Improve tip for simple deform origin 2014-12-15 16:10:17 +01:00
db0e2e7347 Fix T42864 (partial): knife-project included uncut backfaces
When knife-project ran with cut-through disabled,
it would still try to select faces behind the cut.

Now check if the faces are obscured.
2014-12-15 15:10:49 +01:00
2329b58fd3 Fix T42864 (partial): Knife-project had too-low precision 2014-12-15 15:10:49 +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
090ab750b3 Fix missing UI ID messages and/or I18N contexts for MovieClip/Mask/Palette/PaintCurve ID types. 2014-12-15 11:53:35 +01:00
c167ac1556 Tracking: Fix wrong logic in tracks synchronization
There was some stupidness in the way how tracks are synchronized from the job
to actual DNA data leading to all sort of weird and wonderful failures again.
2014-12-15 14:39:59 +05:00
06ea819c0d Tracking: Avoid possible treading issue reading the frame to sync 2014-12-15 14:34:47 +05:00
ca25fe98fc Tracking: Fix possible race condition accessing the tracks
Writing to the tracks was already inside the lock section, but
reading was not. This could have lead to race condition leading
to all sorts of weird and wonderful artifacts.
2014-12-15 14:31:19 +05:00
Severin
ae6f62c4e2 IME fix: Quit two assert failures
We could now also remove the win->ime_data assert in wm_window_IME_end,
but think it's better to leave it for further development.
2014-12-14 18:51:14 +01:00
c1d3532d2c Fix for idproperty comparison
comparing arrays had flipped logic
2014-12-14 18:24:13 +01:00
17253bec06 Fix T42892: UV pixel snap with negative values 2014-12-14 12:36:32 +01:00
9c81833430 Fix T42885: We still had a few wrong doc in mathutils about methods returning
instance of self while actually returning None...
2014-12-13 14:07:46 +01:00
d6beaad01c Fix T42875 GLSL display not correct in vertex array mode.
GLSL used a global variable to store the enabled vertex attributes which
were not set for vertex arrays after the VBO refactor.
2014-12-12 17:59:06 +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
28a0e1dae5 Fix T42883: ID-Prop arrays longer than 'shot' fail 2014-12-12 16:25:32 +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
fbd25174d1 Amend to previous 'append warning' commit.
Actually, append/link *is* converted/updated, issue here is IPO-to-FCurves
code is not called from our do_version code, but later, directly from BKE_blender's
setup_app_data. This is bad but not easily fixed it seems, so for now
keep a warning in this case.

thanks Sergey for the headup.
2014-12-12 12:38:54 +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
a6343696c1 Fix T42882: Now warn user when trying to append/link from older blender files.
Since we do not make any conversion in this case, worth warning user about
potential issues!
2014-12-12 12:13:30 +01:00
cea086dd97 cleanup: disallow NULL arg to uvedit_aspect
also some typo's
2014-12-12 11:18:03 +01:00
19eb700fef Fix blenderplayer compilation (tm) 2014-12-11 20:34:53 +01:00
f1ddf99580 Fix T42859 smart UV unwrap does not support aspect correction.
Can be considered TODO but it's not bad to support either. Also added
RNA api to get aspect ratio of assigned UV image - returns aspect
corrected image dimensions so needs adjustments for uv editing.
2014-12-11 19:46:35 +01:00
472abc4669 Merge branch 'master' into gooseberry 2014-12-11 14:43:37 +01:00
2309def874 Fix crash when changing worlds with world background active.
Freeing the preview will free the original gpu material so NULL that out
on copy.
2014-12-11 14:43:15 +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
754bdbe4b4 Cycles: Fix more wrong usages of RNA_id_pointer_create
Title says it all, just be more careful in the future.
2014-12-11 17:11:23 +05:00
cb7cf523e5 Fix T42829: Cycles crash rendering when file is saved to specific location
The issue was caused by the way how RNA pointer was created for the bMain:
namely Cycles was using RNA_id_pointer_create to create the pointer, which
would then try to refine the poniter based on the ID type.

This is just wrong and worked so far just because of co-incident, with the
file path from the bug report first letters in the ID name happened to be
NT which corresponds to NodeTree, and for sure refining such pointer will
fail.

Simple solution -- use proper way to create RNA pointer for non-ID block.
2014-12-11 16:55:10 +05:00
1999b5a814 Fix ping-pong actions when using the Action Actuator. 2014-12-11 00:05:11 -08:00
2617d37034 Libmv: Reshuffle CMake and SCons configuration files
The main idea is to share as much code between cases when feature-full built
is done and only logging is needed, so all the defines and include directories
are guaranteed to be the same.

This would hopefully make it so MinGW compilation is all happy about Cycles
logging for both CMake and SCons.
2014-12-11 11:58:03 +05:00
julianeisel
c71c7f0e0b Correction for non-Windows SCons compiling fix after IME Merge
As discussed in rB983c71931b1886d4, we should print a warning in case of building on non-Windows and WITH_BF_IME enabled. We also terminate build in this case, so the warning isn't scrolled away. Was worked out together with @sergey.
2014-12-11 00:22:17 +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
1e02a5ff43 Fix for object_utils.object_data_add: Now supports None obdata for
creating empties.

The documentation says None is a valid argument for obdata (making
empties), but this would cause an exception. Now obdata is only used
when it is defined. An optional name argument can be passed to override
obdata.name as well.
2014-12-10 17:22:26 +01:00
d7e4944e5b UI: add Shift-Drag to multiselect expanded enum items too.
Differential Revision: https://developer.blender.org/D928
2014-12-10 17:04:36 +01:00
aaa02bd490 startup.blend, update movie-tracking layout T41660
Layout by @sebastian_k, now includes 3D view.
2014-12-10 16:49:00 +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
bce0dc8cf7 cleanup: comment unused defines 2014-12-10 15:55:40 +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
d9ddc99a27 Fix T42184: Normal not displayed correctly in Material Viewport
There was a differences between how Cycles and BI treats Normal shader:

- Different normal direction assumption
- Different policy about vector normalization

Previous idea of trying to use single function and flip the output if
needed becomes more tricky, so i've just added new GLSL function which
corresponds to how Cycles deals with the Normal shader.
2014-12-10 19:12:54 +05:00
d68521df7b Cycles: Fix difference between SVM and OSL implementation of Normal node
SVM was normalizing the input normal, OSL did not. This lead to render
result differences across this shading systems.
2014-12-10 19:07:50 +05:00
668ffcd6e9 Fix for wrong flip of Normal node Dot output for new shading system
It was wrong to use invert(), we need to multiply by -1 instead.
2014-12-10 18:50:30 +05:00
01bda15832 Fix T42472: Undoing/Redoing repeated transform operator gives wrong final matrix on objects with no geom data.
This hack should not be needed here, quoting Sergey, the actual issue comes from BKE_object_handle_update_ex,
which is calling BKE_object_where_is_calc_ex when it shouldn't.

Propper fix is depsgraph refactor topic, though.
2014-12-10 13:57:16 +01:00
7366283c01 Fix T42818: Cycles SSS passes are incorrect for SSS size of 0
This was caused by some internal optimization which evaluated SSS with
size of zero as BSDF but used different ID so the evaluation result
didn't appear in regular diffuse pass.

This lead to situation when SSS data was nowhere stored if the
size was zero.

Now SSS with zero size and close-to-zero sizes will be handled in the
same way from the passes point of view.
2014-12-10 17:28:44 +05: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
602250d9fe Fix T42748: Crash in subsurf, threaded access
Allocating the iterator from a BLI_memarena wasn't threadsafe.
Change the API to use stack memory for iterators.

Thanks to @mont29 for finding exact cause of the bug.
2014-12-10 11:16:42 +01:00
47788b5e68 Switch to numpy 1.9 for windows platform 2014-12-10 13:50:51 +05:00
1807dcf619 Fix numpy installation on windows+cmake
The was caused by numpy never unpackign because of no
dpependnecy of any targets from the unpacked numpy.

Tried making it so blender target dpeends on it, but for
some reason it didn't work. For now added dedicated target
for unpacked numpy. A bit dirty but much better than just
totally failing.
2014-12-10 13:45:45 +05:00
8555595d17 Fixes for compilation with msvc
MSVC doesn't like caling macro argument f when using float values
in the macro, it simply replaces the f in the float value with the
argument..

CMake compilation still fails because of 77785ce708, numpy is never
getting unpacked.
2014-12-10 13:39:24 +05:00
9783d9297c cleanup: pep8 2014-12-09 21:49:46 +01:00
117a7e3545 Sequencer: optionally show strip offsets
was disabled in recent sequencer refactor, enable with view menu option.
2014-12-09 21:42:25 +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
17f0a01a56 Correct last commit checking knife edges 2014-12-09 20:57:37 +01:00
e77b25fabb Cycles: Code cleanup, typo 2014-12-10 00:08:33 +05:00
6fb1e1680b Knife: cuts along existing edges are now selected
This means cuts along existing edges don't have gaps in the selection.

Fixes T42616
2014-12-09 19:51:08 +01:00
2efc3211ab Knife: rename vert & edge 'draw' to 'is_cut'
More logical for checking if the edge is a cut into the mesh.
2014-12-09 17:24:19 +01:00
4d9f2f7e86 Knife: fix edge aligned cuts, could add redundant verts 2014-12-09 17:23:10 +01:00
d5abe8419d Smallhash: add support for iterating value pointers
also add reinsert function
2014-12-09 17:18:05 +01:00
6496051251 Merge branch 'master' into gooseberry 2014-12-09 16:55:38 +01:00
233c650d55 Gooseberry request, circle select for graph editor 2014-12-09 16:54:15 +01:00
491839b3c8 Fix T42857: Inconsistency between cache line visibility and ability to change frame from image space 2014-12-09 20:34:28 +05:00
781db5f8a6 Knife: test if an edge is on the face boundary
Was checking if an edges midpoint was inside the face,
giving random results (point-inside for an edge location).
2014-12-09 15:57:59 +01:00
171a6bb5dc Fix T42488: Knife (selected_only + occlude) failed 2014-12-09 15:51:58 +01:00
8fe336ce7e Fix T4284: Drawing modified curves crashes 2014-12-09 14:38:32 +01:00
ebee593f26 Fix bug reported by kopias on irc, crash when attempting to set canvas
with a non-mesh object selected
2014-12-09 14:36:24 +01:00
59f1585d02 Fix T42175: Modifiers don't render in sculpt mode using multires
Modifier stack should ignore sculpt restrictions when creating derived render.
2014-12-09 17:21:02 +05:00
a5c3de2e49 Fix T42630: Triangulate returns invalid face-map
Triangulate with beautify caused a bug when there were existing edges
could make the bmesh-operator return an invalid face-map.

Now the beauty is calculated on the 2d-tri's resulting from polyfill,
its simpler and faster.
2014-12-09 13:08:28 +01:00
6076bedec0 Cleanup: remove scanfill define for polyfill code
also rename vars which were previously used for scanfill.
2014-12-09 12:19:26 +01:00
83cbcefac8 Add edgehash remove, clear functions, Heap clear
Edgehash was missing removal functions (remove, popkey, clear),
since it wasn't needed so far, but is based on same code as ghash which has them.

also add heap clear() method so we can reuse heaps.

(needed for upcoming fix).
2014-12-09 00:32:20 +01:00
55812e3acd Cleanup: simplify heap popmin 2014-12-09 00:13:35 +01:00
03760fed0d Cleanup: remove unused pointer in Heap 2014-12-09 00:02:50 +01:00
ab6417aa9f Fix Mesh Objects with missing textures or wrong texture path now import without texture 2014-12-08 19:57:50 +01:00
8545fb516e Fix T42824: Proxy bone custom-shape lost on undo 2014-12-08 16:46:42 +01:00
252bfc6f65 Fix T42838: Make dupli's real use_hierarchy fails
Regression since the dupli-object refactor.
2014-12-08 16:15:53 +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
7b6c9d23cf Cycles: Fix compilation error with MinGW and logging enabled 2014-12-08 19:37:41 +05: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
c07f6c02b3 Docs: reference the new manual 2014-12-08 11:18:58 +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
3e7e97f127 BMesh: ensure iterator macros assign to valid types
note, this is for C++ code which expects a cast, (will be added later)
also add a macro for nop-expressions (EXPR_NOP),
when we never want an expression to be evaluated, but it should still be valid.
2014-12-08 10:54:56 +01:00
690345a826 Cleanup: spelling 2014-12-08 09:46:21 +01:00
7ba2b37a8a Cleanup: remove unused operator-type member 2014-12-08 09:45:47 +01:00
julianeisel
b88e700df4 Cleanup: Minor edits to widget emboss code
* Rename "emboss" to "widget_emboss"
* Remove duplicated UI_GetThemeColor4ubv function

I made sure version bump and Save User Settings are working correctly ;P
2014-12-08 00:38:36 +01:00
julianeisel
983c71931b Fix non-Windows SCons compiling error after IME merge 2014-12-07 23:57:51 +01:00
Severin
12e5a32557 Forgot to add new files in recent IME commit
Sorry, my bad :/
2014-12-07 18:23:02 +01:00
fe4d0c234e Bugfix T42774: BSurface addon doesn't work on new builds
It turns out that several important modelling addons depend on the assumption
that Grease Pencil data gets created on the active object instead of on scene
level. This commit adds a toggle for setting whether new Grease Pencil data
is created on scene or object level.

These work as follows:
* "Scene" = The behaviour originally introduced as part of the GPencil_EditStrokes
  changes. New strokes are added to the scene instead of the active object, making
  it easier to manage things when working with Grease Pencil in general.
* "Object" = The previous behaviour (from 2.50 to 2.72), where new strokes are added
  to the active object. This is now being reintroduced to soften the transition
  for addons out there which have been doing this in a lazy/lax way so far.


Now, what may be slightly confusing are the "fallback" measures in place:
* "Scene" - To ensure that loading old files goes ok without needing a version patch,
   if the active object has GPencil data, that will be used in place of the scene's
   own GPencil data.
* "Object" - If there was no active object at the time of creating strokes
  (for instance, if you delete the active object immediately before drawing),
  GPencil data gets attached to the current scene instead.

Since some tweaks may still be needed here, I've decided to bump the subversion
number so that we have a reference point when doing version patches.
2014-12-08 02:42:45 +13:00
e67fd7a2cb Correct defines for binreloc
After recent moving path functions to appdir.c

patch T42826: by ldo (Lawrence D'Oliveiro)
2014-12-07 13:53:42 +01:00
Severin
e81d077c85 Input Method Editor (IME) support for text buttons
Original patch by @random (D765) with some minor work done by @campbell
and me.

At this place, I'd like call out a number of people who were involved and
deserve a big "Thank you!":
* At the first place @randon who developed and submitted the patch
* The Blendercn community which helped a lot with testing - espacially
* @yuzukyo, @leon_cheung and @kjym3
* @campbellbarton, @mont29 and @sergey for their help and advises during
* review
* @ton who realized the importance of this early on and asked me for
* reviewing

We are still not finished, as this is only the first part of the
implementaion, but there's more to come!
2014-12-07 00:58:17 +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
06515475b9 CMake: remove redundant include dir 2014-12-06 13:39:46 +01:00
81ae71fcd3 Fix crash in RE_AcquiredResultGet32 on debug builds introduced yesterday 2014-12-06 12:30:59 +01:00
6e8a8a72a3 OSX: change previous commit to not only make animation-player window frontmost but whole process 2014-12-06 12:13:28 +01:00
036f4e7a38 Cleanup: style from my previous commit 2014-12-06 03:48:41 -05:00
c077f5fa08 Fix T42789: support 3Dconnexion wireless devices
SpaceMouse Wireless
SpaceMouse Pro Wireless

Device info is from user reports. I don’t yet have the new devices, so
these are untested but likely to work :D
2014-12-06 02:48:51 -05:00
c8995ecc83 Fix inbetween mousemove event getting detected in hotkey buttons. 2014-12-06 02:28:05 +01:00
871cf70144 Fix playercompile after ecc03c8ed 2014-12-05 18:51:19 +01:00
825d6adef5 OSX: make sure window of new blender instance is front when playing animation 2014-12-05 18:42:10 +01:00
0493879401 Cycles: Report error via the new engine API
This way CUDA errors are visible in the image info line,
which makes things to behave the same across viewport and
final rendering.

That's right, we've got error reported via reports and info
line now. This is based on the feedback from our gooseberry
team.
2014-12-05 22:15:09 +05:00
ecc03c8ed0 Render API: Add RenderEngine.error_set() function
This function sets an error message which would be displayed after
rendering is over and info space lost the link to the engine.
2014-12-05 22:15:05 +05:00
2b4eeb79cd Cycles: Report error to the blender using report API
This way when something goes wrong in Cycles (for example out of VRAM, timelimit
launching the kernel etc) we'll have a nice report in the Info space header.

Sure it'll be nice to have mention of error in the image editor's information
line, but that's for the future.

This fixes T42747: "CUDA error" appears only momentarily, then disappears
2014-12-05 22:15:04 +05:00
bd0b9ed0c0 Cycles: Add dedicated Progress::set_error() call
Currently it acts the same as set_cancel(), but this way we're able to
distinguish situations when rendering was aborted by user demand (for
example pressing Esc in standalone renderer) or if something went horribly
wrong (for example out of VRAM error).
2014-12-05 22:15:04 +05:00
716890e864 Cycles: Early output from Scene::device_update when device error occurs
This way for example we wouldn't wait a fortune while BVH is building after
GPU run out of memory when loading images just to see the render failure
message.
2014-12-05 22:15:04 +05:00
0b67102bd6 Cycles: Code cleanup, whitespace 2014-12-05 22:15:04 +05: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
e1e984e437 Fix T42807, variance shadow map broken afterFBO changes.
This code was a bit do-it-yourself instead of relying on the API. Should
be OK now.
2014-12-05 16:01:18 +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
e54d571176 Amendment to previous commit: Add an option to scene strips to disable GPencil
On second thought, it is probably still worthwhile to be able to disable GPencil
drawing on strips. By default, GPencil strokes are still shown by default now,
but they can be turned off using this option if it turns out that they are
getting in the way (e.g. a director/animator make some planning notes in the shot
at an earlier stage which are hidden for normal display now, but are still there
popping up sproadically during the animatic).
2014-12-05 16:39:49 +13:00
3673a03226 Grease Pencil sketches get included when doing OpenGL previews for scene strips in sequencer
After double checking the sequencer code, there doesn't seem to be any reason to
exclude these from the sequencer previews. This makes it possible to use the
sequencer to non-destructively chain together difference Grease Pencil animated
shots together without having to render each image sequence first, allowing for
a smoother workflow.

Just in case the initial assumption isn't entirely correct, I've put in place
an extra arg to the relevant functions which can be hooked up to a suitable
option on the scene strip later to turn this on/off as needed.
2014-12-05 15:47:23 +13:00
844909b294 Fix for typo + memory leak 2014-12-05 14:15:46 +13:00
e93990dfc5 Bugfix T42697: Hiding/unhiding NLA strip doesn't update the 3D Viewport
The Toggle Muting operator was missing code to tag the animation to get recalculated.

This was also missing from a few other operators too, including Snap, and
Add/Paste FModifiers .
2014-12-05 14:14:50 +13:00
abab4f19e6 Fix scons+mingw64 compiling - Ensure WITH_BF_CYCLES_LOGGING is defined and turned off 2014-12-05 13:13:34 +13:00
030b694c7a To make Strokes Edit Mode a bit more "solid", Tab key can be used to toggle out of it 2014-12-05 12:12:03 +13:00
d87ff752af Selectmouse-drag now works to move GPencil verts 2014-12-05 12:12:03 +13:00
cf7bdb42ac BGE VideoTexture: refresh() on ImageFFmpeg should have no effect.
ImageFFmpeg objects will not refresh properly because the image
file is closed immediately after creation. Therefore refresh()
should have no effect on them.
This was causing problems with ImageMix using ImageFFmpeg as
sources: refreshing the ImageMix object is required to update
the mix but it has the side effect of refreshing the underlying
sources, hence the need to skip refresh on fixed images.
2014-12-04 23:55:53 +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
2556 changed files with 195747 additions and 59589 deletions

View File

@@ -197,10 +197,10 @@ option(WITH_PYTHON "Enable Embedded Python API (only disable for develop
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.
set(WITH_PYTHON_SECURITY ON CACHE BOOL "ON" FORCE) # temp force on.
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
mark_as_advanced(WITH_PYTHON_SAFETY)
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development), installs to PYTHON_SITE_PACKAGES (or CMAKE_INSTALL_PREFIX if WITH_INSTALL_PORTABLE is enabled)." OFF)
if(APPLE)
option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
endif()
@@ -260,6 +260,10 @@ endif()
# (unix defaults to System OpenJPEG On)
option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" OFF)
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
endif()
# Modifiers
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
@@ -270,6 +274,10 @@ option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
# mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF)
# Alembic
option(WITH_ALEMBIC "Enable Alembic Support" OFF)
option(WITH_HDF5 "Enable HDF5 Support for Alembic" OFF)
# Image format support
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON)
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ${_init_IMAGE_OPENEXR})
@@ -308,6 +316,9 @@ endif()
# Compression
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_LZO "Use the system LZO library" OFF)
endif()
# Camera/motion tracking
option(WITH_LIBMV "Enable libmv structure from motion library" ON)
@@ -318,8 +329,8 @@ mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
# Misc
if (WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME)" ON)
if(WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
endif()
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF})
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
@@ -351,7 +362,7 @@ option(WITH_CYCLES_STANDALONE "Build cycles standalone application" OFF)
option(WITH_CYCLES_STANDALONE_GUI "Build cycles standalone with GUI" OFF)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL})
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 CACHE STRING "CUDA architectures to build binaries for")
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 sm_52 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build cycles with logging support" ON)
@@ -369,7 +380,7 @@ endif()
mark_as_advanced(LLVM_STATIC)
# disable for now, but plan to support on all platforms eventually
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" ON)
mark_as_advanced(WITH_MEM_JEMALLOC)
# currently only used for BLI_mempool
@@ -387,6 +398,7 @@ option(WITH_BOOST "Enable features depending on boost" ON)
# Unit testsing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_TESTS_PERFORMANCE "Enable performance tests" OFF)
# Documentation
@@ -403,6 +415,7 @@ option(WITH_GL_EGL "Use the EGL OpenGL system library instead of th
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
option(WITH_GPU_DEBUG "Create a debug OpenGL context (allows inserting custom messages and getting notifications for bad GL use)" OFF)
mark_as_advanced(
WITH_GLEW_MX
@@ -411,6 +424,7 @@ mark_as_advanced(
WITH_GL_PROFILE_COMPAT
WITH_GL_PROFILE_CORE
WITH_GL_PROFILE_ES20
WITH_GPU_DEBUG
)
if(WITH_GL_PROFILE_COMPAT)
@@ -434,6 +448,13 @@ if(MSVC)
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
endif()
# Experimental support of C++11
option(WITH_CPP11 "Build with C++11 standard enabled, for development use only!" OFF)
mark_as_advanced(WITH_CPP11)
# Dependency graph
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
# avoid using again
option_defaults_clear()
@@ -623,17 +644,23 @@ if(NOT WITH_BOOST)
set_and_warn(WITH_CYCLES OFF)
set_and_warn(WITH_AUDASPACE OFF)
set_and_warn(WITH_ALEMBIC OFF)
set_and_warn(WITH_INTERNATIONAL OFF)
set_and_warn(WITH_OPENAL OFF) # depends on AUDASPACE
set_and_warn(WITH_GAMEENGINE OFF) # depends on AUDASPACE
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL)
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_ALEMBIC OR WITH_INTERNATIONAL)
# Keep enabled
else()
# Enabled but we don't need it
set(WITH_BOOST OFF)
endif()
# disable hdf5 if Alembic is disabled
if(NOT WITH_ALEMBIC)
set(WITH_HDF5 OFF)
endif()
# auto enable openimageio for cycles
if(WITH_CYCLES)
set(WITH_OPENIMAGEIO ON)
@@ -660,6 +687,7 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
set(WITH_X11_XINPUT OFF)
set(WITH_X11_XF86VMODE OFF)
set(WITH_GHOST_XDND OFF)
set(WITH_INPUT_IME OFF)
endif()
if(WITH_CPU_SSE)
@@ -794,6 +822,21 @@ if(UNIX AND NOT APPLE)
find_package_wrapper(ZLIB REQUIRED)
find_package_wrapper(Freetype REQUIRED)
if(WITH_LZO AND WITH_SYSTEM_LZO)
find_package_wrapper(LZO)
if(NOT LZO_FOUND)
message(FATAL_ERROR "Failed finding system LZO version!")
endif()
endif()
if(WITH_SYSTEM_EIGEN3)
find_package_wrapper(Eigen3)
if(NOT EIGEN3_FOUND)
message(FATAL_ERROR "Failed finding system Eigen3 version!")
endif()
endif()
# else values are set below for all platforms
if(WITH_PYTHON)
# No way to set py34. remove for now.
# find_package(PythonLibs)
@@ -838,17 +881,21 @@ if(UNIX AND NOT APPLE)
if(WITH_SDL)
if(WITH_SDL_DYNLOAD)
set(SDLMAIN_LIBRARY)
set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2")
set(SDL_LIBRARY)
set(SDL_LIBRARY_TEMP)
else()
find_package_wrapper(SDL)
find_package_wrapper(SDL2)
if(SDL2_FOUND)
# Use same names for both versions of SDL until we move to 2.x.
set(SDL_INCLUDE_DIR "${SDL2_INCLUDE_DIR}")
set(SDL_LIBRARY "${SDL2_LIBRARY}")
set(SDL_FOUND "${SDL2_FOUND}")
else()
find_package_wrapper(SDL)
endif()
mark_as_advanced(
SDLMAIN_LIBRARY
SDL_INCLUDE_DIR
SDL_LIBRARY
SDL_LIBRARY_TEMP
)
# unset(SDLMAIN_LIBRARY CACHE)
if(NOT SDL_FOUND)
@@ -926,6 +973,24 @@ if(UNIX AND NOT APPLE)
endif()
endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
if(NOT OSL_ROOT)
set(OSL_ROOT ${CYCLES_OSL})
endif()
find_package_wrapper(OpenShadingLanguage)
if(OSL_FOUND)
if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
# otherwise LLVM is missing the osl_allocate_closure_component function
set(OSL_LIBRARIES ${OSL_OSLCOMP_LIBRARY} -Wl,--whole-archive ${OSL_OSLEXEC_LIBRARY} -Wl,--no-whole-archive ${OSL_OSLQUERY_LIBRARY})
endif()
else()
message(STATUS "OSL not found, disabling it from Cycles")
set(WITH_CYCLES_OSL OFF)
endif()
endif()
if(WITH_BOOST)
# uses in build instructions to override include and library variables
if(NOT BOOST_CUSTOM)
@@ -934,6 +999,12 @@ if(UNIX AND NOT APPLE)
endif()
set(Boost_USE_MULTITHREADED ON)
set(__boost_packages filesystem regex system thread date_time)
if(WITH_CYCLES_OSL)
if(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6"))
list(APPEND __boost_packages wave)
else()
endif()
endif()
if(WITH_INTERNATIONAL)
list(APPEND __boost_packages locale)
endif()
@@ -963,6 +1034,12 @@ if(UNIX AND NOT APPLE)
if(WITH_OPENIMAGEIO)
find_package_wrapper(OpenImageIO)
if(NOT OPENIMAGEIO_PUGIXML_FOUND AND WITH_CYCLES_STANDALONE)
find_package_wrapper(PugiXML)
else()
set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}")
set(PUGIXML_LIBRARIES "")
endif()
set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES})
set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere
@@ -994,104 +1071,40 @@ if(UNIX AND NOT APPLE)
endif()
endif()
# XXX Maybe most of this section should go into an llvm module?
if(WITH_LLVM)
# Set llvm version if not specified
if(NOT LLVM_VERSION)
set(LLVM_VERSION "3.0")
endif()
find_package_wrapper(LLVM)
if(LLVM_DIRECTORY)
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
endif()
else()
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config)
endif()
if(NOT LLVM_FOUND)
set(WITH_LLVM OFF)
message(STATUS "LLVM not found")
endif()
if(NOT DEFINED LLVM_VERSION)
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_VERSION ${LLVM_VERSION} CACHE STRING "Version of LLVM to use")
endif()
if(NOT DEFINED LLVM_DIRECTORY)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_DIRECTORY
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_DIRECTORY ${LLVM_DIRECTORY} CACHE PATH "Path to the LLVM installation")
endif()
if(NOT DEFINED LLVM_LIBPATH)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_LIBPATH ${LLVM_LIBPATH} CACHE PATH "Path to the LLVM library path")
mark_as_advanced(LLVM_LIBPATH)
endif()
if(LLVM_STATIC)
find_library(LLVM_LIBRARY
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
else()
find_library(LLVM_LIBRARY
NAMES LLVM-${LLVM_VERSION}
PATHS ${LLVM_LIBPATH})
endif()
if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY "${LLVM_LIBRARY}")
endif()
else()
message(FATAL_ERROR "LLVM not found.")
endif()
endif()
if(WITH_LLVM OR WITH_SDL_DYNLOAD)
# Fix for conflict with Mesa llvmpipe
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/source/creator/blender.map")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'")
endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
message(STATUS "CYCLES_OSL = ${CYCLES_OSL}")
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
# otherwise LLVM is missing the osl_allocate_closure_component function
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -Wl,--whole-archive ${OSL_LIB_EXEC} -Wl,--no-whole-archive ${OSL_LIB_QUERY})
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
set(OSL_FOUND TRUE)
else()
message(STATUS "OSL not found")
set(WITH_CYCLES_OSL OFF)
if(WITH_ALEMBIC)
find_package_wrapper(Alembic)
set(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARIES} ${BOOST_LIBRARIES})
if(NOT ALEMBIC_HDF5_FOUND AND WITH_HDF5)
message(STATUS "Alembic is compiled without HDF5 support, disabling HDF5 options")
set(WITH_HDF5 OFF)
endif()
endif()
if(WITH_HDF5)
find_package_wrapper(HDF5)
endif()
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm)
find_package(Threads REQUIRED)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
# used by other platforms
set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
if(CMAKE_DL_LIBS)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS})
@@ -1111,6 +1124,25 @@ if(UNIX AND NOT APPLE)
# GNU Compiler
if(CMAKE_COMPILER_IS_GNUCC)
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "5.0")
# GCC5 uses gnu11, until we update, force c89
# though some c11 features can still be used.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89")
endif()
# use ld.gold linker if available, could make optional
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if ("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
else ()
message(INFO "GNU gold linker isn't available, using the default system linker.")
endif ()
unset(LD_VERSION)
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
@@ -1152,7 +1184,11 @@ elseif(WIN32)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi imm32)
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS imm32)
endif()
add_definitions(
-D_CRT_NONSTDC_NO_DEPRECATE
@@ -1237,8 +1273,8 @@ elseif(WIN32)
find_package(png)
if(NOT PNG_FOUND)
set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include)
message(WARNING "Using HARDCODED libpng locations")
set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include)
set(PNG_LIBRARIES libpng)
set(PNG "${LIBDIR}/png")
set(PNG_INCLUDE_DIRS "${PNG}/include")
@@ -1325,19 +1361,19 @@ elseif(WIN32)
set(OPENEXR_VERSION "2.1")
find_package(OPENEXR REQUIRED)
if(NOT OPENEXR_FOUND)
message(WARNING "Using HARDCODED OpenEXR locations")
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
${OPENEXR_LIBPATH}/Iex-2_1.lib
${OPENEXR_LIBPATH}/Half.lib
${OPENEXR_LIBPATH}/IlmImf-2_1.lib
${OPENEXR_LIBPATH}/Imath-2_1.lib
${OPENEXR_LIBPATH}/IlmThread-2_1.lib
)
endif(NOT OPENEXR_FOUND)
message(WARNING "Using HARDCODED OpenEXR locations")
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
${OPENEXR_LIBPATH}/Iex-2_2.lib
${OPENEXR_LIBPATH}/Half.lib
${OPENEXR_LIBPATH}/IlmImf-2_2.lib
${OPENEXR_LIBPATH}/Imath-2_2.lib
${OPENEXR_LIBPATH}/IlmThread-2_2.lib
)
endif()
endif()
if(WITH_IMAGE_TIFF)
@@ -1377,10 +1413,10 @@ elseif(WIN32)
if(WITH_BOOST)
if(WITH_CYCLES_OSL)
set(boost_extra_libs wave)
endif(WITH_CYCLES_OSL)
endif()
if(WITH_INTERNATIONAL)
list(APPEND boost_extra_libs locale)
endif(WITH_INTERNATIONAL)
endif()
set(Boost_USE_STATIC_RUNTIME ON) # prefix lib
set(Boost_USE_MULTITHREADED ON) # suffix -mt
set(Boost_USE_STATIC_LIBS ON) # suffix -s
@@ -1433,20 +1469,21 @@ elseif(WIN32)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
add_definitions(-DOIIO_STATIC_BUILD)
endif()
if(WITH_LLVM)
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_DIRECTORY}/lib/*.lib)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_ROOT_DIR}/lib/*.lib)
if(EXISTS ${LLVM_DIRECTORY}/debug/lib)
if(EXISTS ${LLVM_ROOT_DIR}/debug/lib)
foreach(LLVM_OPTIMIZED_LIB ${LLVM_LIBRARY_OPTIMIZED})
get_filename_component(LIBNAME ${LLVM_OPTIMIZED_LIB} ABSOLUTE)
list(APPEND LLVM_LIBS optimized ${LIBNAME})
endforeach(LLVM_OPTIMIZED_LIB)
file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_DIRECTORY}/debug/lib/*.lib)
file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_ROOT_DIR}/debug/lib/*.lib)
foreach(LLVM_DEBUG_LIB ${LLVM_LIBRARY_DEBUG})
get_filename_component(LIBNAME ${LLVM_DEBUG_LIB} ABSOLUTE)
@@ -1481,6 +1518,13 @@ elseif(WIN32)
)
endif()
if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBRARY SDL2)
set(SDL_LIBPATH ${SDL}/lib)
endif()
# used in many places so include globally, like OpenGL
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
@@ -1498,7 +1542,12 @@ elseif(WIN32)
if(WITH_MINGW64)
message(STATUS "Compiling for 64 bit with MinGW-w64.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64_gcc49)
else()
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
endif()
else()
message(STATUS "Compiling for 32 bit with MinGW-w32.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
@@ -1508,7 +1557,12 @@ elseif(WIN32)
endif()
endif()
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -limm32)
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -ldbghelp)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS -limm32)
endif()
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
if(WITH_MINGW64)
@@ -1662,11 +1716,12 @@ elseif(WIN32)
set(OPENIMAGEIO_LIBRARIES OpenImageIO)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_DEFINITIONS "")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
endif()
if(WITH_LLVM)
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_LIBPATH ${LLVM_DIRECTORY}/lib)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_LIBPATH ${LLVM_ROOT_DIR}/lib)
# Explicitly set llvm lib order.
#---- WARNING ON GCC ORDER OF LIBS IS IMPORTANT, DO NOT CHANGE! ---------
set(LLVM_LIBRARY LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMAnalysis LLVMArchive
@@ -1699,6 +1754,13 @@ elseif(WIN32)
set(OPENCOLORIO_DEFINITIONS)
endif()
if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBRARY SDL)
set(SDL_LIBPATH ${SDL}/lib)
endif()
set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
## DISABLE - causes linking errors
@@ -1730,13 +1792,6 @@ elseif(WIN32)
set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
endif()
if(WITH_SDL)
set(SDL ${LIBDIR}/sdl)
set(SDL_INCLUDE_DIR ${SDL}/include)
set(SDL_LIBRARY SDL2)
set(SDL_LIBPATH ${SDL}/lib)
endif()
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
add_definitions(-D__SSE__ -D__MMX__)
endif()
@@ -1751,10 +1806,10 @@ elseif(WIN32)
find_library(OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${CYCLES_OSL}/lib)
list(APPEND OSL_LIBRARIES optimized ${OSL_LIB_COMP} optimized ${OSL_LIB_EXEC} optimized ${OSL_LIB_QUERY} debug ${OSL_LIB_EXEC_DEBUG} debug ${OSL_LIB_COMP_DEBUG} debug ${OSL_LIB_QUERY_DEBUG})
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
set(OSL_FOUND TRUE)
else()
message(STATUS "OSL not found")
@@ -1812,14 +1867,14 @@ elseif(APPLE)
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
# normally cached but not since we include them with blender
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
# set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
else()
# module must be compiled against Python framework
set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
set(PYTHON_EXECUTABLE "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
#set(PYTHON_LIBRARY python${PYTHON_VERSION})
set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
#set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
@@ -1990,6 +2045,7 @@ elseif(APPLE)
set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO}/lib/libOpenImageIO.a ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH})
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
endif()
if(WITH_OPENCOLORIO)
@@ -2000,10 +2056,10 @@ elseif(APPLE)
endif()
if(WITH_LLVM)
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_VERSION "3.4" CACHE STRING "Version of LLVM to use")
if(EXISTS "${LLVM_DIRECTORY}/bin/llvm-config")
set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
else()
set(LLVM_CONFIG llvm-config)
endif()
@@ -2011,7 +2067,7 @@ elseif(APPLE)
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_DIRECTORY
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
@@ -2020,7 +2076,7 @@ elseif(APPLE)
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIBPATH)
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
@@ -2045,10 +2101,10 @@ elseif(APPLE)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
# WARNING! depends on correct order of OSL libs linking
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
set(OSL_FOUND TRUE)
else()
message(STATUS "OSL not found")
@@ -2128,6 +2184,12 @@ if(WITH_CYCLES)
endif()
endif()
if(WITH_ALEMBIC)
if(NOT WITH_BOOST)
message(FATAL_ERROR "Alembic requires WITH_BOOST, the library may not have been found. Configure BOOST or disable WITH_ALEMBIC")
endif()
endif()
if(WITH_INTERNATIONAL)
if(NOT WITH_BOOST)
message(FATAL_ERROR "Internationalization requires WITH_BOOST, the library may not have been found. Configure BOOST or disable WITH_INTERNATIONAL")
@@ -2191,6 +2253,9 @@ if(WITH_IMAGE_REDCODE)
set(REDCODE_INC ${REDCODE})
endif()
if(NOT WITH_SYSTEM_EIGEN3)
set(EIGEN3_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/Eigen3)
endif()
#-----------------------------------------------------------------------------
# Configure OpenGL.
@@ -2312,6 +2377,10 @@ if(WITH_GL_EGL)
list(APPEND GL_DEFINITIONS -DWITH_EGL)
endif()
if(WITH_GPU_DEBUG)
list(APPEND GL_DEFINITIONS -DWITH_GPU_DEBUG)
endif()
#-----------------------------------------------------------------------------
# Configure OpenMP.
if(WITH_OPENMP)
@@ -2448,6 +2517,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2475,6 +2545,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_RETURN_TYPE -Werror=return-type)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_POINTER_ARITH -Wpointer-arith)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_PARAMETER -Wunused-parameter)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_FORMAT_SIGN -Wformat-signedness)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2608,6 +2688,16 @@ if(WITH_PYTHON)
endif()
endif()
if(WITH_CPP11)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(MSVC12)
# Nothing special is needed, C++11 features are available by default.
else()
message(FATAL_ERROR "Compiler ${CMAKE_C_COMPILER_ID} is not supported for C++11 build yet")
endif()
endif()
# Include warnings first, so its possible to disable them with user defined flags
# eg: -Wno-uninitialized
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")
@@ -2620,12 +2710,12 @@ mark_as_advanced(
OSL_COMPILER
OSL_LIB_COMP
OSL_LIB_QUERY
OSL_INCLUDES
OSL_INCLUDE_DIR
)
mark_as_advanced(
LLVM_CONFIG
LLVM_DIRECTORY
LLVM_ROOT_DIR
LLVM_LIBRARY
LLVM_VERSION
)
@@ -2794,6 +2884,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_GL_PROFILE_COMPAT)
info_cfg_option(WITH_GL_PROFILE_CORE)
info_cfg_option(WITH_GL_PROFILE_ES20)
info_cfg_option(WITH_GPU_DEBUG)
if(WIN32)
info_cfg_option(WITH_GL_ANGLE)
endif()

View File

@@ -65,7 +65,7 @@ ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake"
endif
ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_DIR:=$(BUILD_DIR)_headless
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
endif
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
@@ -113,7 +113,7 @@ endif
# -----------------------------------------------------------------------------
# Build Blender
all:
all: FORCE
@echo
@echo Configuring Blender ...
@@ -142,13 +142,13 @@ bpy: all
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
config:
config: FORCE
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Help for build targets
help:
help: FORCE
@echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
@echo " * debug - build a debug binary"
@@ -171,7 +171,7 @@ help:
@echo ""
@echo "Package Targets"
@echo " * package_debian - build a debian package"
@echo " * package_pacman - build an arch linux pacmanpackage"
@echo " * package_pacman - build an arch linux pacman package"
@echo " * package_archive - build an archive package"
@echo ""
@echo "Testing Targets (not associated with building blender)"
@@ -214,13 +214,13 @@ help:
# -----------------------------------------------------------------------------
# Packages
#
package_debian:
package_debian: FORCE
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman:
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
package_pacman: FORCE
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg
package_archive:
package_archive: FORCE
make -C "$(BUILD_DIR)" -s package_archive
@echo archive in "$(BUILD_DIR)/release"
@@ -228,24 +228,24 @@ package_archive:
# -----------------------------------------------------------------------------
# Tests
#
test:
test: FORCE
cd $(BUILD_DIR) ; ctest . --output-on-failure
# run pep8 check check on scripts we distribute.
test_pep8:
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:
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:
test_deprecated: FORCE
python3 tests/check_deprecated.py
test_style_c:
test_style_c: FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
@@ -253,7 +253,7 @@ test_style_c:
"$(BLENDER_DIR)/source/creator" \
--no-length-check
test_style_c_qtc:
test_style_c_qtc: FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \
@@ -266,7 +266,7 @@ test_style_c_qtc:
@echo "written: test_style.tasks"
test_style_osl:
test_style_osl: FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
@@ -274,7 +274,7 @@ test_style_osl:
"$(BLENDER_DIR)/release/scripts/templates_osl"
test_style_osl_qtc:
test_style_osl_qtc: FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \
@@ -289,13 +289,13 @@ test_style_osl_qtc:
# Project Files
#
project_qtcreator:
project_qtcreator: FORCE
python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_netbeans:
project_netbeans: FORCE
python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
project_eclipse:
project_eclipse: FORCE
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
@@ -303,40 +303,40 @@ project_eclipse:
# Static Checking
#
check_cppcheck:
check_cppcheck: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
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:
check_clang_array: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint:
check_splint: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse:
check_sparse: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch:
check_smatch: FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_spelling_py:
check_spelling_py: FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/release/scripts"
check_spelling_c:
check_spelling_c: FORCE
cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
@@ -345,7 +345,7 @@ check_spelling_c:
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
check_spelling_c_qtc:
check_spelling_c_qtc: FORCE
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
@@ -356,13 +356,13 @@ check_spelling_c_qtc:
> \
"$(BLENDER_DIR)/check_spelling_c.tasks"
check_spelling_osl:
check_spelling_osl: FORCE
cd "$(BUILD_DIR)" ;\
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions:
check_descriptions: FORCE
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python \
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
@@ -370,14 +370,14 @@ check_descriptions:
# Utilities
#
tgz:
tgz: FORCE
./build_files/utils/build_tgz.sh
icons:
icons: FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
update:
update: FORCE
if [ -d "../lib" ]; then \
svn update ../lib/* ; \
fi
@@ -390,23 +390,23 @@ update:
#
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_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:
doc_doxy: FORCE
cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna:
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:
doc_man: FORCE
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
help_features:
help_features: FORCE
@python3 -c \
"import re; \
print('\n'.join([ \
@@ -417,7 +417,9 @@ help_features:
if w.startswith('WITH_')]))" | uniq
clean:
clean: FORCE
$(MAKE) -C "$(BUILD_DIR)" clean
.PHONY: all
FORCE:

View File

@@ -266,6 +266,7 @@ if 'blenderlite' in B.targets:
target_env_defs['WITH_BF_BOOLEAN'] = False
target_env_defs['WITH_BF_REMESH'] = False
target_env_defs['WITH_BF_PYTHON'] = False
target_env_defs['WITH_BF_IME'] = False
target_env_defs['WITH_BF_3DMOUSE'] = False
target_env_defs['WITH_BF_LIBMV'] = False
target_env_defs['WITH_BF_FREESTYLE'] = False
@@ -469,6 +470,14 @@ if env['OURPLATFORM']=='darwin':
################### End Automatic configuration for OSX ##################
#############################################################################
if env['OURPLATFORM'] == 'linux' and not env['C_COMPILER_ID']:
command = ["%s"%env['CC'], "--version"]
line = btools.get_command_output(command)
if line.startswith('gcc'):
env['C_COMPILER_ID'] = 'gcc'
elif 'clang' in line[0]:
env['C_COMPILER_ID'] = 'clang'
if env['WITH_BF_OPENMP'] == 1:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
env['CCFLAGS'].append('/openmp')
@@ -479,6 +488,13 @@ if env['WITH_BF_OPENMP'] == 1:
else:
env.Append(CCFLAGS=['-fopenmp'])
if env['WITH_BF_CPP11']:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
# Nothing special is needed, C++11 features are available by default.
pass
else:
env['CXXFLAGS'].append('-std=c++11')
#check for additional debug libnames
if env.has_key('BF_DEBUG_LIBS'):
@@ -750,6 +766,9 @@ if B.targets != ['cudakernels']:
data_to_c_simple("release/datafiles/preview_cycles.blend")
# --- glsl ---
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_color_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
@@ -760,6 +779,15 @@ if B.targets != ['cudakernels']:
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex_world.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_lib.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_vert.glsl")
data_to_c_simple("intern/opencolorio/gpu_shader_display_transform.glsl")
# --- blender ---
@@ -789,6 +817,13 @@ if B.targets != ['cudakernels']:
data_to_c_simple("release/datafiles/brushicons/fill.png")
data_to_c_simple("release/datafiles/brushicons/flatten.png")
data_to_c_simple("release/datafiles/brushicons/grab.png")
data_to_c_simple("release/datafiles/brushicons/hairadd.png")
data_to_c_simple("release/datafiles/brushicons/haircomb.png")
data_to_c_simple("release/datafiles/brushicons/haircut.png")
data_to_c_simple("release/datafiles/brushicons/hairlength.png")
data_to_c_simple("release/datafiles/brushicons/hairpuff.png")
data_to_c_simple("release/datafiles/brushicons/hairsmooth.png")
data_to_c_simple("release/datafiles/brushicons/hairweight.png")
data_to_c_simple("release/datafiles/brushicons/inflate.png")
data_to_c_simple("release/datafiles/brushicons/layer.png")
data_to_c_simple("release/datafiles/brushicons/lighten.png")
@@ -854,19 +889,21 @@ B.init_lib_dict()
##### END SETUP ##########
if B.targets != ['cudakernels']:
# Put all auto configuration run-time tests here
## Auto-configuration run-time tests
from FindSharedPtr import FindSharedPtr
from FindUnorderedMap import FindUnorderedMap
from FindSharedPtr import FindSharedPtr
from FindUnorderedMap import FindUnorderedMap
conf = Configure(env)
old_linkflags = conf.env['LINKFLAGS']
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
FindSharedPtr(conf)
FindUnorderedMap(conf)
conf.env['LINKFLAGS'] = old_linkflags
env = conf.Finish()
conf = Configure(env)
old_linkflags = conf.env['LINKFLAGS']
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
# Put all tests here
FindSharedPtr(conf)
FindUnorderedMap(conf)
conf.env['LINKFLAGS'] = old_linkflags
env = conf.Finish()
# End of auto configuration
@@ -998,17 +1035,20 @@ if env['OURPLATFORM']!='darwin':
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel')
source=os.listdir('intern/cycles/kernel')
if '__pycache__' in source: source.remove('__pycache__')
source.remove('kernel.cpp')
source.remove('CMakeLists.txt')
source.remove('SConscript')
source.remove('svm')
source.remove('closure')
source.remove('geom')
source.remove('shaders')
source.remove('osl')
source.remove('split')
source=['intern/cycles/kernel/'+s for s in source]
source.append('intern/cycles/util/util_atomic.h')
source.append('intern/cycles/util/util_color.h')
source.append('intern/cycles/util/util_half.h')
source.append('intern/cycles/util/util_math.h')
source.append('intern/cycles/util/util_math_fast.h')
source.append('intern/cycles/util/util_transform.h')
source.append('intern/cycles/util/util_types.h')
scriptinstall.append(env.Install(dir=dir,source=source))
@@ -1030,6 +1070,12 @@ if env['OURPLATFORM']!='darwin':
if '__pycache__' in source: source.remove('__pycache__')
source=['intern/cycles/kernel/geom/'+s for s in source]
scriptinstall.append(env.Install(dir=dir,source=source))
# split
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel', 'split')
source=os.listdir('intern/cycles/kernel/split')
if '__pycache__' in source: source.remove('__pycache__')
source=['intern/cycles/kernel/split/'+s for s in source]
scriptinstall.append(env.Install(dir=dir,source=source))
# licenses
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'license')
@@ -1159,9 +1205,37 @@ if env['OURPLATFORM']=='linuxcross':
textlist = []
texttargetlist = []
for tp, tn, tf in os.walk('release/text'):
tf.remove("readme.html")
for f in tf:
textlist.append(tp+os.sep+f)
def readme_version_patch():
readme_src = "release/text/readme.html"
readme_dst = os.path.abspath(os.path.normpath(os.path.join(env['BF_BUILDDIR'], "readme.html")))
if not os.path.exists(readme_dst) or (os.path.getmtime(readme_dst) < os.path.getmtime(readme_src)):
f = open(readme_src, "r")
data = f.read()
f.close()
data = data.replace("BLENDER_VERSION", VERSION)
f = open(readme_dst, "w")
f.write(data)
f.close()
textlist.append(readme_dst)
readme_version_patch()
del readme_version_patch
'''Command(
"release/text/readme.html"
)
Command("file.out", "file.in", Copy(env['BF_INSTALLDIR'], "release/text/readme.html"))
'''
# Font licenses
textlist.append('release/datafiles/LICENSE-bfont.ttf.txt')
if env['WITH_BF_INTERNATIONAL']:
@@ -1207,7 +1281,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
if env['WITH_BF_OPENAL']:
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
if env['WITH_BF_SNDFILE']:
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')

View File

@@ -28,8 +28,8 @@ getopt \
--long source:,install:,tmp:,info:,threads:,help,no-sudo,with-all,with-opencollada,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,\
force-all,force-python,force-numpy,force-boost,force-ocio,force-oiio,force-llvm,force-osl,force-opencollada,\
force-ffmpeg,\
skip-python,skip-numpy,skip-boost,skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-ffmpeg,skip-opencollada,\
force-ffmpeg,force-alembic,\
skip-python,skip-numpy,skip-boost,skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-ffmpeg,skip-opencollada,skip-alembic,\
required-numpy: \
-- "$@" \
)
@@ -95,6 +95,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--with-opencollada
Build and install the OpenCOLLADA libraries.
--with-alembic
Build and install the Alembic library.
--ver-ocio=<ver>
Force version of OCIO library.
@@ -144,6 +147,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--force-ffmpeg
Force the rebuild of FFMpeg.
--force-alembic
Force the rebuild of Alembic.
Note about the --force-foo options:
* They obviously only have an effect if those libraries are built by this script
(i.e. if there is no available and satisfactory package)!
@@ -180,6 +186,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--skip-ffmpeg
Unconditionally skip FFMpeg installation/building.
--skip-alembic
Unconditionally skip Alembic installation/building.
--required-numpy
Use this in case your distro features a valid python package, but no matching Numpy one.
It will force compilation of both python and numpy\""
@@ -209,14 +218,14 @@ OCIO_VERSION_MIN="1.0"
OCIO_FORCE_REBUILD=false
OCIO_SKIP=false
OPENEXR_VERSION="2.1.0"
OPENEXR_VERSION="2.2.0"
OPENEXR_VERSION_MIN="2.0.1"
ILMBASE_VERSION="2.1.0"
ILMBASE_VERSION="2.2.0"
OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false
_with_built_openexr=false
OIIO_VERSION="1.4.11"
OIIO_VERSION="1.4.16"
OIIO_VERSION_MIN="1.4.0"
OIIO_FORCE_REBUILD=false
OIIO_SKIP=false
@@ -228,7 +237,7 @@ LLVM_FORCE_REBUILD=false
LLVM_SKIP=false
# OSL needs to be compiled for now!
OSL_VERSION="1.5.0"
OSL_VERSION="1.5.11"
OSL_VERSION_MIN=$OSL_VERSION
OSL_FORCE_REBUILD=false
OSL_SKIP=false
@@ -264,6 +273,11 @@ MP3LAME_DEV=""
OPENJPEG_USE=false
OPENJPEG_DEV=""
ALEMBIC_VERSION="1.5.5"
ALEMBIC_VERSION_MIN="1.5.5"
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
# Switch to english language, else some things (like check_package_DEB()) won't work!
LANG_BACK=$LANG
LANG=""
@@ -423,6 +437,9 @@ while true; do
--force-ffmpeg)
FFMPEG_FORCE_REBUILD=true; shift; continue
;;
--force-alembic)
ALEMBIC_FORCE_REBUILD=true; shift; continue
;;
--skip-python)
PYTHON_SKIP=true; shift; continue
;;
@@ -453,6 +470,9 @@ while true; do
--skip-ffmpeg)
FFMPEG_SKIP=true; shift; continue
;;
--skip-alembic)
ALEMBIC_SKIP=true; shift; continue
;;
--required-numpy)
NUMPY_REQUIRED=true; shift; continue
;;
@@ -485,30 +505,37 @@ BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION
OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" )
#OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
OPENEXR_SOURCE=( "https://github.com/mont29/openexr.git" )
OPENEXR_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
OPENEXR_USE_REPO=false
OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
OPENEXR_SOURCE_REPO=( "https://github.com/mont29/openexr.git" )
OPENEXR_SOURCE_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
ILMBASE_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz" )
#OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio.git" )
OIIO_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
OIIO_USE_REPO=false
OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" )
OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
#OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
#OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage.git" )
#OSL_SOURCE=( "https://github.com/mont29/OpenShadingLanguage.git" )
#OSL_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
#OSL_REPO_BRANCH="master"
OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
OSL_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
OSL_REPO_BRANCH="blender-fixes"
OSL_USE_REPO=true
#~ OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage/archive/Release-1.5.11.tar.gz" )
#~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" )
#~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" )
#~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
#~ OSL_SOURCE_REPO_BRANCH="master"
OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
OSL_SOURCE_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
OSL_SOURCE_REPO_BRANCH="blender-fixes"
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
OPENCOLLADA_REPO_UID="18da7f4109a8eafaa290a33f5550501cc4c8bae8"
OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d"
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
ALEMBIC_SOURCE=( "https://code.google.com/p/alembic/" )
ALEMBIC_REPO_UID=( "1_05_05" )
##### Generic Helpers #####
@@ -835,6 +862,7 @@ compile_Boost() {
# Rebuild dependecies as well!
OIIO_FORCE_REBUILD=true
OSL_FORCE_REBUILD=true
ALEMBIC_FORCE_REBUILD=true
prepare_opt
@@ -979,7 +1007,7 @@ clean_ILMBASE() {
compile_ILMBASE() {
# To be changed each time we make edits that would modify the compiled result!
ilmbase_magic=9
ilmbase_magic=10
_init_ilmbase
# Clean install if needed!
@@ -1003,8 +1031,7 @@ compile_ILMBASE() {
download ILMBASE_SOURCE[@] $_src.tar.gz
INFO "Unpacking ILMBase-$ILMBASE_VERSION"
tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" \
-xf $_src.tar.gz
tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" -xf $_src.tar.gz
fi
@@ -1020,6 +1047,7 @@ compile_ILMBASE() {
cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
if file /bin/cp | grep -q '32-bit'; then
cflags="-fPIC -m32 -march=i686"
@@ -1092,24 +1120,28 @@ compile_OPENEXR() {
INFO "Downloading OpenEXR-$OPENEXR_VERSION"
mkdir -p $SRC
# download OPENEXR_SOURCE[@] $_src.tar.gz
# INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
# tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" \
# -xf $_src.tar.gz
git clone ${OPENEXR_SOURCE[0]} $_src
if [ $OPENEXR_USE_REPO == true ]; then
git clone ${OPENEXR_SOURCE_REPO[0]} $_src
else
download OPENEXR_SOURCE[@] $_src.tar.gz
INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" -xf $_src.tar.gz
fi
fi
cd $_src
# XXX For now, always update from latest repo...
git pull origin master
# Stick to same rev as windows' libs...
git checkout $OPENEXR_REPO_UID
git reset --hard
if [ $OPENEXR_USE_REPO == true ]; then
# XXX For now, always update from latest repo...
git pull origin master
# Stick to same rev as windows' libs...
git checkout $OPENEXR_SOURCE_REPO_UID
git reset --hard
oiio_src_path="../OpenEXR"
else
oiio_src_path=".."
fi
# Always refresh the whole build!
if [ -d build ]; then
@@ -1123,6 +1155,7 @@ compile_OPENEXR() {
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D ILMBASE_PACKAGE_PREFIX=$_ilmbase_inst"
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
if file /bin/cp | grep -q '32-bit'; then
cflags="-fPIC -m32 -march=i686"
@@ -1130,7 +1163,7 @@ compile_OPENEXR() {
cflags="-fPIC"
fi
cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ../OpenEXR
cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" $oiio_src_path
make -j$THREADS && make install
@@ -1194,24 +1227,25 @@ compile_OIIO() {
if [ ! -d $_src ]; then
mkdir -p $SRC
#download OIIO_SOURCE[@] "$_src.tar.gz"
#
#INFO "Unpacking OpenImageIO-$OIIO_VERSION"
#tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" \
#-xf $_src.tar.gz
git clone ${OIIO_SOURCE[0]} $_src
if [ $OIIO_USE_REPO == true ]; then
git clone ${OIIO_SOURCE_REPO[0]} $_src
else
download OIIO_SOURCE[@] "$_src.tar.gz"
INFO "Unpacking OpenImageIO-$OIIO_VERSION"
tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" -xf $_src.tar.gz
fi
fi
cd $_src
# XXX For now, always update from latest repo...
git pull origin master
# Stick to same rev as windows' libs...
git checkout $OIIO_REPO_UID
git reset --hard
if [ $OIIO_USE_REPO == true ]; then
# XXX For now, always update from latest repo...
git pull origin master
# Stick to same rev as windows' libs...
git checkout $OIIO_SOURCE_REPO_UID
git reset --hard
fi
# Always refresh the whole build!
if [ -d build ]; then
@@ -1233,6 +1267,7 @@ compile_OIIO() {
if [ $_with_built_openexr == true ]; then
cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
cmake_d="$cmake_d -D OPENEXR_HOME=$INST/openexr"
INFO "ILMBASE_HOME=$INST/openexr"
fi
# Optional tests and cmd tools
@@ -1363,7 +1398,7 @@ EOF
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON"
cmake_d="$cmake_d -D LLVM_TARGETS_TO_BUILD=X86"
cmake_d="$cmake_d -D -DLLVM_ENABLE_TERMINFO=OFF"
cmake_d="$cmake_d -D LLVM_ENABLE_TERMINFO=OFF"
if [ -d $_FFI_INCLUDE_DIR ]; then
cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR"
@@ -1409,15 +1444,15 @@ clean_OSL() {
compile_OSL() {
# To be changed each time we make edits that would modify the compiled result!
osl_magic=16
osl_magic=17
_init_osl
# Clean install if needed!
magic_compile_check osl-$OSL_VERSION $osl_magic
if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
clean_OSL
fi
#~ if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
#~ rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
#~ clean_OSL
#~ fi
if [ ! -d $_inst ]; then
INFO "Building OpenShadingLanguage-$OSL_VERSION"
@@ -1427,26 +1462,26 @@ compile_OSL() {
if [ ! -d $_src ]; then
mkdir -p $SRC
#download OSL_SOURCE[@] "$_src.tar.gz"
#INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
#tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
#-xf $_src.tar.gz
git clone ${OSL_SOURCE[0]} $_src
if [ $OSL_USE_REPO == true ]; then
git clone ${OSL_SOURCE_REPO[0]} $_src
else
download OSL_SOURCE[@] "$_src.tar.gz"
INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
-xf $_src.tar.gz
fi
fi
cd $_src
git remote set-url origin ${OSL_SOURCE[0]}
# XXX For now, always update from latest repo...
git pull --no-edit -X theirs origin $OSL_GIT_BRANCH
# Stick to same rev as windows' libs...
git checkout $OSL_REPO_UID
git reset --hard
if [ $OSL_USE_REPO == true ]; then
git remote set-url origin ${OSL_SOURCE_REPO[0]}
# XXX For now, always update from latest repo...
git pull --no-edit -X theirs origin $OSL_SOURCE_REPO_BRANCH
# Stick to same rev as windows' libs...
git checkout $OSL_SOURCE_REPO_UID
git reset --hard
fi
# Always refresh the whole build!
if [ -d build ]; then
@@ -1461,11 +1496,14 @@ compile_OSL() {
cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
cmake_d="$cmake_d -D BUILDSTATIC=OFF"
cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
if [ $_with_built_openexr == true ]; then
INFO "ILMBASE_HOME=$INST/openexr"
cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
# XXX Temp workaround... sigh, ILMBase really messed the things up by defining their custom names ON by default :(
cmake_d="$cmake_d -D ILMBASE_CUSTOM=ON"
cmake_d="$cmake_d -D ILMBASE_CUSTOM_LIBRARIES='Half;Iex;Imath;IlmThread'"
fi
if [ -d $INST/boost ]; then
@@ -1479,7 +1517,7 @@ compile_OSL() {
if [ ! -z $LLVM_VERSION_FOUND ]; then
cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
if [ -d $INST/llvm ]; then
cmake_d="$cmake_d -D LLVM_DIRECTORY=$INST/llvm"
cmake_d="$cmake_d -D LLVM_ROOT_DIR=$INST/llvm"
cmake_d="$cmake_d -D LLVM_STATIC=ON"
fi
fi
@@ -1523,7 +1561,7 @@ clean_OpenCOLLADA() {
compile_OpenCOLLADA() {
# To be changed each time we make edits that would modify the compiled results!
opencollada_magic=8
opencollada_magic=9
_init_opencollada
# Clean install if needed!
@@ -1692,6 +1730,165 @@ compile_FFmpeg() {
fi
}
#### Build ALEMBIC ####
_init_alembic() {
_src=$SRC/Alembic-$ALEMBIC_VERSION
_hg=false
_inst=$INST/alembic-$ALEMBIC_VERSION
_inst_shortcut=$INST/alembic
}
clean_alembic() {
_init_alembic
_clean
}
compile_alembic() {
# To be changed each time we make edits that would modify the compiled result!
alembic_magic=1
_init_alembic
# Clean install if needed!
magic_compile_check alembic-$ALEMBIC_VERSION $alembic_magic
if [ $? -eq 1 -o $ALEMBIC_FORCE_REBUILD == true ]; then
clean_alembic
fi
if [ ! -d $_inst ]; then
INFO "Building Alembic-$ALEMBIC_VERSION"
prepare_opt
if [ ! -d $_src ]; then
mkdir -p $SRC
hg clone -u $ALEMBIC_REPO_UID $ALEMBIC_SOURCE $_src
fi
cd $_src
# XXX Ugly patching hack!
# Alembice cmake files are erratic, to say the least
# have to manually disable a bunch of crap here
cat << EOF | patch -p1
--- a/CMakeLists.txt Mon Jul 28 10:09:21 2014 -0700
+++ b/CMakeLists.txt Thu Oct 16 15:03:27 2014 +0200
@@ -57,9 +57,9 @@
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} )
SET( VERSION ${PROJECT_VERSION} )
-SET( ALEMBIC_NO_TESTS FALSE )
-SET( ALEMBIC_NO_BOOTSTRAP FALSE )
-SET( ALEMBIC_NO_OPENGL FALSE )
+SET( ALEMBIC_NO_TESTS TRUE )
+SET( ALEMBIC_NO_BOOTSTRAP TRUE )
+SET( ALEMBIC_NO_OPENGL TRUE )
MESSAGE(STATUS "CMAKE SYSTEM NAME = ${CMAKE_SYSTEM_NAME}" )
@@ -306,15 +306,15 @@
ENDIF()
# Include PyAlembic stuff
-IF(DEFINED USE_PYALEMBIC AND NOT USE_PYALEMBIC)
- MESSAGE(STATUS "Skipping Alembic Python bindings")
-ELSE()
- MESSAGE(STATUS "About to include Python cmake files")
- ADD_SUBDIRECTORY( python )
-ENDIF()
+#IF(DEFINED USE_PYALEMBIC AND NOT USE_PYALEMBIC)
+# MESSAGE(STATUS "Skipping Alembic Python bindings")
+#ELSE()
+# MESSAGE(STATUS "About to include Python cmake files")
+# ADD_SUBDIRECTORY( python )
+#ENDIF()
# Example code not supported
-ADD_SUBDIRECTORY( examples )
+#ADD_SUBDIRECTORY( examples )
# Uncomment to build python docs Makefile (requires Sphinx)
# Run `make docs` from build root
EOF
cat << EOF | patch -p1
--- a/lib/Alembic/Util/CMakeLists.txt Mon Jul 28 10:09:21 2014 -0700
+++ b/lib/Alembic/Util/CMakeLists.txt Thu Oct 16 15:03:27 2014 +0200
@@ -65,7 +65,7 @@
DESTINATION include/Alembic/Util
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ )
-IF( NOT ALEMBIC_NO_TESTS )
- ADD_SUBDIRECTORY( Tests )
-ENDIF()
+#IF( NOT ALEMBIC_NO_TESTS )
+# ADD_SUBDIRECTORY( Tests )
+#ENDIF()
EOF
cat << EOF | patch -p1
--- a/python/CMakeLists.txt Mon Jul 28 10:09:21 2014 -0700
+++ b/python/CMakeLists.txt Thu Oct 16 14:20:25 2014 +0200
@@ -35,4 +35,4 @@
ADD_SUBDIRECTORY( PyAlembic )
ADD_SUBDIRECTORY( PyAbcOpenGL )
-ADD_SUBDIRECTORY( examples )
+#ADD_SUBDIRECTORY( examples )
EOF
# Always refresh the whole build!
# XXX 'build' directory is included in Alembic sources, don't touch that
if [ -d blender_build ]; then
rm -rf blender_build
fi
mkdir blender_build
cd blender_build
# XXX Alembic cmake doesn't take these as options
# XXX Alembic creates a subfolder itself ... rather than fix their
# stupid build files, just expect this here by using $INST as prefix
export ALEMBIC_INSTALL_PREFIX=$INST
cmake_d="-D CMAKE_BUILD_TYPE=Release"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$INST"
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -D BUILD_STATIC_LIBS=ON"
cmake_d="$cmake_d -D USE_PYTHON=OFF"
cmake_d="$cmake_d -D USE_PYALEMBIC=OFF"
cmake_d="$cmakd_d -D ALEMBIC_PYTHON_INCLUDE_DIR=/use/include/python2.7" # XXX BAD
cmake_d="$cmakd_d -D ALEMBIC_PYTHON_LIBRARY=/use/lib/python2.7" # XXX BAD
cmake_d="$cmake_d -D USE_PYILMBASE=OFF"
cmake_d="$cmake_d -D ILMBASE_ROOT=$INST/openexr"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_HALF_LIB=$INST/openexr/lib/libHalf.la"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_IEX_LIB=$INST/openexr/lib/libIex-2_1.la"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_ILMTHREAD_LIB=$INST/openexr/lib/libIlmThread-2_1.la"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_IMATH_LIB=$INST/openexr/lib/libImath-2_1.la"
cmake $cmake_d ../
make -j$THREADS && make install
make clean
if [ -d $_inst ]; then
_create_inst_shortcut
else
ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
exit 1
fi
magic_compile_set alembic-$ALEMBIC_VERSION $alembic_magic
cd $CWD
INFO "Done compiling Alembic-$ALEMBIC_VERSION!"
else
INFO "Own Alembic-$ALEMBIC_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-alembic option."
fi
}
#### Install on DEB-like ####
get_package_version_DEB() {
@@ -1798,7 +1995,7 @@ install_DEB() {
OGG_DEV="libogg-dev"
THEORA_DEV="libtheora-dev"
_packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \
_packages="gawk cmake cmake-curses-gui scons mercurial build-essential libjpeg-dev libpng-dev \
libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \
libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
libopenal-dev libglew-dev libglewmx-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
@@ -1978,7 +2175,8 @@ install_DEB() {
if [ $? -eq 0 ]; then
install_packages_DEB libboost-locale$boost_version-dev libboost-filesystem$boost_version-dev \
libboost-regex$boost_version-dev libboost-system$boost_version-dev \
libboost-thread$boost_version-dev
libboost-thread$boost_version-dev libboost-python$boost_version-dev \
libboost-program-options$boost_version-dev libboost-wave$boost_version-dev
clean_Boost
else
compile_Boost
@@ -2111,6 +2309,14 @@ install_DEB() {
# fi
compile_FFmpeg
fi
if $ALEMBIC_SKIP; then
WARNING "Skipping Alembic installation, as requested..."
else
install_packages_DEB libhdf5-dev
install_packages_DEB libpython2.7-dev # XXX nasty hack, should be done better ...
compile_alembic
fi
}
@@ -2273,7 +2479,7 @@ install_RPM() {
OGG_DEV="libogg-devel"
THEORA_DEV="libtheora-devel"
_packages="gcc gcc-c++ make scons libtiff-devel freetype-devel libjpeg-devel\
_packages="gcc gcc-c++ make scons libtiff-devel libjpeg-devel\
libpng-devel libX11-devel libXi-devel wget ncurses-devel \
readline-devel $OPENJPEG_DEV openal-soft-devel \
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
@@ -2287,7 +2493,7 @@ install_RPM() {
if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
OPENEXR_DEV="openexr-devel"
_packages="$_packages libsqlite3x-devel fftw-devel SDL-devel"
_packages="$_packages freetype-devel libsqlite3x-devel fftw-devel SDL-devel"
if $WITH_ALL; then
_packages="$_packages jack-audio-connection-kit-devel"
@@ -2325,7 +2531,7 @@ install_RPM() {
elif [ $RPM = "SUSE" ]; then
OPENEXR_DEV="libopenexr-devel"
_packages="$_packages cmake sqlite3-devel fftw3-devel libSDL-devel"
_packages="$_packages cmake freetype2-devel sqlite3-devel fftw3-devel libSDL-devel"
PRINT ""
install_packages_RPM $_packages
@@ -2983,7 +3189,7 @@ print_info() {
_buildargs="$_buildargs $_1"
fi
if [ -d $INST/llvm ]; then
_1="-D LLVM_DIRECTORY=$INST/llvm"
_1="-D LLVM_ROOT_DIR=$INST/llvm"
_2="-D LLVM_STATIC=ON"
PRINT " $_1"
PRINT " $_2"
@@ -3016,6 +3222,12 @@ print_info() {
fi
fi
if [ -d $INST/alembic ]; then
_1="-D ALEMBIC_ROOT_DIR=$INST/alembic"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
PRINT ""
PRINT "Or even simpler, just run (in your blender-source dir):"
PRINT " make -j$THREADS BUILD_CMAKE_ARGS=\"$_buildargs\""
@@ -3039,10 +3251,10 @@ print_info() {
PRINT "BF_OPENEXR = '$INST/openexr'"
_ilm_libs_ext=""
version_ge $OPENEXR_VERSION "2.1.0"
if [ $? -eq 0 ]; then
_ilm_libs_ext=`echo $OPENEXR_VERSION | sed -r 's/([0-9]+)\.([0-9]+).*/-\1_\2/'`
fi
#~ version_ge $OPENEXR_VERSION "2.1.0"
#~ if [ $? -eq 0 ]; then
#~ _ilm_libs_ext=`echo $OPENEXR_VERSION | sed -r 's/([0-9]+)\.([0-9]+).*/-\1_\2/'`
#~ fi
PRINT "BF_OPENEXR_LIB = 'Half IlmImf$_ilm_libs_ext Iex$_ilm_libs_ext Imath$_ilm_libs_ext '"
# BF_OPENEXR_LIB does not work, things like '-lIlmImf-2_1' do not suit ld.
# For now, hack around!!!
@@ -3085,6 +3297,13 @@ print_info() {
PRINT "BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice `print_info_ffmpeglink`'"
fi
if [ "$ALEMBIC_SKIP" = false ]; then
PRINT "WITH_BF_ALEMBIC = True"
if [ -d $INST/alembic ]; then
PRINT "BF_ALEMBIC = '$INST/alembic'"
fi
fi
if [ "$WITH_ALL" = false ]; then
PRINT "WITH_BF_3DMOUSE = False"
# No libspacenav in official arch repos...

View File

@@ -124,13 +124,15 @@ 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 = False
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'
@@ -157,13 +159,31 @@ 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']
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
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

@@ -124,13 +124,15 @@ 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 = False
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'
@@ -157,13 +159,31 @@ 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']
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
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

@@ -5,3 +5,5 @@ 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

@@ -1,5 +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

@@ -120,6 +120,19 @@ 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++

View File

@@ -120,6 +120,19 @@ 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++

View File

@@ -4,10 +4,10 @@
# <pep8 compliant>
# List of the branches being built automatically overnight
NIGHT_SCHEDULE_BRANCHES=[None, "gooseberry"]
NIGHT_SCHEDULE_BRANCHES = [None, "gooseberry"]
# List of the branches available for force build
FORCE_SCHEDULE_BRANCHES=["master", "gooseberry", "experimental-build"]
FORCE_SCHEDULE_BRANCHES = ["master", "gooseberry", "experimental-build"]
"""
Stock Twisted directory lister doesn't provide any information about last file
@@ -17,6 +17,7 @@ modification time, we hack the class a bit in order to have such functionaliity
from buildbot.status.web.base import DirectoryLister
def get_files_and_directories(self, directory):
from twisted.web.static import (getTypeAndEncoding,
formatFileSize)
@@ -97,6 +98,7 @@ all_repositories = {
r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
}
def codebaseGenerator(chdict):
return all_repositories[chdict['repository']]
@@ -112,6 +114,7 @@ from buildbot.schedulers import timed, forcesched
c['schedulers'] = []
def schedule_force_build(name):
c['schedulers'].append(forcesched.ForceScheduler(name='force ' + name,
builderNames=[name],
@@ -143,7 +146,7 @@ def schedule_build(name, hour, minute=0):
"blender-addons": {"repository": "", "branch": "master"},
"blender-addons-contrib": {"repository": "", "branch": "master"},
"scons": {"repository": "", "branch": "master"},
"lib svn": {"repository": "", "branch": "master"}},
"lib svn": {"repository": "", "branch": "trunk"}},
branch=current_branch,
builderNames=[name],
hour=hour,

View File

@@ -37,6 +37,7 @@ def strip_extension(filename):
return filename
# extract platform from package name
def get_platform(filename):
# name is blender-version-platform.extension. we want to get the
@@ -64,10 +65,11 @@ def get_platform(filename):
return '-'.join(platform_tokens)
def get_branch(filename):
tokens = filename.split("-")
branch = ""
for token in tokens:
if token == "blender":
return branch
@@ -93,7 +95,7 @@ if not os.path.exists(filename):
try:
z = zipfile.ZipFile(filename, "r")
except Exception, ex:
except Exception as ex:
sys.stderr.write('Failed to open zip file: %s\n' % str(ex))
sys.exit(1)
@@ -122,14 +124,16 @@ else:
directory = 'public_html/download'
try:
filename = os.path.join(directory, packagename)
zf = z.open(package)
f = file(os.path.join(directory, packagename), "wb")
f = file(filename, "wb")
shutil.copyfileobj(zf, f)
os.chmod(filename, 0644)
zf.close()
z.close()
except Exception, ex:
except Exception as ex:
sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
sys.exit(1)
@@ -139,6 +143,6 @@ try:
if get_platform(f) == platform and get_branch(f) == branch:
if f != packagename:
os.remove(os.path.join(directory, f))
except Exception, ex:
except Exception as ex:
sys.stderr.write('Failed to remove old packages: %s\n' % str(ex))
sys.exit(1)

View File

@@ -47,9 +47,9 @@ if 'cmake' in builder:
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
if 'win64' in builder:
cmake_options.append(['-G','"Visual Studio 12 2013 Win64"'])
cmake_options.append(['-G', '"Visual Studio 12 2013 Win64"'])
elif 'win32' in builder:
cmake_options.append(['-G','"Visual Studio 12 2013"'])
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
@@ -116,6 +116,8 @@ else:
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))
@@ -140,7 +142,7 @@ else:
retcode = subprocess.call(cur_scons_cmd + scons_options)
if retcode != 0:
print('Error building rules wuth config ' + config)
print('Error building rules with config ' + config)
sys.exit(retcode)
sys.exit(0)

View File

@@ -116,12 +116,12 @@ if builder.find('scons') != -1:
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options)
sys.exit(retcode)
else:
#cmake
# CMake
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'])
retcode = subprocess.call(['cpack', '-G', 'ZIP'])
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
os.rename(result_file, "{}.zip".format(builder))
# create zip file
@@ -133,7 +133,7 @@ else:
z.write("{}.zip".format(builder))
z.close()
sys.exit(retcode)
except Exception, ex:
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1)
@@ -149,7 +149,7 @@ if os.path.exists(release_dir):
# create release package
try:
subprocess.call(['make', 'package_archive'])
except Exception, ex:
except Exception as ex:
sys.stderr.write('Make package release failed' + str(ex) + '\n')
sys.exit(1)
@@ -180,6 +180,6 @@ try:
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write(filepath, arcname=file)
z.close()
except Exception, ex:
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1)

View File

@@ -0,0 +1,103 @@
# - Find Alembic library
# Find the native Alembic includes and library
# This module defines
# 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 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 ALEMBIC_ROOT_DIR was defined in the environment, use it.
IF(NOT ALEMBIC_ROOT_DIR AND NOT $ENV{ALEMBIC_ROOT_DIR} STREQUAL "")
SET(ALEMBIC_ROOT_DIR $ENV{ALEMBIC_ROOT_DIR})
ENDIF()
SET(_alembic_SEARCH_DIRS
${ALEMBIC_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/alembic
)
SET(_alembic_FIND_COMPONENTS
AlembicAbc
AlembicAbcCoreAbstract
AlembicAbcGeom
AlembicAbcCoreOgawa
AlembicOgawa
AlembicUtil
)
FIND_PATH(ALEMBIC_INCLUDE_DIR
NAMES
Alembic/Abc/All.h
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
include
)
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
AlembicAbcCoreHDF5
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
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_LIBRARIES ALEMBIC_INCLUDE_DIR)
IF(ALEMBIC_FOUND)
SET(ALEMBIC_LIBRARIES ${_alembic_LIBRARIES})
SET(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
ENDIF(ALEMBIC_FOUND)
MARK_AS_ADVANCED(
ALEMBIC_INCLUDE_DIR
ALEMBIC_LIBRARIES
)

View File

@@ -0,0 +1,56 @@
# - Find Eigen3 library
# Find the native Eigen3 includes and library
# This module defines
# EIGEN3_INCLUDE_DIRS, where to find spnav.h, Set when
# EIGEN3_INCLUDE_DIR is found.
# EIGEN3_ROOT_DIR, The base directory to search for Eigen3.
# This can also be an environment variable.
# EIGEN3_FOUND, If false, do not try to use Eigen3.
#
#=============================================================================
# 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 EIGEN3_ROOT_DIR was defined in the environment, use it.
IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "")
SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR})
ENDIF()
SET(_eigen3_SEARCH_DIRS
${EIGEN3_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(EIGEN3_INCLUDE_DIR
NAMES
# header has no '.h' suffix
Eigen/Eigen
HINTS
${_eigen3_SEARCH_DIRS}
PATH_SUFFIXES
include/eigen3
)
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
EIGEN3_INCLUDE_DIR)
IF(EIGEN3_FOUND)
SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
ENDIF(EIGEN3_FOUND)
MARK_AS_ADVANCED(
EIGEN3_INCLUDE_DIR
)

View File

@@ -0,0 +1,75 @@
# - Find HDF5 library
# Find the native hdf5 includes and library
# This module defines
# 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.
#=============================================================================
# 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 HDF5_ROOT_DIR was defined in the environment, use it.
IF(NOT HDF5_ROOT_DIR AND NOT $ENV{HDF5_ROOT_DIR} STREQUAL "")
SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR})
ENDIF()
SET(_hdf5_SEARCH_DIRS
${HDF5_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/hdf5
)
SET(_hdf5_FIND_COMPONENTS
hdf5
hdf5_hl
)
FIND_PATH(_hdf5_INCLUDE_DIRS
NAMES
hdf5.h
HINTS
${_hdf5_SEARCH_DIRS}
)
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_LIBRARIES _hdf5_INCLUDE_DIRS)
IF(HDF5_FOUND)
SET(HDF5_LIBRARIES ${_hdf5_LIBRARIES})
SET(HDF5_INCLUDE_DIRS ${_hdf5_INCLUDE_DIRS})
ENDIF(HDF5_FOUND)
MARK_AS_ADVANCED(
HDF5_INCLUDE_DIRS
HDF5_LIBRARIES
)

View File

@@ -33,6 +33,7 @@ SET(_jemalloc_SEARCH_DIRS
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/jemalloc
)
FIND_PATH(JEMALLOC_INCLUDE_DIR

View File

@@ -0,0 +1,94 @@
# - Find LLVM library
# Find the native LLVM includes and library
# This module defines
# LLVM_INCLUDE_DIRS, where to find LLVM.h, Set when LLVM_INCLUDE_DIR is found.
# LLVM_LIBRARIES, libraries to link against to use LLVM.
# LLVM_ROOT_DIR, The base directory to search for LLVM.
# This can also be an environment variable.
# LLVM_FOUND, If false, do not try to use LLVM.
#
# also defined, but not for general use are
# LLVM_LIBRARY, where to find the LLVM 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(LLVM_ROOT_DIR)
if(DEFINED LLVM_VERSION)
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
endif()
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
endif()
else()
if(DEFINED LLVM_VERSION)
message(running llvm-config-${LLVM_VERSION})
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
endif()
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config)
endif()
endif()
if(NOT DEFINED LLVM_VERSION)
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_VERSION ${LLVM_VERSION} CACHE STRING "Version of LLVM to use")
endif()
if(NOT LLVM_ROOT_DIR)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_ROOT_DIR ${LLVM_ROOT_DIR} CACHE PATH "Path to the LLVM installation")
endif()
if(NOT LLVM_LIBPATH)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_LIBPATH ${LLVM_LIBPATH} CACHE PATH "Path to the LLVM library path")
mark_as_advanced(LLVM_LIBPATH)
endif()
if(LLVM_STATIC)
find_library(LLVM_LIBRARY
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
else()
find_library(LLVM_LIBRARY
NAMES LLVM-${LLVM_VERSION}
PATHS ${LLVM_LIBPATH})
endif()
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY "${LLVM_LIBRARY}")
endif()
endif()
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
LLVM_LIBRARY)
MARK_AS_ADVANCED(
LLVM_LIBRARY
)

View File

@@ -0,0 +1,68 @@
# - Find LZO library
# Find the native LZO includes and library
# This module defines
# LZO_INCLUDE_DIRS, where to find lzo1x.h, Set when
# LZO_INCLUDE_DIR is found.
# LZO_LIBRARIES, libraries to link against to use LZO.
# LZO_ROOT_DIR, The base directory to search for LZO.
# This can also be an environment variable.
# LZO_FOUND, If false, do not try to use LZO.
#
# also defined, but not for general use are
# LZO_LIBRARY, where to find the LZO 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 LZO_ROOT_DIR was defined in the environment, use it.
IF(NOT LZO_ROOT_DIR AND NOT $ENV{LZO_ROOT_DIR} STREQUAL "")
SET(LZO_ROOT_DIR $ENV{LZO_ROOT_DIR})
ENDIF()
SET(_lzo_SEARCH_DIRS
${LZO_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(LZO_INCLUDE_DIR lzo/lzo1x.h
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(LZO_LIBRARY
NAMES
lzo2
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
LZO_LIBRARY LZO_INCLUDE_DIR)
IF(LZO_FOUND)
SET(LZO_LIBRARIES ${LZO_LIBRARY})
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
ENDIF(LZO_FOUND)
MARK_AS_ADVANCED(
LZO_INCLUDE_DIR
LZO_LIBRARY
)

View File

@@ -51,6 +51,7 @@ SET(_openexr_SEARCH_DIRS
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/openexr
)
FIND_PATH(OPENEXR_INCLUDE_DIR

View File

@@ -71,6 +71,7 @@ ENDIF()
MARK_AS_ADVANCED(
OPENGLES_EGL_INCLUDE_DIR
OPENGLES_EGL_LIBRARY
OPENGLES_LIBRARY
OPENGLES_INCLUDE_DIR
)

View File

@@ -7,6 +7,8 @@
# OPENIMAGEIO_ROOT_DIR, The base directory to search for OpenImageIO.
# This can also be an environment variable.
# OPENIMAGEIO_FOUND, If false, do not try to use OpenImageIO.
# OPENIMAGEIO_PUGIXML_FOUND, Indicates whether OIIO has biltin PuguXML parser.
# OPENIMAGEIO_IDIFF, full path to idiff application if found.
#
# also defined, but not for general use are
# OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library.
@@ -54,6 +56,14 @@ FIND_LIBRARY(OPENIMAGEIO_LIBRARY
lib64 lib
)
FIND_FILE(OPENIMAGEIO_IDIFF
NAMES
idiff
${OPENIMAGEIO_ROOT_DIR}
PATH_SUFFIXES
bin
)
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
@@ -63,11 +73,17 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO DEFAULT_MSG
IF(OPENIMAGEIO_FOUND)
SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
ENDIF(OPENIMAGEIO_FOUND)
IF(EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/pugixml.hpp)
SET(OPENIMAGEIO_PUGIXML_FOUND TRUE)
ENDIF()
ELSE()
SET(OPENIMAGEIO_PUGIXML_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
OPENIMAGEIO_INCLUDE_DIR
OPENIMAGEIO_LIBRARY
OPENIMAGEIO_IDIFF
)
UNSET(_openimageio_SEARCH_DIRS)

View File

@@ -0,0 +1,98 @@
# - Find OpenShadingLanguage library
# Find the native OpenShadingLanguage includes and library
# This module defines
# OSL_INCLUDE_DIRS, where to find OSL headers, Set when
# OSL_INCLUDE_DIR is found.
# OSL_LIBRARIES, libraries to link against to use OSL.
# OSL_ROOT_DIR, the base directory to search for OSL.
# This can also be an environment variable.
# OSL_COMPILER, full path to OSL script compiler.
# OSL_FOUND, if false, do not try to use OSL.
# OSL_LIBRARY_VERSION_MAJOR, OSL_LIBRARY_VERSION_MINOR, the major
# and minor versions of OSL library if found.
#
#=============================================================================
# Copyright 2014 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 OSL_ROOT_DIR was defined in the environment, use it.
IF(NOT OSL_ROOT_DIR AND NOT $ENV{OSL_ROOT_DIR} STREQUAL "")
SET(OSL_ROOT_DIR $ENV{OSL_ROOT_DIR})
ENDIF()
SET(_osl_FIND_COMPONENTS
oslcomp
oslexec
oslquery
)
SET(_osl_SEARCH_DIRS
${OSL_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/osl
)
FIND_PATH(OSL_INCLUDE_DIR
NAMES
OSL/oslversion.h
HINTS
${_osl_SEARCH_DIRS}
PATH_SUFFIXES
include
)
SET(_osl_LIBRARIES)
FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(OSL_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_osl_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
LIST(APPEND _osl_LIBRARIES "${OSL_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
FIND_PROGRAM(OSL_COMPILER oslc
HINTS ${_osl_SEARCH_DIRS}
PATH_SUFFIXES bin)
# handle the QUIETLY and REQUIRED arguments and set OSL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSL DEFAULT_MSG _osl_LIBRARIES OSL_INCLUDE_DIR OSL_COMPILER)
IF(OSL_FOUND)
SET(OSL_LIBRARIES ${_osl_LIBRARIES})
SET(OSL_INCLUDE_DIRS ${OSL_INCLUDE_DIR})
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_MAJOR
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+[0-9]+.*$")
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_MINOR
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+[0-9]+.*$")
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
ENDIF(OSL_FOUND)
MARK_AS_ADVANCED(
OSL_INCLUDE_DIR
)
FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
MARK_AS_ADVANCED(OSL_${UPPERCOMPONENT}_LIBRARY)
ENDFOREACH()

View File

@@ -40,7 +40,6 @@ FIND_PATH(PCRE_INCLUDE_DIR pcre.h
${_pcre_SEARCH_DIRS}
PATH_SUFFIXES
include
include
)
FIND_LIBRARY(PCRE_LIBRARY

View File

@@ -0,0 +1,73 @@
# - Find PugiXML library
# Find the native PugiXML includes and library
# This module defines
# PUGIXML_INCLUDE_DIRS, where to find pugixml.hpp, Set when
# PugiXML is found.
# PUGIXML_LIBRARIES, libraries to link against to use PugiiXML.
# PUGIXML_ROOT_DIR, The base directory to search for PugiXML.
# This can also be an environment variable.
# PUGIXML_FOUND, If false, do not try to use PugiXML.
#
# also defined, but not for general use are
# PUGIXML_LIBRARY, where to find the PugiXML library.
#=============================================================================
# Copyright 2014 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 PUGIXML_ROOT_DIR was defined in the environment, use it.
IF(NOT PUGIXML_ROOT_DIR AND NOT $ENV{PUGIXML_ROOT_DIR} STREQUAL "")
SET(PUGIXML_ROOT_DIR $ENV{PUGIXML_ROOT_DIR})
ENDIF()
SET(_pugixml_SEARCH_DIRS
${PUGIXML_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/oiio
)
FIND_PATH(PUGIXML_INCLUDE_DIR
NAMES
pugixml.hpp
HINTS
${_pugixml_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(PUGIXML_LIBRARY
NAMES
pugixml
HINTS
${_pugixml_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PUGIXML DEFAULT_MSG
PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
IF(PUGIXML_FOUND)
SET(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
SET(PUGIXML_INCLUDE_DIRS ${PUGIXML_INCLUDE_DIR})
ELSE()
SET(PUGIXML_PUGIXML_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
PUGIXML_INCLUDE_DIR
PUGIXML_LIBRARY
)

View File

@@ -14,6 +14,7 @@
# PYTHON_INCLUDE_CONFIG_DIRS
# PYTHON_LIBRARIES
# PYTHON_LIBPATH, Used for installation
# PYTHON_SITE_PACKAGES, Used for installation (as a Python module)
# PYTHON_LINKFLAGS
# PYTHON_ROOT_DIR, The base directory to search for Python.
# This can also be an environment variable.
@@ -65,6 +66,14 @@ IF(DEFINED PYTHON_LIBPATH)
SET(_IS_LIB_PATH_DEF ON)
ENDIF()
STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/lib/python-${PYTHON_VERSION}"
)
# only search for the dirs if we havn't already
IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF))
@@ -74,14 +83,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
"dm;dmu;du;d" # debug
)
STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/lib/python-${PYTHON_VERSION}"
)
FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
#IF(CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -146,6 +148,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
ENDIF()
IF(PYTHON_LIBRARY AND PYTHON_LIBPATH AND PYTHON_INCLUDE_DIR AND PYTHON_INCLUDE_CONFIG_DIR)
SET(_PYTHON_ABI_FLAGS "${_CURRENT_ABI_FLAGS}")
break()
ELSE()
# ensure we dont find values from 2 different ABI versions
@@ -168,7 +171,6 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
UNSET(_CURRENT_PATH)
UNSET(_python_ABI_FLAGS)
UNSET(_python_SEARCH_DIRS)
ENDIF()
UNSET(_IS_INC_DEF)
@@ -187,17 +189,41 @@ IF(PYTHONLIBSUNIX_FOUND)
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
FIND_FILE(PYTHON_SITE_PACKAGES
NAMES
# debian specific
dist-packages
site-packages
HINTS
${PYTHON_LIBPATH}/python${PYTHON_VERSION}
)
# we need this for installation
# XXX No more valid with debian-like py3.4 packages...
# GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
# not used
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
# not required for build, just used when bundling Python.
FIND_PROGRAM(
PYTHON_EXECUTABLE
NAMES
"python${PYTHON_VERSION}${_PYTHON_ABI_FLAGS}"
"python${PYTHON_VERSION}"
"python"
HINTS
${_python_SEARCH_DIRS}
PATH_SUFFIXES bin
)
ENDIF()
UNSET(_PYTHON_VERSION_NO_DOTS)
UNSET(_PYTHON_ABI_FLAGS)
UNSET(_python_SEARCH_DIRS)
MARK_AS_ADVANCED(
PYTHON_INCLUDE_DIR
PYTHON_INCLUDE_CONFIG_DIR
PYTHON_LIBRARY
PYTHON_LIBPATH
PYTHON_SITE_PACKAGES
PYTHON_EXECUTABLE
)

View File

@@ -0,0 +1,72 @@
# - Find SDL library
# Find the native SDL includes and library
# This module defines
# SDL2_INCLUDE_DIRS, where to find SDL.h, Set when SDL2_INCLUDE_DIR is found.
# SDL2_LIBRARIES, libraries to link against to use SDL.
# SDL2_ROOT_DIR, The base directory to search for SDL.
# This can also be an environment variable.
# SDL2_FOUND, If false, do not try to use SDL.
#
# also defined, but not for general use are
# SDL2_LIBRARY, where to find the SDL 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 SDL2_ROOT_DIR was defined in the environment, use it.
IF(NOT SDL2_ROOT_DIR AND NOT $ENV{SDL2_ROOT_DIR} STREQUAL "")
SET(SDL2_ROOT_DIR $ENV{SDL2_ROOT_DIR})
ENDIF()
SET(_sdl2_SEARCH_DIRS
${SDL2_ROOT_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(SDL2_INCLUDE_DIR
NAMES
SDL.h
HINTS
${_sdl2_SEARCH_DIRS}
PATH_SUFFIXES
include/SDL2 include
)
FIND_LIBRARY(SDL2_LIBRARY
NAMES
SDL2
HINTS
${_sdl2_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 DEFAULT_MSG
SDL2_LIBRARY SDL2_INCLUDE_DIR)
IF(SDL2_FOUND)
SET(SDL2_LIBRARIES ${SDL2_LIBRARY})
SET(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
ENDIF(SDL2_FOUND)
MARK_AS_ADVANCED(
SDL2_INCLUDE_DIR
SDL2_LIBRARY
)

View File

@@ -32,6 +32,8 @@ macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
bf_testing_main
bf_intern_guardedalloc
extern_gtest
# needed for glog
${PTHREADS_LIBRARIES}
extern_glog)
set_target_properties(${NAME}_test PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"

View File

@@ -60,7 +60,8 @@ if(EXISTS ${SOURCE_DIR}/.git)
execute_process(COMMAND git log HEAD..@{u}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_below_check
OUTPUT_STRIP_TRAILING_WHITESPACE)
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.

View File

@@ -28,13 +28,17 @@ if not sys.version.startswith("3"):
sys.version.partition(" ")[0])
sys.exit(1)
from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR
from cmake_consistency_check_config import (
IGNORE,
UTF8_CHECK,
SOURCE_DIR,
BUILD_DIR,
)
import os
from os.path import join, dirname, normpath, splitext
print("Scanning:", SOURCE_DIR)
global_h = set()
global_c = set()
global_refs = {}
@@ -134,6 +138,7 @@ def cmake_get_src(f):
if found:
cmake_base = dirname(f)
cmake_base_bin = os.path.join(BUILD_DIR, os.path.relpath(cmake_base, SOURCE_DIR))
while it is not None:
i += 1
@@ -154,6 +159,8 @@ def cmake_get_src(f):
# replace dirs
l = l.replace("${CMAKE_CURRENT_SOURCE_DIR}", cmake_base)
l = l.replace("${CMAKE_CURRENT_BINARY_DIR}", cmake_base_bin)
l = l.strip('"')
if not l:
pass
@@ -187,17 +194,22 @@ def cmake_get_src(f):
pass
elif new_file.endswith(".osl"): # open shading language
pass
elif new_file.endswith(".glsl"):
pass
else:
raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file))
elif context_name == "INC":
if os.path.isdir(new_file):
if new_file.startswith(BUILD_DIR):
# assume generated path
pass
elif os.path.isdir(new_file):
new_path_rel = os.path.relpath(new_file, cmake_base)
if new_path_rel != l:
print("overly relative path:\n %s:%d\n %s\n %s" % (f, i, l, new_path_rel))
## Save time. just replace the line
# # Save time. just replace the line
# replace_line(f, i - 1, new_path_rel)
else:
@@ -228,10 +240,6 @@ def cmake_get_src(f):
filen.close()
for cmake in source_list(SOURCE_DIR, is_cmake):
cmake_get_src(cmake)
def is_ignore(f):
for ig in IGNORE:
if ig in f:
@@ -239,73 +247,83 @@ def is_ignore(f):
return False
# First do stupid check, do these files exist?
print("\nChecking for missing references:")
is_err = False
errs = []
for f in (global_h | global_c):
if f.endswith("dna.c"):
continue
def main():
if not os.path.exists(f):
refs = global_refs[f]
if refs:
for cf, i in refs:
errs.append((cf, i))
else:
raise Exception("CMake referenecs missing, internal error, aborting!")
is_err = True
print("Scanning:", SOURCE_DIR)
errs.sort()
errs.reverse()
for cf, i in errs:
print("%s:%d" % (cf, i))
# 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))
for cmake in source_list(SOURCE_DIR, is_cmake):
cmake_get_src(cmake)
# First do stupid check, do these files exist?
print("\nChecking for missing references:")
is_err = False
errs = []
for f in (global_h | global_c):
if f.startswith(BUILD_DIR):
continue
if not os.path.exists(f):
refs = global_refs[f]
if refs:
for cf, i in refs:
errs.append((cf, i))
else:
raise Exception("CMake referenecs missing, internal error, aborting!")
is_err = True
errs.sort()
errs.reverse()
for cf, i in errs:
print("%s:%d" % (cf, i))
# 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
if is_err:
raise Exception("CMake referenecs missing files, aborting!")
del is_err
del errs
# 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):
if cf not in global_c:
print("missing_c: ", cf)
# 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):
if cf not in global_c:
print("missing_c: ", cf)
# check if automake builds a corrasponding .o file.
'''
if cf in global_c:
out1 = os.path.splitext(cf)[0] + ".o"
out2 = os.path.splitext(cf)[0] + ".Po"
out2_dir, out2_file = out2 = os.path.split(out2)
out2 = os.path.join(out2_dir, ".deps", out2_file)
if not os.path.exists(out1) and not os.path.exists(out2):
print("bad_c: ", cf)
'''
# check if automake builds a corrasponding .o file.
'''
if cf in global_c:
out1 = os.path.splitext(cf)[0] + ".o"
out2 = os.path.splitext(cf)[0] + ".Po"
out2_dir, out2_file = out2 = os.path.split(out2)
out2 = os.path.join(out2_dir, ".deps", out2_file)
if not os.path.exists(out1) and not os.path.exists(out2):
print("bad_c: ", cf)
'''
print("\nC/C++ Headers CMake doesnt know about...")
for hf in sorted(source_list(SOURCE_DIR, is_c_header)):
if not is_ignore(hf):
if hf not in global_h:
print("missing_h: ", hf)
print("\nC/C++ Headers CMake doesnt know about...")
for hf in sorted(source_list(SOURCE_DIR, is_c_header)):
if not is_ignore(hf):
if hf not in global_h:
print("missing_h: ", hf)
if UTF8_CHECK:
# test encoding
import traceback
for files in (global_c, global_h):
for f in sorted(files):
if os.path.exists(f):
# ignore outside of our source tree
if "extern" not in f:
i = 1
try:
for l in open(f, "r", encoding="utf8"):
i += 1
except:
print("Non utf8: %s:%d" % (f, i))
if i > 1:
traceback.print_exc()
if UTF8_CHECK:
# test encoding
import traceback
for files in (global_c, global_h):
for f in sorted(files):
if os.path.exists(f):
# ignore outside of our source tree
if "extern" not in f:
i = 1
try:
for l in open(f, "r", encoding="utf8"):
i += 1
except UnicodeDecodeError:
print("Non utf8: %s:%d" % (f, i))
if i > 1:
traceback.print_exc()
if __name__ == "__main__":
main()

View File

@@ -74,3 +74,6 @@ IGNORE = (
UTF8_CHECK = True
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))))
# doesn't have to exist, just use as reference
BUILD_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(SOURCE_DIR, "..", "build"))))

View File

@@ -29,18 +29,19 @@ Example linux usage
Windows not supported so far
"""
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,
)
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

View File

@@ -22,26 +22,27 @@
# <pep8 compliant>
"""
r"""
Example Linux usage:
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 c:\blender_dev\cmake_build
example linux usage
python .~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake
"""
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,
)
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
@@ -63,18 +64,19 @@ def create_qtc_project_main():
if SIMPLE_PROJECTFILE:
# --- qtcreator specific, simple format
PROJECT_NAME = "Blender"
with open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w') as f:
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" % PROJECT_NAME), 'w') as f:
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))))))
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
with open(qtc_prj, 'w') as f:
f.write("[General]\n")
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
if not os.path.exists(qtc_cfg):
with open(qtc_cfg, 'w') as f:
f.write("// ADD PREDEFINED MACROS HERE!\n")

View File

@@ -118,6 +118,19 @@ macro(target_link_libraries_debug TARGET LIBS)
unset(_LIB)
endmacro()
macro(target_link_libraries_decoupled target libraries_var)
if(NOT MSVC)
target_link_libraries(${target} ${${libraries_var}})
else()
# For MSVC we link to different libraries depending whether
# release or debug target is being built.
file_list_suffix(_libraries_debug "${${libraries_var}}" "_d")
target_link_libraries_debug(${target} "${_libraries_debug}")
target_link_libraries_optimized(${target} "${${libraries_var}}")
unset(_libraries_debug)
endif()
endmacro()
# Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
# use it instead of include_directories()
macro(blender_include_dirs
@@ -283,8 +296,13 @@ macro(setup_liblinks
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
target_link_libraries(${target}
${BLENDER_GL_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
${FREETYPE_LIBRARY})
@@ -303,6 +321,9 @@ macro(setup_liblinks
endif()
endif()
if(WITH_LZO AND WITH_SYSTEM_LZO)
target_link_libraries(${target} ${LZO_LIBRARIES})
endif()
if(WITH_SYSTEM_GLEW)
target_link_libraries(${target} ${BLENDER_GLEW_LIBRARIES})
endif()
@@ -336,6 +357,9 @@ macro(setup_liblinks
if(WITH_OPENCOLORIO)
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
endif()
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_BOOST)
target_link_libraries(${target} ${BOOST_LIBRARIES})
if(Boost_USE_STATIC_LIBS AND Boost_USE_ICU)
@@ -357,14 +381,6 @@ macro(setup_liblinks
target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
endif()
if(WITH_CODEC_FFMPEG)
# Strange! Without this ffmpeg gives linking errors (on linux),
# even though it's linked above.
# XXX: Does FFMPEG depend on GLU?
if(WITH_GLU)
target_link_libraries(${target} ${OPENGL_glu_LIBRARY})
endif()
target_link_libraries(${target} ${FFMPEG_LIBRARIES})
endif()
if(WITH_OPENCOLLADA)
@@ -402,23 +418,30 @@ macro(setup_liblinks
if(WITH_MOD_CLOTH_ELTOPO)
target_link_libraries(${target} ${LAPACK_LIBRARIES})
endif()
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_LLVM)
target_link_libraries(${target} ${LLVM_LIBRARY})
endif()
if(WITH_ALEMBIC)
target_link_libraries(${target} ${ALEMBIC_LIBRARIES})
endif()
if(WITH_HDF5)
target_link_libraries(${target} ${HDF5_LIBRARIES})
endif()
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
endif()
target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
target_link_libraries(${target} "extern_clew")
target_link_libraries(${target} "extern_cuew")
endif()
#system libraries with no dependencies such as platform link libs or opengl should go last
target_link_libraries(${target}
${BLENDER_GL_LIBRARIES})
target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
endmacro()
macro(SETUP_BLENDER_SORTED_LIBS)
@@ -481,6 +504,7 @@ macro(SETUP_BLENDER_SORTED_LIBS)
bf_editor_object
bf_editor_armature
bf_editor_physics
bf_editor_hair
bf_editor_render
bf_editor_screen
bf_editor_sculpt_paint
@@ -499,13 +523,15 @@ macro(SETUP_BLENDER_SORTED_LIBS)
bf_ikplugin
bf_modifiers
bf_bmesh
bf_gpu
bf_blenkernel
bf_physics
bf_nodes
bf_rna
bf_gpu
bf_blenloader
bf_imbuf
bf_blenlib
bf_depsgraph
bf_intern_ghost
bf_intern_string
bf_avi
@@ -524,7 +550,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
ge_phys_dummy
ge_phys_bullet
bf_intern_smoke
extern_minilzo
extern_lzma
extern_colamd
ge_logic_ketsji
@@ -543,6 +568,8 @@ macro(SETUP_BLENDER_SORTED_LIBS)
ge_videotex
bf_dna
bf_blenfont
bf_pointcache_alembic
bf_pointcache
bf_intern_audaspace
bf_intern_mikktspace
bf_intern_dualcon
@@ -578,6 +605,10 @@ macro(SETUP_BLENDER_SORTED_LIBS)
list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
endif()
if(NOT WITH_SYSTEM_LZO)
list(APPEND BLENDER_SORTED_LIBS extern_minilzo)
endif()
if(NOT WITH_SYSTEM_GLEW)
list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES})
endif()
@@ -910,6 +941,7 @@ macro(remove_strict_flags)
remove_cc_flag("-Wstrict-prototypes")
remove_cc_flag("-Wmissing-prototypes")
remove_cc_flag("-Wunused-parameter")
remove_cc_flag("-Wunused-macros")
remove_cc_flag("-Wwrite-strings")
remove_cc_flag("-Wredundant-decls")
remove_cc_flag("-Wundef")
@@ -939,6 +971,20 @@ macro(remove_strict_flags)
endmacro()
macro(remove_extra_strict_flags)
if(CMAKE_COMPILER_IS_GNUCC)
remove_cc_flag("-Wunused-parameter")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
remove_cc_flag("-Wunused-parameter")
endif()
if(MSVC)
# TODO
endif()
endmacro()
# note, we can only append flags on a single file so we need to negate the options.
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
# probably add more removals here.
@@ -1000,6 +1046,15 @@ macro(ADD_CHECK_CXX_COMPILER_FLAG
endmacro()
function(get_blender_version)
# extracts header vars and defines them in the parent scope:
#
# - BLENDER_VERSION (major.minor)
# - BLENDER_VERSION_MAJOR
# - BLENDER_VERSION_MINOR
# - BLENDER_SUBVERSION (used for internal versioning mainly)
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
# So cmake depends on BKE_blender.h, beware of inf-loops!
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
@@ -1032,25 +1087,28 @@ function(get_blender_version)
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE")
endif()
math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}" PARENT_SCOPE)
set(BLENDER_SUBVERSION ${_out_subversion} PARENT_SCOPE)
set(BLENDER_VERSION_CHAR ${_out_version_char} PARENT_SCOPE)
set(BLENDER_VERSION_CYCLE ${_out_version_cycle} PARENT_SCOPE)
math(EXPR _out_version_major "${_out_version} / 100")
math(EXPR _out_version_minor "${_out_version} % 100")
# for packaging, alpha to numbers
string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty)
if(${_out_version_char_empty})
set(BLENDER_VERSION_CHAR_INDEX "0" PARENT_SCOPE)
set(_out_version_char_index "0")
else()
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1" PARENT_SCOPE)
list(FIND _char_ls ${_out_version_char} _out_version_char_index)
math(EXPR _out_version_char_index "${_out_version_char_index} + 1")
endif()
# message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
# output vars
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
endfunction()
@@ -1088,7 +1146,7 @@ endmacro()
macro(blender_project_hack_post)
# --------------
# MINGW HACK END
if (_reset_standard_libraries)
if(_reset_standard_libraries)
# Must come after projecINCt(...)
#
# MINGW workaround for -ladvapi32 being included which surprisingly causes

View File

@@ -27,7 +27,8 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
execute_process(COMMAND git rev-parse --short @{u}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
endif()
endif()
set(BUILD_REV ${MY_WC_HASH})
@@ -111,3 +112,9 @@ elseif(UNIX)
"tar.bz2")
endif()
unset(MAJOR_VERSION)
unset(MINOR_VERSION)
unset(PATCH_VERSION)
unset(BUILD_REV)

View File

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

View File

@@ -12,9 +12,9 @@ blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blen
# map the version a -> 1
# not to be confused with blender's internal subversions
if [ "$blender_version_char" ]; then
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
else
blender_version_full=${blender_version}
blender_version_full=${blender_version}
fi
blender_ver_string=$blender_version+git$blender_version_full
@@ -60,7 +60,7 @@ package() {
cd $srcdir/build
make DESTDIR="$pkgdir" install
python -m compileall \
$pkgdir/usr/share/blender/$blender_version/scripts/startup \
$pkgdir/usr/share/blender/$blender_version/scripts/modules \
$pkgdir/usr/share/blender/$blender_version/scripts/addons
$pkgdir/usr/share/blender/$blender_version/scripts/startup \
$pkgdir/usr/share/blender/$blender_version/scripts/modules \
$pkgdir/usr/share/blender/$blender_version/scripts/addons
}

View File

@@ -52,9 +52,9 @@ BF_OPENEXR = '/usr'
# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
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'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
WITH_BF_DDS = True
@@ -144,7 +144,7 @@ BF_REDCODE_LIB = ''
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 your using them as well....
# 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'
@@ -226,11 +226,25 @@ 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']
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
CFLAGS = ['-std=gnu89']
CXXFLAGS = []
CPPFLAGS = []

View File

@@ -170,6 +170,8 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
WITH_BF_IME = True
WITH_BF_OPENMP = True
#CUDA
@@ -196,7 +198,10 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-limm32']
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']

View File

@@ -33,7 +33,7 @@ WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_ICONV = True
@@ -69,7 +69,7 @@ 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_1 Half IlmImf-2_1 Imath-2_1 IlmThread-2_1 '
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'
@@ -151,6 +151,8 @@ 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
@@ -235,7 +237,10 @@ C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
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']

View File

@@ -169,6 +169,8 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
WITH_BF_IME = True
WITH_BF_OPENMP = True
#Freestyle
@@ -186,11 +188,15 @@ 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' ]
CC_WARN = [ '-Wall', '-Wno-char-subscripts' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-limm32']
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']

View File

@@ -34,7 +34,7 @@ WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_SNDFILE = True
@@ -66,7 +66,7 @@ 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_1 Half IlmImf-2_1 Imath-2_1 IlmThread-2_1 '
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'
@@ -154,6 +154,8 @@ 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
@@ -242,7 +244,10 @@ C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
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']

76
build_files/scons/tools/Blender.py Executable file → Normal file
View File

@@ -204,10 +204,20 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_OIIO_LIBPATH'])
if lenv['WITH_BF_STATICOIIO']:
statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
if lenv['WITH_BF_HDF5']:
libincs += Split(lenv['BF_HDF5_LIBPATH'])
if lenv['WITH_BF_ALEMBIC']:
libincs += Split(lenv['BF_ALEMBIC_LIBPATH'])
if lenv['WITH_BF_STATICALEMBIC']:
statlibs += Split(lenv['BF_ALEMBIC_LIB_STATIC'])
if lenv['WITH_BF_OPENEXR']:
libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
if lenv['WITH_BF_STATICOPENEXR']:
statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
if lenv['WITH_BF_ZLIB'] and lenv['WITH_BF_STATICZLIB']:
statlibs += Split(lenv['BF_ZLIB_LIB_STATIC'])
@@ -216,16 +226,16 @@ def setup_staticlibs(lenv):
if lenv['WITH_BF_STATICOCIO']:
statlibs += Split(lenv['BF_OCIO_LIB_STATIC'])
if lenv['WITH_BF_BOOST']:
libincs += Split(lenv['BF_BOOST_LIBPATH'])
if lenv['WITH_BF_STATICBOOST']:
statlibs += Split(lenv['BF_BOOST_LIB_STATIC'])
if lenv['WITH_BF_CYCLES_OSL']:
libincs += Split(lenv['BF_OSL_LIBPATH'])
if lenv['WITH_BF_STATICOSL']:
statlibs += Split(lenv['BF_OSL_LIB_STATIC'])
if lenv['WITH_BF_BOOST']:
libincs += Split(lenv['BF_BOOST_LIBPATH'])
if lenv['WITH_BF_STATICBOOST']:
statlibs += Split(lenv['BF_BOOST_LIB_STATIC'])
if lenv['WITH_BF_LLVM']:
libincs += Split(lenv['BF_LLVM_LIBPATH'])
if lenv['WITH_BF_STATICLLVM']:
@@ -283,8 +293,16 @@ def setup_syslibs(lenv):
if not lenv['WITH_BF_STATICOCIO']:
syslibs += Split(lenv['BF_OCIO_LIB'])
if lenv['WITH_BF_HDF5']:
syslibs += Split(lenv['BF_HDF5_LIB'])
if lenv['WITH_BF_ALEMBIC']:
if not lenv['WITH_BF_STATICALEMBIC']:
syslibs += Split(lenv['BF_ALEMBIC_LIB'])
if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']:
syslibs += Split(lenv['BF_OPENEXR_LIB'])
if lenv['WITH_BF_ZLIB'] and not lenv['WITH_BF_STATICZLIB']:
syslibs += Split(lenv['BF_ZLIB_LIB'])
if lenv['WITH_BF_TIFF'] and not lenv['WITH_BF_STATICTIFF']:
@@ -325,16 +343,16 @@ def setup_syslibs(lenv):
if lenv['WITH_BF_3DMOUSE']:
if not lenv['WITH_BF_STATIC3DMOUSE']:
syslibs += Split(lenv['BF_3DMOUSE_LIB'])
if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
syslibs += Split(lenv['BF_BOOST_LIB'])
if lenv['WITH_BF_INTERNATIONAL']:
syslibs += Split(lenv['BF_BOOST_LIB_INTERNATIONAL'])
if lenv['WITH_BF_CYCLES_OSL'] and not lenv['WITH_BF_STATICOSL']:
syslibs += Split(lenv['BF_OSL_LIB'])
if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
syslibs += Split(lenv['BF_BOOST_LIB'])
if lenv['WITH_BF_INTERNATIONAL']:
syslibs += Split(lenv['BF_BOOST_LIB_INTERNATIONAL'])
if lenv['WITH_BF_LLVM'] and not lenv['WITH_BF_STATICLLVM']:
syslibs += Split(lenv['BF_LLVM_LIB'])
@@ -372,7 +390,23 @@ def propose_priorities():
def creator(env):
sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
incs = ['#/intern/guardedalloc',
'#/source/blender/blenlib',
'#/source/blender/blenkernel',
'#/source/blender/depsgraph',
'#/source/blender/editors/include',
'#/source/blender/blenloader',
'#/source/blender/imbuf',
'#/source/blender/renderconverter',
'#/source/blender/render/extern/include',
'#/source/blender/windowmanager',
'#/source/blender/makesdna',
'#/source/blender/makesrna',
'#/source/blender/pointcache',
'#/source/gameengine/BlenderRoutines',
'#/extern/glew/include',
'#/source/blender/gpu',
env['BF_OPENGL_INC']]
defs = []
@@ -441,7 +475,7 @@ def buildinfo(lenv, build_type):
no_upstream = False
try :
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}']).strip()
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}'], stderr=subprocess.STDOUT).strip()
except subprocess.CalledProcessError:
# assume branch has no upstream configured
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
@@ -630,7 +664,7 @@ def WinPyBundle(target=None, source=None, env=None):
py_tar+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '.tar.gz'
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
py_target = os.path.join(py_target, VERSION, 'python', 'lib')
py_target = os.path.join(py_target, VERSION, 'python')
def printexception(func,path,ex):
if os.path.exists(path): #do not report if path does not exist. eg on a fresh build.
print str(func) + ' failed on ' + str(path)
@@ -654,7 +688,7 @@ def WinPyBundle(target=None, source=None, env=None):
# Extract Numpy
if env['WITH_BF_PYTHON_INSTALL_NUMPY']:
py_tar = env.subst(env['LCGDIR']).lstrip("#")
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.9.tar.gz'
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')
@@ -670,6 +704,8 @@ def WinPyBundle(target=None, source=None, env=None):
py_dir += '/release/site-packages'
# grr, we have to do one by one because the dir exists
for f in os.listdir(py_dir):
if f == '.svn':
continue
fn_src = os.path.join(py_dir, f)
fn_dst = os.path.join(py_target, f)
@@ -762,7 +798,7 @@ def AppIt(target=None, source=None, env=None):
commands.getoutput(cmd)
cmd = 'cp -R %s/kernel/*.h %s/kernel/*.cl %s/kernel/*.cu %s/kernel/' % (croot, croot, croot, cinstalldir)
commands.getoutput(cmd)
cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir)
cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_math_fast.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir)
commands.getoutput(cmd)
cmd = 'cp -R %s/../intern/cycles/kernel/*.cubin %s/lib/' % (builddir, cinstalldir)
commands.getoutput(cmd)
@@ -816,6 +852,8 @@ def AppIt(target=None, source=None, env=None):
instname = env['LCGDIR'][1:] # made libiomp5 part of blender libs
cmd = 'ditto --arch %s %s/openmp/lib/libiomp5.dylib %s/%s.app/Contents/Resources/lib/'%(osxarch, instname, installdir, binary) # copy libiomp5
commands.getoutput(cmd)
cmd = 'cp %s/openmp/LICENSE.txt %s/LICENSE-libiomp5.txt'%(instname, installdir) # copy libiomp5 license
commands.getoutput(cmd)
# extract copy system python, be sure to update other build systems
# when making changes to the files that are copied.
@@ -839,6 +877,7 @@ def UnixPyBundle(target=None, source=None, env=None):
py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
py_target = env.subst( dir + '/python/' + target_lib + '/python'+env['BF_PYTHON_VERSION'] )
py_target_bin = env.subst(dir + '/python/bin')
# This is a bit weak, but dont install if its been installed before, makes rebuilds quite slow.
if os.path.exists(py_target):
@@ -858,6 +897,11 @@ def UnixPyBundle(target=None, source=None, env=None):
except:
pass
# install the executable
run("rm -rf '%s'" % py_target_bin)
os.makedirs(py_target_bin)
run("cp '%s' '%s'" % (env.subst(env['BF_PYTHON_BINARY']), py_target_bin))
run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
run("rm -rf '%s/distutils'" % py_target)
run("rm -rf '%s/lib2to3'" % py_target)

View File

@@ -174,6 +174,7 @@ def validate_arguments(args, bc):
'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',
@@ -181,7 +182,8 @@ def validate_arguments(args, bc):
'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_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
@@ -197,7 +199,8 @@ def validate_arguments(args, bc):
'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_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING',
'WITH_BF_CPP11', 'WITH_BF_LEGACY_DEPSGRAPH',
]
@@ -507,6 +510,8 @@ def read_opts(env, cfg, args):
(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', ''),
@@ -577,6 +582,19 @@ def read_opts(env, cfg, args):
(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(
@@ -650,7 +668,11 @@ def read_opts(env, cfg, args):
('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)', '')
('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

View File

@@ -25,7 +25,16 @@ TARBALL="blender-$VERSION.tar.gz"
cd "$blender_srcdir"
# not so nice, but works
FILTER_FILES_PY="import os, sys; [print(l[:-1]) for l in sys.stdin.readlines() if os.path.isfile(l[:-1])]"
FILTER_FILES_PY=\
"import os, sys; "\
"[print(l[:-1]) for l in sys.stdin.readlines() "\
"if os.path.isfile(l[:-1]) "\
"if os.path.basename(l[:-1]) not in {"\
"'.gitignore', "\
"'.gitmodules', "\
"'.arcconfig', "\
"}"\
"]"
# Build master list
echo -n "Building manifest of files: \"$BASE_DIR/$MANIFEST\" ..."

View File

@@ -35,13 +35,14 @@
defaults.
Much of the actual functionality can be found in the python scripts
in the directory $BLENDERHOME/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.
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
------------------

View File

@@ -29,9 +29,9 @@
a scons-local installation, which can be found in the scons/ subdirectory.
This document uses the scons-local installation for its examples.
Check from the page
http://www.blender.org/development/building-blender/getting-dependencies/
that you have all dependencies needed for building Blender. Note that for
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.
@@ -53,12 +53,13 @@
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/config/(platform)-config.py. After the build successfully
completes, you can find everything you need in BF_INSTALLDIR.
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.
@@ -72,8 +73,8 @@
---------------------
The default values for your platform can be found in the directory
$BLENDERHOME/config. Your platform specific defaults are in
(platform)-config.py, where platform is one of:
$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
@@ -81,12 +82,13 @@
- 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 config/(platform)-config.py that you want to change. Don't
copy the entire file (unless explicitely stated in the configuration file),
because you may not get updated options you don't change yourself, which may
result in build errors.
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:
@@ -113,11 +115,6 @@
(unless you have overridden any of them in your
$BLENDERHOME/user-config.py).
NOTE: The best way to avoid confusion is the
copy $BLENDERHOME/config/(platform)-config.py to
$BLENDERHOME/user-config.py. You should NEVER have to modify
$BLENDERHOME/config/(platform)-config.py
Configuring the output
----------------------

File diff suppressed because it is too large Load Diff

View File

@@ -10,26 +10,14 @@
* \ingroup intern
*/
/** \defgroup boolop boolop
* \ingroup intern
*/
/** \defgroup ctr container
* \ingroup intern
*/
/** \defgroup decimation decimation
* \ingroup intern
*/
/** \defgroup elbeem elbeem
* \ingroup intern
*/
/** \defgroup bsp bsp
* \ingroup intern
*/
/** \defgroup iksolver iksolver
* \ingroup intern
*/

View File

@@ -7,7 +7,7 @@
* These pages document the source code of blender.
*
* \subsection implinks Important Links
* - <a href="http://projects.blender.org">projects.blender.org</a> with <a href="http://projects.blender.org/tracker/index.php?group_id=9&atid=498">bug tracker</a>
* - <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

@@ -93,36 +93,44 @@
/* ================================ */
/** \defgroup blender blender */
/** \defgroup blender Blender */
/** \defgroup blf blenfont
/** \defgroup blf BlenFont
* \ingroup blender
*/
/** \defgroup bke blenkernel
/** \defgroup bke BlenKernel
* \ingroup blender
*/
/** \defgroup bli blenlib
/** \defgroup bli BlenLib
* \ingroup blender
*/
/** \defgroup nodes nodes
/** \defgroup depsgraph Dependency Graph
* \ingroup blender
*/
/** \defgroup cmpnodes cmpnodes
/** \defgroup bph Physics
* \ingroup blender
*/
/** \defgroup nodes Nodes
* \ingroup blender
*/
/** \defgroup cmpnodes Nodes (Compositor)
* \ingroup nodes
*/
/** \defgroup shdnodes shdnodes
/** \defgroup shdnodes Nodes (Shader)
* \ingroup nodes
*/
/** \defgroup texnodes texnodes
/** \defgroup texnodes Nodes (Texture)
* \ingroup nodes
*/
/** \defgroup modifiers modifiers
/** \defgroup modifiers Object Modifiers
* \ingroup blender
*/
@@ -132,29 +140,29 @@
* \ingroup blender
*/
/** \defgroup ikplugin ikplugin
/** \defgroup ikplugin IK Plugin
* \ingroup blender
*/
/** \defgroup DNA sDNA
/** \defgroup DNA Struct DNA (File Format)
* \ingroup blender data
*/
/** \defgroup RNA RNA
/** \defgroup RNA RNA (Data API)
* \ingroup blender data
*/
/** \defgroup blenloader .blend read and write functions
/** \defgroup blenloader Blend file IO
* \ingroup blender data
* \todo check if \ref blo and \ref blenloader groups can be
* merged in docs.
*/
/** \defgroup quicktime quicktime
/** \defgroup quicktime QuickTime
* \ingroup blender
/** \defgroup gui GUI */
/** \defgroup wm windowmanager
/** \defgroup wm Window Manager
* \ingroup blender gui
*/
@@ -324,7 +332,7 @@
* \ingroup externformats
*/
/** \defgroup imbuf IMage Buffer
/** \defgroup imbuf Image Buffer (ImBuf)
* \ingroup blender
*/

View File

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

View File

@@ -20,15 +20,15 @@ constraint_type = 2
physics_id_1 = object_1.getPhysicsId()
physics_id_2 = object_2.getPhysicsId()
# Use bottom right edge of Object1 for hinge position
# use bottom right edge of Object1 for hinge position
edge_position_x = 1.0
edge_position_y = 0.0
edge_position_z = -1.0
# use Object1 y axis for angle to point hinge
# rotate the pivot z axis about 90 degrees
edge_angle_x = 0.0
edge_angle_y = 1.0
edge_angle_z = 0.0
edge_angle_y = 0.0
edge_angle_z = 90.0
# create an edge constraint
constraints.createConstraint(physics_id_1, physics_id_2,

View File

@@ -1,16 +1,19 @@
"""
.. _operator-execution_context:
Execution Context
-----------------
When calling an operator you may want to pass the execution context.
This determines the context thats given to the operator to run in, and weather
invoke() is called or execute().
This determines the context that is given for the operator to run in, and whether
invoke() is called or only execute().
'EXEC_DEFAULT' is used by default but you may want the operator to take user
interaction with 'INVOKE_DEFAULT'.
'EXEC_DEFAULT' is used by default, running only the execute() method, but you may
want the operator to take user interaction with 'INVOKE_DEFAULT' which will also
call invoke() if existing.
The execution context is as a non keyword, string argument in:
The execution context is one of:
('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',

View File

@@ -3,7 +3,7 @@ PropertyGroup Example
+++++++++++++++++++++
PropertyGroups can be used for collecting custom settings into one value
to avoid many indervidual settings mixed in together.
to avoid many individual settings mixed in together.
"""
import bpy

View File

@@ -6,7 +6,7 @@ Custom properties can be added to any subclass of an :class:`ID`,
:class:`Bone` and :class:`PoseBone`.
These properties can be animated, accessed by the user interface and python
like blenders existing properties.
like Blender's existing properties.
"""
import bpy

View File

@@ -1,12 +1,11 @@
"""
Extending Menus
+++++++++++++++
When creating menus for addons you can't reference menus in blenders default
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.
Instead the addon can add menu items to existing menus.
The function menu_draw acts like Menu.draw
The function menu_draw acts like :class:`Menu.draw`.
"""
import bpy

View File

@@ -1,21 +1,20 @@
"""
Basic Menu Example
++++++++++++++++++
This script is a simple menu, menus differ from panels in that they must
Here is an example of a simple menu. Menus differ from panels in that they must
reference from a header, panel or another menu.
Notice the 'CATEGORY_MT_name' :class:`Menu.bl_idname`, this is a naming
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::
Menu's have their :class:`Layout.operator_context` initialized as
'EXEC_REGION_WIN' rather then 'INVOKE_DEFAULT', so if the operator context
needs to initialize inputs from the :class:`Operator.invoke` function
then this needs to be explicitly set.
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
:class:`Operator.invoke` function, then this needs to be explicitly set.
"""
import bpy

View File

@@ -7,7 +7,7 @@ A mix-in parent class can be used to share common properties and
import bpy
class View3DPanel():
class View3DPanel:
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'

View File

@@ -21,3 +21,12 @@ print(quat_out)
print("%.2f, %.2f, %.2f" % tuple(math.degrees(a) for a in quat_out.to_euler()))
print("(%.2f, %.2f, %.2f), %.2f" % (quat_out.axis[:] +
(math.degrees(quat_out.angle), )))
# multiple rotations can be interpolated using the exponential map
quat_c = mathutils.Quaternion((1.0, 0.0, 0.0), math.radians(15.0))
exp_avg = (quat_a.to_exponential_map() +
quat_b.to_exponential_map() +
quat_c.to_exponential_map()) / 3.0
quat_avg = mathutils.Quaternion(exp_avg)
print("Average rotation:")
print(quat_avg)

View File

@@ -18,16 +18,16 @@ matrix = mathutils.Matrix()
# Comparison operators can be done on Vector classes:
# greater and less then test vector length.
# (In)equality operators == and != test component values, e.g. 1,2,3 != 3,2,1
vec_a == vec_b
vec_a != vec_b
# Ordering operators >, >=, > and <= test vector length.
vec_a > vec_b
vec_a >= vec_b
vec_a < vec_b
vec_a <= vec_b
# ==, != test vector values e.g. 1,2,3 != 3,2,1 even if they are the same length
vec_a == vec_b
vec_a != vec_b
# Math can be performed on Vector classes
vec_a + vec_b

View File

@@ -11,51 +11,54 @@ Physics Constraints (bge.constraints)
.. literalinclude:: ../examples/bge.constraints.py
:lines: 6-
.. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag]]]])
.. function:: createConstraint(physicsid_1, physicsid_2, constraint_type, pivot_X, pivot_y, pivot_z, axis_x, axis_y, axis_z, flag)
Creates a constraint.
:arg physicsid: the physics id of the first object in constraint
:type physicsid: int
Constraints types:
- :class:`POINTTOPOINT_CONSTRAINT`
- :class:`LINEHINGE_CONSTRAINT`
- :class:`ANGULAR_CONSTRAINT`
- :class:`CONETWIST_CONSTRAINT`
- :class:`VEHICLE_CONSTRAINT`
- :class:`GENERIC_6DOF_CONSTRAINT`
:arg physicsid2: the physics id of the second object in constraint
:type physicsid2: int
:arg physicsid_1: the physics id of the first object in constraint.
:type physicsid_1: int
:arg constrainttype: the type of the constraint. The constraint types are:
- :class:`POINTTOPOINT_CONSTRAINT`
- :class:`LINEHINGE_CONSTRAINT`
- :class:`ANGULAR_CONSTRAINT`
- :class:`CONETWIST_CONSTRAINT`
- :class:`VEHICLE_CONSTRAINT`
- :class:`GENERIC_6DOF_CONSTRAINT`
:arg physicsid_2: the physics id of the second object in constraint.
:type physicsid_2: int
:arg constrainttype: the type of the constraint.
:type constrainttype: int
:arg pivotX: pivot X position
:type pivotX: float
:arg pivot_X: pivot X position (optional).
:type pivot_X: float
:arg pivotY: pivot Y position
:type pivotY: float
:arg pivot_Y: pivot Y position (optional).
:type pivot_Y: float
:arg pivotZ: pivot Z position
:type pivotZ: float
:arg pivot_Z: pivot Z position (optional).
:type pivot_Z: float
:arg axisX: X axis
:type axisX: float
:arg axis_X: X axis angle in degrees (optional).
:type axis_X: float
:arg axisY: Y axis
:type axisY: float
:arg axis_Y: Y axis angle in degrees (optional).
:type axis_Y: float
:arg axisZ: Z axis
:type axisZ: float
:arg axis_Z: Z axis angle in degrees (optional).
:type axis_Z: float
:arg flag: 128 to disable collision between linked bodies
:arg flag: 128 to disable collision between linked bodies (optional).
:type flag: int
:return: a constraint wrapper.
:rtype: :class:`bge.types.KX_ConstraintWrapper`
.. attribute:: error
Simbolic constant string that indicates error.
Symbolic constant string that indicates error.
.. function:: exportBulletFile(filename)

View File

@@ -8,9 +8,13 @@ Intro
.. module:: bge.render
Example of using a :class:`bge.types.SCA_MouseSensor`, and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook:
.. note::
This can also be achieved with the :class:`bge.types.KX_MouseActuator`.
.. code-block:: python
# Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook::
# To use a mouse movement sensor "Mouse" and a
# motion actuator to mouse look:
import bge
@@ -62,7 +66,7 @@ Constants
.. data:: KX_BLENDER_GLSL_MATERIAL
Materials approximating blender materials with GLSL.
.. DATA:: VSYNC_OFF
Disables vsync
@@ -75,6 +79,15 @@ Constants
Enables adaptive vsync if supported. Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. Otherwise, vsync is diabled if the framerate is too low.
.. data:: LEFT_EYE
Left eye being used during stereoscopic rendering.
.. data:: RIGHT_EYE
Right eye being used during stereoscopic rendering.
*********
Functions
*********
@@ -82,47 +95,55 @@ Functions
.. function:: getWindowWidth()
Gets the width of the window (in pixels)
:rtype: integer
.. function:: getWindowHeight()
Gets the height of the window (in pixels)
:rtype: integer
.. function:: setWindowSize(width, height)
Set the width and height of the window (in pixels). This also works for fullscreen applications.
:type width: integer
:type height: integer
.. function:: setFullScreen(enable)
Set whether or not the window should be fullscreen.
:type enable: bool
.. function:: getFullScreen()
Returns whether or not the window is fullscreen.
:rtype: bool
.. function:: getDisplayDimensions()
Get the actual display dimensions, in pixels, of the physical display (e.g., the monitor).
:type dimension: list [width,heigh]
.. function:: makeScreenshot(filename)
Writes a screenshot to the given filename.
If filename starts with // the image will be saved relative to the current directory.
If the filename contains # it will be replaced with the frame number.
The standalone player saves .png files. It does not support color space conversion
or gamma correction.
When run from Blender, makeScreenshot supports all Blender image file formats like PNG, TGA, Jpeg and OpenEXR.
Gamma, Colorspace conversion and Jpeg compression are taken from the Render settings panels.
Writes an image file with the current displayed frame.
The image is written to *'filename'*. The path may be absolute (eg. "/home/foo/image") or relative when started with
"//" (eg. "//image"). Note that absolute paths are not portable between platforms.
If the filename contains a "#", it will be replaced by an incremental index so that screenshots can be taken multiple
times without overwriting the previous ones (eg. "image-#").
Settings for the image are taken from the render settings (file format and respective settings, gamma and colospace
conversion, etc). The image resolution matches the framebuffer, meaning, the window size and aspect ratio.
When running from the standalone player, instead of the embedded player, only PNG files are supported. Additional
color conversions are also not supported.
:arg filename: path and name of the file to write
:type filename: string
@@ -134,65 +155,29 @@ Functions
.. function:: showMouse(visible)
Enables or disables the operating system mouse cursor.
:type visible: boolean
.. function:: setMousePosition(x, y)
Sets the mouse cursor position.
:type x: integer
:type y: integer
.. function:: setBackgroundColor(rgba)
Sets the window background color.
Sets the window background color. (Deprecated: use KX_WorldInfo.background_color)
:type rgba: list [r, g, b, a]
.. function:: setMistColor(rgb)
Sets the mist color.
:type rgb: list [r, g, b]
.. function:: setAmbientColor(rgb)
Sets the color of ambient light.
:type rgb: list [r, g, b]
.. function:: setMistStart(start)
Sets the mist start value. Objects further away than start will have mist applied to them.
:type start: float
.. function:: setMistEnd(end)
Sets the mist end value. Objects further away from this will be colored solid with
the color set by setMistColor().
:type end: float
.. function:: disableMist()
Disables mist.
.. note:: Set any of the mist properties to enable mist.
.. function:: setEyeSeparation(eyesep)
Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
:arg eyesep: The distance between the left and right eye.
:type eyesep: float
@@ -200,27 +185,36 @@ Functions
.. function:: getEyeSeparation()
Gets the current eye separation for stereo mode.
:rtype: float
.. function:: setFocalLength(focallength)
Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
:arg focallength: The focal length.
:arg focallength: The focal length.
:type focallength: float
.. function:: getFocalLength()
Gets the current focal length for stereo mode.
:rtype: float
.. function:: getStereoEye()
Gets the current stereoscopy eye being rendered.
This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` callback
function to customize the camera projection matrices for each
stereoscopic eye.
:rtype: LEFT_EYE, RIGHT_EYE
.. function:: setMaterialMode(mode)
Set the material mode to use for OpenGL rendering.
:type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. note:: Changes will only affect newly created scenes.
@@ -229,14 +223,14 @@ Functions
.. function:: getMaterialMode(mode)
Get the material mode to use for OpenGL rendering.
:rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. function:: setGLSLMaterialSetting(setting, enable)
Enables or disables a GLSL material setting.
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:type enable: boolean
@@ -244,43 +238,43 @@ Functions
.. function:: getGLSLMaterialSetting(setting, enable)
Get the state of a GLSL material setting.
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:rtype: boolean
.. function:: setAnisotropicFiltering(level)
Set the anisotropic filtering level for textures.
:arg level: The new anisotropic filtering level to use
:type level: integer (must be one of 1, 2, 4, 8, 16)
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getAnisotropicFiltering()
Get the anisotropic filtering level used for textures.
:rtype: integer (one of 1, 2, 4, 8, 16)
.. function:: setMipmapping(value)
Change how to use mipmapping.
:type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getMipmapping()
Get the current mipmapping setting.
:rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. function:: drawLine(fromVec,toVec,color)
Draw a line in the 3D scene.
:arg fromVec: the origin of the line
:type fromVec: list [x, y, z]
:arg toVec: the end of the line
@@ -292,7 +286,7 @@ Functions
.. function:: enableMotionBlur(factor)
Enable the motion blur effect.
:arg factor: the ammount of motion blur to display.
:type factor: float [0.0 - 1.0]

View File

@@ -37,7 +37,7 @@ base class --- :class:`PyObjectPlus`
The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.
:type: list [x, y, z]
:type: Vector((x, y, z))
.. method:: jump()

View File

@@ -23,15 +23,14 @@ base class --- :class:`PyObjectPlus`
:arg axis:
:type axis: integer
.. note::
For each axis:
* Lowerlimit == Upperlimit -> axis is locked
* Lowerlimit > Upperlimit -> axis is free
* Lowerlimit < Upperlimit -> axis it limited in that range
.. note::
* Lowerlimit == Upperlimit -> axis is locked
* Lowerlimit > Upperlimit -> axis is free
* Lowerlimit < Upperlimit -> axis it limited in that range
For PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:
PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:
axis = 3 is a constraint limit, with low/high limit value
* 3: X axis angle
:arg value0 (min): Set the minimum limit of the axis
@@ -39,7 +38,8 @@ base class --- :class:`PyObjectPlus`
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
PHY_CONE_TWIST_CONSTRAINT = 3:
For PHY_CONE_TWIST_CONSTRAINT = 4:
axis = 3..5 are constraint limits, high limit values
* 3: X axis angle
* 4: Y axis angle
@@ -50,7 +50,8 @@ base class --- :class:`PyObjectPlus`
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
PHY_GENERIC_6DOF_CONSTRAINT = 12:
For PHY_GENERIC_6DOF_CONSTRAINT = 12:
axis = 0..2 are constraint limits, with low/high limit value
* 0: X axis position
* 1: Y axis position
@@ -132,10 +133,10 @@ base class --- :class:`PyObjectPlus`
Returns the contraint type (read only)
:type: integer
- 1 = :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
- 2 = :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
- 3 = :class:`~bge.constraints.ANGULAR_CONSTRAINT`
- 4 = :class:`~bge.constraints.CONETWIST_CONSTRAINT`
- 11 = :class:`~bge.constraints.VEHICLE_CONSTRAINT`
- 12 = :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
* 1 = POINTTOPOINT_CONSTRAINT
* 2 = LINEHINGE_CONSTRAINT
* 3 = ANGULAR_CONSTRAINT (aka LINEHINGE_CONSTRAINT)
* 4 = CONETWIST_CONSTRAINT
* 11 = VEHICLE_CONSTRAINT
* 12 = GENERIC_6DOF_CONSTRAINT

View File

@@ -7,6 +7,26 @@ base class --- :class:`KX_GameObject`
.. class:: KX_FontObject(KX_GameObject)
TODO.
A Font object.
.. code-block:: python
# Display a message about the exit key using a Font object.
import bge
co = bge.logic.getCurrentController()
font = co.owner
exit_key = bge.events.EventToString(bge.logic.getExitKey())
if exit_key.endswith("KEY"):
exit_key = exit_key[:-3]
font.text = "Press key '%s' to quit the game." % exit_key
.. attribute:: text
The text displayed by this Font object.
:type: string

View File

@@ -78,6 +78,35 @@ base class --- :class:`SCA_IObject`
The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
.. attribute:: isSuspendDynamics
The object's dynamic state (read-only).
:type: boolean
.. seealso:: :py:meth:`suspendDynamics` and :py:meth:`restoreDynamics` allow you to change the state.
.. attribute:: linearDamping
The object's linear damping, also known as translational damping. Can be set simultaneously with angular damping using the :py:meth:`setDamping` method.
:type: float between 0 and 1 inclusive.
.. note::
The object must have a physics controller for the linear damping to be applied, otherwise the value will be returned as 0.0.
.. attribute:: angularDamping
The object's angular damping, also known as rotationation damping. Can be set simultaneously with linear damping using the :py:meth:`setDamping` method.
:type: float between 0 and 1 inclusive.
.. note::
The object must have a physics controller for the angular damping to be applied, otherwise the value will be returned as 0.0.
.. attribute:: linVelocityMin
Enforces the object keeps moving at a minimum velocity.
@@ -114,7 +143,7 @@ base class --- :class:`SCA_IObject`
the object's inertia vector in local coordinates. Read only.
:type: list [ix, iy, iz]
:type: Vector((ix, iy, iz))
.. attribute:: parent
@@ -124,21 +153,70 @@ base class --- :class:`SCA_IObject`
.. attribute:: groupMembers
Returns the list of group members if the object is a group object, otherwise None is returned.
Returns the list of group members if the object is a group object (dupli group instance), otherwise None is returned.
:type: :class:`CListValue` of :class:`KX_GameObject` or None
.. attribute:: groupObject
Returns the group object that the object belongs to or None if the object is not part of a group.
Returns the group object (dupli group instance) that the object belongs to or None if the object is not part of a group.
:type: :class:`KX_GameObject` or None
.. attribute:: collisionGroup
The object's collision group.
:type: bitfield
.. attribute:: collisionMask
The object's collision mask.
:type: bitfield
.. attribute:: collisionCallbacks
A list of callables to be run when a collision occurs.
A list of functions to be called when a collision occurs.
:type: list
:type: list of functions and/or methods
Callbacks should either accept one argument `(object)`, or three
arguments `(object, point, normal)`. For simplicity, per
colliding object only the first collision point is reported.
.. code-block:: python
# Function form
def callback_three(object, point, normal):
print('Hit by %r at %s with normal %s' % (object.name, point, normal))
def callback_one(object):
print('Hit by %r' % object.name)
def register_callback(controller):
controller.owner.collisionCallbacks.append(callback_three)
controller.owner.collisionCallbacks.append(callback_one)
# Method form
class YourGameEntity(bge.types.KX_GameObject):
def __init__(self, old_owner):
self.collisionCallbacks.append(self.on_collision_three)
self.collisionCallbacks.append(self.on_collision_one)
def on_collision_three(self, object, point, normal):
print('Hit by %r at %s with normal %s' % (object.name, point, normal))
def on_collision_one(self, object):
print('Hit by %r' % object.name)
.. note::
For backward compatibility, a callback with variable number of
arguments (using `*args`) will be passed only the `object`
argument. Only when there is more than one fixed argument (not
counting `self` for methods) will the three-argument form be
used.
.. attribute:: scene
@@ -374,6 +452,12 @@ base class --- :class:`SCA_IObject`
If true, the object's and children's debug properties will be displayed on screen.
:type: boolean
.. attribute:: currentLodLevel
The index of the level of detail (LOD) currently used by this object (read-only).
:type: int
.. method:: endObject()
@@ -496,7 +580,7 @@ base class --- :class:`SCA_IObject`
* True: you get the "local" velocity ie: relative to object orientation.
:type local: boolean
:return: the object's linear velocity.
:rtype: list [vx, vy, vz]
:rtype: Vector((vx, vy, vz))
.. method:: setLinearVelocity(velocity, local=False)
@@ -523,7 +607,7 @@ base class --- :class:`SCA_IObject`
* True: you get the "local" velocity ie: relative to object orientation.
:type local: boolean
:return: the object's angular velocity.
:rtype: list [vx, vy, vz]
:rtype: Vector((vx, vy, vz))
.. method:: setAngularVelocity(velocity, local=False)
@@ -547,7 +631,7 @@ base class --- :class:`SCA_IObject`
:arg point: optional point to return the velocity for, in local coordinates.
:type point: 3D Vector
:return: the velocity at the specified point.
:rtype: list [vx, vy, vz]
:rtype: Vector((vx, vy, vz))
.. method:: getReactionForce()
@@ -557,7 +641,7 @@ base class --- :class:`SCA_IObject`
This also includes impulses, eg from collisions.
:return: the reaction force of this object.
:rtype: list [fx, fy, fz]
:rtype: Vector((fx, fy, fz))
.. note::
@@ -580,13 +664,28 @@ base class --- :class:`SCA_IObject`
* True: you get the "local" impulse ie: relative to local coordinates with object orientation.
:type local: boolean
.. method:: suspendDynamics()
.. method:: setDamping(linear_damping, angular_damping)
Sets both the :py:attr:`linearDamping` and :py:attr:`angularDamping` simultaneously. This is more efficient than setting both properties individually.
:arg linear_damping: Linear ("translational") damping factor.
:type linear_damping: float ∈ [0, 1]
:arg angular_damping: Angular ("rotational") damping factor.
:type angular_damping: float ∈ [0, 1]
.. method:: suspendDynamics([ghost])
Suspends physics for this object.
:arg ghost: When set to `True`, collisions with the object will be ignored, similar to the "ghost" checkbox in
Blender. When `False` (the default), the object becomes static but still collide with other objects.
:type ghost: bool
.. seealso:: :py:attr:`isSuspendDynamics` allows you to inspect whether the object is in a suspended state.
.. method:: restoreDynamics()
Resumes physics for this object.
Resumes physics for this object. Also reinstates collisions; the object will no longer be a ghost.
.. note::
@@ -876,4 +975,4 @@ base class --- :class:`SCA_IObject`
:arg name: name of the property that added to the debug list.
:type name: string
:arg debug: the debug state.
:type debug: boolean
:type debug: boolean

View File

@@ -15,7 +15,7 @@ base class --- :class:`SCA_IActuator`
The force applied by the actuator.
:type: list [x, y, z]
:type: Vector((x, y, z))
.. attribute:: useLocalForce
@@ -27,7 +27,7 @@ base class --- :class:`SCA_IActuator`
The torque applied by the actuator.
:type: list [x, y, z]
:type: Vector((x, y, z))
.. attribute:: useLocalTorque
@@ -39,7 +39,7 @@ base class --- :class:`SCA_IActuator`
The displacement vector applied by the actuator.
:type: list [x, y, z]
:type: Vector((x, y, z))
.. attribute:: useLocalDLoc
@@ -51,7 +51,7 @@ base class --- :class:`SCA_IActuator`
The angular displacement vector applied by the actuator
:type: list [x, y, z]
:type: Vector((x, y, z))
.. note::
@@ -67,7 +67,7 @@ base class --- :class:`SCA_IActuator`
The linear velocity applied by the actuator.
:type: list [x, y, z]
:type: Vector((x, y, z))
.. attribute:: useLocalLinV
@@ -83,7 +83,7 @@ base class --- :class:`SCA_IActuator`
The angular velocity applied by the actuator.
:type: list [x, y, z]
:type: Vector((x, y, z))
.. attribute:: useLocalAngV

View File

@@ -83,6 +83,12 @@ base class --- :class:`PyObjectPlus`
This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
.. attribute:: world
The current active world, (read-only).
:type: :class:`KX_WorldInfo`
.. attribute:: suspended
True if the scene is suspended, (read-only).
@@ -119,21 +125,27 @@ base class --- :class:`PyObjectPlus`
:type: list
.. attribute:: pre_draw_setup
A list of callables to be run before the drawing setup (i.e., before the model view and projection matrices are computed).
:type: list
.. attribute:: gravity
The scene gravity using the world x, y and z axis.
:type: list [fx, fy, fz]
:type: Vector((gx, gy, gz))
.. method:: addObject(object, other, time=0)
.. method:: addObject(object, reference, time=0)
Adds an object to the scene like the Add Object Actuator would.
:arg object: The object to add
:arg object: The (name of the) object to add.
:type object: :class:`KX_GameObject` or string
:arg other: The object's center to use when adding the object
:type other: :class:`KX_GameObject` or string
:arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
:arg reference: The (name of the) object which position, orientation, and scale to copy (optional), if the object to add is a light and there is not reference the light's layer will be the same that the active layer in the blender scene.
:type reference: :class:`KX_GameObject` or string
:arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever (optional).
:type time: integer
:return: The newly added object.
:rtype: :class:`KX_GameObject`

View File

@@ -11,22 +11,25 @@ base class --- :class:`PyObjectPlus`
TODO - description
.. method:: addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
.. method:: addWheel(wheel, attachPos, downDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
Add a wheel to the vehicle
:arg wheel: The object to use as a wheel.
:type wheel: :class:`KX_GameObject` or a KX_GameObject name
:arg attachPos: The position that this wheel will attach to.
:type wheel: :class:`KX_GameObject` or a :class:`KX_GameObject` name
:arg attachPos: The position to attach the wheel, relative to the chassis object center.
:type attachPos: vector of 3 floats
:arg attachDir: The direction this wheel points.
:type attachDir: vector of 3 floats
:arg axleDir: The direction of this wheels axle.
:arg downDir: The direction vector pointing down to where the vehicle should collide with the floor.
:type downDir: vector of 3 floats
:arg axleDir: The axis the wheel rotates around, relative to the chassis.
:type axleDir: vector of 3 floats
:arg suspensionRestLength: TODO - Description
:arg suspensionRestLength: The length of the suspension when no forces are being applied.
:type suspensionRestLength: float
:arg wheelRadius: The size of the wheel.
:arg wheelRadius: The radius of the wheel (half the diameter).
:type wheelRadius: float
:arg hasSteering: True if the wheel should turn with steering, typically used in front wheels.
:type hasSteering: boolean
.. method:: applyBraking(force, wheelIndex)
@@ -38,6 +41,7 @@ base class --- :class:`PyObjectPlus`
:arg wheelIndex: index of the wheel where the force needs to be applied
:type wheelIndex: integer
.. method:: applyEngineForce(force, wheelIndex)
Apply an engine force to the specified wheel
@@ -48,6 +52,7 @@ base class --- :class:`PyObjectPlus`
:arg wheelIndex: index of the wheel where the force needs to be applied
:type wheelIndex: integer
.. method:: getConstraintId()
Get the constraint ID

View File

@@ -17,25 +17,25 @@ base class --- :class:`SCA_IObject`
The position of the vertex.
:type: list [x, y, z]
:type: Vector((x, y, z))
.. attribute:: UV
The texture coordinates of the vertex.
:type: list [u, v]
:type: Vector((u, v))
.. attribute:: normal
The normal of the vertex.
:type: list [nx, ny, nz]
:type: Vector((nx, ny, nz))
.. attribute:: color
The color of the vertex.
:type: list [r, g, b, a]
:type: Vector((r, g, b, a))
Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
@@ -110,13 +110,13 @@ base class --- :class:`SCA_IObject`
Gets the position of this vertex.
:return: this vertexes position in local coordinates.
:rtype: list [x, y, z]
:rtype: Vector((x, y, z))
.. method:: setXYZ(pos)
Sets the position of this vertex.
:type: list [x, y, z]
:type: Vector((x, y, z))
:arg pos: the new position for this vertex in local coordinates.
@@ -125,26 +125,26 @@ base class --- :class:`SCA_IObject`
Gets the UV (texture) coordinates of this vertex.
:return: this vertexes UV (texture) coordinates.
:rtype: list [u, v]
:rtype: Vector((u, v))
.. method:: setUV(uv)
Sets the UV (texture) coordinates of this vertex.
:type: list [u, v]
:type: Vector((u, v))
.. method:: getUV2()
Gets the 2nd UV (texture) coordinates of this vertex.
:return: this vertexes UV (texture) coordinates.
:rtype: list [u, v]
:rtype: Vector((u, v))
.. method:: setUV2(uv, unit)
Sets the 2nd UV (texture) coordinates of this vertex.
:type: list [u, v]
:type: Vector((u, v))
:arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
:arg unit: integer
@@ -197,7 +197,7 @@ base class --- :class:`SCA_IObject`
Gets the normal vector of this vertex.
:return: normalized normal vector.
:rtype: list [nx, ny, nz]
:rtype: Vector((nx, ny, nz))
.. method:: setNormal(normal)

View File

@@ -0,0 +1,79 @@
KX_WordlInfo(PyObjectPlus)
=============================
.. module:: bge.types
base class --- :class:`PyObjectPlus`
.. class:: KX_WorldInfo(PyObjectPlus)
A wolrd object.
.. code-block:: python
# Set the mist color to red.
import bge
sce = bge.logic.getCurrentScene()
sce.world.mistColor = [1.0, 0.0, 0.0]
.. data:: KX_MIST_QUADRATIC
Type of quadratic attenuation used to fade mist.
.. data:: KX_MIST_LINEAR
Type of linear attenuation used to fade mist.
.. data:: KX_MIST_INV_QUADRATIC
Type of inverse quadratic attenuation used to fade mist.
.. attribute:: mistEnable
Return the state of the mist.
:type: bool
.. attribute:: mistStart
The mist start point.
:type: float
.. attribute:: mistDistance
The mist distance fom the start point to reach 100% mist.
:type: float
.. attribute:: mistIntensity
The mist intensity.
:type: float
.. attribute:: mistType
The type of mist - must be KX_MIST_QUADRATIC, KX_MIST_LINEAR or KX_MIST_INV_QUADRATIC
.. attribute:: mistColor
The color of the mist. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
Mist and background color sould always set to the same color.
:type: :class:`mathutils.Vector`
.. attribute:: backgroundColor
The color of the background. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
Mist and background color sould always set to the same color.
:type: :class:`mathutils.Vector`
.. attribute:: ambientColor
The color of the ambient light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
:type: :class:`mathutils.Vector`

View File

@@ -23,8 +23,14 @@ base class --- :class:`SCA_ILogicBrick`
.. attribute:: frequency
The frequency for pulse mode sensors.
The frequency for pulse mode sensors. (Deprecated: use SCA_ISensor.skippedTicks)
:type: integer
.. attribute:: skippedTicks
Number of logic ticks skipped between 2 active pulses
:type: integer
.. attribute:: level

View File

@@ -25,7 +25,7 @@ base class --- :class:`PyObjectPlus`
The normalized x and y position of the mouse cursor.
:type: list [x, y]
:type: tuple (x, y)
.. attribute:: visible

View File

@@ -8,19 +8,17 @@ This module wraps OpenGL constants and functions, making them available from
within Blender Python.
The complete list can be retrieved from the module itself, by listing its
contents: dir(bgl). A simple search on the net can point to more
contents: dir(bgl). A simple search on the web can point to more
than enough material to teach OpenGL programming, from books to many
collections of tutorials.
The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
OpenGL}" and the online NeHe tutorials are two of the best resources.
Here is a comprehensive `list of books <http://www.opengl.org/documentation/books/>`_ (non free). The `arcsynthesis tutorials <http://www.arcsynthesis.org/gltut/>`_ is one of the best resources to learn modern OpenGL and `g-truc <http://www.g-truc.net/post-tech-content-sample.html>`_ offers a set of extensive examples, including advanced features.
.. note::
You can use the :class:`Image` type to load and set textures.
See :class:`Image.gl_load` and :class:`Image.gl_load`,
for example.
`OpenGL.org <http://www.opengl.org>`_
`NeHe GameDev <http://nehe.gamedev.net>`_
.. function:: glAccum(op, value):

View File

@@ -86,9 +86,15 @@ Consider the calculations that might go into working out the object's final tran
To avoid expensive recalculations every time a property is modified, Blender defers making the actual calculations until they are needed.
However, while the script runs you may want to access the updated values.
In this case you need to call :class:`bpy.types.Scene.update` after modifying values, for example:
This can be done by calling :class:`bpy.types.Scene.update` after modifying values which recalculates all data that is tagged to be updated.
.. code-block:: python
bpy.context.object.location = 1, 2, 3
bpy.context.scene.update()
Now all dependent data (child objects, modifiers, drivers... etc) has been recalculated and is available to the script.
Can I redraw during the script?
-------------------------------

View File

@@ -11,32 +11,22 @@ This API is generally stable but some areas are still being added and improved.
The Blender/Python API can do the following:
* Edit any data the user interface can (Scenes, Meshes, Particles etc.)
* Modify user preferences, keymaps and themes
* Run tools with own settings
* Create user interface elements such as menus, headers and panels
* Create new tools
* Create interactive tools
* Create new rendering engines that integrate with Blender
* Define new settings in existing Blender data
* Draw in the 3D view using OpenGL commands from Python
- Edit any data the user interface can (Scenes, Meshes, Particles etc.)
- Modify user preferences, keymaps and themes
- Run tools with own settings
- Create user interface elements such as menus, headers and panels
- Create new tools
- Create interactive tools
- Create new rendering engines that integrate with Blender
- Define new settings in existing Blender data
- Draw in the 3D view using OpenGL commands from Python
The Blender/Python API **can't** (yet)...
* Create new space types.
* Assign custom properties to every type.
* Define callbacks or listeners to be notified when data is changed.
- Create new space types.
- Assign custom properties to every type.
- Define callbacks or listeners to be notified when data is changed.
Before Starting
@@ -47,23 +37,21 @@ This document isn't intended to fully cover each topic. Rather, its purpose is t
A quick list of helpful things to know before starting:
* Blender uses Python 3.x; some 3rd party extensions are not available yet.
- Blender uses Python 3.x; some online documentation still assumes 2.x.
- The interactive console is great for testing one-liners, It also has autocompletion so you can inspect the API quickly.
- Button tool tips show Python attributes and operator names.
- Right clicking on buttons and menu items directly links to API documentation.
- For more examples, the text menu has a templates section where some example operators can be found.
- To examine further scripts distributed with Blender, see:
* The interactive console is great for testing one-liners, It also has autocompletion so you can inspect the api quickly.
* Button tool tips show Python attributes and operator names.
* Right clicking on buttons and menu items directly links to API documentation.
* For more examples, the text menu has a templates section where some example operators can be found.
* To examine further scripts distributed with Blender, see ``~/.blender/scripts/startup/bl_ui`` for the user interface and ``~/.blender/scripts/startup/bl_op`` for operators.
| ``~/.blender/scripts/startup/bl_ui`` for the user interface,
| ``~/.blender/scripts/startup/bl_op`` for operators.
Running Scripts
---------------
The two most common ways to execute python scripts are using the built-in text editor or entering commands in the python console.
The two most common ways to execute Python scripts are using the built-in text editor or entering commands in the Python console.
Both the **Text Editor** and **Python Console** are space types you can select from the view header.
@@ -82,7 +70,7 @@ Key Concepts
Data Access
-----------
Accessing datablocks
Accessing DataBlocks
^^^^^^^^^^^^^^^^^^^^
Python accesses Blender's data in the same way as the animation system and user interface; this implies that any setting that can be changed via a button can also be changed from Python.
@@ -116,7 +104,7 @@ Unlike Python's dictionaries, both methods are acceptable; however, the index of
bpy.data.objects["Cube"]
Accessing attributes
Accessing Attributes
^^^^^^^^^^^^^^^^^^^^
Once you have a data block, such as a material, object, groups etc., its attributes can be accessed much like you would change a setting using the graphical interface. In fact, the tooltip for each button also displays the Python attribute which can help in finding what settings to change in a script.
@@ -144,7 +132,7 @@ Example of a data path that can be quickly found via the console:
Data Creation/Removal
^^^^^^^^^^^^^^^^^^^^^
Those of you familiar with other python api's may be surprised that new datablocks in the bpy api can't be created by calling the class:
Those of you familiar with other Python API's may be surprised that new datablocks in the bpy API can't be created by calling the class:
>>> bpy.types.Mesh()
Traceback (most recent call last):
@@ -153,9 +141,9 @@ Those of you familiar with other python api's may be surprised that new databloc
This is an intentional part of the API design.
The blender/python api can't create blender data that exists outside the main blender database (accessed through bpy.data), because this data is managed by blender (save/load/undo/append... etc).
The Blender/Python API can't create Blender data that exists outside the main Blender database (accessed through :mod:`bpy.data`), because this data is managed by Blender (save/load/undo/append... etc).
Data is added and removed via methods on the collections in bpy.data, eg:
Data is added and removed via methods on the collections in :mod:`bpy.data`, eg:
>>> mesh = bpy.data.meshes.new(name="MyMesh")
>>> print(mesh)
@@ -167,7 +155,8 @@ Data is added and removed via methods on the collections in bpy.data, eg:
Custom Properties
^^^^^^^^^^^^^^^^^
Python can access properties on any datablock that has an ID (data that can be linked in and accessed from :mod:`bpy.data`. When assigning a property, you can make up your own names, these will be created when needed or overwritten if they exist.
Python can access properties on any datablock that has an ID (data that can be linked in and accessed from :mod:`bpy.data`.
When assigning a property, you can make up your own names, these will be created when needed or overwritten if they exist.
This data is saved with the blend file and copied with objects.
@@ -180,7 +169,7 @@ Example:
if "SomeProp" in bpy.context.object:
print("Property found")
# Use the get function like a python dictionary
# Use the get function like a Python dictionary
# which can have a fallback value.
value = bpy.data.scenes["Scene"].get("test_prop", "fallback value")
@@ -193,11 +182,9 @@ Example:
Note that these properties can only be assigned basic Python types.
* int, float, string
* array of ints/floats
* dictionary (only string keys are supported, values must be basic types too)
- int, float, string
- array of ints/floats
- dictionary (only string keys are supported, values must be basic types too)
These properties are valid outside of Python. They can be animated by curves or used in driver paths.
@@ -205,7 +192,8 @@ These properties are valid outside of Python. They can be animated by curves or
Context
-------
While it's useful to be able to access data directly by name or as a list, it's more common to operate on the user's selection. The context is always available from '''bpy.context''' and can be used to get the active object, scene, tool settings along with many other attributes.
While it's useful to be able to access data directly by name or as a list, it's more common to operate on the user's selection.
The context is always available from ``bpy.context`` and can be used to get the active object, scene, tool settings along with many other attributes.
Common-use cases:
@@ -220,9 +208,10 @@ So ``bpy.context.object = obj`` will raise an error.
But ``bpy.context.scene.objects.active = obj`` will work as expected.
The context attributes change depending on where they are accessed. The 3D view has different context members than the console, so take care when accessing context attributes that the user state is known.
The context attributes change depending on where they are accessed.
The 3D view has different context members than the console, so take care when accessing context attributes that the user state is known.
See :mod:`bpy.context` API reference
See :mod:`bpy.context` API reference.
Operators (Tools)
@@ -241,16 +230,17 @@ Examples:
.. note::
The menu item: Help -> Operator Cheat Sheet" gives a list of all operators and their default values in Python syntax, along with the generated docs. This is a good way to get an overview of all blender's operators.
The menu item: :menuselection:`Help --> Operator Cheat Sheet` gives a list of all operators and their default values in Python syntax, along with the generated docs.
This is a good way to get an overview of all Blender's operators.
Operator Poll()
^^^^^^^^^^^^^^^
Many operators have a "poll" function which may check that the mouse is in a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc).
When an operator's poll function fails within python, an exception is raised.
When an operator's poll function fails within Python, an exception is raised.
For example, calling bpy.ops.view3d.render_border() from the console raises the following error:
For example, calling ``bpy.ops.view3d.render_border()`` from the console raises the following error:
.. code-block:: python
@@ -271,13 +261,10 @@ Integration
Python scripts can integrate with Blender in the following ways:
* By defining a rendering engine.
* By defining operators.
* By defining menus, headers and panels.
* By inserting new buttons into existing menus, headers and panels
- By defining a rendering engine.
- By defining operators.
- By defining menus, headers and panels.
- By inserting new buttons into existing menus, headers and panels
In Python, this is done by defining a class, which is a subclass of an existing type.
@@ -292,24 +279,17 @@ Once this script runs, ``SimpleOperator`` is registered with Blender and can be
To run the script:
#. Highlight the above code then press Ctrl+C to copy it.
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it.
#. Start Blender
#. Press Ctrl+Right twice to change to the Scripting layout.
#. Press :kbd:`Ctrl-Right` twice to change to the Scripting layout.
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
#. Press Ctrl+V to paste the code into the text panel (the upper left frame).
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame).
#. Click on the button **Run Script**.
#. Move your mouse into the 3D view, press spacebar for the operator search menu, and type "Simple".
#. Click on the "Simple Operator" item found in search.
.. seealso:: The class members with the **bl_** prefix are documented in the API
.. seealso:: The class members with the ``bl_`` prefix are documented in the API
reference :class:`bpy.types.Operator`
.. note:: The output from the ``main`` function is sent to the terminal; in order to see this, be sure to :ref:`use the terminal <use_the_terminal>`.
@@ -317,33 +297,25 @@ To run the script:
Example Panel
-------------
Panels register themselves as a class, like an operator. Notice the extra **bl_** variables used to set the context they display in.
Panels register themselves as a class, like an operator. Notice the extra ``bl_`` variables used to set the context they display in.
.. literalinclude:: ../../../release/scripts/templates_py/ui_panel_simple.py
To run the script:
#. Highlight the above code then press Ctrl+C to copy it
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it
#. Start Blender
#. Press Ctrl+Right twice to change to the Scripting layout
#. Press :kbd:`Ctrl-Right` twice to change to the Scripting layout
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
#. Press Ctrl+V to paste the code into the text panel (the upper left frame)
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame)
#. Click on the button **Run Script**.
To view the results:
#. Select the the default cube.
#. Click on the Object properties icon in the buttons panel (far right; appears as a tiny cube).
#. Scroll down to see a panel named **Hello World Panel**.
#. Changing the object name also updates **Hello World Panel's** Name: field.
Note the row distribution and the label and properties that are available through the code.
@@ -362,16 +334,14 @@ Blender's Python API can be split up into 3 categories.
Native Types
------------
In simple cases returning a number or a string as a custom type would be cumbersome, so these are accessed as normal python types.
In simple cases returning a number or a string as a custom type would be cumbersome, so these are accessed as normal Python types.
* blender float/int/boolean -> float/int/boolean
* blender enumerator -> string
- Blender float/int/boolean -> float/int/boolean
- Blender enumerator -> string
>>> C.object.rotation_mode = 'AXIS_ANGLE'
* blender enumerator (multiple) -> set of strings
- Blender enumerator (multiple) -> set of strings
.. code-block:: python
@@ -389,7 +359,7 @@ Used for Blender datablocks and collections: :class:`bpy.types.bpy_struct`
For data that contains its own attributes groups/meshes/bones/scenes... etc.
There are 2 main types that wrap Blenders data, one for datablocks (known internally as bpy_struct), another for properties.
There are 2 main types that wrap Blenders data, one for datablocks (known internally as ``bpy_struct``), another for properties.
>>> bpy.context.object
bpy.data.objects['Cube']

View File

@@ -19,21 +19,17 @@ Prerequisites
Before going through the tutorial you should...
* Familiarity with the basics of working in Blender.
* Know how to run a script in Blender's text editor (as documented in the quick-start)
* Have an understanding of Python primitive types (int, boolean, string, list, tuple, dictionary, and set).
* Be familiar with the concept of Python modules.
* Basic understanding of classes (object orientation) in Python.
- Familiarity with the basics of working in Blender.
- Know how to run a script in Blender's text editor (as documented in the quick-start)
- Have an understanding of Python primitive types (int, boolean, string, list, tuple, dictionary, and set).
- Be familiar with the concept of Python modules.
- Basic understanding of classes (object orientation) in Python.
Suggested reading before starting this tutorial.
* `Dive Into Python <http://getpython3.com/diveintopython3/index.html>`_ sections (1, 2, 3, 4, and 7).
* :ref:`Blender API Quickstart <info_quickstart>`
- `Dive Into Python <http://getpython3.com/diveintopython3/index.html>`_ sections (1, 2, 3, 4, and 7).
- :ref:`Blender API Quickstart <info_quickstart>`
to help become familiar with Blender/Python basics.
@@ -45,13 +41,11 @@ Documentation Links
While going through the tutorial you may want to look into our reference documentation.
* :ref:`Blender API Overview <info_overview>`. -
- :ref:`Blender API Overview <info_overview>`. -
*This document is rather detailed but helpful if you want to know more on a topic.*
* :mod:`bpy.context` api reference. -
- :mod:`bpy.context` api reference. -
*Handy to have a list of available items your script may operate on.*
* :class:`bpy.types.Operator`. -
- :class:`bpy.types.Operator`. -
*The following addons define operators, these docs give details and more examples of operators.*
@@ -78,11 +72,11 @@ To give an example, here is the simplest possible addon.
print("Goodbye World")
* ``bl_info`` is a dictionary containing addon meta-data such as the title, version and author to be displayed in the
- ``bl_info`` is a dictionary containing addon meta-data such as the title, version and author to be displayed in the
user preferences addon list.
* ``register`` is a function which only runs when enabling the addon, this means the module can be loaded without
- ``register`` is a function which only runs when enabling the addon, this means the module can be loaded without
activating the addon.
* ``unregister`` is a function to unload anything setup by ``register``, this is called when the addon is disabled.
- ``unregister`` is a function to unload anything setup by ``register``, this is called when the addon is disabled.
@@ -184,12 +178,15 @@ This addon takes the body of the script above, and adds them to an operator's ``
register()
.. note:: ``bl_info`` is split across multiple lines, this is just a style convention used to more easily add items.
.. note::
.. note:: Rather than using ``bpy.context.scene``, we use the ``context.scene`` argument passed to ``execute()``.
In most cases these will be the same however in some cases operators will be passed a custom context
so script authors should prefer the ``context`` argument passed to operators.
``bl_info`` is split across multiple lines, this is just a style convention used to more easily add items.
.. note::
Rather than using ``bpy.context.scene``, we use the ``context.scene`` argument passed to ``execute()``.
In most cases these will be the same however in some cases operators will be passed a custom context
so script authors should prefer the ``context`` argument passed to operators.
To test the script you can copy and paste this into Blender text editor and run it, this will execute the script
directly and call register immediately.
@@ -202,8 +199,8 @@ However running the script wont move any objects, for this you need to execute t
:height: 574px
:alt: Spacebar
Do this by pressing ``SpaceBar`` to bring up the operator search dialog and type in "Move X by One" (the ``bl_label``),
then press ``Enter``.
Do this by pressing :kbd:`Spacebar` to bring up the operator search dialog and type in
"Move X by One" (the ``bl_label``), then :kbd:`Enter`.
@@ -214,8 +211,8 @@ The objects should move as before.
Install The Addon
-----------------
Once you have your addon within in Blender's text editor, you will want to be able to install it so it can be enabled in
the user preferences to load on startup.
Once you have your addon within in Blender's text editor,
you will want to be able to install it so it can be enabled in the user preferences to load on startup.
Even though the addon above is a test, lets go through the steps anyway so you know how to do it for later.
@@ -633,15 +630,12 @@ you want to see example code for, this is a good place to start.
Here are some sites you might like to check on after completing this tutorial.
* :ref:`Blender/Python API Overview <info_overview>` -
- :ref:`Blender/Python API Overview <info_overview>` -
*For more background details on Blender/Python integration.*
* `How to Think Like a Computer Scientist <http://interactivepython.org/courselib/static/thinkcspy/index.html>`_ -
- `How to Think Like a Computer Scientist <http://interactivepython.org/courselib/static/thinkcspy/index.html>`_ -
*Great info for those who are still learning Python.*
* `Blender Development (Wiki) <http://wiki.blender.org/index.php/Dev:Contents>`_ -
- `Blender Development (Wiki) <http://wiki.blender.org/index.php/Dev:Contents>`_ -
*Blender Development, general information and helpful links.*
* `Blender Artists (Coding Section) <http://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
- `Blender Artists (Coding Section) <http://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
*forum where people ask Python development questions*

View File

@@ -316,7 +316,7 @@ def main():
try:
import argparse
except:
except ImportError:
print("Old Blender, just dumping")
api_dump()
return

View File

@@ -138,19 +138,9 @@ def handle_args():
parser.add_argument("-T", "--sphinx-theme",
dest="sphinx_theme",
type=str,
default='default',
help=
# see SPHINX_THEMES below
"Sphinx theme (default='default')\n"
"Available themes\n"
"----------------\n"
"(Blender Foundation) blender-org\n" # naiad
"(Sphinx) agogo, basic, epub, haiku, nature, "
"scrolls, sphinxdoc, traditional\n",
# choices=['naiad', 'blender-org'] + # bf
# ['agogo', 'basic', 'epub',
# 'haiku', 'nature', 'scrolls',
# 'sphinxdoc', 'traditional'], # sphinx
default="classic",
help="Sphinx theme (default='classic'), "
"see: http://sphinx-doc.org/theming.html",
required=False)
parser.add_argument("-N", "--sphinx-named-output",
@@ -267,6 +257,7 @@ else:
"bpy.props",
"bpy.types", # supports filtering
"bpy.utils",
"bpy.utils.previews",
"bpy_extras",
"gpu",
"mathutils",
@@ -419,23 +410,7 @@ BLENDER_ZIP_FILENAME = "%s.zip" % REFERENCE_NAME
# -------------------------------SPHINX-----------------------------------------
SPHINX_THEMES = {'bf': ['blender-org'], # , 'naiad',
'sphinx': ['agogo',
'basic',
'default',
'epub',
'haiku',
'nature',
'scrolls',
'sphinxdoc',
'traditional']}
available_themes = SPHINX_THEMES['bf'] + SPHINX_THEMES['sphinx']
if ARGS.sphinx_theme not in available_themes:
print("Please choose a theme among: %s" % ', '.join(available_themes))
sys.exit()
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
if ARGS.sphinx_theme == "blender-org":
SPHINX_THEME_DIR = os.path.join(ARGS.output_dir, ARGS.sphinx_theme)
SPHINX_THEME_SVN_DIR = os.path.join(SCRIPT_DIR, ARGS.sphinx_theme)
@@ -480,9 +455,11 @@ ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None))
from types import (MemberDescriptorType,
MethodType,
)
from types import (
MemberDescriptorType,
MethodType,
FunctionType,
)
_BPY_STRUCT_FAKE = "bpy_struct"
_BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection"
@@ -659,19 +636,26 @@ def pyfunc2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_cla
func_type = "function"
# ther rest are class methods
elif arg_str.startswith("(self, "):
arg_str = "(" + arg_str[7:]
elif arg_str.startswith("(self, ") or arg_str == "(self)":
arg_str = "()" if (arg_str == "(self)") else ("(" + arg_str[7:])
func_type = "method"
elif arg_str.startswith("(cls, "):
arg_str = "(" + arg_str[6:]
arg_str = "()" if (arg_str == "(cls)") else ("(" + arg_str[6:])
func_type = "classmethod"
else:
func_type = "staticmethod"
fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
if py_func.__doc__:
write_indented_lines(ident + " ", fw, py_func.__doc__)
doc = py_func.__doc__
if (not doc) or (not doc.startswith(".. %s:: " % func_type)):
fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
ident_temp = ident + " "
else:
ident_temp = ident
if doc:
write_indented_lines(ident_temp, fw, doc)
fw("\n")
del doc, ident_temp
if is_class:
write_example_ref(ident + " ", fw, module_name + "." + type_name + "." + identifier)
@@ -887,7 +871,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
for attribute, value, value_type in module_dir_value_type:
if value_type == types.FunctionType:
if value_type == FunctionType:
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof
# note: can't get args from these, so dump the string as is
@@ -937,18 +921,29 @@ def pymodule2sphinx(basepath, module_name, module, title):
fw(title_string(heading, heading_char))
# May need to be its own function
fw(".. class:: %s\n\n" % type_name)
if value.__doc__:
write_indented_lines(" ", fw, value.__doc__, False)
fw("\n")
if value.__doc__.startswith(".. class::"):
fw(value.__doc__)
else:
fw(".. class:: %s\n\n" % type_name)
write_indented_lines(" ", fw, value.__doc__, True)
else:
fw(".. class:: %s\n\n" % type_name)
fw("\n")
write_example_ref(" ", fw, module_name + "." + type_name)
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")]
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("_")]
for key, descr in descr_items:
if type(descr) == ClassMethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
# needed for pure python classes
for key, descr in descr_items:
if type(descr) == FunctionType:
pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True)
for key, descr in descr_items:
if type(descr) == MethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
@@ -971,10 +966,12 @@ def pymodule2sphinx(basepath, module_name, module, title):
context_type_map = {
"active_base": ("ObjectBase", False),
"active_bone": ("EditBone", False),
"active_gpencil_frame": ("GreasePencilLayer", True),
"active_gpencil_layer": ("GPencilLayer", True),
"active_node": ("Node", False),
"active_object": ("Object", False),
"active_operator": ("Operator", False),
"active_pose_bone": ("PoseBone", False),
"active_node": ("Node", False),
"armature": ("Armature", False),
"bone": ("Bone", False),
"brush": ("Brush", False),
@@ -990,7 +987,11 @@ context_type_map = {
"edit_object": ("Object", False),
"edit_text": ("Text", False),
"editable_bones": ("EditBone", True),
"editable_gpencil_layers": ("GPencilLayer", True),
"editable_gpencil_strokes": ("GPencilStroke", True),
"fluid": ("FluidSimulationModifier", False),
"gpencil_data": ("GreasePencel", False),
"gpencil_data_owner": ("ID", False),
"image_paint_object": ("Object", False),
"lamp": ("Lamp", False),
"lattice": ("Lattice", False),
@@ -1030,6 +1031,7 @@ context_type_map = {
"vertex_paint_object": ("Object", False),
"visible_bases": ("ObjectBase", True),
"visible_bones": ("EditBone", True),
"visible_gpencil_layers": ("GPencilLayer", True),
"visible_objects": ("Object", True),
"visible_pose_bones": ("PoseBone", True),
"weight_paint_object": ("Object", False),
@@ -1252,6 +1254,7 @@ def pyrna2sphinx(basepath):
fw("\n\n")
subclass_ids = [s.identifier for s in structs.values() if s.base is struct if not rna_info.rna_id_ignore(s.identifier)]
subclass_ids.sort()
if subclass_ids:
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n")
@@ -1559,7 +1562,7 @@ def write_sphinx_conf_py(basepath):
if ARGS.sphinx_theme != 'default':
fw("html_theme = '%s'\n" % ARGS.sphinx_theme)
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
if ARGS.sphinx_theme == "blender-org":
fw("html_theme_path = ['../']\n")
# copied with the theme, exclude else we get an error [#28873]
fw("html_favicon = 'favicon.ico'\n") # in <theme>/static/
@@ -1620,6 +1623,7 @@ def write_rst_contents(basepath):
# py modules
"bpy.utils",
"bpy.utils.previews",
"bpy.path",
"bpy.app",
"bpy.app.handlers",
@@ -1974,7 +1978,7 @@ def main():
copy_function=shutil.copy)
# eventually, copy the theme dir
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
if ARGS.sphinx_theme == "blender-org":
if os.path.exists(SPHINX_THEME_DIR):
shutil.rmtree(SPHINX_THEME_DIR, True)
shutil.copytree(SPHINX_THEME_SVN_DIR,

View File

@@ -26,11 +26,14 @@
# Otherwise we get warnings here that we cant fix in external projects
remove_strict_flags()
add_subdirectory(colamd)
add_subdirectory(rangetree)
add_subdirectory(wcwidth)
add_subdirectory(libmv)
if(WITH_OPENNL)
add_subdirectory(colamd)
endif()
if(WITH_BULLET)
if(NOT WITH_SYSTEM_BULLET)
add_subdirectory(bullet2)
@@ -66,7 +69,7 @@ if(WITH_IMAGE_REDCODE)
add_subdirectory(libredcode)
endif()
if(WITH_LZO)
if(WITH_LZO AND NOT WITH_SYSTEM_LZO)
add_subdirectory(lzo)
endif()

View File

@@ -6,3 +6,8 @@ Erwin
Apply patches/convex_hull.patch to add access to the convex hull
operation, used in the BMesh convex hull operator.
Documentation is available at:
http://code.google.com/p/bullet/source/browse/trunk/Bullet_User_Manual.pdf
and:
https://github.com/bulletphysics/bullet3/tree/master/docs

View File

@@ -171,6 +171,7 @@ extern "C" {
/* Convex Hull */
PL_DECLARE_HANDLE(plConvexHull);
plConvexHull plConvexHullCompute(float (*coords)[3], int count);
void plConvexHullDelete(plConvexHull hull);
int plConvexHullNumVertices(plConvexHull hull);
int plConvexHullNumFaces(plConvexHull hull);
void plConvexHullGetVertex(plConvexHull hull, int n, float coords[3], int *original_index);

View File

@@ -15,7 +15,7 @@ subject to the following restrictions:
/**
* @mainpage Bullet Documentation
* @page Bullet Documentation
*
* @section intro_sec Introduction
* Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license ( http://opensource.org/licenses/zlib-license.php ).

View File

View File

View File

@@ -413,6 +413,12 @@ plConvexHull plConvexHullCompute(float (*coords)[3], int count)
return reinterpret_cast<plConvexHull>(computer);
}
void plConvexHullDelete(plConvexHull hull)
{
btConvexHullComputer *computer(reinterpret_cast< btConvexHullComputer* >(hull));
delete computer;
}
int plConvexHullNumVertices(plConvexHull hull)
{
btConvexHullComputer *computer(reinterpret_cast< btConvexHullComputer* >(hull));

View File

@@ -105,8 +105,6 @@ blender_add_lib(extern_carve "\${SRC}" "\${INC}" "\${INC_SYS}")
EOF
cat > SConscript << EOF
#!/usr/bin/python
# NOTE: This file is automatically generated by bundle.sh script
# If you're doing changes in this file, please update template
# in that script too

View File

@@ -2751,6 +2751,30 @@ CLEW_FUN_EXPORT PFNCLGETGLCONTEXTINFOKHR __clewGetGLContextInfoKH
#endif
#define clGetGLContextInfoKHR CLEW_GET_FUN(__clewGetGLContextInfoKHR )
/* cl_ext */
/******************************************
* cl_nv_device_attribute_query extension *
******************************************/
/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */
#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000
#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001
#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002
#define CL_DEVICE_WARP_SIZE_NV 0x4003
#define CL_DEVICE_GPU_OVERLAP_NV 0x4004
#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
/*********************************
* cl_amd_device_attribute_query *
*********************************/
#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
/*********************************
* cl_arm_printf extension
*********************************/
#define CL_PRINTF_CALLBACK_ARM 0x40B0
#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
#define CLEW_SUCCESS 0 //!< Success error code
#define CLEW_ERROR_OPEN_FAILED -1 //!< Error code for failing to open the dynamic library

View File

@@ -37,13 +37,42 @@ set(SRC
libmv-capi.h
)
if(WITH_LIBMV)
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
list(APPEND INC
third_party/gflags
third_party/gflags/gflags
third_party/glog/src
third_party/ceres/include
third_party/ceres/config
../../intern/guardedalloc
)
list(APPEND INC_SYS
${EIGEN3_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
add_definitions(
-DWITH_LIBMV_GUARDED_ALLOC
-DGOOGLE_GLOG_DLL_DECL=
-DLIBMV_NO_FAST_DETECTOR=
)
endif()
if(WITH_LIBMV)
TEST_SHARED_PTR_SUPPORT()
if(SHARED_PTR_FOUND)
if(SHARED_PTR_TR1_MEMORY_HEADER)
@@ -56,20 +85,6 @@ if(WITH_LIBMV)
message(FATAL_ERROR "Unable to find shared_ptr.")
endif()
list(APPEND INC
third_party/gflags
third_party/glog/src
third_party/ceres/include
third_party/ceres/config
../../intern/guardedalloc
)
list(APPEND INC_SYS
../Eigen3
${PNG_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)
list(APPEND SRC
intern/autotrack.cc
intern/camera_intrinsics.cc
@@ -202,17 +217,6 @@ if(WITH_LIBMV)
third_party/msinttypes/stdint.h
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
if(WITH_GTESTS)
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "" "")
@@ -262,7 +266,7 @@ if(WITH_LIBMV)
endif()
# make GLog a separate target, so it can be used for gtest as well.
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
# We compile GLog together with GFlag so we don't worry about
# adding extra lib to linker.
set(GLOG_SRC
@@ -303,6 +307,9 @@ if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
third_party/glog/src/windows/glog/log_severity.h
third_party/glog/src/windows/port.h
third_party/glog/src/windows/config.h
third_party/gflags/windows_port.cc
third_party/gflags/windows_port.h
)
else()
list(APPEND GLOG_SRC
@@ -338,13 +345,5 @@ if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
)
endif()
set(GLOG_INC
third_party/gflags
third_party/glog/src
)
set(GLOG_INC_SYS
)
blender_add_lib(extern_glog "${GLOG_SRC}" "${GLOG_INC}" "${GLOG_INC_SYS}")
blender_add_lib(extern_glog "${GLOG_SRC}" "${INC}" "${INC_SYS}")
endif()

View File

@@ -1,3 +1,42 @@
commit 7d6020d2ec42c6cb2749bc891186b4880d26d40b
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Wed Dec 31 15:32:07 2014 +0500
Update GLog to latest upstream revision 143
Mainly to solve compilation error with demangle.cc.
commit 5dc746700eaf85cb674f0fb73ff3c1b49a7f6315
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Fri Dec 12 14:59:55 2014 +0500
Update GFlags to latest release 2.1.1
Main purpose of this (andsome of upcoming) update is to check if the
upstream sources are useable without any modifications for us. And if
not, then we'll need to consider moving some changes into upstream.
This commit contains an one-to-one copy of the upstream GFlags library
and also changes namespace usage since it's changed in the upstream.
commit 6fe6d75f7e90e161b44643b953f058a3829a5247
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Sat Nov 1 02:53:36 2014 +0500
Libmv: Code cleanup, mixed class/struct in declaration/definition
commit d2a5f7953812d2d09765431b59c6c4ac72faf35b
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Thu Oct 30 23:13:53 2014 +0500
Libmv: Support disabled color channels in tracking settings
This was never ported to a new tracking pipeline and now it's done using
FrameAccessor::Transform routines. Quite striaghtforward, but i've changed
order of grayscale conversion in blender side with call of transform callback.
This way it's much easier to perform rescaling in libmv side.
commit d976e034cdf74b34860e0632d7b29713f47c5756
Author: Keir Mierle <mierle@gmail.com>
Date: Sat Aug 23 00:38:01 2014 -0700
@@ -666,37 +705,3 @@ Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Tue Feb 18 19:38:22 2014 +0600
Remove .orig file which was added by accident
commit 62597e3cf0f266a2fefec415c89759e502793e06
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Thu Jan 2 16:02:08 2014 +0600
Upgrade glog to latest svn r139
The intention of this upgrade is to get rid of custom patches
we've been having to support compilation on different platforms
and compilers.
commit 2452d5d42b390c7ab853e6fe60e58bdd7a01a004
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Tue Feb 18 18:46:08 2014 +0600
Tweak Ceres CMake to detect uninstall target properly on Windows
commit 98a281d58ce2301f3dd239a97a448e53f48d0258
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Fri Feb 14 00:36:44 2014 +0600
Fix order of third party libs compilation and options used by them
WITH_FAST_DETECTOR was defined too late and third_party folder
didn't see this option.
commit 4962bccd643ec0f2aed3035170d5f20e8f6efc85
Author: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Thu Feb 13 23:55:03 2014 +0600
Disable Ceres unit tests and examples by default
Actually we're to switch to external Ceres rather than
bundled one, would make life much easier actually.

View File

@@ -12,6 +12,22 @@ Import('env')
defs = []
incs = '.'
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
incs += ' ../Eigen3 third_party/gflags third_party/gflags/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
else:
incs += ' ./third_party/glog/src'
if env['WITH_BF_LIBMV']:
if not env['WITH_SHARED_PTR_SUPPORT']:
print("-- Unable to find shared_ptr which is required for compilation.")
@@ -22,10 +38,6 @@ if env['WITH_BF_LIBMV']:
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
defs.append('CERES_TR1_SHARED_PTR')
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
src = env.Glob('intern/*.cc')
src.remove('intern' + os.sep + 'stub.cc')
src += env.Glob('libmv/autotrack/*.cc')
@@ -35,19 +47,6 @@ if env['WITH_BF_LIBMV']:
src += env.Glob('libmv/numeric/*.cc')
src += env.Glob('libmv/simple_pipeline/*.cc')
src += env.Glob('libmv/tracking/*.cc')
src += env.Glob('third_party/gflags/*.cc')
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
else:
incs += ' ./third_party/glog/src'
else:
src = env.Glob("intern/stub.cc")
@@ -57,10 +56,12 @@ env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defi
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
glog_src = []
glog_src += env.Glob("third_party/gflags/*.cc")
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
glog_src += ['./third_party/glog/src/windows/port.cc']
else:
glog_src.remove('third_party/gflags/windows_port.cc')
glog_src += env.Glob("third_party/glog/src/*.cc")
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])

109
extern/libmv/bundle.sh vendored
View File

@@ -75,7 +75,7 @@ for x in $src_dir $src_third_dir; do
fi
fi
if test `echo $x | grep -c windows ` -eq 0; then
if test `echo $x | grep -c "windows\|gflags" ` -eq 0; then
if [ -z "$src" ]; then
src=$t
else
@@ -130,13 +130,42 @@ set(SRC
libmv-capi.h
)
if(WITH_LIBMV)
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
list(APPEND INC
third_party/gflags
third_party/gflags/gflags
third_party/glog/src
third_party/ceres/include
third_party/ceres/config
../../intern/guardedalloc
)
list(APPEND INC_SYS
\${EIGEN3_INCLUDE_DIRS}
\${PNG_INCLUDE_DIRS}
\${ZLIB_INCLUDE_DIRS}
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
add_definitions(
-DWITH_LIBMV_GUARDED_ALLOC
-DGOOGLE_GLOG_DLL_DECL=
-DLIBMV_NO_FAST_DETECTOR=
)
endif()
if(WITH_LIBMV)
TEST_SHARED_PTR_SUPPORT()
if(SHARED_PTR_FOUND)
if(SHARED_PTR_TR1_MEMORY_HEADER)
@@ -149,20 +178,6 @@ if(WITH_LIBMV)
message(FATAL_ERROR "Unable to find shared_ptr.")
endif()
list(APPEND INC
third_party/gflags
third_party/glog/src
third_party/ceres/include
third_party/ceres/config
../../intern/guardedalloc
)
list(APPEND INC_SYS
../Eigen3
\${PNG_INCLUDE_DIRS}
\${ZLIB_INCLUDE_DIRS}
)
list(APPEND SRC
intern/autotrack.cc
intern/camera_intrinsics.cc
@@ -194,17 +209,6 @@ ${headers}
${third_headers}
)
if(WIN32)
list(APPEND INC
third_party/glog/src/windows
)
if(NOT MINGW)
list(APPEND INC
third_party/msinttypes
)
endif()
endif()
if(WITH_GTESTS)
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "${INC}" "${INC_SYS}")
@@ -224,7 +228,7 @@ if(WITH_LIBMV)
endif()
# make GLog a separate target, so it can be used for gtest as well.
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
# We compile GLog together with GFlag so we don't worry about
# adding extra lib to linker.
set(GLOG_SRC
@@ -258,6 +262,9 @@ ${third_gflags_headers}
third_party/glog/src/windows/glog/log_severity.h
third_party/glog/src/windows/port.h
third_party/glog/src/windows/config.h
third_party/gflags/windows_port.cc
third_party/gflags/windows_port.h
)
else()
list(APPEND GLOG_SRC
@@ -267,21 +274,11 @@ ${third_glog_headers}
)
endif()
set(GLOG_INC
third_party/gflags
third_party/glog/src
)
set(GLOG_INC_SYS
)
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${GLOG_INC}" "\${GLOG_INC_SYS}")
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${INC}" "\${INC_SYS}")
endif()
EOF
cat > SConscript << EOF
#!/usr/bin/python
# NOTE: This file is automatically generated by bundle.sh script
# If you're doing changes in this file, please update template
# in that script too
@@ -294,6 +291,22 @@ Import('env')
defs = []
incs = '.'
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
incs += ' ../Eigen3 third_party/gflags third_party/gflags/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
else:
incs += ' ./third_party/glog/src'
if env['WITH_BF_LIBMV']:
if not env['WITH_SHARED_PTR_SUPPORT']:
print("-- Unable to find shared_ptr which is required for compilation.")
@@ -304,25 +317,9 @@ if env['WITH_BF_LIBMV']:
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
defs.append('CERES_TR1_SHARED_PTR')
defs.append('GOOGLE_GLOG_DLL_DECL=')
defs.append('WITH_LIBMV_GUARDED_ALLOC')
defs.append('LIBMV_NO_FAST_DETECTOR')
src = env.Glob('intern/*.cc')
src.remove('intern' + os.sep + 'stub.cc')
$src
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ./third_party/msinttypes'
${win_src}
else:
incs += ' ./third_party/glog/src'
else:
src = env.Glob("intern/stub.cc")
@@ -332,10 +329,12 @@ env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defi
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
glog_src = []
glog_src += env.Glob("third_party/gflags/*.cc")
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
glog_src += ['./third_party/glog/src/windows/port.cc']
else:
glog_src.remove('third_party/gflags/windows_port.cc')
glog_src += env.Glob("third_party/glog/src/*.cc")
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])

View File

@@ -133,10 +133,10 @@ libmv/tracking/track_region.cc
libmv/tracking/track_region.h
libmv/tracking/trklt_region_tracker.cc
libmv/tracking/trklt_region_tracker.h
third_party/gflags/AUTHORS
third_party/gflags/ChangeLog
third_party/gflags/AUTHORS.txt
third_party/gflags/ChangeLog.txt
third_party/gflags/config.h
third_party/gflags/COPYING
third_party/gflags/COPYING.txt
third_party/gflags/gflags.cc
third_party/gflags/gflags_completions.cc
third_party/gflags/gflags/gflags_completions.h
@@ -144,9 +144,11 @@ third_party/gflags/gflags/gflags_declare.h
third_party/gflags/gflags/gflags.h
third_party/gflags/gflags_reporting.cc
third_party/gflags/mutex.h
third_party/gflags/NEWS
third_party/gflags/NEWS.txt
third_party/gflags/README.libmv
third_party/gflags/util.h
third_party/gflags/windows_port.cc
third_party/gflags/windows_port.h
third_party/glog/AUTHORS
third_party/glog/ChangeLog
third_party/glog/COPYING

View File

@@ -35,21 +35,21 @@ void libmv_initLogging(const char* argv0) {
google::GLOG_FATAL);
google::InitGoogleLogging(argv0);
google::SetCommandLineOption("logtostderr", "1");
google::SetCommandLineOption("v", "0");
google::SetCommandLineOption("stderrthreshold", severity_fatal);
google::SetCommandLineOption("minloglevel", severity_fatal);
gflags::SetCommandLineOption("logtostderr", "1");
gflags::SetCommandLineOption("v", "0");
gflags::SetCommandLineOption("stderrthreshold", severity_fatal);
gflags::SetCommandLineOption("minloglevel", severity_fatal);
}
void libmv_startDebugLogging(void) {
google::SetCommandLineOption("logtostderr", "1");
google::SetCommandLineOption("v", "2");
google::SetCommandLineOption("stderrthreshold", "1");
google::SetCommandLineOption("minloglevel", "0");
gflags::SetCommandLineOption("logtostderr", "1");
gflags::SetCommandLineOption("v", "2");
gflags::SetCommandLineOption("stderrthreshold", "1");
gflags::SetCommandLineOption("minloglevel", "0");
}
void libmv_setLoggingVerbosity(int verbosity) {
char val[10];
snprintf(val, sizeof(val), "%d", verbosity);
google::SetCommandLineOption("v", val);
gflags::SetCommandLineOption("v", val);
}

View File

@@ -179,20 +179,20 @@ void libmv_reconstructionDestroy(
/* ************ Feature detector ************ */
libmv_Features *libmv_detectFeaturesByte(const unsigned char */*image_buffer*/,
libmv_Features *libmv_detectFeaturesByte(const unsigned char * /*image_buffer*/,
int /*width*/,
int /*height*/,
int /*channels*/,
libmv_DetectOptions */*options*/) {
libmv_DetectOptions * /*options*/) {
return NULL;
}
struct libmv_Features *libmv_detectFeaturesFloat(
const float */*image_buffer*/,
const float * /*image_buffer*/,
int /*width*/,
int /*height*/,
int /*channels*/,
libmv_DetectOptions */*options*/) {
libmv_DetectOptions * /*options*/) {
return NULL;
}
@@ -247,7 +247,7 @@ void libmv_cameraIntrinsicsSetThreads(
}
void libmv_cameraIntrinsicsExtractOptions(
const libmv_CameraIntrinsics */*libmv_intrinsics*/,
const libmv_CameraIntrinsics * /*libmv_intrinsics*/,
libmv_CameraIntrinsicsOptions *camera_intrinsics_options) {
memset(camera_intrinsics_options, 0, sizeof(libmv_CameraIntrinsicsOptions));
camera_intrinsics_options->focal_length = 1.0;
@@ -355,7 +355,7 @@ void libmv_autoTrackSetOptions(libmv_AutoTrack* /*libmv_autotrack*/,
int libmv_autoTrackMarker(libmv_AutoTrack* /*libmv_autotrack*/,
const libmv_TrackRegionOptions* /*libmv_options*/,
libmv_Marker */*libmv_tracker_marker*/,
libmv_Marker * /*libmv_tracker_marker*/,
libmv_TrackRegionResult* /*libmv_result*/)
{
return 0;
@@ -390,7 +390,7 @@ void libmv_FrameAccessorDestroy(libmv_FrameAccessor* /*frame_accessor*/)
}
int64_t libmv_frameAccessorgetTransformKey(
const libmv_FrameTransform */*transform*/)
const libmv_FrameTransform * /*transform*/)
{
return 0;
}

View File

@@ -154,6 +154,7 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker,
frame_accessor_,
&tracked_image);
if (!tracked_key) {
frame_accessor_->ReleaseImage(reference_key);
LG << "Couldn't get frame for tracked marker: " << tracked_marker;
return false;
}

View File

@@ -179,8 +179,12 @@ void GetNormalizedPoints(const Mat &original_points,
class HomographySymmetricGeometricCostFunctor {
public:
HomographySymmetricGeometricCostFunctor(const Vec2 &x,
const Vec2 &y)
: x_(x), y_(y) { }
const Vec2 &y) {
xx_ = x(0);
xy_ = x(1);
yx_ = y(0);
yy_ = y(1);
}
template<typename T>
bool operator()(const T *homography_parameters, T *residuals) const {
@@ -189,8 +193,8 @@ class HomographySymmetricGeometricCostFunctor {
Mat3 H(homography_parameters);
Vec3 x(T(x_(0)), T(x_(1)), T(1.0));
Vec3 y(T(y_(0)), T(y_(1)), T(1.0));
Vec3 x(T(xx_), T(xy_), T(1.0));
Vec3 y(T(yx_), T(yy_), T(1.0));
Vec3 H_x = H * x;
Vec3 Hinv_y = H.inverse() * y;
@@ -199,18 +203,19 @@ class HomographySymmetricGeometricCostFunctor {
Hinv_y /= Hinv_y(2);
// This is a forward error.
residuals[0] = H_x(0) - T(y_(0));
residuals[1] = H_x(1) - T(y_(1));
residuals[0] = H_x(0) - T(yx_);
residuals[1] = H_x(1) - T(yy_);
// This is a backward error.
residuals[2] = Hinv_y(0) - T(x_(0));
residuals[3] = Hinv_y(1) - T(x_(1));
residuals[2] = Hinv_y(0) - T(xx_);
residuals[3] = Hinv_y(1) - T(xy_);
return true;
}
const Vec2 x_;
const Vec2 y_;
// TODO(sergey): Think of better naming.
double xx_, xy_;
double yx_, yy_;
};
// Termination checking callback used for homography estimation.

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