Commit Graph

95 Commits

Author SHA1 Message Date
482201d1a0 Style cleanup 2014-03-31 05:46:19 +11:00
8b43b9f255 Fix for mask vert add-slide dragging flipped direction 2014-03-29 06:44:40 +11:00
1af69b6df3 Implement asymmetric and free handles type for masks
Summary:
The title actually says it all, it's just possible to
have independent free handles for mask splines. Also
it's now possible to have aligned handles displayed
as independent handles.

Required changes in quite a few places, but they're
rather straightforward.

From user perspective there's one really visible change
which is removed Handle Type menu from the panel. With
asymmetric handles it's not clear which handle type to
display there. So now the only way to change handle type
is via V-key menu.

Rewrote normal evaluation function to make it deal
with new type of handles we support. Now it works in
the following way:

- Offset the original spline by maximal weight
- Calculate vector between corresponding U positions
  on offset and original spline
- Normalize this vector.

Seems to be giving more adequate results and doesn't
tend to self-intersect as much as old behavior used to,

There're still some changes which needed to be done, but
which are planned for further patch:

- Support colors and handle size via themes.
- Make handles color-coded, just the same as done for
  regular bezier splines in 3D viewport.

Additional changes to make roto workflow even better:
- Use circles to draw handles
- Support AA for handles
- Change click-create-drag to change curvature of the
  spline instead of adjusting point position.

Reviewers: campbellbarton

CC: sebastian_k, hype, cronk

Differential Revision: http://developer.blender.org/D121
2014-03-28 17:54:38 +06:00
9c79fd1193 Fix T38669: Mask duplicate fails with multiple layers
Allow duplicating splines from inactive layers. This way it's
more useful IMO than restricting duplication to an active layer.

TODO: What should be a behavior for clipboard (currently it copies
splines from an active layer only)?
2014-02-17 12:39:15 +06:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
37026b12ec Code cleanup: use bool for static methods 2014-02-05 22:36:15 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
fed1b8b16d Code cleanup: suffix vars to make obvious they are squared 2014-02-03 02:46:45 +11:00
a1a0ebbf49 Code cleanup: use length squared where possible 2014-02-02 02:24:48 +11:00
1d12c3fd53 Implement clipboard for mask splines
So now it's possible to copy-paste splines between layers.

Implementation is pretty much straightforward and duplicates
some logic which we've got in sequencer/tracking clipboards.

Will work on a common routine for clipboards later, for now
it's not so much crucial to have.
2014-01-27 15:42:46 +06:00
348cf17448 Code Cleanup: no need to pass empty strings as default values 2014-01-16 22:00:29 +11:00
b2fdc591c3 UI: restore confirmation popups for delete operators.
It turned out this was leading to accidental deleting in some cases when the
info message was missed by users. Fixes T37801.
2013-12-20 01:40:33 +01:00
cedc90b607 Fix errors and inconsistencies in confirmation popup removal.
* Improve some clip editor messages
* Remove popup for metastrips, seems unnecessary
* Renamed some variables for consistency
* Avoid unnecessary call to CTX_DATA_COUNT

Reviewed By: sergey, campbellbarton, aligorith

Differential Revision: http://developer.blender.org/D44
2013-11-29 17:49:01 +01:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
3ca4387bc8 UI: remove unnecessary confirmation popups
This makes a number of operators no longer ask for confirmation, rather it will
show an info message after performing the operation. Ref T37422 for decision. In
particular, these were changed:

* Delete objects, bones, keyframes, masks, mask curves, motion tracks, markers.
* Clear and delete keyframes in the 3D view.
* Align bone to parents.
* Separate bones from armature.
* Group/ungroup metastrips in sequencer.
* Copy/paste objects to/from buffer.

Reviewed By: brecht, dingto

Differential Revision: http://developer.blender.org/D35
2013-11-25 12:21:45 +01:00
03dbae07d3 Mask primitives
Currently only circle and square, might be easily
extended in the future.

