Commit Graph

2335 Commits

Author SHA1 Message Date
Campbell Barton 572b1a644f Merge branch 'master' into blender2.8 2017-09-05 22:56:03 +10:00
Joshua Leung 53ec0e5166 Fix T52227: Time Slide tool doesn't take NLA mapping into account
To be backported to 2.79
2017-09-03 12:49:15 +12:00
Campbell Barton 00ba48a699 Manipulator: replace old cage2d manipulator
Mostly internal changes, keeping both manipulators
could have worked but there was no point long term.

There are still some glitches to resolve, will work on those next.
2017-08-31 02:00:16 +10:00
Campbell Barton 9ca03ba410 Manipulator: use cage2d_rotate in UV view
Use when selection bounds isn't a single point.
2017-08-29 20:04:31 +10:00
Campbell Barton 3d56bfbc82 Merge branch 'master' into blender2.8 2017-08-29 16:06:26 +10:00
Campbell Barton 1c92ffa149 Transform: scale center override by aspect
Needed for image space.
2017-08-29 16:01:16 +10:00
Campbell Barton 7114b5681f Missing from last commit (missed manually resolving) 2017-08-28 16:29:13 +10:00
Campbell Barton 8cd2b6ca8e Merge branch 'master' into blender2.8 2017-08-28 16:04:42 +10:00
Campbell Barton a520e7c85c Transform: center override
Hidden option to override transform center.
Needed for manipulators that define their own center.
2017-08-28 16:00:28 +10:00
Campbell Barton ddff9d0ea6 Manipulator: support operator per-part
A single manipulator could only assign a single operator to each part.
Now each part can have it's own.

Also modify 2D selection callback, 2D started at 1, 3D at 0.
Now use -1 for unset value, start both at 0.
2017-08-28 00:56:08 +10:00
Campbell Barton e20c825b05 Manipulator: modal callback can now cancel & pass events
Re-use operator return flags for manipulator modal & invoke,
this means manipulators can allow navigation or other events to be
handled as they run - see T52499
2017-08-24 17:04:28 +10:00
Germano Cavalcante 264d0cc6a0 Merge branch 'master' into blender2.8 2017-08-16 19:10:18 -03:00
Germano Cavalcante 85169de54d Transform: remove unused function 2017-08-16 18:55:55 -03:00
Germano Cavalcante 916b9b311f Transform: Move enum SnapSelect to ED_transform_snap_object_context 2017-08-16 14:16:30 -03:00
Bastien Montagne 1f3724f7f4 Fix T52414: Blender 2.79 crash on object duplication via menu.
Caused by own recent changes in handling of verts/edges/etc. arrays storage
for raycasting (rBe324172d9ca6690e8).

Issue was actually even weirder - there is absolutely no reason at all to
release DM here, those finaldm are stored in Object or EditMesh structs and
handled by general update system, other code shall never try to release them!
2017-08-16 10:52:49 +02:00
Campbell Barton 1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00
Campbell Barton d9e253abce Correct last commit 2017-08-16 00:25:47 +10:00
Bastien Montagne 77497175fa Cleanup/refactor: no new general arg-less macros enforcing var names please!
We do have an history of those pieces of evil in our code, would be nice
to get fully rid of it, but at the very least let's not add more of them
in new code. :)
2017-08-15 15:59:38 +02:00
Campbell Barton a60727080f Merge branch 'master' into blender2.8 2017-08-12 14:06:29 +10:00
Bastien Montagne e324172d9c Fix transform snap code using 'allocated' flags to get verts/edges/etc. arrays again from DM.
This was... horribly wrong, CDDM will often *not* need to allocate
anything to return arrays of mesh items! Just check whether array
pointer is NULL.

Also, remove `DM_get_looptri_array`, that one is useless currently,
`dm->getLoopTriArray` will always return cached array (computing it if
needed).
2017-08-11 17:08:41 +02:00
Campbell Barton 317b8d9669 Transform: Snap used multiple eval contexts
Changes for 2.8x to use EvaluationContext caused some confusion

- Would use scene layer passed from snap context.
- Would generate duplis from Main eval context.
- Would take context argument and use it to create another eval context.

Adding context args all over and filling in a new eval-context
for every ray-cast test isn't ideal either.

Remove the context argument since the purpose of
SnapObjectContext is to avoid this kind of confusion.
Store the EvaluationContext once and re-use.
2017-08-11 11:23:39 +10:00
Campbell Barton d1328feeb1 Merge branch 'master' into blender2.8 2017-08-11 10:33:39 +10:00
Campbell Barton e5604a2fa4 Cleanup: whitespace 2017-08-11 08:32:05 +10:00
Campbell Barton 1d6b99b157 Cleanup: don't abbreviate color w/ manipulator API 2017-08-10 09:59:12 +10:00
Campbell Barton 8403ec5160 Manipulator: Add function to calculate matrix
Each manipulator was doing this slightly differently,
use shared function which can optionally override each matrix.
2017-08-09 22:34:08 +10:00
Campbell Barton d186ab6560 Manipulator: grab3d - support for 2d views
Also internal changes so arrow3d matches grab3d's behavior.

