Commit Graph

787 Commits

Author SHA1 Message Date
7880f75e87 Cleanup: use bool 2014-10-07 14:04:39 +02:00
7fff7beac1 Cleanup: sculpt float -> bool 2014-10-05 17:17:19 +02:00
72f557d34e Sculpting:
Grab and Snake hook brushes now support strength. To keep compatibility
with older brushes, this commit also sets strength to 1.0 for those
brushes.
2014-10-03 13:14:10 +02:00
3a40aed3d5 Cleanup: use float versions of functions when in/output are floats 2014-09-24 14:55:02 +10:00
c5a2c08dd9 Code cleanup, defined shared stroke properties to one central function. 2014-09-03 14:09:05 +02:00
8c14651292 Refactor sculpt rotate tool to use new dial mechanism. 2014-08-27 17:30:01 +02:00
115458b53e Fix T41193: 2.71 use 100% of CPU at sculpt
Issue wascaused by the famous OpenMP crap in MSVC2013,
so only way is to use openmp threading if number of BVH
nodes is high enough.

Made it 8 for now, which seems to work rather fine on my
laptop and adult dragon from sintel. But maybe it's to be
adjusted a bit more.
2014-07-28 15:47:32 +06:00
f745564e4e GSOC 2013 paint
Yep, at last it's here!

There are a few minor issues remaining but development can go on in
master after discussion at blender institute.

For full list of features see:

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting

Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.
2014-07-21 12:02:05 +02:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
bd777ffd3b Follow up to previous commit, do not calculate normal now with front
facing.
2014-06-27 01:55:30 +03:00
dbc04c594b Fix T40758 Front facing not consistent in sculpt mode.
Some tools used view vector while others used the area normal.

Area Normal -is- useful and it will have to be incorporated to the
system better, but I'd like to do it in a way that is well
collaborating with sculpt plane calculation too, because it will have
to be slightly more expensive, i.e normal calculated before the plane,
never together, so only front to the area normal influence can be kept.

Currently sculpt plane takes into consideration view vector, but that
can produce an unwanted normal/plane at glancing angles on mesh edges.

Another issue that arises here is whether we do an actual calculation of
sculpt normal for each symmetry pass or we just flip the initial (former
is more expensive but more correct)
2014-06-27 01:48:49 +03:00
7df2717727 Add ED_paint.h, split out ED_sculpt.h
also rename some functions to match our convention
2014-06-23 22:00:44 +10:00
8461acd54c Fix T40567 Crash when returing to object mode from dyntopo.
Returning to object mode reactivates any generative modifiers
and this can lead to a polycount explosion.

For now just improve the warning when entering dyntopo with generative
modifiers. I would like to add the ability spawn options to apply or
remove the modifiers too, however separate undo stack system comes back
with a vengeance here, since it won't allow restoring the application/
also may invalidate all sculpt undo in the undo stack prior to the
application (needs investigation).
2014-06-21 21:20:13 +03:00
bf462149a6 BLI_bitmap: rename macros
- BLI_BITMAP_SET -> BLI_BITMAP_ENABLE
- BLI_BITMAP_CLEAR -> BLI_BITMAP_DISABLE
- BLI_BITMAP_GET -> BLI_BITMAP_TEST
- BLI_BITMAP_MODIFY -> BLI_BITMAP_SET
2014-06-14 00:47:12 +10:00
f8f25c38d3 Fix T40510, revert openmp thread count to how it was in
2.70 for non Apple systems.

Also refactored the code that restores the previous openmp thread count.
The logic here was weird, mostly due to all the commit madness with
Apple openmp support. The restored thread count though should not depend
on the on/off state of threaded sculpting (since it has to do with
systems other than sculpting only). For OSX threads are restored to the
system thread count but Jens should recheck here.
2014-06-08 01:39:02 +03:00
d9dd29054f Style cleanup 2014-05-20 00:11:16 +10:00
7773f8f504 Use warning instead of info for previous commit 2014-05-15 23:06:29 +03:00
56aa4eadcc Fix T39684, warn when entering sculpt mode with an object with non- 2014-05-15 22:49:47 +03: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
20f7aaf6be Fix issue discovered while investigating T39950:
Sculpt mode drawing fails after deleting a subsurf modifier
in sculpt mode and undoing.

This was quite difficult to spot. Main cause was that mesh data was not
synchronized properly between undo and sculpt code because we generated
a pbvh on derivedmesh invalidation without really refreshing the rest of
the data. This could result in undo and drawing operating on different
data.

