Commit Graph

885 Commits

Author SHA1 Message Date
7848bf00b8 Correct cu->pathlen treated as a float 2014-08-04 10:15:25 +10:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
415af0bec8 Cleanup: Adhere to our naming convention for BKE_linestyle.h API 2014-07-16 15:13:40 +10:00
a472a544d3 Fix compilation error with Freestyle after recent DAG changes 2014-07-07 16:29:04 +06:00
2fe0cf54a5 Fix T40712: Duplicators don't generate orco and UV coordinates in Cycles viewport preview.
Fix T39286: Display percentage ignored in Cycles viewport.

The threaded depsgraph update changes included a cleanup of the global
is_rendering flag, which was replaced by a general EvalContext being
passed to dupli functions.

Problem is that the global flag was true for viewport duplis before
(ugly hack), which was used as a check for generating dupli orco/UV from
mesh data layers. The new flag is stricter and only true for actual
renders, which disables these attributes and breaks the Cycles
Texture Coordinates and UVMap nodes.

The solution is to extend the simple for_render boolean to an enum:
* VIEWPORT: OpenGL viewport drawing (dupli tex coords omitted)
* PREVIEW: Viewport preview render (simplified modifiers)
* RENDER: Full render with all details and attributes

There are still some areas that need to be examined, in particular
modifiers seem to totally ignore the EvaluationContext!
Instead they generally execute without render params from the depsgraph
(BKE_object_handle_update_ex) and are built with render settings
explicitly.

Differential Revision: https://developer.blender.org/D613
2014-07-07 10:54:14 +02:00
241a9b5c6e Fix T40823 LoD Add and Remove crash without valid object
Changed the polling method used for both the add and remove LoD operators
to a more appropriate one.
2014-07-02 06:12:31 -07:00
92ecbd2998 Fix T40823, crash with LoD operator without valid object. 2014-06-26 23:51:44 +02:00
3c63eee7b4 Code cleanup: replace 0 with OB_MODE_OBJECT 2014-06-18 16:01:51 +10:00
0ae8ce3ab1 Fix T40057: invisible hair particles slowing down mesh edits
Skip doing particle update in object_handle_update if object is in
edit mode.

Object will be re-evaluated on exit from edit mode anyway, so it's
_expected_ to be a safe change.
2014-06-09 17:33:39 +06:00
edfd989e86 Fix T40315: Boolean modifier with Freestyle edges.
The helper function `make_freestyle_edge_mark_hash()` was referring to the
original mesh to determine Freestyle edge marks for individual derived mesh edges.
This is no longer necessary now that derived meshes deliver CD_FREESTYLE_EDGE
and CD_FREESTYLE_FACE layers of their own.  The reference of the original mesh
was also inappropriate since the edges coming from one of the operands of a boolean
modifier don't have proper CD_ORIGINDEX values but ORIGINDEX_NONE's.

Many thanks to Sergey Sharybin for patch contributions and discussions.
2014-06-01 16:24:18 +09:00
d9dd29054f Style cleanup 2014-05-20 00:11:16 +10:00
f44e743c72 Fix T40194: cycles deformation motion blur not working with curves + shape keys. 2014-05-19 14:25:08 +02:00
88e5705a3f Code Cleanup: remove unused m_contactProcessingThreshold 2014-05-08 14:22:47 +10:00
2e07109feb Code cleanup: naming.
Prepend BKE_ to the functions moved in blenkernel for recent bug fix.
2014-05-07 02:59:23 +03:00
762a988130 Fix for copy_object_pose incrementing custom user twice 2014-05-01 05:54:57 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
409fb4da0c Code cleanup: remove redundant matrix initialization 2014-04-29 18:13:20 +10:00
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +10:00
3216e4b202 API Cleanup: Use BKE_constraint prefix for constraint api 2014-04-11 11:47:07 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
9de24c82ba View3D: disable LOD when game engine is disabled or ifdef'd 2014-04-09 11:52:34 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
097a3756c0 Code cleanup: use bool 2014-03-31 23:39:08 +11:00
1f58bfb8be Code cleanup: de-duplicate cotangent weight function & add arg sizes 2014-03-30 11:08:33 +11:00
f48828b64e Fix T39318: Blender 2.70 crash when I link an asset
Issue is a regression since threaded objetc update and caused
by the fact that some objects might share the same proxy object.

