Commit Graph

704 Commits

Author SHA1 Message Date
3216e4b202 API Cleanup: Use BKE_constraint prefix for constraint api 2014-04-11 11:47:07 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
a6fb6706a8 Revert "FCurve Transform: scaling no longer changes hansle types"
This reverts commit 6cc5bdc99e.

Revent this for 2.70a, it changes behavior too much without allowing
keyframe handles to be scaled some alternative way.
2014-04-09 20:25:55 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
a5be03b270 Fix deffects reported by CoverityScan (nothing dramatic, but at least one was a (minor) bug). 2014-03-31 16:42:15 +02: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
29888dcea0 Fix T39455: Nodes scaled wrong when some in a frame, some not.
Transform operators for nodes were not taking parent nodes (frames) into
account. Now use the nodeToView/nodeFromView functions to apply
transforms in local node space.
2014-03-28 10:07:11 +01:00
9767ff8916 Code cleanup: use true/false in sequencer functions 2014-03-20 15:46:38 +06:00
a2057005f2 Fix T39164: Mask tansform doesn't respect parent for center
A regressions since 2.69, eeeh.
2014-03-14 12:58:36 +06:00
032b42d48d Code cleanup: de-duplicate switch statement, style edits 2014-03-13 06:31:06 +11:00
35ed7486c7 Mesh API: rename 'octree' to 'spatial' since internally its using kdtree 2014-03-13 01:49:47 +11:00
5db086b7ce Transform: minor optimization, use BLI_bitmap for island tagging 2014-03-12 18:30:38 +11:00
98abc80dcf Correction to previous commit 2014-03-07 21:17:26 +11:00
7a9838b5d3 Fix action-editor crash transforming gpencil and masks
There were 3 bugs with both data types
- using freed memory while sorting.
- sorting failed in some situations.
- scaling allowed multiple items to be on the same frame.

Replace this with a simple sort + de-duplicate, taking selection into account.
2014-03-07 21:09:51 +11:00
3d2b530315 Hiding plane tracks was never implemented 2014-03-06 20:07:40 +06:00
9737717234 Fix for some unlikely memory leaks, remove redundant checks 2014-03-01 20:14:20 +11:00
6cc5bdc99e FCurve Transform: scaling no longer changes hansle types
This matches 3d view and means you can change the amplitude of a curve
while keeping auto-clamped handles.
2014-03-01 13:06:07 +11:00
a32588b174 Fix for transform setting T_CAMERA
This was only set when the camera was active, however non active cameras
can be transformed too.
2014-03-01 01:28:15 +11:00
771b0e354c Fix Crazyspace with proportional editing 2014-02-28 21:26:19 +11:00
2e0a33745d Revert editbone roll correction changes.
This reverts commit f72acc38d 65c5be967 eff6b385e 3fe487217
2014-02-28 10:35:11 +01:00
f72acc38dd Transform: remove recently added ival2, use editbones temp data 2014-02-27 09:47:37 +11:00
65c5be9676 Fix T38843: Bone parallel to world z axis flicking when scale in edit mode.
This commit hopefully fixes all glitches we had when bone was Z-aligned. Note that when you init a transform
with a Z-aligned bone and change it to be non-Z-aligned, you will still get some brutal roll change,
there is not much things we can do here afaik...
2014-02-26 21:36:24 +01:00
eff6b385e4 Code cleanup: use lowercase names for vars 2014-02-23 14:38:26 +11:00
3fe487217d Fix T38407: Bone roll calculation flips local axes at wrong rotation angle.
Basic idea is now to have the transformes bones keep "facing" the armature's Z axis, see comments in code for details.

That might not be ideal, but at least we now have humanly predictable and consistent results.
2014-02-22 11:12:44 +01:00
1776cb9244 Fix T38670: Mask transform without a movieclip crashes
Disable transform and mask display when there's no active clip.

It's not a matter of returning fallback dimensions if there's no
slip, it's also matter of making it so stabilization and distortion
routines are aware of clip == NULL which is really crappy.

Also almost all the operators are disabled in clip editor without
active clip already anyway.