To solve this and avoid bad level calls I had to move quite some code
around. Crazyspace is now moved to blenkernel, as did some sculpt calls
that make sure sculpt data are properly refreshed.
2014-05-06 23:44:06 +03:00
09f5dff244 Fixes to previous sculpting tweaks
undo didn't work, layer and smooth crashed..
2014-05-06 16:27:45 +02:00
45b4506c0d Cleanup a bit of the locked shape keys painting
It's still gives some slowdown when painting a locked
key in the solid view, but since shape key is now longer
being re-used by DM.

but this change should still give some degree of speedup
propagating delta onto the keyblock if i remember the
code correct.
2014-05-06 14:49:50 +02:00
4638ca0ebe Fix T39956.
Even locked shape keys need to be flushed if user is in textured or
wireframe mode.
2014-05-05 22:39:55 +03: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
da25ae183a Remove unused argument from sculpt_omp_start() 2014-04-28 13:07:21 +06:00
f3798fa45e Revert the testing sculpt openmp thread control and limit for OSX to physical threads as in 2.70a tag 2014-04-27 18:39:03 +02:00
b6e967be63 Code cleanup: const args and arrays 2014-04-27 08:56:54 +10:00
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
55d75f5020 Code cleanup: correct abs use
also minor cleanup to rotation code
2014-04-21 02:02:21 +10:00
ad8a35a659 Dyntopo: Solve issue with test file by Jens.
Seems like custom data indices can be mangled when many layers are
present in the mesh, so use more strict calculation of offset (copied
over from BM_CD_LAYER_ID).

I was under the impression that all custom data would be deleted on
entering dyntopo, it seems this is not the case though.
2014-04-18 00:11:05 +03:00
169f831394 Make sure we invalidate the node ID layer each time the PBVH is reset.
It makes code more tidy (avoids having to call invalidation on a myriad
places). Also makes sure other invalidation cases (some mesh change,
e.g.) work as expected.
2014-04-17 20:53:40 +03:00
dc40a97fc1 Optimize and symmetrize operators missed reset of node layer. 2014-04-17 19:13:58 +03:00
38eef8deee Refactor to Dyntopo node customdata commit.
Don't use a dedicated node layer but use temporary int layer instead.
Works like a charm as long as we are careful resetting the layer when
needed (after pbvh clearing and always after bmesh has been filled in
undo)

Tip by Campbell, thanks!
2014-04-17 19:03:08 +03:00
e0e05ae85e Add missing node update in dyntopo flood fill. 2014-04-17 16:03:14 +03:00
556590fa3a Dyntopo:
Store PBVH node ID in CustomData. This avoids a number of hash deletions
and checks/insertions on big hashes.
2014-04-16 05:31:02 +03:00
3cbd9ebcf2 Fix for sculpt mode last-stroke applying obmat twice 2014-04-12 16:35:11 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
b95e826841 Code cleanup: remove unused functions and convert int -> bool 2014-04-07 17:00:08 +10:00
62dc18c717 Fix an unused function warning without openmp present, some typos 2014-04-01 11:23:28 +02:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
d25ba1eccd Changes to openmp threads commit (UI and RNA)
- use same names as render threads
- remove OpenMP from UI
- remove details from tips
2014-04-01 08:30:24 +11:00
6815a22110 Sculpt/dytopo: remove debug prints and add explanations 2014-03-31 19:11:52 +02:00
097a3756c0 Code cleanup: use bool 2014-03-31 23:39:08 +11:00
277fb1a31f Sculpt/dyntopo: Make the omp threads configurable to overcome performance issues
- autodetect optimal default, which typically avoids HT threads
- can store setting in .blend per scene
- this does not touch general omp max threads, due i found other areas where the calculations are fitting for huge corecount
- Intel notes, some of the older generation processors with HyperThreading would not provide significant performance boost for FPU intensive applications. On those systems you might want to set OMP_NUM_THREADS = total number of cores (not total number of hardware theads).
2014-03-31 13:51:49 +02:00
482201d1a0 Style cleanup 2014-03-31 05:46:19 +11:00
d84bd56ec5 OSX: Remove the apple/omp workaround for now, to better judge compiler differences 2014-03-30 17:38:52 +02:00
e659cfdaf7 Change dyntopo detail size calculation slightly so the result is close
to the radius of the widget when setting the detail.
2014-03-29 18:16:36 +02:00
fb0959f88d Code cleanup: replace dot with len_squared and is_zero checks 2014-03-29 22:24:12 +11:00
aec4367226 Fix building without openmp continued 2014-03-29 00:11:35 +02:00