Commit Graph

81 Commits

Author SHA1 Message Date
ad87d47fdb Fix T39978: Sculpting shapekeys - Using Smooth tool, turns shapekey into Basis.
Smooth brush requires deformed coordinates array to present.
2014-05-15 17:45:35 +02:00
164841e30e Code cleanup: style 2014-05-09 18:29:42 +10:00
bbf6db0c0c Fix regression from 2.70:
Multires did not support hiding in zero level. It's a case of PBVH not
being used in drawing due to code reporting active modifiers being used.

However multires level zero can be treated as effectively no modifier
and we can use mesh PBVH.
2014-05-08 17:58:55 +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
b95e826841 Code cleanup: remove unused functions and convert int -> bool 2014-04-07 17:00:08 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
2de9da6ee9 Fix T39034 brush always shown even after deactivating the show cursor
option after reentering a paint mode.

Solution by Bastien with modifications, thanks!
Show Brush flag need not be reenabled always, but make sure it is at
least enabled once on paint initialization.
2014-03-10 18:42:35 +02:00
081a3412a9 Paint API: add BKE_paint_select_elem_test: to check on paint selection 2014-02-26 16:00:54 +11: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
3073a5b1c4 Mark some CCG funcrions as inlined
This seems to be giving speedup up to 10% in own tests.

--
svn merge -r60104:60105 ^/branches/soc-2013-depsgraph_mt
2013-10-01 09:17:35 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
e101b043e1 Default paint context will be image paint if object is not in a paint mode. It solves not being able to tweak textures in the new texture context button system if an image editor is set up for painting and active object is in object mode. 2013-06-20 23:20:33 +00:00
a6b505ef0b style cleanup 2013-06-06 06:02:46 +00:00
11186184aa Fix #35404: crash in file save with python code that accesses mesh from panel.
On file save the mesh gets loads from the editmesh but the derived mesh caches
wer not cleared. This usually happens through the depsgraph but it needs to be
done manually here. Most changes are some refactoring to deduplicate derived
mesh freeing code.
2013-05-18 10:24:34 +00:00
9c510330d9 Move sculptsession functions implementation from object.c to paint.c
This functios are declared in BKE_paint.h header and using
SculptSession structure which is also declared there.

Anyway, does not make sense such a splitting of header and
implementation files, better be consistent here.
2013-05-15 08:54:05 +00:00
51010f5035 Allow hiding separate hiding of overlays on stroke. 2013-04-23 00:32:51 +00:00
36e476ede6 Overlay refactor:
Allow separate control for tex/mask/cursor overlay. This commit implements
separate overlays for mask textures and cursor curves. The user can turn on
and off separate parts of the overlay by using the appropriate widgets.
The cursor overlay widgets are located at the tool selection panel

Also fixed alpha masks not getting correctly masked and mask texture mapping
not having the correct update callback
2013-04-22 20:46:18 +00:00
53c9507c28 Option to hide overlay during a stroke. To enable, press the brush icon
next to the overlay alpha.
2013-04-16 15:02:41 +00:00
e39ea5f0a3 Fix crash when no brush is active. Reported by Francesco Siddi, on irc
thanks!
2013-04-16 14:00:18 +00:00
2f9b7410dc code cleanup: warnings + style 2013-04-13 00:43:49 +00:00
a305452275 Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:

Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:

These attributes/aspects are:

Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)

Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.

Properties that affect this are:

Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.

These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
acd3bef34e Texture sampling function refactoring:
ALERT! POSSIBLE BREAKING COMMIT, ESPECIALLY FOR SCULPT!

Separate the sculpt sampling function so that it can be reused
from other paint systems. This includes updating of the relevant
coordinates for anchored and rake style brushes, which are now
being updated as part of the stroke system.

I left only code for area-style brush texture mapping in sculpt
code, since it requires a few data structures not present on other
paint systems.

This commit makes it almost as easy to support rake on other systems as
exposing the python UI for it. Also it makes it totally possible to
have texture painting capabilities in vertex paint too :) These commits
will follow very soon.

Also, even if I did my best to keep the code from breaking, (even fixed a
leftover bug from coordinate changes) this is a big change. Please test!
2013-03-13 03:46:22 +00:00
65869589b6 Support position jittering on new texpaint code using the stroke system. 2013-03-06 22:54:44 +00:00
fdfa5910b5 Fix #34040: Moving Normal Node with enabled Cycles Material Preview crashes
Issue was caused by couple of circumstances:

- Normal Map node requires tesselated faces to compute tangent space
- All temporary meshes needed for Cycles export were adding to G.main
- Undo pushes would temporary set meshes tessfaces to NULL
- Moving node will cause undo push and tree re-evaluate fr preview

All this leads to threading conflict between preview render and undo
system.

Solved it in  way that all temporary meshes are adding to that exact
Main which was passed to Cycles via BlendData. This required couple
of mechanic changes like adding extra parameter to *_add() functions
and adding some *_ex() functions to make it possible RNA adds objects
to Main passed to new() RNA function.

This was tricky to pass Main to RNA function and IMO that's not so
nice to pass main to function, so ended up with such decision:

- Object.to_mesh() will add temp mesh to G.main
- Added Main.meshes.new_from_object() which does the same as to_mesh,
  but adds temporary mesh to specified Main.