Needed to add WM_MANIPULATOR_DRAW_OFFSET_SCALE flag so
we can optionally apply offset in worldspace or screen scaled values.
2017-08-09 18:07:55 +10:00
Campbell Barton 459365443f Manipulator: experimental lamp positioning tool
- New manipulator tracks lamps to position under cursor.
- Works with multiple lamps, keeping relative offsets.
- Holding Ctrl moves the lamp.
- Access via manipulator or Shift-T.

Code could be improved, but like to get feedback from users.
2017-08-06 19:50:09 +10:00
Campbell Barton 48adef4444 Merge branch 'master' into blender2.8 2017-08-05 07:53:07 +10:00
Sergey Sharybin 0db4dab0c3 Tracking: Cleanup of transform code 2017-08-04 08:13:38 +02:00
Campbell Barton be7de5f239 Cleanup: warnings 2017-08-03 08:08:47 +10:00
Campbell Barton 8ddaa6a4e2 Merge branch 'master' into blender2.8 2017-08-01 10:38:36 +10:00
Brecht Van Lommel becb413f29 Fix T52224: auto IK not respecting length, after recent bugfix. 2017-07-31 19:22:03 +02:00
Sergey Sharybin 03d258d613 Copy on write: Prevent crash when duplicating object with particle system
Transform system was using global main, which might have been pointing to a
freed scene layer.
2017-07-27 16:28:16 +02:00
Campbell Barton b01d38ef7d Manipulator: remove names
They weren't used anywhere,
both C & Py manipulators better assign to vars (no lookup needed).
2017-07-27 07:43:15 +10:00
Sergey Sharybin 723f2b292f Fix T52186: Crash on bevel
bContext is not always available in transform, so need to use explicit
scene and scene layer to create evaluation context from.
2017-07-26 16:33:44 +02:00
Campbell Barton 2e83897f91 Cleanup: typedef enums
Manipulator enum types are easy to confuse, use typedefs.
2017-07-26 18:00:26 +10:00
Sergey Sharybin 247ddb6237 Depsgraph: Fix relations update when transform is done and there was no temporary constraints created 2017-07-25 14:38:10 +02:00
Germano Cavalcante 7fbd529fb5 Revert "ransform: fix unreported bug: geometry hidden by clipping border (alt + b) is not bypassed in snap to faces"
This reverts commit 7f09b55d01.
2017-07-24 12:08:23 -03:00
Germano Cavalcante 7f09b55d01 ransform: fix unreported bug: geometry hidden by clipping border (alt + b) is not bypassed in snap to faces
The geometry behind the farther clip_plane is not bypassed
2017-07-24 11:13:33 -03:00
Aaron Carlisle 3aeabe3afa Merge branch 'master' into blender2.8 2017-07-21 18:28:32 -04:00
Germano Cavalcante a27b6ae4a9 Transform: remove unused argument 2017-07-21 18:04:05 -03:00
Germano Cavalcante 64fd45b1df Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-21 14:20:24 -03:00
Germano Cavalcante 34f0250f32 Another solution to bug T38358 and related
Moving the ray_start_local to the new position does not lose as much precision as moving the ray_org_local to the corresponding position.

The problem of inaccuracy is within the functions: `bvhtree_ray_cast_data_precalc` and` fast_ray_nearest_hit`. And not directly in the values of the rays.
2017-07-21 14:02:16 -03:00
Luna Rood 1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
Campbell Barton 2475dbdc94 Merge branch 'master' into blender2.8 2017-07-18 13:09:36 +10:00
Campbell Barton 16fc2ad28e Transform: avoid possible uninitialized var 2017-07-18 12:13:41 +10:00
Germano Cavalcante a3d9ef2ea5 Merge branch 'master' into blender2.8 2017-07-14 17:26:46 -03:00
Germano Cavalcante 8009564503 Snap System: Fixed index of objects used to make snap to volume
*note: make a complete test scene
2017-07-14 17:25:16 -03:00
Germano Cavalcante 37242f0a47 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-14 16:56:36 -03:00
Germano Cavalcante 08b59ab7b9 Snap System: Use function that does the interactor instead of Macro
Macro makes debugging difficult. And in that case I was escaping from the style used in Blender
2017-07-14 16:52:31 -03:00