8 years agoHad not been updated after last edit to prvicons.svg file (r53004)...
Bastien Montagne [Thu, 22 Aug 2013 13:48:22 +0000 (13:48 +0000)]
Had not been updated after last edit to prvicons.svg file (r53004)...

8 years agoFix [#36534] Errors in script when running on Arch Linux
Bastien Montagne [Thu, 22 Aug 2013 06:05:40 +0000 (06:05 +0000)]
Fix [#36534] Errors in script when running on Arch Linux

Patch provided by Darren Beck, thanks!

8 years agominor internal change: isect_point_poly_v2 was assigning a value past the array bounds,
Campbell Barton [Wed, 21 Aug 2013 23:33:50 +0000 (23:33 +0000)]
minor internal change: isect_point_poly_v2 was assigning a value past the array bounds,
not that bad since it wasn't read but this isnt good practice and its simple to avoid.

8 years agostyle cleanup: pep8, also use float literals when comparing floats and pass tuples...
Campbell Barton [Wed, 21 Aug 2013 23:19:01 +0000 (23:19 +0000)]
style cleanup: pep8, also use float literals when comparing floats and pass tuples to mathutils.Vector() rather then list.

8 years agoFix [#36530] Texture tab refreshing problem
Bastien Montagne [Wed, 21 Aug 2013 21:35:45 +0000 (21:35 +0000)]
Fix [#36530] Texture tab refreshing problem

That was not really a bug (code working as expected), but the way tex context was handled was a bit raw, now it is much smarter:
* Default fallback context (when current one is no more valid) will now choose "most specific" ones first (i.e. material/lamp/particules before world and "others").
* When using that default fallback context, previous one is stored and we try to revive it later, if possible. Thus e.g. object[mat tex ctxt] -> empty[default world ctxt] -> object[mat tex ctxt] is now working as expected.
* However, when user explicitely or implicitely (through e.g. going to Material context...) sets a tex context, previous one is not stored, so that only default fallback context switch may later automatically revive a previous (presumably user-set) context.

8 years agoTemporary fix for gaps in strokes when objects are behind the lines.
Tamito Kajiyama [Wed, 21 Aug 2013 21:20:51 +0000 (21:20 +0000)]
Temporary fix for gaps in strokes when objects are behind the lines.
Problem report by Light BWK through personal communications, thanks a lot!

Apparently there is something wrong in the way how edges are chained to
create strokes.  For some unknown reason, strokes may contain a very small
line segment that proceeds in the opposite direction (e.g., downward
even when adjacent stroke segments proceed upward), resulting in the
reported visual artefact.

This revision is intended to address the reported issue in most cases.
The present solution is not a proper fix of the issue.  Another code
update with better understanding of the real cause is due in the future

8 years agoset nonnull args for BLI_qsort_r
Campbell Barton [Wed, 21 Aug 2013 20:45:51 +0000 (20:45 +0000)]
set nonnull args for BLI_qsort_r

8 years agoghash/edgehash flag wasn't being initialized for new hashes. also init vars in same...
Campbell Barton [Wed, 21 Aug 2013 20:21:42 +0000 (20:21 +0000)]
ghash/edgehash flag wasn't being initialized for new hashes. also init vars in same order for ghash/edgehash.

8 years agorename recently added BLI_ghash_assign() -> BLI_ghash_reinsert()
Campbell Barton [Wed, 21 Aug 2013 16:06:03 +0000 (16:06 +0000)]
rename recently added BLI_ghash_assign() -> BLI_ghash_reinsert()

8 years agofix for bad mistake in recently added BM_face_create_verts functiofix for bad mistake...
Campbell Barton [Wed, 21 Aug 2013 16:00:53 +0000 (16:00 +0000)]
fix for bad mistake in recently added BM_face_create_verts functiofix for bad mistake in recently added BM_face_create_verts functionn

8 years agoScultping: Growing the pbvh node container should use malloc instead of
Antony Riakiotakis [Wed, 21 Aug 2013 15:21:56 +0000 (15:21 +0000)]
Scultping: Growing the pbvh node container should use malloc instead of
calloc. Since we copy the first 1/1.3 part of the new array from the
existing nodes, only the rest 0.3/1.3 should be initialized to zero.
This should in theory cut down the times of occasional hangs with
dyntopo, since my guess is that it is caused by dynamic reallocations.
Maybe a linked list structure would help here? This is a bigger change
though, leaving as is for now.

Also, minor cleanup, delete duplicate ghash deletion and remove unneeded
commented code.

8 years agocode cleanup: bmesh duplicate functions
Campbell Barton [Wed, 21 Aug 2013 14:35:51 +0000 (14:35 +0000)]
code cleanup: bmesh duplicate functions
- avoid using an iterator when stepping around an edges radial loop.
- use naming constant with the rest of the bmesh operators.

8 years agoCopying of nurbs shall happen after converting font to curves
Sergey Sharybin [Wed, 21 Aug 2013 13:13:48 +0000 (13:13 +0000)]
Copying of nurbs shall happen after converting font to curves

Otherwise changing font settings wouldn't apply instantly.

8 years agoFix #36453: scaling faces with individual origins would permanently turn of
Brecht Van Lommel [Wed, 21 Aug 2013 12:20:40 +0000 (12:20 +0000)]
Fix #36453: scaling faces with individual origins would permanently turn of
proportional editing because this combination doesn't work, but it should
be only temporary.

8 years agoFix #36526: SSS + hair crash after recent changes.
Brecht Van Lommel [Wed, 21 Aug 2013 12:20:38 +0000 (12:20 +0000)]
Fix #36526: SSS + hair crash after recent changes.

8 years agoFix #36499: proportional edit circle was drawing behind objects in some cases,
Brecht Van Lommel [Wed, 21 Aug 2013 12:20:31 +0000 (12:20 +0000)]
Fix #36499: proportional edit circle was drawing behind objects in some cases,
now it always draws in front to ensure the circle is visible.

8 years agomesh duplication was doing a loop & hash lookup for every loop corner, when there...
Campbell Barton [Wed, 21 Aug 2013 11:27:18 +0000 (11:27 +0000)]
mesh duplication was doing a loop & hash lookup for every loop corner, when there is no need since the faces are aligned.
was also initializing and stepping an iterator for no reason.

8 years agocorrect error in recent commit (face customdata)
Campbell Barton [Wed, 21 Aug 2013 11:09:50 +0000 (11:09 +0000)]
correct error in recent commit (face customdata)

8 years agoClear cyclic flag if we didn't copy the whole mask spline
Sergey Sharybin [Wed, 21 Aug 2013 10:17:55 +0000 (10:17 +0000)]
Clear cyclic flag if we didn't copy the whole mask spline

8 years agoDuplicate operator for masks
Sergey Sharybin [Wed, 21 Aug 2013 10:12:42 +0000 (10:12 +0000)]
Duplicate operator for masks

Topic says it all :)

Jut implemented operator to duplicate mask points
and segments between them (exactly the same behavior
as Curve object duplication in edit mode).

Does not copy animation, but that's tricky and likely
not needed anyway.

8 years agoNeed to set new curve's disp to NULL when duplicating.
Sergey Sharybin [Wed, 21 Aug 2013 09:43:22 +0000 (09:43 +0000)]
Need to set new curve's disp to NULL when duplicating.

8 years agobmesh api cleanup, face creation args now accept an example face (as with vertex...
Campbell Barton [Wed, 21 Aug 2013 07:51:47 +0000 (07:51 +0000)]
bmesh api cleanup, face creation args now accept an example face (as with vertex and edge),
also replace BM_face_create_quad_tri_v with BM_face_create_verts

8 years agoPartial revert of recenr cu->disp merge commit
Sergey Sharybin [Wed, 21 Aug 2013 07:40:19 +0000 (07:40 +0000)]
Partial revert of recenr cu->disp merge commit

That ended up in tricky code trying to mimic depsgraph
branch behavior API-wise preserving texspace and bound
box calculation compatible with previous releases.

So for now bring cu->disp back to the trunk but keep
texpsace and boundbox APIs the same as in the branch.

This keeps texpsapce and boundbox behavior fully compatible
with previous releases and still makes API the same as
for meshes.

8 years agouse BM_CREATE_NOP arg rather then zero, with pointer and bool args in either side...
Campbell Barton [Wed, 21 Aug 2013 05:39:46 +0000 (05:39 +0000)]
use BM_CREATE_NOP arg rather then zero, with pointer and bool args in either side in some cases it gets a bit confusing.
also correct edge-rotate where bool->flag conversion worked by accident.

8 years agobmesh api:
Campbell Barton [Wed, 21 Aug 2013 05:20:57 +0000 (05:20 +0000)]
bmesh api:
- use heap for BM_face_create_ngon_vcloud allocations.
- replace BM_face_create_ngon_verts with more efficient BM_face_create_verts

8 years agofix own regression [#36443] Vertex to UV index doesn't match with 2.68a
Campbell Barton [Wed, 21 Aug 2013 05:11:11 +0000 (05:11 +0000)]
fix own  regression [#36443] Vertex to UV index doesn't match with 2.68a

add BM_face_create_verts wrapper for BM_face_create which creates its own edge array.

8 years agocorrect NULL pointer dereference with recent displist changes.
Campbell Barton [Wed, 21 Aug 2013 02:30:19 +0000 (02:30 +0000)]
correct NULL pointer dereference with recent displist changes.

8 years agostyle cleanup: also use ARRAY_HAS_ITEM macro for mempool check
Campbell Barton [Wed, 21 Aug 2013 02:29:13 +0000 (02:29 +0000)]
style cleanup: also use ARRAY_HAS_ITEM macro for mempool check

8 years agoImage Editor: implement FKey to call 'View All' with 'fit_view'
Dalai Felinto [Tue, 20 Aug 2013 23:40:46 +0000 (23:40 +0000)]
Image Editor: implement FKey to call 'View All' with 'fit_view'
This mimics the behaviour we have in the Clip Editor.

I personally would prefer if we had no border once in fullscreen
(current border is 5 pixels).

I will consult Sergey Sharybin first to see if we can change that in the clip editor as well (though there I
believe the border is useful - the bottom of the editor is used to indicate 'tracked' frames.

8 years agobugfix: fit_view property was saved in CLIP_OT_view_all operator
Dalai Felinto [Tue, 20 Aug 2013 23:23:17 +0000 (23:23 +0000)]
bugfix: fit_view property was saved in CLIP_OT_view_all operator
before that if you pressed 'F', fit_view would be True every time (e.g.,
even if you pressed 'HOME' which is supposed to call the operator
without the fit_view).

I'm not sure why we need a fullscreen without 'fit_view' but anyways,
that's a different issue.

8 years agoFix [#36351] Changing the Frame Rate value doesnt adjust audio strip length.
Bastien Montagne [Tue, 20 Aug 2013 19:50:31 +0000 (19:50 +0000)]
Fix [#36351] Changing the Frame Rate value doesnt adjust audio strip length.

Simply recalc sequence len for audio (and meta!) strips when modifying fps value. Note start, startofs and endofs are also updated, to try to keep final pos and length as consistent as possible.

8 years agofix [#36347] Blender crashes when clicking on 'render' in 'viewport shading'
Campbell Barton [Tue, 20 Aug 2013 18:55:41 +0000 (18:55 +0000)]
fix [#36347] Blender crashes when clicking on 'render' in 'viewport shading'

8 years agoFix compiler warning due to undefined BVH_FUNCTION_FEATURES with patch by Campbell,
Brecht Van Lommel [Tue, 20 Aug 2013 18:25:59 +0000 (18:25 +0000)]
Fix compiler warning due to undefined BVH_FUNCTION_FEATURES with patch by Campbell,
and a coverity warning about use of uninitialized variables with OSL.

8 years agoinset depth wasn't working right with relative offset, also make it work for inset...
Campbell Barton [Tue, 20 Aug 2013 17:38:29 +0000 (17:38 +0000)]
inset depth wasn't working right with relative offset, also make it work for inset individual.

8 years agofix [#36352] Inset individual, uncheck "select outer" selects zero faces
Campbell Barton [Tue, 20 Aug 2013 16:59:04 +0000 (16:59 +0000)]
fix [#36352] Inset individual, uncheck "select outer" selects zero faces

rewrite individual inset not to remove and re-create faces, makes re-selection simpler.

8 years agoadd BLI_memarena_clear function to reset a memarena, keeping the last allocated block...
Campbell Barton [Tue, 20 Aug 2013 16:56:46 +0000 (16:56 +0000)]
add BLI_memarena_clear function to reset a memarena, keeping the last allocated block for more efficient reuse.

8 years agoquiet error installing an addon when the directory already exists (would happen on...
Campbell Barton [Tue, 20 Aug 2013 14:43:01 +0000 (14:43 +0000)]
quiet error installing an addon when the directory already exists (would happen on OSX frequently),
the addon would install but error was misleading.

8 years agopatch [#36503] BGE Python - Radar and Ray sensor wrong AXIS constants wrong defined
Campbell Barton [Tue, 20 Aug 2013 13:13:30 +0000 (13:13 +0000)]
patch [#36503] BGE Python - Radar and Ray sensor wrong AXIS constants wrong defined
from Jorge Bernal (lordloki)

8 years agodisable material index clamping, fbx importer doesn't know the total number of materi...
Campbell Barton [Tue, 20 Aug 2013 12:48:44 +0000 (12:48 +0000)]
disable material index clamping, fbx importer doesn't know the total number of materials when meshes are loading,
also, its possible to have values outside this range by removing materials (though not from the UI)

8 years agoCode cleanup / Cycles:
Thomas Dinges [Tue, 20 Aug 2013 11:22:26 +0000 (11:22 +0000)]
Code cleanup / Cycles:
* Remove unused hair presets enum.

8 years agofix/workaround [#36519] Origin to Center of Mass" failes when faces have an area...
Campbell Barton [Tue, 20 Aug 2013 09:42:18 +0000 (09:42 +0000)]
fix/workaround [#36519] Origin to Center of Mass" failes when faces have an area of zero

8 years agoadd is_finite_v# functions, use bool's
Campbell Barton [Tue, 20 Aug 2013 09:34:52 +0000 (09:34 +0000)]
add is_finite_v# functions, use bool's

8 years agofix incorrect docs [#36518] Vector.rotate() does not return value as documented
Campbell Barton [Tue, 20 Aug 2013 08:41:34 +0000 (08:41 +0000)]
fix incorrect docs [#36518] Vector.rotate() does not return value as documented

8 years agoGet rid of PATH_MAX in Ghost System X11
Sergey Sharybin [Tue, 20 Aug 2013 08:33:04 +0000 (08:33 +0000)]
Get rid of PATH_MAX in Ghost System X11

The reason of this is because PATH_MAX is not guaranteed
to be defined on all platforms and Hurd doesn't define it.

So either we need to support arbitrary long file path or
we need to define own maximum path length.

The rule here would be:

- If it's not big trouble to support arbitrary long paths
  (i.e. in ghost by using std::string instead of char*)
  then arbitrary long path shall be implemented.

- For other cases to use PATH_MAX please include BLI_fileops.h
  which takes care of making sure PATH_MAX is defined.

Additional change: get rid of own changes made yesterday
which were supposed to make storage.c work fine in cases
PATH_MAX is not define, but on the second though it lead
to unneeded complication of the code.

Thanks Campbell for review!

8 years agofix [#36517] You can edit a texture space (Shift-T) of a linked mesh
Campbell Barton [Tue, 20 Aug 2013 06:04:46 +0000 (06:04 +0000)]
fix [#36517] You can edit a texture space (Shift-T) of a linked mesh

also enable other errors to show up which were previously commented.

8 years agoFix GPencil part of [#36101] BSurface Throw an Error When Press "Add Surface"
Bastien Montagne [Mon, 19 Aug 2013 22:46:32 +0000 (22:46 +0000)]
Fix GPencil part of [#36101] BSurface Throw an Error When Press "Add Surface"

gpencil_data_get_active and gpencil_data_get_active_v3d did not have consistent behavior when we had an active object, but not on any visible layer (the first would return the default scene gpd in this case, while the first was still returning active object's one). Now they both return scene's one.

8 years agoFix crash caused by own commit to optimize out curvemapping
Antony Riakiotakis [Mon, 19 Aug 2013 19:41:38 +0000 (19:41 +0000)]
Fix crash caused by own commit to optimize out curvemapping
initialization. In sculpt mode, when using shift-click to switch to the
smooth brush it was possible to ommit initialization of curvemapping for
that brush.

8 years agoMinor optimization for paint systems, initialize the paint curve before
Antony Riakiotakis [Mon, 19 Aug 2013 19:04:39 +0000 (19:04 +0000)]
Minor optimization for paint systems, initialize the paint curve before
the stroke and skip checking for initialization each time we request the
curve value.

8 years agoUsual UI messages fixes...
Bastien Montagne [Mon, 19 Aug 2013 18:37:00 +0000 (18:37 +0000)]
Usual UI messages fixes...

8 years agoFix [#36438] Adding Metaball when unit scale is smaller than 0.01 seemingly hangs...
Bastien Montagne [Mon, 19 Aug 2013 17:58:28 +0000 (17:58 +0000)]
Fix [#36438] Adding Metaball when unit scale is smaller than 0.01 seemingly hangs Blender

Wiresize and rendersize were not handled regarding scene scale, leading to insane precision when working in cm or less...

8 years agoDyntopo:
Antony Riakiotakis [Mon, 19 Aug 2013 17:37:21 +0000 (17:37 +0000)]

* Actually check if normal recalculation flags exists and set it when
splitting nodes in dyntopo. Right now, nodes that need GPU buffer update
will always get in the list to get their normals generated, but to avoid
a possible future breakage better do it right now.
* Avoid keeping deleted/removed vertices in vertex-to-node and unique
vertex hashes, since some checks rely on those and may go awry if these
still exist. Also they pollute the hashes, and may hurt performance

8 years agoFix build with GE and WITH_CXX_GUARDEDALLOC enabled…
Bastien Montagne [Mon, 19 Aug 2013 15:02:28 +0000 (15:02 +0000)]
Fix build with GE and WITH_CXX_GUARDEDALLOC enabled…

8 years agocode cleanup: confirm include guards to our convention
Campbell Barton [Mon, 19 Aug 2013 14:40:16 +0000 (14:40 +0000)]
code cleanup: confirm include guards to our convention

8 years agoFix crash happening due to missing ob->curve_cache
Sergey Sharybin [Mon, 19 Aug 2013 14:22:02 +0000 (14:22 +0000)]
Fix crash happening due to missing ob->curve_cache

It's a bit dumb to store render-time bevel list in
object's curve_cache, but that's how blender already
used to work for ages.

Proper fix is suspended for tomorrow :)

8 years agoDyntopo:
Antony Riakiotakis [Mon, 19 Aug 2013 14:08:59 +0000 (14:08 +0000)]

Turn off pbvh normal update flag after recalculation, saves
recalculating normals every frame when not stroking the mesh.

For this to work reliably with undo we need to support original normals
in the bm_log (was marked as a TODO already in the code), so that
undoing avoids having invalid normals in the mesh (since we don't update
every frame anymore). This was added in this commit as well.

Also added some (disabled) quite paranoid checks in the bmesh valication
code for dyntopo hoping to catch the real normal update issue. No luck
there yet.

8 years agoApparently sizeof(unsigned) is 4 bytes on both 32 and 64 bit platforms
Sergey Sharybin [Mon, 19 Aug 2013 14:03:44 +0000 (14:03 +0000)]
Apparently sizeof(unsigned) is 4 bytes on both 32 and 64 bit platforms

For now assume sizeof(int) == 4 for all supported platforms, could be
changed in the future.

Added an assert to functions which depends on this this, so we'll
easily notice bad things happening.

8 years agoFix [#36454] 'Tiles' settings in Render/Performance panel don't respect keyframes
Bastien Montagne [Mon, 19 Aug 2013 13:30:17 +0000 (13:30 +0000)]
Fix [#36454] 'Tiles' settings in Render/Performance panel don't respect keyframes

These are not animatable! Note this is the case of most (all?) render settings, maybe we should go over both Cycles and internal ones, there are still quite a bunch of them that are marked as animatable... :/

8 years agoMistake in revious PATH_MAX commit, sorry!
Sergey Sharybin [Mon, 19 Aug 2013 12:04:00 +0000 (12:04 +0000)]
Mistake in revious PATH_MAX commit, sorry!

8 years agoAttempt to fix compilation error of sort.c
Sergey Sharybin [Mon, 19 Aug 2013 11:50:33 +0000 (11:50 +0000)]
Attempt to fix compilation error of sort.c

8 years agoFix compilation error on platforms where PATH_MAX is not defined
Sergey Sharybin [Mon, 19 Aug 2013 11:49:10 +0000 (11:49 +0000)]
Fix compilation error on platforms where PATH_MAX is not defined

8 years agoCode cleanup: use bool instead of BOOL/int
Sergey Sharybin [Mon, 19 Aug 2013 11:37:42 +0000 (11:37 +0000)]
Code cleanup: use bool instead of BOOL/int

8 years agoFix read past end of array when drawing tracking markers keyframes
Sergey Sharybin [Mon, 19 Aug 2013 11:36:29 +0000 (11:36 +0000)]
Fix read past end of array when drawing tracking markers keyframes

Was introduced by plane track merge.

8 years agoMCE: usability improvement
Sergey Sharybin [Mon, 19 Aug 2013 11:24:35 +0000 (11:24 +0000)]
MCE: usability improvement

Align Clear Before/After into a row and remove
Clear button (which wasn't actually used by

8 years agoMerge remained parts of r57520: use use_render argument rather than G.is_rendering
Sergey Sharybin [Mon, 19 Aug 2013 11:04:32 +0000 (11:04 +0000)]
Merge remained parts of r57520: use use_render argument rather than G.is_rendering

8 years agoNo static vars shall be in mballs now
Sergey Sharybin [Mon, 19 Aug 2013 11:04:28 +0000 (11:04 +0000)]
No static vars shall be in mballs now

No need in special hacks for this now :)

8 years agoAnd for sure forgot to commit another cleaup patch
Sergey Sharybin [Mon, 19 Aug 2013 10:54:15 +0000 (10:54 +0000)]
And for sure forgot to commit another cleaup patch

svn merge -r59259:59260  ^/branches/soc-2013-depsgraph_mt

8 years agoForgot this in previous commit
Sergey Sharybin [Mon, 19 Aug 2013 10:53:10 +0000 (10:53 +0000)]
Forgot this in previous commit

Solves compilation issues on Win and OSX

svn merge -r59180:59181 ^/branches/soc-2013-depsgraph_mt

8 years agoSpeedup for guarded allocator
Sergey Sharybin [Mon, 19 Aug 2013 10:51:40 +0000 (10:51 +0000)]
Speedup for guarded allocator

- Re-arrange locks, so no actual memory allocation
  (which is relatively slow) happens from inside
  the lock. operation system will take care of locks
  which might be needed there on it's own.

- Use spin lock instead of mutex, since it's just
  list operations happens from inside lock, no need
  in mutex here.

- Use atomic operations for memory in use and total
  used blocks counters.

This makes guarded allocator almost the same speed
as non-guarded one in files from Tube project.

There're still MemHead/MemTail overhead which might
be bad for CPU cache utilization

8 years agoCommit atomic operations file
Sergey Sharybin [Mon, 19 Aug 2013 10:44:18 +0000 (10:44 +0000)]
Commit atomic operations file

Not currently used, but needed for some further changes

8 years agoUse reentrant qsort() in particle codes
Sergey Sharybin [Mon, 19 Aug 2013 10:40:47 +0000 (10:40 +0000)]
Use reentrant qsort() in particle codes

Particle system code used global variable to sort hair by orig index,
which is not safe for threading at all.

Replaced this with usage of reentrant version of qsort, which is
now implemented in BLI. It was moved from recast navigation code
to BLI, so more areas could use it (if needed).

svn merge -r59086:59087 ^/branches/soc-2013-depsgraph_mt

8 years agoAdded check for whether thread lock is being removed while thread is using guarded...
Sergey Sharybin [Mon, 19 Aug 2013 10:38:27 +0000 (10:38 +0000)]
Added check for whether thread lock is being removed while thread is using guarded alloc.

svn merge -r58788:58789 ^/branches/soc-2013-depsgraph_mt

8 years agoOptimization and threading fix for shapekeys weights calculation
Sergey Sharybin [Mon, 19 Aug 2013 10:36:39 +0000 (10:36 +0000)]
Optimization and threading fix for shapekeys weights calculation

This commit fixes two different issues, which were caused by
how weights are being calculated for relative shapekeys.

Weights for key block used to saved in KeyBlock DNA structure,
which lead to situations when different objects could start
writing to the same weights array if they're sharing the same
key datablock.

Solved this in a way so weights are never stored in KeyBlock
and being passed to shapekeys routines as an array of pointers.
This way weights are still computed run-time (meaning they're
calculated before shapekey evaluation and freed afterwards).

This required some changes to GameEngine as well, to make it
never cache weights in the key blocks.

Another aspect of this commit makes it so weight for a given
vertex group is only computed once. So if multiple key blocks
are using the same influence vertex group, they'll share the
same exact weights array. This gave around 1.7x speedup in
test chinchilla file which is close enough to if we've been
caching weights permanently in DNA (test machine is dual-code
4 threads laptop, speedup measured in depsgraph_mt branch,
trunk might be not so much high speedup).

Some further speed is optimization possible, but it could be
done later as well.

Thanks Brecht for idea of how the things might be solved in
really clear way.

svn merge -r58786:58787  ^/branches/soc-2013-depsgraph_mt

8 years agoAdded check for address being freed by mempool free
Sergey Sharybin [Mon, 19 Aug 2013 10:18:25 +0000 (10:18 +0000)]
Added check for address being freed by mempool free

When blender is built in debug mode, BLI_mempool_free will
ensure address passed to the function actually belongs to
this pool.

svn merge -r58710:58711 ^/branches/soc-2013-depsgraph_mt

8 years agoUtility benchmarking macros
Sergey Sharybin [Mon, 19 Aug 2013 10:16:23 +0000 (10:16 +0000)]
Utility benchmarking macros

This new macros could be used to benchmark overall
execution time of some chunk of code, running in cycle.

The usage is:

  void foo(void) {

    for (...) {




  This would print total time which was spent on
  running function bar().

svn merge -r58281:58283 ^/branches/soc-2013-depsgraph_mt

8 years agoMade armatures evaluation safe for threading
Sergey Sharybin [Mon, 19 Aug 2013 10:14:22 +0000 (10:14 +0000)]
Made armatures evaluation safe for threading

Apparently, some routines in armature deformation code
were using static arrays. This is probably just an
optimization thing, but it's very bad for threading.

Now made it so bbone matrices array is allocating in
callee function stack. This required exposing
MAX_BBONE_SUBDIV to an external API, This is not so
much crappy from code side, and it shall be the same
fast as before.

svn merge -r58278:58279 ^/branches/soc-2013-depsgraph_mt

8 years agoMake lattice deform safe for threading
Sergey Sharybin [Mon, 19 Aug 2013 10:11:48 +0000 (10:11 +0000)]
Make lattice deform safe for threading

Lattice deformation used to store some runtime data
inside of lattice datablock itself. It's something
which is REALLY bad. Ideally DNA shouldn't contain
and runtime data.

For now solved it in a way that initialization of
lattice deform will create a structure which contains
lattice object for which deformation is calculating
and that runtime data which used to be stored in
lattice datablock itself.

It works really fine for mesh deform modifier, but
there's still runtime data stored in particle system
DNA, It didn't look something easy to be solved, so
leaving this as-is for now.

svn merge -r58277:58278 -r58795:58796 ^/branches/soc-2013-depsgraph_mt

8 years agoMake GPU buffers allocation/freeing safe for threading
Sergey Sharybin [Mon, 19 Aug 2013 10:06:05 +0000 (10:06 +0000)]
Make GPU buffers allocation/freeing safe for threading

Code in GPU_buffers_free was already trying to be safe
for threading, by skipping OGL calls there, but in fact
it was still buggy.

Namely, freeing was doing buffers shift in a cycle, and
if two threads will call this function shifting will go

Now made it so GPU_buffers_alloc and GPU_buffers_free
are using mutex lock, so they're completely safe for
threading. Same goes to gpu_buffer_setup function.

It required minor functions reshuffle, so there're no
locks happening from locked thread, but it's all very
straightforward change

svn merge -r58276:58277 ^/branches/soc-2013-depsgraph_mt

8 years agoMake fonts safe(r) for threading
Sergey Sharybin [Mon, 19 Aug 2013 10:02:18 +0000 (10:02 +0000)]
Make fonts safe(r) for threading

Getting vfont data wasn't safe for threading, because it
was modifying font data which is in bmain and could be
shared by multiple objects.

For now made it so getting vfont uses critical section,
meaning vfont->data is initializing from inside a locked

svn merge -r58168:58169 ^/branches/soc-2013-depsgraph_mt

8 years agofix [#36481] When "Rip Edge" cannot be completed, Blender crashes weirdly
Campbell Barton [Mon, 19 Aug 2013 10:00:17 +0000 (10:00 +0000)]
fix [#36481] When "Rip Edge" cannot be completed, Blender crashes weirdly

8 years agoTag object-data level boundbox as invalid rather than freeing it
Sergey Sharybin [Mon, 19 Aug 2013 09:58:28 +0000 (09:58 +0000)]
Tag object-data level boundbox as invalid rather than freeing it

Object update used to free object-data level bounding box to trigger
it's re-calculation in the future. Such a freeing performed from
object update isn't thread-safe because mesh could be shared between
multiple objects.

Rather than freeing bounding box, tag it's as invalid, this is safe
from threading point of view and also prevents unnecessary memory

Object-level bounding box is still reallocating, but think we could
change this easily in the future as well.

svn merge -r58154:58156 -r59258:59259 ^/branches/soc-2013-depsgraph_mt

8 years agoRemove unused bounding box from MetaBall
Sergey Sharybin [Mon, 19 Aug 2013 09:41:13 +0000 (09:41 +0000)]
Remove unused bounding box from MetaBall

svn merge -r58150:58151 ^/branches/soc-2013-depsgraph_mt

8 years agoMade curves almost thread-safe
Sergey Sharybin [Mon, 19 Aug 2013 09:36:40 +0000 (09:36 +0000)]
Made curves almost thread-safe

Now modifier stack wouldn't modify original curve's nurbs
and will operate on a copy of nurbs.

This makes it possible to process curve object update with
shared curve datablocks from multiple threads. There's no
big overhead for creating a copy of nurbs comparing to old
behavior which was allocating original vertex array and
apply coordinates on curve after all modifier are applied.

The only remained issue with curves is curve's bounding box
and texture space. It's not thread-safe, but it wouldn't
lead to crashes -- it just could lead to either memory
leak or wrong texture coordinates due to difference in
modifiers stacks of objects which shares the same curve.

svn merge -r57959:57961 ^/branches/soc-2013-depsgraph_mt

8 years agoRemove unused argument from utility curve functions
Sergey Sharybin [Mon, 19 Aug 2013 09:29:51 +0000 (09:29 +0000)]
Remove unused argument from utility curve functions

So far it was harmless, but with upcoming changes having this
argument could be confusing from logic point of view

svn merge -r57958:57959 ^/branches/soc-2013-depsgraph_mt

8 years agoMove bevel list and path from Curve to Object datablock
Sergey Sharybin [Mon, 19 Aug 2013 09:25:24 +0000 (09:25 +0000)]
Move bevel list and path from Curve to Object datablock

I know this is not so much nice to have this guys hanging
around in a general Object datablock and ideally they better
be wrapped around into a structure like DerivedMesh or
something like this. But this is pure runtime only stuff and
we could re-wrap them around later.

Main purpose of this is making curves more thread safe,
so no separate threads will ever start freeing the same path
or the same bevel list.

It also makes sense because path and bevel shall include
deformation coming from modifiers which are applying on
pre-tesselation point and different objects could have
different set of modifiers. This used to be really confusing
in the past and now data which depends on object is stored
in an object, making things clear for understanding even.

This doesn't make curve code fully thread-safe due to
pre-tesselation modifiers still modifies actual nurbs and
lock is still needed in makeDispListsCurveTypes, but this
change makes usage of paths safe for threading.

Once modifiers will stop modifying actual nurbs, curves
will be fully safe for threading.

Actually, this commit also contains wrapping runtime curve
members into own structure

This allows easier assignment on file loading, keeps curve-
specific runtime data grouped and saves couple of bytes in
Object for non-curve types.

svn merge -r57938:57939 ^/branches/soc-2013-depsgraph_mt
svn merge -r57957:57958^/branches/soc-2013-depsgraph_mt

8 years agoGet rid of a display list stored in Curve datablock
Sergey Sharybin [Mon, 19 Aug 2013 09:13:15 +0000 (09:13 +0000)]
Get rid of a display list stored in Curve datablock

This display list was only used for texture space calculation,
and even there this display list was only used for bounding
box calculation.

Since we already do have bounding box in a curve datablock
there's no reason to duplicate non-modified display list
just to calculate bounding box later, let's just calculate
bounding box at the first point.

This makes code a little be more thread-safe but curves are
still not safe for threads at all because of bevel list and
path. That would be solved later.

svn merge -r57939:57940 ^/branches/soc-2013-depsgraph_mt

8 years agoAlways use ob->bb when drawing the curve types
Sergey Sharybin [Mon, 19 Aug 2013 09:07:09 +0000 (09:07 +0000)]
Always use ob->bb when drawing the curve types

It used to be a check for ob->bb ? ob->bb : cu->bb but
in fact it doesn't make sense and only makes code more

Making displist for mballs and curves/surfaces/fonts
already ensures object has walid bounding box.

svn merge -r57938:57939 ^/branches/soc-2013-depsgraph_mt

8 years agoMade modifiers_getVirtualModifierList safe for threading
Sergey Sharybin [Mon, 19 Aug 2013 09:05:34 +0000 (09:05 +0000)]
Made modifiers_getVirtualModifierList safe for threading

Move static variables to context filling in by this fcuntion
and owned by a callee function. This ensures no conflicts
between threads happens because of static variables used in
this function.

Also moved modifier types and virtual modifiers data to a
function called from creator. This is needed to be sure all
the information is properly initialied to the time when
threads starts to use this data.

svn merge -r57899:57900 ^/branches/soc-2013-depsgraph_mt

8 years agoFix issue with EWA filtering in compositor which disabled alpha
Sergey Sharybin [Mon, 19 Aug 2013 08:30:03 +0000 (08:30 +0000)]
Fix issue with EWA filtering in compositor which disabled alpha

It was caused by wrong copy-paste thing, which replaced check
"whether alpha channel is enabled" with "whether alpha channel
is not zero" (which is always zero in accumulator).

Compositor always works with RGBA, so no need to do any special
checks here.

TODO: Maybe MapUV ode shall ignore alpha channel?

8 years agoRemove unneeded include, was a residual from some WIP patch in the past
Sergey Sharybin [Mon, 19 Aug 2013 08:03:44 +0000 (08:03 +0000)]
Remove unneeded include, was a residual from some WIP patch in the past

8 years agoUse BOUNDBOX_DIRTY to mark BB as need to be updated
Sergey Sharybin [Mon, 19 Aug 2013 08:03:40 +0000 (08:03 +0000)]
Use BOUNDBOX_DIRTY to mark BB as need to be updated

8 years agoMerging r59182 through r59257 from trunk into soc-2013-depsgraph_mt
Sergey Sharybin [Mon, 19 Aug 2013 07:43:26 +0000 (07:43 +0000)]
Merging r59182 through r59257 from trunk into soc-2013-depsgraph_mt

8 years agoFix warnings reported by cavity checker
Sergey Sharybin [Mon, 19 Aug 2013 07:32:47 +0000 (07:32 +0000)]
Fix warnings reported by cavity checker

8 years agoedit to object center snapping, exit early if unsupported.
Campbell Barton [Mon, 19 Aug 2013 04:23:54 +0000 (04:23 +0000)]
edit to object center snapping, exit early if unsupported.

8 years agoadd support for snapping to empty centers during transform.
Campbell Barton [Mon, 19 Aug 2013 04:22:05 +0000 (04:22 +0000)]
add support for snapping to empty centers during transform.

8 years agostyle cleanup: indent/whitespace
Campbell Barton [Mon, 19 Aug 2013 01:48:44 +0000 (01:48 +0000)]
style cleanup: indent/whitespace

8 years agocorrect uninitialized var, worked by accident.
Campbell Barton [Mon, 19 Aug 2013 00:39:28 +0000 (00:39 +0000)]
correct uninitialized var, worked by accident.

8 years agoFix #34485 sculpt strength weirdly inverted with some mesh part.
Antony Riakiotakis [Sun, 18 Aug 2013 22:44:43 +0000 (22:44 +0000)]
Fix #34485 sculpt strength weirdly inverted with some mesh part.

The view vector was not being calculated correctly. Shamelessly rip off
correct transform to object space from projective texture painting code.

8 years agoCycles:
Thomas Dinges [Sun, 18 Aug 2013 22:25:37 +0000 (22:25 +0000)]
* Fix 16 byte alignment for constant hair kernel data.

8 years agoCycles / SSS:
Thomas Dinges [Sun, 18 Aug 2013 20:49:58 +0000 (20:49 +0000)]
Cycles / SSS:
* OSL rendered Black with Compatible Fallof option, fixed.

Note: OSL uses compatible scattering when "Compatible" or "Bicubic" is selected. I guess compatible will be removed later? If not we need to fix this properly.

8 years agoAdd comments for outliner's treestore and treehash (no functional changes)
Sv. Lockal [Sun, 18 Aug 2013 20:07:49 +0000 (20:07 +0000)]
Add comments for outliner's treestore and treehash (no functional changes)