Also tweaked header UI a bit to not display mask stuff when there's
no active clip,
2014-02-17 12:58:50 +06:00
da8c6360b1 Revert 7142b97085 (transform toggle node hiding)
D187 was committed without review and later rejected by Brecht and myself.
2014-02-17 14:46:16 +11:00
f49e89fa37 Fix T38525: missing update when running bpy.ops.transform.* from the console. 2014-02-12 17:01:53 +01:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
1d260d84ad Fix T38411: Free keyframe handles do not snap to frames when duplicating 2014-02-04 19:12:19 +06:00
b29bfd5daa Fix T38469: Strip delimiter handlers don't move strip correctly with keyboard input
Issue was in fact in strip update code when transforming, in case we move both left and right
handles the strip is handled twice in the loop, but it was always updated at the end of the
first loop only...
2014-02-04 09:55:09 +01: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
70f2389f5a Code cleanup: be less vague checking invalid index values 2014-02-01 02:01:00 +11:00
1e0654f162 Fix T38393: bone roll not restored properly after cancelling rotation of bones. 2014-01-29 16:14:21 +01:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
19da32abf3 Fix T38128: snapping to node border uses node centers.
This was caused by recent change to transform locations being changed
to the upper-left corner of nodes (rBa857a6f).
2014-01-21 13:13:41 +01:00
37242e6b0b Code Cleanup: style 2014-01-21 12:05:27 +11:00
7142b97085 Make it possible to hide/unhide a node during node transform operations.
During drag the H key can be used to toggle the hide flag of the selected nodes.
This makes it easier to 'attach' nodes to available links in narrow places.
2014-01-18 18:20:21 +01:00
6c629e7594 Only check OB_RECALC_ALL flags of the object in transform code
Because of the issue of how simplification works, there could
be more flags in on->recalc bitfield which are ignored by object
anyway.

Would save some update calls after simplificating the scene.
2014-01-15 16:38:47 +06:00
eb89570733 Followup to the previous commit
It was actually rather simple to make sure depsgraph is up to date
before calling BKE_object_handle_update() in the transform code by
just moving DAG_scene_relations_update() to the beginning of the
function.

Wouldn't expect any side effects for other cases since DAG is not
used bu the code between new location of the call and old one.
2014-01-15 16:36:48 +06:00
b8b412230b Code Cleanup: use iroundf
also increase precision of rctf print functions
2014-01-15 13:40:40 +11:00
c00b8c538c fixed wrong comment 2014-01-14 23:08:29 +01:00
e618d8238e Fix T38054: High CPU usage with many objects
This is a regression since threaded dependency graph landed to master.
Root of the issue goes to the loads of graph preparation being done
even if there's nothing to be updated.

The idea of this change is to use ID type recalc bits to determine
whether there're objects to be updated. Generally speaking, we now
check object and object data datablocks with DAG_id_type_tagged()
and if there's no such IDs tagged we skip the whole task pool creation
and so,

The only difficult aspect was that in some circumstances it was possible
that there are tagged objects but nothing in ID recalc bit fields.

There were several different circumstances when it was possible:

* When one assigns object->recalc flag directly DAG flush didn't
  set corresponding bits to ID recalc bits. Partially it is fixed
  by making it so flush will set bitfield, but also for object
  types there's no reason to assign recalc flag directly. Using
  generic DAG_id_type_tag works almost the same fast as direct
  assignment, ensures all the bitflags are set properly and for the
  long run it seems it's what we would actually want to.

* DAG_on_visible_update() didn't set recalc bits at all.

* Some areas were checking for object->recalc != 0, however it is was
  possible that object recalc flag contains PSYS_RECALC_CHILD which
  was never cleaned from there.

  No idea why would we need to assign such a flag when enabling
  scene simplification, this is to be investigated separately.

* It is possible that scene_update_post and frame_update_post handlers
  will modify objects. The issue is that DAG_ids_clear_recalc is called
  just after callbacks, which leaves objects with recalc flags but no
  corresponding bit in ID recalc bitfield. This leads to some kind of
  regression when using ID type tag fields to check whether there objects
  to be updated internally comparing threaded DAG with legacy one.

  For now let's have a workaround which will preserve tag for ID_OB
  if there're objects with OB_RECALC_ALL bits. This keeps behavior
  unchanged comparing with 2.69 release.
