Commit Graph

450 Commits

Author SHA1 Message Date
3a0593cc3d code cleanup: dont use function calls like dot_v3v3, pow and sqrt within macros which results in calling the function multiple times needlessly.
also added some comments.
2012-07-06 22:48:28 +00:00
9f22750422 style cleanup 2012-07-04 20:47:12 +00:00
8b865c01cd style cleanup: comments 2012-06-30 22:49:33 +00:00
35d8424273 code cleanup: rename some members of bmesh operators, 'slots' is a C++ keyword which confuses some IDE's.
also added missing BMO_op_vinitf args to comments.
2012-06-30 09:55:04 +00:00
Lukas Toenne
83093d6770 Extended modes for snapping in the node editor.
The transform operators in nodes will now use the unselected nodes to generate snapping points. Unlike object snapping, node snapping works for the x/y axes separately and snaps node borders to same borders of unselected nodes. The sensitive area for node borders extends over the whole view2D range, to enable simple alignment of nodes in both x and y direction.

For snap points in the node editor an additional enum value is stored to indicate the type of node border (left/right/top/bottom). This works as a constraint on possible node alignments: only same border types align with each other.
2012-06-29 14:34:46 +00:00
6b8986af43 revert part of 48340, it causes uvs across islands to stitch in a different way (?) than before 2012-06-28 15:09:24 +00:00
1ba5db129b recent fix for #31581 could crash when doing edge slide on a mesh with no UV's. 2012-06-28 14:18:04 +00:00
Lukas Toenne
855b6391ea Basic snapping in node transform operator.
Snapping actually was working already, but grid spacing was set to 1.0, which is basically pixel size in the node editor. Increased this to 1x grid step for fine snapping and 5x grid step for rough snapping.

Grid drawing in node editor now draws 2 levels in slightly different shades to indicate the different snapping modes better.

Node editor also supports the general use_snap tool setting to enable automatic snapping during transform. For now only the incremental snapping is supported, in future could be extended to enable alignment between nodes in a number of ways.
2012-06-28 08:47:22 +00:00
ae2f3a4e5e Fix for #31581, UVs shrink on edge slide.
Issue is that all loops of a face adjacent to the sliding verts were 
getting project-corrected. Introduced a test to only project the
affected loops. 

The projection code introduces a small offset to the boundaries so that
any boundary tests can work as expected, but this leads to shrinking of
the barycentric coordinates of the projection, causing a shrink of the
uvs in turn. This even affects the uvs that -should- be affected though
the unfixed behavior works strangely in a correctish way (my guess is
because the projection uses the same face as the opposite sliding loop).

I fixed the behaviour by taking the mean value of the uvs. This won't
support seams but current code doesn't either. Also, all CustomData to
exhibit this unfixed behaviour. I only fixed the uv case, other data
(Vcolors, etc) will have discontinuities when edge sliding. I expect
that the CorrectUV code I am working on may address some of these
issues.

