Commit Graph

57072 Commits

Author SHA1 Message Date
Campbell Barton
cc830e2586 Manipulator: correct pivot w/ non 1:1 aspect 2017-08-31 03:07:05 +10:00
Campbell Barton
eafe96a718 Manipulator: empty image manipulator, use aspect 2017-08-31 02:38:16 +10: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
b448b025c7 Manipulator: rename callback type 2017-08-31 02:00:16 +10:00
Dalai Felinto
698bae05aa Eevee: Fix conditional statement depending on unitialized value
Basically since g_data was malloc'ed (instead of calloc'ed)
g_data->minzbuffer was never initialized.

So when running DRW_framebuffer_init after EEVEE_effects_init, the test
to *g_data->minzbuffer would lead to unpredictable results.

This was caught by valgrind, reported by Sergey Sharybin.
2017-08-30 17:00:00 +02:00
Sergey Sharybin
fbcf05f443 Depsgraph: Copy-on-write component does not depend on itself 2017-08-30 11:15:58 +02:00
Campbell Barton
998947360b Manipulator: remove inline matrix calculation 2017-08-30 18:13:25 +10:00
Campbell Barton
8b23549d47 Manipulator: run callback when calculating the final matrix 2017-08-30 18:04:42 +10:00
Sergey Sharybin
d34dac1070 Depsgraph: Fix crash when ungrouping node group
We shouldn't tag both COW and shading parameters ocmponents for update at
the same time.
2017-08-29 17:12:43 +02:00
Sergey Sharybin
9deccce07d Depsgraph: Fix missing material update when driving property in a group 2017-08-29 17:03:07 +02:00
Sergey Sharybin
852d702da0 Fix possibly missing flushes back to copy-on-write operation
Could have happened if multiple tags per object happens.
2017-08-29 16:28:06 +02:00
Sergey Sharybin
f846846941 Depsgraph: Fix missing updates when tweaking node tree parameters
The is following: split copy on write update for node trees, and if we are only
tagging for uniform buffer update we skip whole datablock copy and only invoke
copy default_values form original nodetree to a copied one.

Thing which i'm not sure is: whether we need to use different branches in graph
itself to control such a conditional behavior, or whether we need to store tag
somewhere in the dependency graph. There are obviously cons and pros in both
approaches, and need to think about this. Maybe with more examples it becomes
more obvious which way is better.

This only fixes manual tweaks for now, animation support is coming.
2017-08-29 12:58:55 +02:00
Sergey Sharybin
c1582667ca Add utility function to copy default values from one tree to another
The trees should match in nodes layout completely.
2017-08-29 12:55:03 +02: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
369cd8521b Manipulator: new cage2d manipulator
Adding alongside the existing one for now,
but it should eventually replace it.

Uses a matrix instead of (position + scale),
written so rotation can be done more easily.

Currently has a primitive handle for rotation, supports corner scaling.
2017-08-29 20:04:31 +10:00
Sergey Sharybin
83ea224a7f Depsgraph: Fix missing updates when changing node tree topology
There were two issues here:

1. material_update did not do anything, because DEG_id_tag_update was storing
   update tags in original IDs, which had nothing evaluated. Even more, material
   update should have been called with evaluated version of material, Solved
   this by copying update tag from original ID to a copied one.

   However, perhaps DEG_id_tag_update should tag both original and copied ID,
   so updates are never gets lots if some depsgraph is not visible.

2. Tagging material for update should ensure it's copied version of node tree is
   up to date, otherwise material will still use old node tree.

This solves missing material updates when changing topology. Tweaking values is
still broken, because of GPUMaterial using pointer to original node's socket
value, which gets broken after copy-on-write of the node tree (pointers of nodes
are changing).
2017-08-29 11:32:25 +02:00
Campbell Barton
6b8132a153 Merge branch 'master' into blender2.8 2017-08-29 19:38:01 +10:00
Campbell Barton
c7f106cbe2 View2D: function to get view to region matrix 2017-08-29 19:36:40 +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
db1ffe11b6 Cleanup: naming (RECT -> CAGE2D)
Make cage2d 'part' defines public (needed to assign operator actions).
2017-08-29 12:53:57 +10:00
Sergey Sharybin
156c0ab255 Depsgraph: Don't case ID_Type to short 2017-08-28 11:51:53 +02:00
Sergey Sharybin
52dd5c5fcf Merge branch 'master' into blender2.8 2017-08-28 11:44:39 +02:00
Sergey Sharybin
b4b1397ad9 Depsgraph: Don't cast ID_Type to short 2017-08-28 11:43:36 +02:00
Sergey Sharybin
f9f4e20871 Merge branch 'master' into blender2.8 2017-08-28 11:27:50 +02:00
Sergey Sharybin
2e71927622 Make GS macro return proper IDType type
Previously it was returning short, which was really easy to (a) compare against
non-ID type value (b) forget to handle some specific value in switch statement.