So now all temporary meshes needed for preview render would be added
to preview_main which does not conflict with undo pushes.

Viewport render shall not be an issue because object sync happens from
main thread in this case.

It could be some issues with final render, but that's not so much
likely to happen, so shall be fine.

Thanks to Brecht for review!
2013-02-05 12:46:15 +00:00
9a50f45469 Skip hidden faces in PBVH BMesh ray intersection test
Moved the GPU function gpu_bmesh_face_visible() to BKE_paint and
inverted the test to match equivalent tests for other mesh types:
paint_is_bmesh_face_hidden().

Changed BKE_pbvh_bmesh_node_save_orig() to not save hidden faces into
the triangle array.

Modified the non-use-original branch of pbvh_bmesh_node_raycast() to
skip hidden faces.

Fixes bug #33914:
projects.blender.org/tracker/index.php?func=detail&aid=33914&group_id=9&atid=498
2013-01-19 16:10:21 +00:00
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
7dca6dbf0b code cleanup:
make vertex/weight flag names consistent
ME_EDIT_VERT_SEL   --> ME_EDIT_PAINT_VERT_SEL
ME_EDIT_PAINT_MASK --> ME_EDIT_PAINT_FACE_SEL

also remove unused header BLO_soundfile.h
2012-12-22 14:25:34 +00:00
58f29fc9ab Fix: wrong brush drawn in image painting, image editor if uv sculpt is on. Now the correct paint struct is returned and the image zoom is calculated correctly 2012-10-29 19:47:26 +00:00
aa49ca25d5 incorrect spelling in comments 2012-09-26 20:05:38 +00:00
be23539a94 code cleanup: use BKE_pain_ prefix for paint funcs. also minor style edits 2012-07-25 22:37:52 +00:00
1091030c11 mask now draws in the image view, misc minor edits. 2012-07-25 13:44:59 +00:00
a42a5c90d5 Fix #31826: UV/Image editor paint image crash
Missed NULL check in own refactoring a while ago.
2012-06-18 14:08:54 +00:00
1511bd8eb4 Correction to recent changes in paint module -- missed NULL check for active object 2012-06-04 07:44:57 +00:00
46cd2a6a38 Fix #31093: Brush's "Paint curve presets" in Image paint in UV\Image Editor doesn't work if weight paint mode is active
Some operators like curve presets, color sample and some more were using object's
mode to distinguish in which mode user is currently painting. Such approach fails
in cases when there's paint mode active in 3D viewport and Image Editor.

Changed logic here to use some context's state like active space which helps
distinguishing current paint mode more accurate.

Ported all areas which uses paint_get_active() to new paint_get_active_from_context().
There're still some calls to paint_get_active(), but that shouldn't be harmful due
to that places indeed have object's mode as priority when getting paint mode.
2012-06-04 07:29:45 +00:00
ce17c35240 style cleanup: mainly sculpt/whitespace 2012-05-11 08:05:47 +00:00
4c66616f44 Add GridPaintMask accessor to paint.c. 2012-05-10 20:33:55 +00:00
084fedd03a code cleanup: brush/camera naming 2012-05-05 00:58:22 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
82840ef94b Add MDisps.hidden bitmap.
Updates SDNA, customdata functions, and file read/write. Also adds
accessor functions to BKE paint.
2012-03-14 06:31:38 +00:00
a8081c1d2b Uv Tools branch GSOC 2011
=========================
Documentation: http://wiki.blender.org/index.php/User:Psy-Fi/UV_Tools

Major features include:

*16 bit image support in viewport
*Subsurf aware unwrapping
*Smart Stitch(snap/rotate islands, preview, middlepoint/endpoint stitching)
*Seams from islands tool (marks seams and sharp, depending on settings)
*Uv Sculpting(Grab/Pinch/Rotate)

All tools are complete apart from stitching that is considered stable but with an extra edge mode under development(will be in soc-2011-onion-uv-tools).
2012-01-17 16:31:13 +00:00
f0b3ec33f6 fix for weight paint mode drawing selected verts even when it wasnt the active object. 2011-12-03 20:26:53 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
73863a1da5 Split do_weight_paint_vertex() to isolate the simple case.
Added a tool-tip to the "fix deforms" op.

Removed code markers:
"Radish"
2011-09-18 17:10:28 +00:00
a9c99f58f4 Changed the branch code markers to say "Radish" in response to a review.
They weren't & aren't meant to show ownership, they just help me navigate my related code.
2011-09-18 03:49:00 +00:00
2e7144bed8 Removed my earlier vertex paint vertex select--someone is changing it drastically in Salad (dynamic paint, I think), so I shouldn't have messed with it. 2011-07-21 18:46:59 +00:00
fb3783bd13 Added vertex masking support for the weight paint vgroup functions including:
Normalize, Normalize All, Invert, Clean, and Levels.

Face mask and vertex select/mask are now mutually exclusive options.

Went ahead and allowed vertex selection support and masking for vertex paint.
2011-07-20 15:56:35 +00:00
b8fc3030b5 svn merge -r37793:37865 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Merge info was  /trunk/blender:36835-37793,37865-38157
so this should merge in missing files.
2011-07-18 14:15:02 +00:00