Also, added NULL checks for utility function (was intended for this bug
but wasn't needed after all)
2012-06-27 17:08:12 +00:00
4b955a60ed Cleanup up space clip API:
- Remove clip/mask specific size/aspect getters, they shall just
  use the same size/aspect ratio.
- Made size getter (and some other public functions) accept context
  instead of SpaceClip. Currently only SpaceClip is being get from
  this context, but later it'll be helpful when adding support of
  editing mask without opening clip in clip editor (in this case
  using render resolution for mask would be ideal, but this
  requires knowing scene in size getter).
- Rearrange some functions in clip_editor.c for easier navigation
  in the file.
2012-06-20 10:28:51 +00:00
4f044f4ec1 Changes in clip editor's public api to make it's more clear
whether getting of some property happens or this property is
being changed.

Also made it more clear whether affecting property belongs
to clip or mask datablock.
2012-06-19 14:26:29 +00:00
869efe927c style cleanup 2012-06-10 22:13:17 +00:00
51d9bf725d style cleanup 2012-06-10 19:59:02 +00:00
25bb441301 Planar tracking support for motion tracking
===========================================

Major list of changes done in tomato branch:

- Add a planar tracking implementation to libmv
  This adds a new planar tracking implementation to libmv. The
  tracker is based on Ceres[1], the new nonlinear minimizer that
  myself and Sameer released from Google as open source. Since
  the motion model is more involved, the interface is
  different than the RegionTracker interface used previously
  in Blender.

  The start of a C API in libmv-capi.{cpp,h} is also included.

- Migrate from pat_{min,max} for markers to 4 corners representation

  Convert markers in the movie clip editor / 2D tracker from using
  pat_min and pat_max notation to using the a more general, 4-corner
  representation.

  There is still considerable porting work to do; in particular
  sliding from preview widget does not work correct for rotated
  markers.

  All other areas should be ported to new representation:

  * Added support of sliding individual corners. LMB slide + Ctrl
    would scale the whole pattern
  * S would scale the whole marker, S-S would scale pattern only
  * Added support of marker's rotation which is currently rotates
    only patterns around their centers or all markers around median,

    Rotation or other non-translation/scaling transformation of search
    area doesn't make sense.

  * Track Preview widget would display transformed pattern which
    libmv actually operates with.

- "Efficient Second-order Minimization" for the planar tracker

  This implements the "Efficient Second-order Minimization"
  scheme, as supported by the existing translation tracker.
  This increases the amount of per-iteration work, but
  decreases the number of iterations required to converge and
  also increases the size of the basin of attraction for the
  optimization.

- Remove the use of the legacy RegionTracker API from Blender,
  and replaces it with the new TrackRegion API. This also
  adds several features to the planar tracker in libmv:

  * Do a brute-force initialization of tracking similar to "Hybrid"
    mode in the stable release, but using all floats. This is slower
    but more accurate. It is still necessary to evaluate if the
    performance loss is worth it. In particular, this change is
    necessary to support high bit depth imagery.

  * Add support for masks over the search window. This is a step
    towards supporting user-defined tracker masks. The tracker masks
    will make it easy for users to make a mask for e.g. a ball.

    Not exposed into interface yet/

  * Add Pearson product moment correlation coefficient checking (aka
    "Correlation" in the UI. This causes tracking failure if the
    tracked patch is not linearly related to the template.

  * Add support for warping a few points in addition to the supplied
    points. This is useful because the tracking code deliberately
    does not expose the underlying warp representation. Instead,
    warps are specified in an aparametric way via the correspondences.

- Replace the old style tracker configuration panel with the
  new planar tracking panel. From a users perspective, this means:

  * The old "tracking algorithm" picker is gone. There is only 1
    algorithm now. We may revisit this later, but I would much
    prefer to have only 1 algorithm. So far no optimization work
    has been done so the speed is not there yet.

  * There is now a dropdown to select the motion model. Choices:

        * Translation
        * Translation, rotation
        * Translation, scale
        * Translation, rotation, scale
        * Affine
        * Perspective

  * The old "Hybrid" mode is gone; instead there is a toggle to
    enable or disable translation-only tracker initialization. This
    is the equivalent of the hyrbid mode before, but rewritten to work
    with the new planar tracking modes.

  * The pyramid levels setting is gone. At a future date, the planar
    tracker will decide to use pyramids or not automatically. The
    pyramid setting was ultimately a mistake; with the brute force
    initialization it is unnecessary.

- Add light-normalized tracking

  Added the ability to normalize patterns by their average value while
  tracking, to make them invariant to global illumination changes.

Additional details could be found at wiki page [2]

  [1] http://code.google.com/p/ceres-solver
  [2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
6e9e758d60 fix for un-initialized memory use for modal inset/bevel. 2012-06-10 09:05:49 +00:00
c714388473 Fix #31734: Edge slide operator Flip/Even options not working
Issue was caused by wrong check whether transform is in edge slide mode.
2012-06-07 07:39:37 +00:00
1931aac1f7 style cleanup: (indentation) 2012-06-06 14:48:39 +00:00
957ea14511 shrink/fatten now works with proportional editmode on curves. 2012-06-05 14:19:13 +00:00
8c71157af6 shrink/fatten transform for mask - adjusts the feather weight.
works in proportional editmode too.
2012-06-05 14:13:14 +00:00
68a9dd54ec mask mode for clip editor developed by Sergey Sharybin, Pete Larabell and myself.
see:
http://wiki.blender.org/index.php/User:Nazg-gul/MaskEditor


note - mask editing tools need continued development, feather option is not working 100%
2012-06-04 16:42:58 +00:00
d5ae958e8f Fix #31634: crash calling bpy.ops.transform.edge_slide() outside 3d view.
Solution based on patch #31635 by Philipp Oeser.
2012-05-31 19:06:52 +00:00
22982e9351 minor transform change to stay in sync with mask branch 2012-05-30 07:38:33 +00:00
654ef111a7 Fix #31606: pg up/down does not work for changing falloff for proportional editing
Initially issue was caused by non-proportional edge slide patch in rev46927 which
had several wrong things:

- It introduced new events TFM_WHEEL_DOWN_EVT/TFM_WHEEL_UP_EVT which were defined
  as per-bit OR between edge slide and proportional editing modal events, but
  the issue is that modal events are not bit masks and that meant that new events
  were defined as 20|24 and 21|25 which is a bit strange.
- Another this was caused by the fact, that keymap wasn't creating for some specific
  transform modal keymap item -- it used to be tried to create single shortcut for
  two different modal events, which isn't supported by keymaps and resulted by
  artifacts in keymap editor interface (nodal event type was empty for wheel movements).
  That was caused by different events used by modal keymap and defining shortcuts.
- Actual issue which prevented PgUP/PGDOWN to work was mixing using that new events
  for wheel scrolling in switch statements which doesn't do bitmask check.

Solved by separating keymaps used for proportional editing and edge slide -- now
it's mouse Wheel for proportional editing and Alt-Wheel for edge slide. If someone
would want to have single shortcut for this two events it'll imply one of the follofing
things:

- Support poll function for shortcuts, so keymap would definitely know which
  modal event to send to operator.
- Generalize TFM_MODAL_PROPSIZE_{UP, DOWN} and TFM_MODAL_EDGESLIDE_{UP, DOWN} so
  they can share the same shortcut with current design of keymaps.
2012-05-27 10:08:37 +00:00
c0f59c44f8 edit to last commit, remove pointer to active slide vert, only need to store the index. 2012-05-23 09:55:48 +00:00
88fc573596 non-proportional edge slide patch by XercesBlue
remmoved edge-visibility check from the patch which gives nice functionality but calculates and BVH and throws it away every update.
2012-05-23 09:46:32 +00:00
dab1d8e487 style cleanup 2012-05-22 22:03:41 +00:00
d2a37d464a code cleanup: double promotion warnings 2012-05-22 21:16:59 +00:00
6c67fc83ea Add vertex skin radii scaling as a transform operator.
Add a new transform operator, "Skin Resize", which scales the X and Y
axes of the radius field in MVertSkin. It's bound to CTRL+AKEY.

Skin modifier documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/SkinModifier
2012-05-22 15:30:14 +00:00
3896ad4cbb code cleanup: spelling 2012-05-20 21:23:26 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
ed679693c9 style cleanup: whitespace/indentation 2012-05-19 13:55:54 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
69b95e1a8a Code cleanup: de-duplicate some transform constraint code.
No functional changes.
2012-05-17 22:52:42 +00:00
5ff7ede1b5 modal operation for bevel and inset:
This commit adds some first building blocks for the two operators to work modally based on mouse input. To make their function easier, two hotkeys are introduced, Ctrl+B for bevel and I for inset.

TODO:
After discussion with Campbell, we would like to add scale-style line indicators for the operators. This is already done for transform operators but a new interface for mesh operations may have to be written using pieces from that code since, strictly speaking bevel and inset are not exactly "transform" operators.

Also, a better input method for inset is needed and more options exposed. The method implemented right now uses mouse move for thickness and ctrl-mouse move for depth. These are calculated using the distance of the selection center in screen space and the mouse position. While that may work and prevents abrupt changes in values when switching from thickness tweak mode to depth tweak mode, it limits the magnitude of values that can be put into the tool especially in small or large scale. 

Alternatives until a better method is written include:

* use relative offset (works but may give strange results)
* tweak manually after the operation.
2012-05-16 14:30:41 +00:00
800bc74a8f Adds “align” option to snap to verts/edges/faces, for bones in Pose mode.
Have to use a ugly hack, as for pose bones, rotscale transform matrix is not always the same as translate one... :/

Adresses feature request [#30979] snapping: "align rotation with the snapping target" and pose-mode.
2012-05-13 16:01:59 +00:00
145289ad95 code cleanup: minor improvements to float/vector usage. 2012-05-12 22:13:38 +00:00
a9ecc86ec9 fix [#31205] Loop cut don't slide when hidden faces between 2012-05-04 17:02:02 +00:00
6327c9aae1 style cleanup: whitespace, braces 2012-05-01 20:08:23 +00:00
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
d30ee954f8 Remove variables tagged as unused. Easier to synchronize with current patches and makes
patches easier to read when variables are creating or e-using, but not un-commenting.
2012-04-29 13:45:31 +00:00
40489e378d quiet unused warnings 2012-04-29 13:19:22 +00:00
c27c87dde4 Camera tracking: backport refactoring made in local branches with masking and dopesheet view into trunk
Mostly related on changes in poll functions for tracking operators and some changes
to how interface is initializing for different view types.
2012-04-29 12:32:26 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
ee6aaafd31 code cleanup: typos and set gcc attributes for string formatting. 2012-04-25 06:06:40 +00:00
e7eac6c3f2 fix [#31080], edge slide UV correction wasnt working for UVs surrounding the end of the slide selection (one edge sliding on a grid for example). 2012-04-25 02:46:32 +00:00
c4abd6cf5a code cleanup: edge slide code had oddly named variables, added some comments and renamed vars.
also made BM_elem_select_set() a function (was a macro calling a function).
2012-04-25 01:24:55 +00:00
48893dba24 style cleanup: no functional changes 2012-04-24 22:50:49 +00:00
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
6701933f5c style cleanup 2012-04-21 12:51:47 +00:00
b26865ba99 code cleanup: prefer BM_face/edge/vert_select_set() over BM_elem_select_set() when the type is known (saves switch statement check on the type).
Add asserts so the correct types are ensured.
2012-04-20 16:55:47 +00:00