Age | Commit message (Collapse) | Author |
|
|
|
Since the cache is created in one way or another, this flag is not really making a difference
More details here: D2496
|
|
points to active object
A simple confusion between enums: ~SNAP_NOT_ACTIVE~
|
|
|
|
Support Snapping screen-space 2d curves, (was applying world-space coords in screen-space).
Also show snap settings in header.
|
|
|
|
- the name of the enumerator `SNAP_NOT_OBEDIT` was changed to `SNAP_NOT_ACTIVE`.
- the parameter `snap_to_flag` was moved to outside `SnapObjectParams`.
- the member `use_object_edit` was renamed to `use_object_edit_cage`.
- added the arg `params` in `ED_transform_snap_object_project_ray`.
- simplifications in the loop of the function `snapObjectsRay`.
|
|
Use center of selection when using absolute grid snapping and cursor pivot.
|
|
Take advantage of the efficiency provided by the snap_context.
Also fixes errors:
- volume snap fails based on view angle (T48394).
- multiple instances of dupli-objects break volume calculation.
|
|
Pass distance argument so its possible to limit the range we get all hits from.
Other changes:
- Use boundbox test before calling callback, avoids redundant calls.
- Remove meaningless return value.
- Add doc string, explaining purpose of this function.
|
|
Use scene snap mode.
Also allow passing NULL ray-depth which falls back to BVH_RAYCAST_DIST_MAX.
|
|
Create snapping context when in the 3d view,
transforming pose bones and grease-pencil crashed.
|
|
Snap targets can't contain vertices which are being transformed
|
|
Re-activating transform would overwrite previous context, leaking memory.
|
|
Separate the creation of trees from EditMesh from the creation of trees from DerivedMesh.
This was meant to simplify the API, but didn't work out so well.
`bvhtree_from_mesh_*` actually is working as `bvhtree_from_derivedmesh_*`.
This is inconsistent with the trees created from EditMesh. Since for create them does not use the DerivedMesh.
In such cases the dm is being used only to cache the tree in the struct DerivedMesh. What is immediately released once
bvhtree is being used in functions that change(tag) the DM cleaning the cache.
- Use a filter function so users of SnapObjectContext can define how edit-mesh elements are handled.
- Remove em_evil.
- bvhtree of EditMesh is now really cached in the snap functions.
- Code becomes organized and easier to maintain.
This is an important patch for future improvements in snapping functions.
|
|
This introduces a snap-context that can be re-used for casting rays into the scene
(by operators such as walk-mode, ruler and transform code).
This can be used to cache data between calls too.
|
|
Regression in 3ad0344, fix from @mano-wii.
More comprehensive fix can be done after 2.77a.
|
|
|
|
treedata could have a non-initialized tree in case of edge_snapping, leading to segfault.
Spotted by @mano-wii, thanks.
|
|
Same causes as when snapping to faces, so same solution: in case of ortho view,
offset start of ray to be just slightly outside of the target's bbox, to avoid
too much far away start point that generate floating point computation instability
in BVH raycasting.
Note that this lead to some refactoring, to avoid duplicating too much of code.
For now, edge snapping seems to behave OK (uses different logic), so not touched.
Based on patch by Germano Cavalcante (@mano-wii), thanks!
|
|
In some cases transform modes would use the custom-data pointer,
other times the transform conversion functions would.
However with some combinations (bone mirror + bend for eg),
both conversion & transform mode would use this pointer causing a crash.
Fix this by having 2 custom-data pointers:
one for the mode, another for the data-type.
This also simplifies time-slide which was conditionally mixing mode/type data in the one array.
|
|
Use BLI_bvhtree_find_nearest_to_ray for vertex snapping,
avoids doing screen-space lookup on each vertex.
|
|
Compare squared distance to snap target since the value is only ever used for comparison.
|
|
Checking for 'Closest' here isn't needed since
TransSnap.snapTarget callback is already ensuring the selected target is the closest.
Also don't reuse the pre-calculated distance,
since its only valid to do this when there are no snap points
and this isn't a significant gain to avoid the extra calculation - run once per update.
|
|
We cannot use FLT_MAX as initi distance for raycast...
Renamed TRANSFORM_DIST_MAX_RAY to BVH_RAYCAST_DIST_MAX, moved it into BLI_kdopbvh,
and use in RNA raycast callbacks (and all other places using that API).
|
|
|
|
This was getting very hard to follow,
- mixing input/output args.
- mixing arg order between functions.
- arg names (mode, snap_mode) rename to (snap_to, snap_select)
|
|
|
|
Don't use nan for comparisons.
|
|
Related to T46503,
fix only worked when the snap target was axis-aligned.
|
|
|
|
Flag mix-up and uninitialized var.
|
|
|
|
|
|
Added a helper that ensures a bbox has some non-NULL dimension along all its axes.
Also, fixed some (rather unlikely) NULL dereference cases (though it should not in this context,
`BKE_object_boundbox_get()` can return NULL).
|
|
|
|
We had too many warnings lately... was awaiting that someone would kill them - didn't happen -> goes to my commit ratio! :P
|
|
Reported in T45978
Was checking mesh selection state.
|
|
|
|
|
|
|
|
|
|
Was performing ray-tri intersection checks on all faces.
Note, this isn't using isect_ray_tri_threshold_v3
which was used to prevent ray-casts slipping through between faces.
Instead we'll move to using watertight intersections by default.
|
|
|
|
|
|
Only euler rotations were checked for.
Also delta rotations caused random/unusable output.
|
|
Excuse the trashing here, but seems users prefer this most (though both can be useful).
Note that the UI remains the same,
so this is an option for 'Incremental' snapping instead of a new snapping mode.
|
|
This ensures that vertices are grid-aligned while transforming,
instead of just snapping the input values for translate.
|
|
|
|
D910 by @donfabio with edits
New icon for menu is still TODO
|