It's all fine but object_handle_update() will call update for
a proxy object which screws up threaded update.

The thing is, proxy object is marked as depending on a scene
object and such a call makes it so the children objetc is
being updated.

This is really bad and depsgraph is to take all responsibility
on updating the proxy objects.

So for now used a simple solution (which is safe to backport
to 'a') which is skipping proxy update if the scene update is
threaded and based on the DAG traversal.

There are some still areas which calls object update directly
and for that cases proxy object is still being updated from
object_handle_update().
2014-03-24 15:10:16 +06:00
7da2175271 KDTree: deprecate 'normal' argument
Normals for each kdtree node were allocated but never used,
and search args only use in particles/boids code.
2014-03-18 09:14:47 +11:00
7b7196e3ad Code cleanup: modifier_skin_customdata_ensure was a bad level call 2014-03-16 21:55:30 +11:00
d908c90d6d Fix T39166: Disappearing text objects
This is a failure of viewport direct displist creation
caused by existing curve_cache pointer which empty content.

Made it so if the curve isn't evaluated it's curve_cache is NULL.

This is just-another-regression to be ported to the release.
2014-03-14 17:51:58 +06:00
ade6646755 Fix T39180: Particle with fluid physics unstable.
Fluid particles use the particle system's bvhtree structure, which is a
runtime BVH tree. This was not reset properly on copying objects/psys,
which lead to concurrent access in threaded depsgraph updates and memory
corruption.
2014-03-14 11:03:04 +01:00
c2045ef794 Fix T39033: Regression, duplicating proxy loses proxy
fix for bug making duplicates real effected copying scenes and linked duplis.
2014-03-12 05:56:15 +11:00
08444518e6 Removing ParticleSystem->frand arrays to avoid memory corruption issues
in threaded depgraph updates and effector list construction.

Gathering effectors during depgraph updates will call the
psys_check_enabled function. This in turn contained a DNA alloc call
for the psys->frand RNG arrays, which is really bad because data must be
immutable during these effector constructions.

To avoid such allocs the frand array is now global for all particle
systems. To avoid correlation of pseudo-random numbers the psys->seed
value is complemented with random offset and multiplier for the actual
float array. This is not ideal, but work sufficiently well (given that
random numbers were already really limited and show repetition quite
easily for particle counts > PSYS_FRAND_COUNT).
2014-03-07 11:20:45 +01:00
8439a165ff Fix T38504: cycles missing object in viewport with shape keys and shared mesh. 2014-02-14 14:54:00 +01:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
aa3d88d34d Fix T35328: Disk caches of multiple particle systems on a single object overwrite each other
It was intended to work actually using particle cache's stack index
but this index might have been calculated incorrect in special case:

* With default cube scene, add particle system to the cube
* Add disk cache to the particle system
* Save file and reload it
* Add another particle system and enable disk cache

This would lead to two point caches with the same stack index of zero.
This happened because point cache indices list wasn't stored in the
.blend file so once you've reload your file blender doesn't know anything
about number or point caches used.

And what was even more confusing is that point cache indices list was
trying to be load from the file, but this failed because it wasn't in the
file.

This commit solves the root of the issue which is ability of producing
.blend file with two point caches using the same disk cache. This is
done by making it sure that point cache indices list is stored in the
.blend file. And also made it so disabling disk cache will tag it to
recalculate stack index.

Old broken files wouldn't magically start working, but fixing them is
rather simple manually by toggling Disk Cache option.

