Commit Graph

56728 Commits

Author SHA1 Message Date
Bastien Montagne
41830cc432 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 20:34:36 +02:00
Bastien Montagne
b282716c3a Merge branch 'master' into blender2.8 2017-08-07 16:16:43 +02:00
Campbell Barton
d1752167a9 Fix T52278: 'Default' application template fails
Own error in 7398b3b7
2017-08-07 21:20:57 +10:00
Bastien Montagne
f5f6f9c9ac Fix broken API doc generation: Partially revert rBa372638a76e0
Making those arrays static remove them from exported symbols, which
breaks API doc generation script.

To be backported to 2.79 branch.
2017-08-06 17:35:41 +02: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
Campbell Barton
fa05718f27 View3D: expose normal from depth publicly 2017-08-05 07:30:28 +10:00
Sergey Sharybin
1210b47a85 Tracking: Undefine temporary define
Missed this in previous commit.
2017-08-04 21:12:11 +02:00
Campbell Barton
796437247f Manipulator: fix cage2d cancel not resetting 2017-08-04 20:33:26 +10:00
Campbell Barton
a65a64cbca Manipulator: fix 2d overlay w/ Blender Render 2017-08-04 19:18:55 +10:00
Sergey Sharybin
e6daa161dd Tracking: Remove limit of 50 points of the track history
Was quite stupid reason for this: static size of array.