Both issues happened in the nearest past, so it's time to tighten some nuts
here.

Most of the change related on silencing strict compiler warning now, but there
is also one tricky aspect: ID_NLA is not in the IDType enum. So there is still
cast to short to handle that switch. If someone has better ideas how to deal
with this please go ahead :)
2017-08-28 11:21:55 +02:00
Sergey Sharybin
49e7b77b19 Depsgraph: Pass copy-on-write pointer to material update
Unfortunately, there is something else wrong going on here, which makes objects
black after tweaking material settings.
2017-08-28 11:00:42 +02: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
c8627b9067 EditMesh: set edge-rin subdiv minimum to 1
This only made sense for bridge tool.

D2785 by @mbjorkegren
2017-08-28 14:25:00 +10:00
Campbell Barton
2f8c8ec8fb Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 14:25:00 +10:00
Campbell Barton
0f1fc5f50d Fix T51400: Pasting hex code fails
The # prefix is supported,
the button didn't give enough space to paste it.

D2812 by @candreacchio
2017-08-28 14:25:00 +10:00
Bastien Montagne
c16a98bb06 Fix T52498: Deleting force field doesn't remove "Surface" from modifier stack.
Logic in `ED_object_check_force_modifiers` was inconsistent between add
and remove modifier cases.

Should be safe enough for 2.79.
2017-08-28 14:25:00 +10:00
Campbell Barton
1261a29fc0 EditMesh: set edge-rin subdiv minimum to 1
This only made sense for bridge tool.

D2785 by @mbjorkegren
2017-08-28 13:01:11 +10:00
Campbell Barton
cb7f1f8160 Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 12:40:36 +10:00
Campbell Barton
0b5cabdca5 Fix T51400: Pasting hex code fails
The # prefix is supported,
the button didn't give enough space to paste it.

D2812 by @candreacchio
2017-08-28 12:18:39 +10:00
Julian Eisel
e0ce01c3b1 Fix blenderplayer compilation 2017-08-28 02:08:47 +02: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
Bastien Montagne
dcebad773f Fix T52498: Deleting force field doesn't remove "Surface" from modifier stack.
Logic in `ED_object_check_force_modifiers` was inconsistent between add
and remove modifier cases.

Should be safe enough for 2.79.
2017-08-27 12:20:21 +02:00
Campbell Barton
ca9801bd42 Merge branch 'master' into blender2.8 2017-08-27 16:35:51 +10:00
Campbell Barton
c90452e111 BLI_rect: Function to calculate a matrix from 2 rctf's 2017-08-27 16:19:34 +10:00
Campbell Barton
2ff7ba2c6c Correct matrix stack assert 2017-08-27 11:22:31 +10:00
Campbell Barton
b07dcb8fb0 Missed last commit 2017-08-27 03:51:25 +10:00
Campbell Barton
b6b27b0671 Fix T52515: Crash on BMesh.to_mesh() 2017-08-27 02:44:15 +10:00
Campbell Barton
79111f9246 Merge branch 'master' into blender2.8 2017-08-27 00:51:54 +10:00
Campbell Barton
7e43210edb WM: move theme check out of ED_view3d_draw_select_loop
In 2.8x this needs to be in view3d_opengl_select,
so simplest to make in master too.
2017-08-27 00:48:52 +10:00
Campbell Barton
fa365d5f2f Fix minor Mesh -> BMesh conversion issues
- Vertex only meshes never restored their selection history.
- Select history was cleared on the source instead of the target.

Simple Optimizations:
- Avoid O(n^2) linked list looping that checked the entire list before
  adding elements (NULL values in the source array to prevent dupes).
- Re-use vert & edge lookup tables instead of allocating new ones.
2017-08-26 23:14:18 +10:00
Bastien Montagne
fe71c86888 Fix T52478: Error report "Shrinkwrap: out of memory" on invisible target.
Shrinkwrap must check it does have valid target data.

Safe for 2.79 release.
2017-08-26 14:48:00 +02:00
Bastien Montagne
5c4fc93f67 Fix T52538: Outliner crash when displaying groups and using Show Active on editmode bone not in any groups
There's no guaranty that given ID is found in current outliner tree...

Safe for 2.79, though not a regression.
2017-08-26 12:28:21 +02:00