Reviewers: lukastoenne, brecht

CC: sergof

Differential Revision: https://developer.blender.org/D286
2014-02-05 23:46:10 +06:00
e9fda259da Fix T38476: incorrect hair draw type after editing particle system in edit mode. 2014-02-05 13:53:34 +01:00
37026b12ec Code cleanup: use bool for static methods 2014-02-05 22:36:15 +11:00
7fbb7e32fd Fix T38450: Remove unused Children Offset option
This option was only exposed to the interface and internally
was doing basically nothing.

Removing it to prevent artists from being confused.
2014-02-03 19:34:29 +06:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
1dc1d92dab Code cleanup: white space and cmake was broken on all platforms 2014-02-03 13:56:34 +11:00
fed1b8b16d Code cleanup: suffix vars to make obvious they are squared 2014-02-03 02:46:45 +11:00
1e096ee816 More snapping fixes (this is ridiculous).
I hope this time we are done!
2014-01-30 18:50:12 +01:00
0cb49286ce Fix T38409: Snapping Bug
Issue partially caused by own errors (glicth in new BKE_boundbox_ray_hit_check() code causing segfault in volume snapping,
and we have to treat ortho and persp differently in case of face snapping, because in persp our ray_start might very well
already be *inside* the boundbox of the checked object), and partly due to the fact that ED_view3d_win_to_vector()
was returning wrong vector (negated one) for ortho views (see previous commit).
2014-01-30 17:16:07 +01:00
77089a3bf2 Fix T38358: Face snapping fails on Orthographic view
Issue is caused by start point of ray used to detect faces under the mouse is set rather far away in ortho 3dviews.
The loss of precision on the ray location induced by this can lead to face snapping failures.

Solution is to do the raycasting with a temp start point, much closer to the object we check, and add back
to the found distance the diff to the real start point once detection is done (as we need all hit distances
from all tested objects to be relative to a common point!).

Note this commit only addresses the "face snapping on mesh" case, other kind of snapping do not seem to suffer
from this issue.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D268
2014-01-29 20:10:03 +01:00
5c750b76f2 Move depsgraph debug print under --debug-depsgraph command line argument 2014-01-29 17:48:07 +06:00
4ae7ae6f2e Code Cleanup: use bool for return values and correct comments
also remove CDDM_Check, theres no need for it.
2014-01-22 02:53:48 +11:00
df72d3cc7f Potential fix for T38111: Duplicating BOIDS emitter cause glitchy operation
Need to reset cached KD tree when duplicating particle system.
2014-01-16 00:56:35 +06:00
1f2136b329 Python/Depsgraph: bpy.data.*.is_updated now detects add/remove of any datablock.
Previously this only worked for some datablocks relevant to rendering, now it
can be used to detect if any type of datablock was added or removed (but not
yet to detect if it was modified, we need many more depsgraph tags for that).

Most of the changes are some function parameter changes, the important parts
are the DAG_id_type_tag calls.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D195
2014-01-15 16:47:53 +01:00
ff98be83a9 Empties with Images draw type: add support for movies and image sequences
This adds an ImageUser to such empties with all the typical settings.

Reviewed By: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D108
2014-01-13 22:18:31 +01:00
cc31722a41 Fix T38000: vertex parent crash due to threading issues
Issue is causes by vertex parent modifies original BMesh from
a multiple threads. Ideally this is to be done as a separate
update callback for mesh datablock, but it's not so much simple
now (would need to do some re-arranges to DAG which might conflict
with the work from Ali or will double amount of work we did).

So for now use simple solution with mutex lock.

Based on the patch from Campbell Barton with some fixes to make
changes really thread-safe.

Differential Revision: https://developer.blender.org/D168
2014-01-09 16:33:53 +06:00
a0dbee6e93 Fix T38016: setting Object.matrix_world does not take bone parents into account. 2014-01-09 00:38:56 +01:00