Now we allocate needed amount of points in heap if requested path length is
getting too big.
2017-08-04 09:11:26 +02:00
Campbell Barton
d7905dab6a Manipulator: add compositor crop manipulator 2017-08-04 16:45:33 +10:00
Sergey Sharybin
0db4dab0c3 Tracking: Cleanup of transform code 2017-08-04 08:13:38 +02:00
Campbell Barton
54cea98046 Manipulator: add manipulator space matrix
Render-border & crop-node 2d-cage manipulators where unreasonably
complicated to implement because there was no good way to define
the sub-region the manipulator was transforming in
(render border within the camera's frame for example).

Add matrix-space variable,
remove scale property from cage2d manipulator, use matrix instead.
2017-08-04 15:34:01 +10:00
Sergey Sharybin
0c48a091f9 Tracking: Cleanup, use boolean instead of integer 2017-08-04 07:21:01 +02:00
Campbell Barton
0a3295953c Manipulator: fix check for custom function 2017-08-04 15:17:21 +10:00
Campbell Barton
2952798cd6 BLI_math: use const args for mul_m#_series 2017-08-04 15:05:02 +10:00
Campbell Barton
b156b968ae Manipulator: modal was drawing in wrong draw-step 2017-08-04 09:41:45 +10:00
Campbell Barton
7821bac08d Manipulator: remove unused draw step 2017-08-04 09:35:07 +10:00
Campbell Barton
caf1a5fc44 Manipulator: correct center-pivot clamping 2017-08-04 09:23:50 +10:00
Campbell Barton
3b57504c09 error in last commit 2017-08-03 20:05:43 +10:00
Campbell Barton
c3eac16eb7 Manipulator: disallow negative scale when resizing 2017-08-03 20:04:22 +10:00
Campbell Barton
c8d02fce93 Manipulator: use matrix to convert view coords
Was doing this with property get/set but this made view operations
require refreshing manipulator properties.
Simplify by operating on properties in their own space.

Also disable clamping for now since it assumes pixel-space.
2017-08-03 19:45:56 +10:00
Campbell Barton
e92cf80a5c Fix for last commit
Missed check for non-camera view frame
2017-08-03 18:09:11 +10:00
Campbell Barton
fe8fcb4343 Manipulator: render border widget
Note there are issues clamping & updating,
will resolve as part of changes to cage2d widget.
2017-08-03 17:57:00 +10:00
Sergey Sharybin
c27446b5a0 Depsgraph: Fix wrong data type used for armature tag
Spotted by Ray aka LazyDodo, thanks!
2017-08-03 08:19:13 +02:00
Campbell Barton
4fada2e10f Manipulator: Use 2D manipulators in the 3D view
Also split update flag into draw-steps,
since drawing 3D manipulators was tagging 2D as being refreshed.
2017-08-03 15:12:47 +10:00
Campbell Barton
fc9da74942 Manipulator: use default for cage2d dimensions
Also minor cleanuup, assign new vars for manipulator group.
2017-08-03 11:28:26 +10:00
Campbell Barton
acde5bb669 Cleanup: split 3D view manipulators by type 2017-08-03 08:30:58 +10:00
Campbell Barton
be7de5f239 Cleanup: warnings 2017-08-03 08:08:47 +10:00
Campbell Barton
cd2bb7831d Cleanup: rename selectionbase -> select_id 2017-08-03 08:01:09 +10:00
Campbell Barton
ca67cdb73c Merge branch 'master' into blender2.8 2017-08-03 07:14:02 +10:00
Campbell Barton
c6c49d90dc Remove volatile, causing issues w/ GCC/ubsan
Was Cygwin workaround, no longer needed.
2017-08-03 07:10:20 +10:00
Joshua Leung
3e6f5f3643 GraphEdit Handle Drawing: Fix handle-vertex size regression (2.7 -> 2.8)
Keyframe handle vertices (the circles on the ends of the handles)
should always be larger than the central vertex. This brings back the
"outer" radius value from the old gluDisk(), and doubles it to get the
necessary diameter, to scale it properly.

TODO's:
- Get rid of all fills inside these circles
- Make the central vertex square-shaped again
2017-08-03 01:52:07 +12:00
Joshua Leung
440bce242d Keyframe Drawing: Fix 2.7 -> 2.8 regressions
* Outlines of keyframes were too thick and ugly

* Size differences between keyframe types was being swallowed
  by the pixel-fudge factor, leaving colour as the only distinguishing
  factor (bad!)
2017-08-03 01:25:55 +12:00
Campbell Barton
b569151ffb Manipulator: add area lamp manipulator 2017-08-02 19:22:35 +10:00
Campbell Barton
dc4ded855a Manipulator: Make cage2d usable in the 3D view 2017-08-02 19:22:29 +10:00
Campbell Barton
1b51c34e8b Manipulator: correct cage-2d scale update 2017-08-02 08:34:59 +10:00
Bastien Montagne
ebd51a022a 2.79 release: update version numbers & readfile versionning code. 2017-08-01 19:22:31 +02:00
Brecht Van Lommel
c42c129393 Render: make Cycles and Evee support each other's output material nodes.
This changes the Cycles exporting and Cycles/Eevee UI code to support both
output material nodes, giving priority to the renderer native one. Still
missing is Eevee code to prefer the Eevee output node.
2017-08-01 19:13:41 +02:00
Bastien Montagne
636289b755 Fix multi-units drawing re precision handling.
This is still far from prefect, but yet much better than what we had so
far (more consistent with inheritent precision available in floats).

Note that this fixes some (currently commented out) units unittests, and
requires adjusting some others, will be done in next commit.
2017-08-01 16:42:35 +02:00
Bastien Montagne
c1e177ad29 BLI_math: add simple helper to get amount of 'integer' digits in a float number. 2017-08-01 16:34:02 +02:00
Campbell Barton
110d6832a8 Fix typo in 2d-cage manipulator 2017-08-01 21:22:17 +10:00
Campbell Barton
6341380fbf Cleanup: warnings 2017-08-01 17:24:30 +10:00
Campbell Barton
5709021f52 Correct previous commit, instance should be cleared
Clear instance in case creating creating new instance fails.

In practice this shouldn't happen,
but better not cause further errors if it does.
2017-08-01 17:17:38 +10:00
Campbell Barton
5ac9e587d4 PyRNA: Ensure changed types creates a new instance
Changing lamp type for eg needs to create a new instance.
2017-08-01 17:14:09 +10:00
Campbell Barton
a108d81af9 Merge branch 'master' into blender2.8 2017-08-01 15:00:49 +10:00
Campbell Barton
4c38d84e73 Cleanup: double promotion 2017-08-01 13:35:26 +10:00
Campbell Barton
702e9c556f Cleanup: warnings from last commit 2017-08-01 12:31:19 +10:00
Campbell Barton
8ddaa6a4e2 Merge branch 'master' into blender2.8 2017-08-01 10:38:36 +10:00