2014-01-13 15:57:51 +06:00
0445454f1e Fix T38077: Scaling bones in EditMode drawn using envelope display mode scales joint radii instead
When trying to scale bones in EditMode and the bones were drawn using envelope display mode,
this resulted in the joint radii (i.e. the inner part of envelopes) being adjusted instead.
It turns out that this was due to an old hack that was put in place back in 2.4x (see the
tracker logs for full details of the problem here).

This commit introduces the following fixes:
1) Removed the old hack. Scaling (S) works normally now.
2) Ctrl-Alt-S (i.e. "Scale Envelopes/BBones") is as-is.
   That is, it is used to adjust the size falloff-region around a bone
   (i.e. the "dist" property)
3) Added Alt-S hotkey in EditMode for armatures for adjusting the radii of bones.
   This change just means that the "TFM_BONE_ENVELOPE" mode is now able to be
   accessed from the UI as a tool on its own right (instead of being accessible
   via the old undocumented hack). This tool adjusts the radii of the bone joints,
   which define the actual full-influence region of the envelopes.
2014-01-10 00:48:43 +13:00
a857a6fcf9 Fix T37970: Node scale/rotate use incorrect pivor
note: added code to use real node center, but ifdef'd for now since it
doesnt work well with absolute snapping.
2013-12-30 20:09:16 +11:00
709041ed0b Threaded object update and EvaluationContext
Summary:
Made objects update happening from multiple threads. It is a task-based
scheduling system which uses current dependency graph for spawning new
tasks. This means threading happens on object level, but the system is
flexible enough for higher granularity.

Technical details:

- Uses task scheduler which was recently committed to trunk
  (that one which Brecht ported from Cycles).

- Added two utility functions to dependency graph:
  * DAG_threaded_update_begin, which is called to  initialize threaded
    objects update. It will also schedule root DAG node to the queue,
    hence starting evaluation process.

    Initialization will calculate how much parents are to be evaluation
    before current DAG node can be scheduled. This value is used by task
    threads for faster detecting which nodes might be scheduled.

  * DAG_threaded_update_handle_node_updated which is  called from task
    thread function when node was fully handled.

	This function decreases num_pending_parents of node children and
	schedules children with zero valency.

    As it might have become clear, task thread receives DAG nodes and
    decides which callback to call for it.

    Currently only BKE_object_handle_update is called for object nodes.

    In the future it'll call node->callback() from Ali's new DAG.

- This required adding some workarounds to the render pipeline.
  Mainly to stop using get_object_dm() from modifiers' apply callback.
  Such a call was only a workaround for dependency graph glitch when
  rendering scene with, say, boolean modifiers before displaying
  this scene.

  Such change moves workaround from one place to another, so overall
  hackentropy remains the same.

- Added paradigm of EvaluaitonContext. Currently it's more like just a
  more reliable replacement for G.is_rendering which fails in some
  circumstances.

  Future idea of this context is to also store all the local data needed
  for objects evaluation such as local time, Copy-on-Write data and so.

  There're two types of EvaluationContext:

  * Context used for viewport updated and owned by Main. In the future
    this context might be easily moved to Window or Screen to allo
    per-window/per-screen local time.

  * Context used by render engines to evaluate objects for render purposes.
    Render engine is an owner of this context.

  This context is passed to all object update routines.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: lukastoenne

Differential Revision: https://developer.blender.org/D94
2013-12-26 17:24:42 +06:00
cdd95e354e Motion tracking curves: correct some operator's poll functions
Curve selection and transform were allowed in cases track's motion
curve wasn't visible.
2013-12-25 19:36:54 +06:00
a0a09d1423 Fix T37757: MCE - Mask Pivot Point individual origins doesnt work
Simple wasn't implemented.
2013-12-12 14:37:01 +06:00
e23f77b935 Code Cleanup: move mesh mapping functions into their own file/header 2013-12-12 16:28:52 +11:00
fcdc04af4f Fix T37755: Autokey doesn't work for local Z-Axis in Camera view with MotionPaths enabled
The problem here was that the hack used to fix T24551 in r32863
would cause the camera to jump back to its pre-transform position
after motionpaths were recalculated. This made it seem like a keyframe
wasn't inserted by AutoKeying (even though it was).
2013-12-11 16:19:42 +13:00