New primitives are creating at cursor location.
This also implied adding 2d cursor to space clip.

Also fix set 2D cursor location which didn't work
in image editor's mask mode since 2.67.

TODO: draw_image_cursor better be moved to some
      more generic file, but it's not so much
      important for now and might be solved later.

Thanks Campbell for the review!
2013-08-26 20:23:26 +00:00
e7ecd7b68c Clear cyclic flag if we didn't copy the whole mask spline 2013-08-21 10:17:55 +00:00
1c2a657eee 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.
2013-08-21 10:12:42 +00:00
98c574e41a use 'greater/less then or equal to' operators rather then adding 1. 2013-08-11 05:40: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
23c053748d add missing notifiers for mask tools, some wouldn't refresh the compositor. 2013-06-23 15:48:00 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +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
b3c605e139 Mask editor: create new mask when trying to create new vertex without active mask set 2012-10-18 12:29:22 +00:00
67e2768570 quiet some -Wshadow warnings 2012-10-12 14:35:10 +00:00
4cb6d5d214 code cleanup: reduce calls to CTX_ functions inline, add some docs to mask rasterizer. 2012-09-13 01:50:21 +00:00
72a3fb15d7 changes to mask editing
- use Alt to modify all mask feather at once while dragging.
- copying a multi-user mask from the interface works now.
- show masks when UV editing isnt used, rather then checking editmode (would give some odd/annoying image space header).
- add a fake mask user by default.
- moving points with LMB drag no longer selects them.
2012-07-31 17:31:34 +00:00
e597234cb5 Code cleanup: remove unused code 2012-07-31 17:24:55 +00:00
f1acd6ac3e code cleanup: pass mouse position as int[2] rather then wmEvent 2012-07-27 15:15:55 +00:00
ff078d309e change clip utility function arguments to take space data and region rather then the context.
this allows a fix to be applied that corrects the helper line in the image view when transforming a mask.
2012-07-26 22:41:40 +00:00
c3a8894f57 wip mask/image commit, mostly internal function & added some TODO's 2012-07-25 10:39:54 +00:00
997850aecc Fix #32132: Uniformly moving custom feather points does not work 2012-07-18 09:56:10 +00:00
6e6dd576a8 Operator to move mask layers up and down in the list 2012-07-11 10:37:38 +00:00
14a68d3a5f Mark context as const when it's possible and avoid typecasts from const bContext* to bContext* 2012-06-19 14:09:44 +00:00
99f7c06d7e added mask tool to recalculate handles (Ctrl+N) 2012-06-13 14:09:20 +00:00
c83d37ccc0 mango request
- highlight active mask layers.
- remove keyframes when all layer data is removed.
2012-06-13 08:35:50 +00:00
7977078227 fix for using freed memory with mask point slide
-- This line, and those below, will be ignored--

M    source/blender/editors/mask/mask_ops.c
2012-06-11 20:58:16 +00:00
477d12d1fc fix for bug in point slide using freed memory when auto-keying. 2012-06-08 09:57:23 +00:00
2cb671591b mask mode
- only keyframe selected mask layers
- fix for crash in deleting animated mask layers (other than the first)
2012-06-06 14:38:47 +00:00
fe58f668a1 mask point slide now accounts for scaled bezier weights, 2012-06-05 12:51:11 +00:00
ae8103240d mask editing
- clear feather weights (alt+s)
- fix for glitch where placing the feather would jitter.
2012-06-05 09:37:44 +00:00
6f0ad4ff0f A few UI messages fixes. 2012-06-04 19:43:12 +00:00
d46a6dc59c abbreviate mask-editing to mask-edit 2012-06-04 17:30:54 +00:00
c517247fc6 include cleanup, also raskter wasn't building on osx 2012-06-04 17:27:22 +00:00
115322ef08 mask merge (initial copy of editor files) 2012-06-04 15:36:16 +00:00