1
1

Compare commits

...

975 Commits

Author SHA1 Message Date
c56ef6fd89 Merge remote-tracking branch 'origin/master' into lineart-bvh 2021-07-04 13:25:58 +08:00
442f269a72 Merge remote-tracking branch 'origin/master' into lineart-bvh 2021-07-04 13:23:52 +08:00
87dae08dd3 LineAer: benchmark 2021-06-23 21:26:10 +08:00
6521f0cbc6 Merge remote-tracking branch 'origin/master' into lineart-bvh 2021-06-23 20:13:39 +08:00
1e816bf837 LineArt: Move type rejection before visibility check 2021-06-22 23:03:53 +08:00
f4ebf2133b LineArt: global look up list for bvh 2021-06-22 20:57:31 +08:00
ee7e06d9b2 Merge remote-tracking branch 'origin/master' into lineart-bvh 2021-06-22 20:14:25 +08:00
1913b4f670 LineArt: Use own isec function 2021-06-21 20:42:12 +08:00
0cc39456c4 Merge remote-tracking branch 'origin/master' into lineart-bvh 2021-06-21 19:57:54 +08:00
73f4bebeff LineArt: Working BVH intersection. 2021-06-16 22:07:44 +08:00
f8230df553 LineArt: BVH reduction 2021-06-15 17:23:37 +08:00
9c2c3e1dd1 Merge branch 'temp-lineart-contained' into lineart-bvh 2021-06-15 16:51:16 +08:00
c3f07d5c6a LineArt: cached ui? 2021-06-15 16:34:41 +08:00
481ff6e7f1 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-15 13:42:47 +08:00
2c4d682edd LineArt: First run cache bug. 2021-06-15 13:38:41 +08:00
9927e833f3 Lineart: Clean up cache patch. 2021-06-14 20:46:35 +08:00
b02b478bb7 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-14 14:45:35 +08:00
0778a469f5 LineArt: Take care of empty duplicollection. 2021-06-11 17:54:14 +08:00
4878f77d58 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-11 15:09:27 +08:00
5e78be3ff8 LineArt: Light contour type. 2021-06-10 22:36:39 +08:00
ca2c6634d5 LineArt: Change edge flag to 16 bits. 2021-06-10 20:53:27 +08:00
e1041b176a Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-10 20:27:55 +08:00
e0a800d6bd LineArt: Add camera marker check. 2021-06-10 00:13:43 +08:00
bc06c08212 Cleanup: Remove useless comment. 2021-06-09 17:36:35 +08:00
10f0d4c6e7 LineArt: Use BKE_object_boundbox_get() instead of mesh only. 2021-06-09 17:33:20 +08:00
a170716208 LineArt: Bound box visibility check when loading 2021-06-09 14:38:30 +08:00
8fa34714ae Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-09 12:41:23 +08:00
9d7466739c Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-08 17:25:18 +08:00
d9c3736950 Cleanup: Comments and unused var. 2021-06-08 12:47:09 +08:00
153828b30d LineArt: Move Mesh->BMesh conversion to worker. 2021-06-07 22:48:32 +08:00
852d53a677 LineArt: Remove fixed overscan in discard function. 2021-06-07 21:14:01 +08:00
31608aab54 LineArt: Adjustable overscan. 2021-06-07 21:03:58 +08:00
f06fa3797b LineArt: Shifting fix for different camera fitting 2021-06-07 20:00:46 +08:00
7591e2807d Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-07 18:42:23 +08:00
90ce858ab6 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-05 23:53:05 +08:00
03599c6dca Lineart: Fixed overscan to 0.1 2021-06-05 23:44:21 +08:00
b44eba1c39 LineArt: Fix edge clipping index error. 2021-06-05 23:04:09 +08:00
b519f95b9f LineArt: Option to offset strokes to custom camera 2021-06-03 20:34:31 +08:00
79c2835397 LineArt: update depsgraph for source_camera. 2021-06-03 20:14:54 +08:00
0cffce3258 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-03 20:13:46 +08:00
6ff2853509 LineArt: Custom camera working correctly. 2021-06-02 20:50:33 +08:00
6d644c587b LineArt: Use NOTE instead of FIXME. 2021-06-02 19:56:26 +08:00
de7563c91a LineArt: Better tolerance for faces that are perpendicular to view vector.
This is due to cam->obmat precision issue, where it affects view vector precision.
2021-06-02 19:39:16 +08:00
8186602fec LineArt: Camera selection. 2021-06-02 19:37:54 +08:00
87bae57cdc Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-02 16:02:19 +08:00
9b420cfef3 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-06-01 21:36:02 +08:00
6e21a40284 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-28 19:55:22 +08:00
423dee4202 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-26 23:32:06 +08:00
7f20c4c885 LineArt: Cleaning up edge list names. 2021-05-25 20:09:11 +08:00
ea48e3bdf3 LineArt: Cleaning up naming convensions. 2021-05-25 19:38:02 +08:00
18e348ded3 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-25 19:18:28 +08:00
cb9504187a LineArt: Change chain_smooth_tolerance default to 0. 2021-05-25 13:02:16 +08:00
c4e0c13604 LineArt: Allow intersection in object selection mode. 2021-05-24 21:56:19 +08:00
17a7b942e1 GPencil: Fix minor stuff in obj_add 2021-05-24 21:39:53 +08:00
e180ed7ee5 GPencil: Use default false for use_lights option. 2021-05-24 16:00:48 +08:00
b2e87e4f77 GPencil: Add line art use_lights option 2021-05-24 15:56:44 +08:00
60a32b8d4e Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-24 15:29:30 +08:00
3b8031e1d6 Cleanup: Use int16_t instead of short. 2021-05-24 14:47:50 +08:00
30d76f3868 Cleanup: List argument renaming. 2021-05-24 14:38:00 +08:00
8d751d48e1 Cleanup: Naming fixes in obj load patch. 2021-05-24 14:26:18 +08:00
b622b2caeb LineArt: Use 2 way look up for global triangle index.
By Falk David
2021-05-22 20:44:50 +08:00
072067f546 LineArt: Make consistent with master typo fix. 2021-05-22 20:33:40 +08:00
d3da4c695e Fix T88464: Incorrect baking with camera markers. 2021-05-22 20:33:27 +08:00
1931f7a7c1 Cleanup: Fix naming changes. 2021-05-22 19:41:36 +08:00
cadd0dacf0 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-22 19:23:11 +08:00
b7871afad0 LineArt: BVH compiler switches. 2021-05-22 17:28:16 +08:00
6624700725 LineArt: Use BVH for intersection calculation. 2021-05-22 17:16:33 +08:00
3507916f62 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-22 14:25:37 +08:00
f6b4d81933 Fix T88362: Lineart countour rendering error 2021-05-18 22:39:49 +08:00
f3c7da0911 LineArt: Fix API Change. 2021-05-18 17:41:41 +08:00
5fcc83a49f Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-18 15:44:04 +08:00
dc8ebd698b Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-15 16:30:40 +08:00
5860d4e240 LineArt: Use array instead of array for ba->linked_edge 2021-05-14 19:15:48 +08:00
be91ecbca3 LineArt: Toggle duplicated edge for types. 2021-05-13 14:23:23 +08:00
13a3dd4be4 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-13 13:33:05 +08:00
ba96e6aa71 LineArt: Option for toggling chaining modes.
Allows switching between image-space and
geometry-space chainin.
2021-05-12 19:41:53 +08:00
099daebdbf Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-12 10:15:37 +08:00
c33d9de716 Cleanup: Use a helper function for repetitive code
Retrieving data from the component can be done in a separate function
to save some repetition.
2021-05-12 10:14:59 +08:00
b0e21a37e4 Functions: Add materialize methods for generic mutable virtual array
Similar to how `GVArray_For_VArray` implements `materialize_impl` to
forward the work to its non-generic virtual array, we can do the same
thing for the mutable version, `GVMutableArray_For_VMutableArray`.

This commit should have no visible changes, since as far as I can tell
the only user of this class does not implement special materialize
methods anyway.
2021-05-12 10:14:59 +08:00
Pablo Dobarro
a95e2eb5b1 Fix T82155: Fade inactive geometry overlay not working with instanced geometry
This enables the overlay for instanced geometry.

After this change, objects that are an instance of the current active
object (which are also being modified in the current active mode) won't
fade, which is different from the previous behavior.

Reviewed By: fclem

Maniphest Tasks: T82155

Differential Revision: https://developer.blender.org/D9362
2021-05-12 10:14:59 +08:00
dc30002cfd Fix T88060: Expand freezing when deleting a Face Set with multiple loose parts
When checking if the mesh has only one Face Set only the current active
component for expand needs to be checked. Otherwhise other components
that won't be modified by Expand that contain other IDs will be taken
into account, making the Face Set deletion go into an infinite loop.

Reviewed By: JacquesLucke

Maniphest Tasks: T88060

Differential Revision: https://developer.blender.org/D11169
2021-05-12 10:14:59 +08:00
300272e8bd Fix T88180: Enable HQ normal workaround for RX 580X cards.
This needs to be backported to 2.83.
2021-05-12 10:14:59 +08:00
367e309fe8 GPencil: Remove B key to create Blank Keyframe in Drawing mode
We have the `I` menu for that. This is part of the old code.
2021-05-12 10:14:59 +08:00
491ee6f15a GPencil: Rename prop dilate_pixels to dilate
Better avoid units in name.
2021-05-12 10:14:59 +08:00
Pratik Borhade
291094b06f Fix T54339: Shapekey Max value doesn't clamp existing value
Update the "current value" of the Shape Key blend amount when value is
not within the min/max range. New function `rna_ShapeKey_update_minmax`
used to update and clamp the current value.

Reviewed By: mano-wii, lichtwerk, #animation_rigging, sybren

Maniphest Tasks: T54339

Differential Revision: https://developer.blender.org/D11071
2021-05-12 10:14:59 +08:00
aec9094530 Fix T87764: Mem-leak during viewport rendering.
When a scene uses cryptomatte the viewport rendering would lead to a
memory leak. The reason was that all image renders (viewport+final)
activated cryptomatte. But is only used for final rendering.

This patch only activates cryptomatte when doing final rendering.
2021-05-12 10:14:59 +08:00
bef38364e8 Animation: move Cycle-Aware Keying to the Keying popover.
The Cycle-Aware Keying option was added in 2.8 and is used
to allow keyframing over cyclic F-Curves without disturbing
the cycle (e.g. overwriting an end keyframe updates both ends).

This effect is not limited to auto keyframing and is applied
to any key insertion, but when the popovers were rearranged
it was put in the Auto-Keyframing related one for some reason.

This is misleading, especially since because of that the
option is incorrectly greyed out when auto keyframing is
disabled, so move it to the generic Keyframing popover.

Differential Revision: https://developer.blender.org/D11213
2021-05-12 10:14:58 +08:00
Severin
2741f3fb2f Fix warning on Apple Clang, missing override specifier
Was giving a warning:
```
BKE_spline.hh:293:35: warning: 'interpolate_to_evaluated_points' overrides a
member function but is not marked 'override' [-Winconsistent-missing-override]
```
2021-05-12 10:14:58 +08:00
4395d7eb27 Fix T88145: Dynamic Paint initial color using vertex color not working as expected
Mistake in {rBe48c4d73d378}.

Was using the vertex index as a lookup for the loop color (instead of
the loop index).
(Issue was not present in original D1429 btw).

Maniphest Tasks: T88145

Differential Revision: https://developer.blender.org/D11212
2021-05-12 10:14:58 +08:00
6afe643435 Compositor: Add vars and methods for easier image looping
These variables and methods should make it easier to loop through buffers elements/pixels. They take into account single element buffers.
Single element buffers can be used for set operations to reduce memory usage.

Usage example: P2078

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D11015
2021-05-12 10:14:58 +08:00
b97d5c388d Cleanup: too small loop variable type
Clang-Tidy: bugprone-too-small-loop-variable
2021-05-12 10:14:58 +08:00
c9f37f50dd Functions: support materialize virtual array to initialized span 2021-05-12 10:14:58 +08:00
de8a32352a Cleanup: spelling 2021-05-12 10:14:58 +08:00
5e712c46cd Cleanup: unused variable warning 2021-05-12 10:14:58 +08:00
c2c7d3573c Cleanup: Remove double import in previous commit. 2021-05-12 10:14:58 +08:00
aee9176996 Enable CLog for GPU test cases. 2021-05-12 10:14:58 +08:00
50c9d4f8aa Cleanup: correct/clarify PlayAnim comments 2021-05-12 10:14:58 +08:00
4c706e90f9 LineArt: Floating edge chaining option 2021-05-10 13:47:38 +08:00
df990e78fa LineArt: better ui logic for crease threshold. 2021-05-10 11:49:20 +08:00
a5b3496785 LineArt: Filtering feature line using face mark. 2021-05-10 11:38:17 +08:00
c6f8567f84 LineArt: Fix LRT_ITER_ALL_LINES_BEGIN.
This handles when the first line list being empty.
2021-05-10 10:59:38 +08:00
146cf1db3f Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-10 09:10:31 +08:00
b4b2f638e9 LineArt: Working intersection filtering. 2021-05-09 13:17:03 +08:00
50a104d2be LineArt: intersection mask ui and code. 2021-05-09 11:12:21 +08:00
2fc5af5b19 LineArt: show full options in first modifier. 2021-05-09 10:17:59 +08:00
213f704b76 LineArt: Data for intersection_flag 2021-05-09 09:55:10 +08:00
d4bdf9a348 LineArt: Clipping handling multi type edges. 2021-05-09 09:11:39 +08:00
e8fc0697de LineArt: Fix text in object_add.c 2021-05-09 08:26:52 +08:00
a5b5775239 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-09 08:23:30 +08:00
477fe55785 LineArt: Use enum for stroke_depth_order.
This is for gpencil object adding.
2021-05-08 09:47:55 +08:00
670342eafd Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-08 09:22:25 +08:00
29bb98efa6 LineArt; intersection flag variables. 2021-05-08 09:15:27 +08:00
6810d031da LineArt: Fix merge conflicts. 2021-05-06 18:01:07 +08:00
5db821da04 LineArt: Smoothing chains before angle splitting. 2021-05-06 18:00:45 +08:00
8658ae92ed LineArt: In-front UI hints. 2021-05-06 11:34:36 +08:00
43f5ae0cea LineArt: Floating edge type. 2021-05-06 11:00:46 +08:00
e7da22ed8a Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-06 09:53:42 +08:00
246345ba03 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-05-01 16:13:06 +08:00
948e4e55dd LineArt: UI For occlusion effectiveness. 2021-05-01 16:12:47 +08:00
bff21b191f LineArt: Ignore triangle when it's ineffective. 2021-05-01 16:12:47 +08:00
87a0494313 LineArt: Occlusion effectiveness in material. 2021-05-01 16:12:47 +08:00
2d874aa34a Cleanup: compiler warnings 2021-05-01 16:12:47 +08:00
840ea5195d Revert "Fix crash running constraint, modifier, fx from missing NULL check"
This reverts commit f4d5a69cf8.

This causes bpy.ops.object.modifier_apply.poll() to fail as
well as modifier binding operators (breaking tests).
2021-05-01 16:12:47 +08:00
d3464315f0 BLI: support removing Map elements during iteration
While it was technically safe to call Map.remove while iterating over
a map, it wasn't really designed to work. Also it wasn't very efficient,
because to remove the element, the map would have to search it
again. Now it is possible to remove an element given an iterator
into the map. It is safe to remove the element while iterating over
the map. Obviously, the removed element must not be accessed
anymore after it has been removed.
2021-05-01 16:12:47 +08:00
6fd0c7a70d BLI: add a common base class for Map iterators
This is useful for an upcoming commit that allows removing
an element based on an iterator.
2021-05-01 16:12:47 +08:00
c0aef3541a Cleanup: Rename #if GPU_USE_PY_REFERENCES to #ifndef GPU_NO_USE_PY_REFERENCES
This is safer for incremental build.

And there was already a macro `GPU_USE_PY_REFERENCES` used elsewhere.
2021-05-01 16:12:47 +08:00
0c7a99d6ec Fix accidental lines removed in the last commit 2021-05-01 16:12:47 +08:00
29c5231fd4 Fix gross errors in previous commit 2021-05-01 16:12:47 +08:00
00ecb38225 Documentation: Replace the bgl API in the gpu module exemples 2021-05-01 16:12:47 +08:00
4b355683ee Python GPU: Add new methods to port the code templates in the manual
This commit adds a new API tha allow to replace the bgl API in the exemples on:
https://docs.blender.org/api/current/gpu.html

**Overview (New API):**
```
gpu.state:      active_framebuffer_get
GPUFramebuffer: read_color
GPUOffscreen:   texture_color
```

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11031
2021-05-01 16:12:47 +08:00
Germano Cavalcante
1376262d87 Python GPU: Add reference of PyObject GPU object to the GPU object itself
Instead of creating different python wrappers for the same GPU object,
return the same `PyObject` created earlier.

This also allows for more secure access to existing GPU objects.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11044
2021-05-01 16:12:47 +08:00
Henrik Dick
3afcf77c91 Fix T85470: Simple deform modifier causes artifacts at low angles
The formula used to compute the bend did subtraction of two big numbers
to get the position. Changed to find the delta and add that,
by rearranging the formula into a more numerically stable form.

Reviewed By: mano-wii, campbellbarton

Ref D11074
2021-05-01 16:12:47 +08:00
c2c70ddc4f Fix/Workaround T87511: snap gizmo flickers on Ctrl-Drag
Hack to bypass drag events, eventually the gizmo API
should support this use case without hacks.
2021-05-01 16:12:47 +08:00
Charlie Jolly
986cc5c018 Geometry Nodes: Add an "Auto" option for Attribute Convert data type
Currently there is an "Auto" option for the domain, this commit adds a
similar option for "Auto" data type, that uses the data type from the
target attribute or the source attribute (in that order).

Ref T87347

Differential Revision: https://developer.blender.org/D10932
2021-05-01 16:12:46 +08:00
9573d22cf8 Object: rename BKE_object_runtime_free, leave data cleared
Rename BKE_object_runtime_free -> BKE_object_runtime_free_data,
since the runtime pointer is part of the object, only the data is freed.

Leave the data cleared to avoid accidental use,
this is in keeping with other `*_free_data()` functions.
2021-05-01 16:12:46 +08:00
ac989a43b2 Fix: missing return 2021-05-01 16:12:46 +08:00
aed01df79e Fix crash running constraint, modifier, fx from missing NULL check
None of these generic poll functions had NULL pointer checks,
since all operators that use these functions expect a valid constraint,
modifier .. etc. Add the NULL check to the poll function.

Ref D11126

Reviewed By: mont29, Severin
2021-05-01 16:12:46 +08:00
5b110496ff Fix all objects getting selected sometimes when droppping object
If no other object was selected while dragging one in (e.g. from the Outliner
or an object asset from the Asset Browser), all visible objects in the active
view layer would get selected.
Issue was caused by a wrong enum type use.

Mistake in bcdba7c34d.
2021-05-01 16:12:46 +08:00
ab94ee39f1 BLI: improve VectorSet data structure
This adds two new methods:
* `clear` just removes all keys from the vector set.
* `index_of_or_add` returns the index of a key and adds it if has not
  been added before.
2021-05-01 16:12:46 +08:00
dc9d940439 Object: improve on fix for Object.to_mesh() crash T86871
While fa7ddd0f43 fixed the reported issue,
the possibility of reusing runtime data during curve-to-mesh conversion
remained. Instead of treating the bounding-box as a special case,
clear all run-time data for temporary objects.

Ref D11026

Reviewed By: sergey
2021-05-01 16:12:46 +08:00
a9ae8d883f Cleanup: interface_intern.h doc-strings
Also clarify some vague comments & add doxygen section for menu-memory.
2021-05-01 16:12:45 +08:00
984637b240 Cleanup: correct comment 2021-05-01 16:12:45 +08:00
e4c6ae784d Cleanup: comments in BMesh bisect, use doxygen sections 2021-05-01 16:12:45 +08:00
0ee0cd71a2 Cleanup: rename BKE_pose_channel_{verify => ensure}
The term `verify` doesn't fit with what this function does
and is sometimes used to check data is valid or to control validity
checking as with `RNA_define_verify_sdna`.
use more common term `ensure`.
2021-05-01 16:12:44 +08:00
40e18eceab Cleanup: rename BKE_pose_channels_hash_{make => ensure}
Use the term `ensure` since it makes it clear the data is
not manipulated if it already exists.
2021-05-01 16:12:44 +08:00
c9030983dc Cleanup: use early return in edittranslation_exec 2021-05-01 16:12:44 +08:00
96160d1ed4 Cleanup: use const variables 2021-05-01 16:12:44 +08:00
8440fcb4d9 Cleanup: avoid ambiguous parenthesis 2021-05-01 16:12:44 +08:00
864303d80e Cleanup: duplicate break 2021-05-01 16:12:44 +08:00
6672a2e9fa Cleanup: use 'else if' 2021-05-01 16:12:44 +08:00
d2daf6aec1 Cleanup: remove redundant assignments & NULL pointer check 2021-05-01 16:12:44 +08:00
b13da56836 Fix potential buffer overrun in drw_shader_dependencies_get
Logical error let this function to write one past the buffer bounds.
2021-05-01 16:12:44 +08:00
1d6642ab1b Fix missing NULL check in grease-pencil clear strokes 2021-05-01 16:12:44 +08:00
0d8c4ec77f Fix sculpt mask operator crash running without a 3D view
Add missing operator poll, depend on the 3D view for all
sculpt paint/mask operators.
2021-05-01 16:12:44 +08:00
c87ea85012 Fix crash running window operators in background mode 2021-05-01 16:12:44 +08:00
59e68605c2 Fix uninitialized memory use in GLDrawList
GLDrawList::init() used MDI_INDEXED which checks base_index_.
2021-05-01 16:12:44 +08:00
f1a1b58105 Fix uninitialized local-view flag on object creation
Local view return argument to ED_object_add_generic_get_opts
was left uninitialized.
2021-05-01 16:12:44 +08:00
27e32c4ce3 Cleanup: quiet shadow variable warning 2021-05-01 16:12:44 +08:00
219679061b Fix T87317: Cycles XML parsing broken after bugfix for initialization order 2021-05-01 16:12:44 +08:00
0f35979283 Fix: crash when creating GPU texture from image fails 2021-05-01 16:12:44 +08:00
8e5c1225f1 Fix error in Python UI script 2021-05-01 16:12:44 +08:00
Wannes Malfait
cc835bec8a Nodes: Add a callback to check for valid socket type
This adds a callback to bNodeTreeType to check which socket types are
valid for the tree type. Function has been implemented for the normal
tree types, and can be implemented for custom node trees with python,
by adding a `classmethod` to the tree. However, only builtin socket
types are supported.

This is relevant for T87049, but it also has the advantage that it is
now clear which node trees support which sockets. Previously this
was assumed to be known by all developers.

Differential Revision: https://developer.blender.org/D10938
2021-05-01 16:12:44 +08:00
ffcb99e1f1 Geometry Nodes: Add a template utility to mix two attribute values
This is just linear interpolation, but it's nice to have an equivalent
to `mix3` for only two values. It will be used for interpolation of
values between bezier spline control points.
2021-05-01 16:12:44 +08:00
c637fe722c Cleanup: Mismatched array bounds in function declaration 2021-05-01 16:12:44 +08:00
c5b622b773 Cleanup: Remove unecessary variable
The value of this variable was incremented, but never used.
2021-05-01 16:12:44 +08:00
Antonio Vazquez
75b157b36b GPencil: Add "Convert Text to Gpencil"
Currently when you try to convert a Text-object to Grease pencil from the Object-menu or via the operator in some other way, the Text-object is only converted to a Curve.

This commit converts that curve to a Grease pencil object.

Differential Revision: https://developer.blender.org/D11117
2021-05-01 16:12:44 +08:00
1db971a6dd Cleanup: Reduce indentation by returning early 2021-05-01 16:12:44 +08:00
eb105f3fa4 Fix T86335: Knife tool fails on object with zero scaled axis
Use invert_m4_m4_safe_ortho for the knife tool to support
operating on objects with a single zero scaled axis.
2021-05-01 16:12:44 +08:00
Pratik Borhade
1c9e23892b Clean-up: Edit and comments
- Corrected spellings
- Comments added and edited

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10991
2021-05-01 16:12:44 +08:00
ae3c0c8394 Fix T87297: Gpencil - Disable Frames and Start delay when use Factor
After talking with the GP team, we agree in disable these options when the factor is used in Build modifier.
2021-05-01 16:12:44 +08:00
436a5db96a Fix T86799: Boolean crashes duplicating object with "Fast" solver
BMesh intersect could leave invalid items in the selection list,
causing a crash. The list is now cleared since boolean is such a
destructive operation, it's unlikely the selection order would be useful.

Thanks to @lukastoenne for finding the root cause.
2021-05-01 16:12:44 +08:00
b08082434b GPencil: glow fx, add threshold value color mode
This patch adds a threshold value to the glow effect in color mode.
Currently, the threshold is hardcoded to 5%.
You can select a color and specify a higher threshold to include
similar colors in the effect.

Note: depends on D10670

Reviewed By: #grease_pencil, pepeland

Differential Revision: https://developer.blender.org/D10672
2021-05-01 16:12:44 +08:00
Himanshi Kalra
a263fce3b3 Added Operator tests: unsubdivide, shading, vertex connect and mark seam
Added tests for:
* Mark Seam
* Shade flat
* Shade smooth
* Unsubdivide
* Vertex Connect Path
* select nth (Checkered Deselect)

Notes:
1) Shade flat, shade smooth are base test cases (to check mesh doesn't change for real)

Updated blend file: tests/modeling/operators.blend

Reviewed By: zazizizou, mont29

Differential Revision: https://developer.blender.org/D10893
2021-05-01 16:12:44 +08:00
01e984712b Fix T87779: Asymmetric position vertices in circles primitives.
Incrementing a floating point value in a loop resulted in the vertex
locations for circles in primitives being slightly asymmetric.
2021-05-01 16:12:43 +08:00
e76b6d1ae8 Fix build error after recent changes to CPU name detection 2021-05-01 16:12:43 +08:00
43da1288f4 Cleanup: Use BLI_findindex instead of loop 2021-05-01 16:12:43 +08:00
Christian Baars
4bfbe8c70e Fix missing Cycles CPU name on macOS Arm
Differential Revision: https://developer.blender.org/D11061
2021-05-01 16:12:43 +08:00
9a2f8b80c5 Fix T87686: Cycles persistent data not updating correctly with hair 2021-05-01 16:12:43 +08:00
Matteo Falduto
df29a77303 Cleanup: removed unnecessary multiplications in area light importance sampling
Differential Revision: https://developer.blender.org/D11114
2021-05-01 16:12:43 +08:00
9756e41302 Fix macOS arm crash in scaling images with ffmpeg
Ref T78710
2021-05-01 16:12:43 +08:00
ed10ebbe30 Fix ASAN warnings with Cycles OSL 2021-05-01 16:12:43 +08:00
ae8f78d136 Fix: missing AO factor from Cyclest Fast GI panel
The AO distance was already there, but I forgot the factor also has an impact
on this.
2021-05-01 16:12:43 +08:00
a5a2dfdd60 Fix T87808: Connected proportional editing includes hidden geometry
Regression in 21b9231d7f
2021-05-01 16:12:43 +08:00
821671f987 Cleanup: Add float format 2021-05-01 16:12:43 +08:00
Cody Winchester
6b9009315e Gpencil Offset Modifier - Add randomize offset options
This patch adds the Randomize options that exist in the Array modifier to the offset modifier.

Currently the patch uses
```
BLI_findindex(&gpf->strokes, gps);
```
to get the index of the current stroke for making each stroke a different seed value. This is how the noise modifier also gets the stroke seed value and it is noted there as well that this method is slow, and should be fixed in the future with another method of getting the stroke index.
Other methods were explored such as using the total number of points of the stroke, but that makes the randomize options incompatible with other modifiers before it such as Multiple Strokes, Array, Build, and Simplify.

{F9591325}

Differential Revision: https://developer.blender.org/D10171
2021-05-01 16:12:43 +08:00
09e1e5d9bf Function: add method to create shallow copy of virtual array
Creating a shallow copy is sometimes useful to get a unique ptr
for a virtual array when one only has a reference. It shouldn't
be used usually, but sometimes its the fastest way to do correct
ownership handling.
2021-05-01 16:12:43 +08:00
83056fc8c9 Correction to own previous commit: Add missing break
Small mistake in 88400f0c03.
Not having this break would be harmless, but we can avoid some unnecessary work
with it.
2021-05-01 16:12:43 +08:00
854f639de7 LineArt: Conditional ui for adding line art. 2021-05-01 16:12:43 +08:00
37fd106739 LineArt: In front and stroke order when adding. 2021-04-30 22:53:21 +08:00
97ecbdb0aa LineArt: Remove default in-front (from a merge). 2021-04-30 22:32:57 +08:00
2f6eca4af3 LineArt: Fix memory leaking issue in threaded loading. 2021-04-29 22:17:26 +08:00
d184490f0e Lineart: Cache toggle for baking operators. 2021-04-29 21:26:46 +08:00
ff51da43fe LineArt: Cache/Non-cache toggle for modifier stack. 2021-04-29 21:18:41 +08:00
88065c20dc LineArt: UI grey out for cache mode. 2021-04-29 21:04:55 +08:00
781684d0cf Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-04-29 19:37:29 +08:00
6b11df31af LineArt: Fix incorrect fov when sensor fit is not Auto. 2021-04-27 11:26:44 +08:00
dac54c3af8 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-04-27 10:56:09 +08:00
b5dc1def41 LineArt: Offset strokes instead of In Front. 2021-04-26 15:20:43 +08:00
40691f442f Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-04-26 14:02:09 +08:00
3086602f70 LineArt: Global overrides for cached calculation. 2021-04-22 11:45:08 +08:00
89d1fb011a LineArt: Fix cache allocation error. 2021-04-22 11:05:11 +08:00
8f3d40820e LineArt: Fix cache nullptr bug. 2021-04-21 19:23:58 +08:00
4b3fc7bb04 LineArt: Modifier stack cache wip 2021-04-21 18:00:23 +08:00
5c8187ee86 LineArt: Fix crashing when tile triangle count exceeds 100. 2021-04-21 14:40:18 +08:00
d336e4d9b2 LineArt: Use array for ba->linked_triangles. 2021-04-21 13:51:15 +08:00
4e19a32cd8 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-04-21 13:14:31 +08:00
9c665e7980 LineArt: UI Fixes. 2021-04-19 16:54:39 +08:00
e1e7e021b2 LineArt: Partial UI fixes for modifier and object panels. 2021-04-16 21:53:42 +08:00
0247439090 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-04-16 20:34:33 +08:00
cd41b9a9a4 LineArt: Optimized tiling strategy for ortho and perspective cameras. 2021-04-14 15:05:45 +08:00
87e3ea74d9 LineArt: Spreading load for multithread loading of geometry. 2021-04-14 14:27:13 +08:00
3df57fe330 LineArt: Accepts multiple line types for one line. 2021-04-13 11:29:03 +08:00
efab421f9e Revert "LineArt: PointCache for caching chains (code path only)"
This reverts commit f3e4464ef7.
2021-04-13 10:50:48 +08:00
f3e4464ef7 LineArt: PointCache for caching chains (code path only) 2021-04-07 23:01:11 +08:00
731b9ad137 LineArt: Use separate memory pool for chained data. 2021-04-07 20:53:35 +08:00
5201296598 GPencil: Fix opacity ineffective curve influence after fading patch. 2021-04-07 20:51:22 +08:00
d883491e40 GPencil: Fading control for opacity/thickness modifier updated. 2021-04-02 12:58:30 +08:00
0da169a778 LineArt: Fix Compiler warnings 2021-03-30 10:38:00 +08:00
0f65f4829a Lineart: Fix missing edge mark problem. 2021-03-27 19:02:06 +08:00
3557fa6963 LineArt: Remove BINARY_WEIGHTS option. 2021-03-26 19:08:10 +08:00
54271f462f LineArt: Remove chaining settings. 2021-03-23 22:15:44 +08:00
8449cfdca2 LineArt: Properly working threaded geometry loading. 2021-03-23 22:09:57 +08:00
e8a9488173 LineArt: Multithread object iterator problem staging. 2021-03-23 18:26:27 +08:00
dc5f6c0d4d LineArt: Fix threading data assignment. 2021-03-23 13:28:25 +08:00
c0d37c9555 LineArt: Fix slight issues for threading object loading (DG still have problems) 2021-03-23 09:49:06 +08:00
3b5044f3bc LineArt: Multithread object loading. 2021-03-23 09:36:12 +08:00
58c2c3262f Merge branch 'master' into temp-lineart-contained 2021-03-22 17:41:52 +01:00
59570d130b LineArt: Fix compiler error for ob->id.orig_id != _rb->_source_object 2021-03-21 15:45:54 +08:00
f9545276c4 Merge branch 'master' into temp-lineart-contained 2021-03-20 14:08:09 +01:00
4194ac20cd LineArt: Fix blank baking for when source type is object. 2021-03-20 20:55:48 +08:00
77261ecb25 Merge branch 'master' into temp-lineart-contained 2021-03-20 12:39:40 +01:00
7f9720124d LineArt: Fixed source selection for nested-instanced collection. 2021-03-20 18:42:27 +08:00
9db7c3db08 Fix T86730: LineArt: keep contour when there's perpendicular faces. 2021-03-20 13:36:17 +08:00
b36ad7dfed Merge branch 'master' into temp-lineart-contained 2021-03-19 21:02:32 +01:00
2468bc8f1b LineArt: Add missing modifer and sanity checks to bake operator
Previously we could crash because we would not check if the modifier in
question actually was a line art modifier. We also did not query if the
modifier was disabled.
2021-03-19 20:56:18 +01:00
8e36187e51 Merge branch 'master' into temp-lineart-contained 2021-03-19 19:00:59 +01:00
203ffd8dee LineArt: Remove geometry space chaining 2021-03-19 20:55:38 +08:00
4569ae7a60 Revert "LineArt: Binary weights option."
This reverts commit 7b76f9f6b6.

# Conflicts:
#	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
#	source/blender/makesrna/intern/rna_gpencil_modifier.c
2021-03-19 20:31:57 +08:00
8793250074 Revert "LineArt: Remove geometry space chaining and clean up vertex group selection code."
This reverts commit b51554bb93.

# Conflicts:
#	source/blender/makesdna/DNA_gpencil_modifier_defaults.h
2021-03-19 20:28:39 +08:00
6276a04d7f LineArt: Added back the missing "allow_clipping_boundaries" option. 2021-03-19 18:48:05 +08:00
8c1bba2fc0 LineArt: Modifier defaults optimization. 2021-03-19 18:47:40 +08:00
ba8e5de378 LineArt: Weight threshold conditional display. 2021-03-19 11:50:11 +08:00
7b76f9f6b6 LineArt: Binary weights option. 2021-03-19 09:11:14 +08:00
b51554bb93 LineArt: Remove geometry space chaining and clean up vertex group selection code. 2021-03-19 09:01:43 +08:00
e51c54478c Merge branch 'master' into temp-lineart-contained 2021-03-18 14:22:49 +01:00
86f404a889 Merge branch 'master' into temp-lineart-contained 2021-03-18 13:29:41 +01:00
6704b49b49 LineArt: Add back allow_duplication property for instanced objects. 2021-03-18 19:29:47 +08:00
dfa85f8629 LineArt: use resample_length property name. 2021-03-18 19:29:17 +08:00
b052e5bf99 LineArt: Add new frame at 0 after clearing baked strokes. 2021-03-18 19:23:52 +08:00
53018b4ac8 LineArt: Use frame 0 when creating grease pencil object. 2021-03-18 17:48:46 +08:00
eb8cc3f33d LineArt: rename tl,tr to t1,t2 2021-03-18 17:45:49 +08:00
8547bf7eb9 LineArt: Fixed collection usage check for nested cases. 2021-03-18 17:24:55 +08:00
719cd96de5 LineArt: Optimize intersection list skipping. 2021-03-18 10:43:26 +08:00
9f52862a1b LineArt: Temp solution for not including lines that are outside selected source. 2021-03-18 10:01:18 +08:00
c1f328753b LineArt: Fix naming error in lineart_cpu.c 2021-03-18 09:44:19 +08:00
4d21182f86 Cleanup LineartLine -> LineartEdge 2021-03-17 14:28:12 +01:00
17f3369f81 LineArt: Fix transparenct mask in cutting function. 2021-03-17 17:55:39 +08:00
59346789fe LineArt:Fix transparency flag error during cutting and chaining. 2021-03-17 17:43:29 +08:00
cdc5e108e5 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-03-17 15:05:49 +08:00
f8a91f9aaa LineArt: Remove "Render" in structure names. 2021-03-17 15:04:51 +08:00
3f78097a6b LineArt: better explaination in lineart_line_cut() 2021-03-17 12:34:23 +08:00
ca3487007c Merge branch 'master' into temp-lineart-contained 2021-03-16 20:04:02 +01:00
49e839bb46 Cleanup comments from older merges with master 2021-03-16 18:50:30 +01:00
a11448b74d Update debug flag add date 2021-03-16 18:43:38 +01:00
581202b34f Minor cleanup 2021-03-16 18:37:42 +01:00
930ddd844e Merge branch 'master' into temp-lineart-contained 2021-03-16 18:13:06 +01:00
ccf076d804 Tweak the collection propery tab location 2021-03-16 15:46:28 +01:00
7aaab357bd LineArt modifier UI tweaks. 2021-03-16 14:48:05 +01:00
66404a54aa LineArt: Fix UI for misused remove_doubles and allow_overlapping_edges. 2021-03-16 21:45:44 +08:00
c3ae9a3438 LineArt: fix struct LineartRenderLine *testing[1]; for addressing level issue. 2021-03-16 09:52:24 +08:00
512f385210 LineArt: Fix pointer in struct LineartRenderLine **testing; 2021-03-16 09:45:32 +08:00
31d1e751b5 LineArt: Continue comment cleanups. 2021-03-15 23:46:39 +08:00
9ec3d01b13 LineArt: MOD_lineart_get_bounding_area rename in header. 2021-03-15 23:03:28 +08:00
259ab267ec LineArt: Comment cleanups in lineart_cpu.c and so on. 2021-03-15 22:57:37 +08:00
736455522d Update collection tab with instancing and tweak LineArt name 2021-03-15 12:19:28 +01:00
6e33b474b9 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-03-15 19:12:11 +08:00
e5a1aefd73 LineArt: chain.c growing comment fixed. 2021-03-15 19:11:42 +08:00
4b2dec18b9 Line Art: Tweak collection tab properties
- Use property split
- Use the same oder as in the outliner
2021-03-14 23:28:20 -04:00
72d70aa88b Line Art: Use correct object source icon in modifier
Also use consistent variable name for a column layout.
2021-03-14 23:24:47 -04:00
952d6882bc Line Art: Remove period after UI description 2021-03-14 23:16:51 -04:00
961316d8ce Line Art: Use consistent scene icon in add menu 2021-03-14 23:15:34 -04:00
f92155e135 Line Art: Close panel in object tab by default 2021-03-14 23:12:07 -04:00
b589940174 LineArt: Added back bounding_area->linked_lines access to fix chaining problem. 2021-03-14 12:50:22 +08:00
fdaa780e4e LineArt: Comment grammar and clarity fixes in lineart_chain.c 2021-03-13 21:27:40 +08:00
af8cc21f91 LineArt: Add back fuzzy chaining option in the UI. 2021-03-13 20:39:09 +08:00
8c94e8e98d LineArt: Comment ending style fix. 2021-03-13 09:49:17 +08:00
a4abf09334 LineArt: Clean up the comments. 2021-03-13 09:43:57 +08:00
489c0fd013 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-03-13 09:00:37 +08:00
Bastien Montagne
b591919172 CLOG: add support for substring matching.
So that `--log "*undo*"` matches any log identifier containing `undo`.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10647
2021-03-13 08:59:00 +08:00
ad94a235e0 Fix heap buffer overflow appending/linking from a blend file
Add new function `blo_bhead_is_id_valid_type()` to correctly check the
blend file block type.

File block type codes have four bytes, and two of those are only in use
when these blocks contain ID datablocks (like `"OB\0\0"`). However,
there are other types defined in `BLO_blend_defs.h` that have four
bytes, like `TEST`, `ENDB`, etc.

The function `BKE_idtype_idcode_is_valid(short idcode)` was used to
check for ID datablocks while reading a blend file. This only takes a
2-byte parameter, and thus its result is invalid for the 4-byte codes.
For `TEST` blocks, it would actually consider it a `TE` block, which is
a valid identifier for a Texture. This caused the heap buffer overflow,
as the datablock is not a valid ID, and thus the bytes that were
expected to form an ID name actually encode something completely
different.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D10703
2021-03-13 08:59:00 +08:00
2bc444763b Fix T82532: Sculpt fails to redo the first sculpt session stroke
Sculpt undo relied on having a mode-changing undo step to properly
apply changes.

However this isn't the case with startup files or when mixing
global undo steps with sculpt (see T82851, also fixed).

Undo stepping logic follows image_undosys_step_decode_undo.
2021-03-13 08:59:00 +08:00
6a1ea4a63c Fix another crash in LibOverride resync code.
Another case where newly overridden ID (stored in `newid` of its linked
reference) gets immediately deleted in old broken overrides.

Re T86501.
2021-03-13 08:59:00 +08:00
d966a57a22 Fix compiler warning when building Cycles without Embree 2021-03-13 08:59:00 +08:00
7eb9ec5441 Cleanup: fix clang-tidy errors when COM_debug is active. 2021-03-13 08:59:00 +08:00
e45492f859 Cleanup: Compiler warnings with COM_TM_NOTHREAD active. 2021-03-13 08:59:00 +08:00
c9bbd5945c Cleanup: document FileSelectAssetLibraryUID::type
No functional changes.
2021-03-13 08:59:00 +08:00
04e451a79f LibOverride: Add a new operation to Outliner to enforce resync of hierarchies.
This is basically done by ignoring override operations from old override
affecting ID pointer properties, when the new (destination) one is not
NULL.

Fix T86501: New object added to overridden collection doesn't show up in linking file on Resync.

This is more of a work-around actually, since there is no real way to
fix the issue in a fully automated and consistent way, it is caused by
older blender files being saved with 'broken' overrides.

WARNING: This cannot ensure that some purposedly edited/overridden ID
pointer properties won't be lost in the process.
2021-03-13 08:59:00 +08:00
eaa00daa34 Fix first part of T86501: Crash during resync process.
Code would end up freeing some of the newly created overrides, which
were assigned to the matching linked ID's `newid` pointer, accessed
again further down the code.

Note that this is not a normal expected situation, and it won't give a
proper resync result anyway, but it might happen in some complicated
corner cases, and also quite often when dealing with older .blend files.
2021-03-13 08:59:00 +08:00
35ca2a8737 IDRemap: Add option to also remap internal runtime ID pointers.
In some cases (advanced, low-level), we also want to remap pointers like
`ID.newid` or `ID.orig_id`.

Only known case currently is `id_delete`, to avoid leaving potential access to freed memory. See next commit and T86501.
2021-03-13 08:59:00 +08:00
139c4f1398 LibQuery: Add an option to process internal runtime ID pointers.
In some cases (advanced, low-level code) we also want to process ID
pointers like `ID.newid` or `ID.orig_id`.
2021-03-13 08:59:00 +08:00
210909e142 Fix T86455: vertex color baking issue with sculpt vertex colors
Baking to Vertex Colors would always bake to sculpt vertex colors (if
such a layer is present) even if those are not enabled in the
experimental preferences. This would bake without an error but leave the
user without a result to look in the viewport.

Now check if sculpt vertex colors are enabled and only bake to them in
that case.

Maniphest Tasks: T86455

Differential Revision: https://developer.blender.org/D10692
2021-03-13 08:59:00 +08:00
d06caba58f Cleanup: remove workaround for MSVC PyTypeObject declarations
This is no longer needed for MSVC-2017.
2021-03-13 08:59:00 +08:00
1333a3ba5c Cleanup: set the window manager to the updated context on load
While this happened to be corrected by code that runs afterwards,
leaving this in an invalid state could cause problems in the future.
2021-03-13 08:59:00 +08:00
c5c542089c Cleanup: make_source_archive.py minor changes & comments
- Add notes on portability.
- Use encoding argument for all file IO.
- Use integer math to calculate major/minor version, while float
  division should be fine prefer matching Blender.
2021-03-13 08:59:00 +08:00
39cdad0b0c Cleanup: incorrect doxy section title
Also correct typo.
2021-03-13 08:59:00 +08:00
3bb7dffd5c Cleanup: break out of loop early 2021-03-13 08:59:00 +08:00
b9c75c67dd Cleanup: redundant flag check 2021-03-13 08:59:00 +08:00
8b3c5feb31 Cleanup: redundant outliner includes 2021-03-13 08:59:00 +08:00
8042cc9613 Fix else after return and NULL pointer value assignment 2021-03-12 17:07:37 +01:00
89f9f9b4f5 Trigger baking progress bar refresh 2021-03-12 17:01:23 +01:00
23d631a869 LineArt: Add new frames when no frame existed in modifier 2021-03-12 23:01:13 +08:00
37cfe9992d LineArt: Baking flags for UI. 2021-03-12 21:59:57 +08:00
a8b950316f LineArt: Unused variable fix 2021-03-12 21:47:10 +08:00
d40048b01a LineArt: Using object list for baking job 2021-03-12 21:28:02 +08:00
03a94ff42e Lineart: remove TODO in object_ops.c 2021-03-12 19:32:47 +08:00
d123aea358 LineArt: Fix wrong return value for cheking LRT_GPENCIL_IS_BAKING 2021-03-12 19:29:05 +08:00
fbb7036b5b LineArt: change ED_ to MOD_ 2021-03-12 19:23:57 +08:00
4dbbeed050 Remove the remaining WITH_LINEART cmake variables 2021-03-12 11:50:45 +01:00
c4f6859938 LineArt: Fix desctription string ending. 2021-03-12 13:06:20 +08:00
1bdd255793 LineArt: Baking buttons rename. 2021-03-12 12:52:29 +08:00
0d0a90fe38 LineArt: Remove 'hide_viewport' in collection panel so it won't accidentally be deactivated. 2021-03-12 12:52:09 +08:00
49441a3595 LineArt: General cleanups for names and order. 2021-03-12 12:36:04 +08:00
af29a17c32 LineArt: use name lineart_get_bounding_area_deep() to clarify. 2021-03-12 12:29:03 +08:00
2dece71d52 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-03-12 12:25:16 +08:00
84c653fb76 LineArt: Guard modifiers from depsgraph when baking. 2021-03-12 09:46:55 +08:00
fcafc06829 LineArt: Bake canceling now operative. 2021-03-12 09:24:44 +08:00
ae68912364 LineArt: Bounding area duplicated code removal. 2021-03-12 09:14:05 +08:00
b96c04b53a LineArt: Naming and comments clean up. 2021-03-12 09:09:53 +08:00
c806ce9cdb Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-03-12 07:05:55 +08:00
4dd037dd20 Merge branch 'master' into temp-lineart-contained 2021-03-11 09:55:10 +01:00
2c329f91fe LineArt: Baking and clearing notifier updated. 2021-03-10 13:46:22 +08:00
0a5cb8d8c9 LineArt: involk/exec fix for operators 2021-03-10 13:19:31 +08:00
d317741149 LineArt: use LRT_ITER_ALL_LINES_NEXT for iteration. 2021-03-10 12:40:05 +08:00
b48f69becc Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-03-10 08:00:31 +08:00
3f254bb955 Merge branch 'master' into temp-lineart-contained 2021-03-09 15:55:40 +01:00
c61691b954 Merge branch 'master' into temp-lineart-contained
Conflicts:
	release/scripts/addons
	source/tools
2021-03-08 15:49:12 +01:00
dda815dea2 Merge branch 'master' into temp-lineart-contained 2021-03-05 19:20:01 +01:00
4427139c6b LineArt: Progress reporting when baking. 2021-03-05 22:28:05 +08:00
012c8b56ed LineArt: Use job system for baking. 2021-03-05 22:12:43 +08:00
f593a8ae15 Lineart: Re-apply truangulation fix as MOD_TRIANGULATE_QUAD_FIXED 2021-03-05 20:58:59 +08:00
3b82c57132 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-03-05 19:59:52 +08:00
2c400731bd Merge branch 'master' into temp-lineart-contained 2021-03-01 16:40:55 +01:00
7853aa3060 Merge branch 'temp-lineart-contained' of git.blender.org:blender into temp-lineart-contained 2021-02-25 15:44:50 +01:00
bc9ab19771 Merge branch 'master' into temp-lineart-contained 2021-02-25 15:44:25 +01:00
b6f8608912 Merge remote-tracking branch 'origin/master' into temp-lineart-contained 2021-02-25 18:22:34 +08:00
d4cfa9e752 Merge branch 'master' into temp-lineart-contained
Conflicts:
	release/datafiles/locale
	release/scripts/addons
	release/scripts/addons_contrib
	source/tools
2021-02-24 16:08:08 +01:00
9b04f61c0e LineArt: Remove missing flag in previous commit 2021-02-20 20:06:29 +01:00
fd0a9d0483 LineArt: Remove WITH_LINEAR and merge projects
As Lineart can be considered a grease pencil feature is not logic to have a flag that only adds problems.

Also, the bf_gpencil_lineart has been removed and all code set inside bf_gpencil_modifiers.
2021-02-20 18:06:45 +01:00
874ecabc91 Lineart: Chnage modifier to use new default system
Now all defaults are defined in `DNA_gpencil_modifier_defaults.h`
2021-02-20 16:23:09 +01:00
7bf2108e4b Merge branch 'master' into temp-lineart-contained 2021-02-20 15:37:07 +01:00
43c43b8d48 Lineart: Fix memory leak in lineart_ops.c (Early return caused memory in list not freed). 2021-02-19 10:58:19 +08:00
24fbb449c6 Lineart: Fixed uninitialized variables. 2021-02-19 10:49:44 +08:00
6f9f45aa4b WIP bake buttons
Buggy and naming and settings needs to change probably.
See TODOs in the code
2021-02-15 01:59:03 +01:00
79ef330aad Cleanup: Remove duplicate definition 2021-02-12 18:32:34 +01:00
f564cda079 Cleanup more unused variables and functions 2021-02-12 01:41:58 +01:00
7446f90707 Cleanup various lineart files, add FIXME comments. 2021-02-12 00:13:14 +01:00
e9120950d8 Fix build issues. 2021-02-11 17:06:21 +01:00
0e59d72b04 Merge branch 'master' into temp-lineart-contained 2021-02-11 14:36:02 +01:00
1d3c721b05 Merge branch 'master' into temp-lineart-contained 2021-02-07 18:55:44 +01:00
be65d12707 Merge branch 'master' into temp-lineart-contained 2021-01-25 10:46:26 +01:00
eb65d5fb09 Fix building with and without WITH_LINEART 2021-01-14 21:28:06 +01:00
93e9068372 Merge branch 'lanpr-under-gp' into temp-lineart-contained 2020-12-21 15:43:21 +08:00
c5a59fba58 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-12-21 15:43:03 +08:00
1e18ffdf14 Merge branch 'lanpr-under-gp' into temp-lineart-contained 2020-12-21 15:40:31 +08:00
b30687b2ca LineArt: Proper Use of BMesh operator to remove doubles. 2020-12-21 15:40:12 +08:00
4143d59823 LineArt: Complete UI in the modifier. 2020-12-19 13:57:44 +08:00
1222a08fca Merge remote-tracking branch 'origin/lanpr-under-gp' into temp-lineart-contained
# Conflicts:
#	extern/ceres/README.blender
#	release/scripts/startup/bl_ui/space_userpref.py
#	source/blender/blenkernel/BKE_gpencil_curve.h
#	source/blender/blenkernel/BKE_gpencil_geom.h
#	source/blender/blenkernel/BKE_layer.h
#	source/blender/blenkernel/BKE_screen.h
#	source/blender/blenkernel/intern/gpencil_curve.c
#	source/blender/blenkernel/intern/layer_utils.c
#	source/blender/blenloader/intern/versioning_290.c
#	source/blender/draw/engines/overlay/shaders/edit_curve_point_vert.glsl
#	source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
#	source/blender/editors/gpencil/annotate_paint.c
#	source/blender/editors/gpencil/gpencil_convert.c
#	source/blender/editors/gpencil/gpencil_edit.c
#	source/blender/editors/gpencil/gpencil_intern.h
#	source/blender/editors/gpencil/gpencil_interpolate.c
#	source/blender/editors/gpencil/gpencil_merge.c
#	source/blender/editors/gpencil/gpencil_mesh.c
#	source/blender/editors/gpencil/gpencil_paint.c
#	source/blender/editors/gpencil/gpencil_select.c
#	source/blender/editors/gpencil/gpencil_trace_ops.c
#	source/blender/editors/gpencil/gpencil_utils.c
#	source/blender/editors/interface/interface_panel.c
#	source/blender/editors/physics/physics_pointcache.c
#	source/blender/editors/space_buttons/buttons_context.c
#	source/blender/editors/space_outliner/space_outliner.c
#	source/blender/editors/space_view3d/view3d_placement.c
#	source/blender/makesdna/DNA_userdef_types.h
#	source/blender/makesrna/intern/rna_scene.c
#	source/blender/makesrna/intern/rna_space.c
#	source/blender/python/gpu/gpu_py_shader.c
2020-12-19 12:55:33 +08:00
c2f0ee013b LineArt: Merge changes 2020-12-19 12:47:59 +08:00
4885b649ef Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/blenloader/intern/versioning_290.c
#	source/blender/makesdna/DNA_brush_types.h
#	source/blender/makesdna/DNA_gpencil_modifier_types.h
#	source/blender/makesrna/intern/rna_scene.c
#	source/tools
2020-12-19 12:04:26 +08:00
de9cfde08b LineArt: Ris for New APIs 2020-12-19 12:01:52 +08:00
4a76934ba3 Outliner: Fix memory errors in runtime data
Fix a heap-use-after-free when duplicating outliner editors, and fully
free runtime data when freeing outliner editors.
2020-12-19 12:00:35 +08:00
63ceade783 GPencil: Missing initialization in previous commit 2020-12-19 12:00:35 +08:00
2474b6c789 GPencil: Cleanup clang format 2020-12-19 12:00:35 +08:00
8ff765a036 GPencil: Fix unreported crash in some cases when duplicate a stroke
Some pointers were not initialized.
2020-12-19 12:00:35 +08:00
d598132c96 GPencil: Fix callback parameter list error
In the previous commit the bGPDframe parameter was removed, but this parameter is required to keep the same function signature.
2020-12-19 12:00:35 +08:00
2946762975 Collections: Prevent setting scene collection color tag from rna
It should not be possible to set the scene collection's color tag
through rna. Also adds a missing notifier for setting the collection
color tag from python.
2020-12-19 12:00:35 +08:00
38ddbfa959 UI: Remove remaining uses of old collection icon
After rB452a1c7b3838 there were still a few cases where the old
collection icon was used in the interface. Replace these with the new
filled collection icon.
2020-12-19 12:00:35 +08:00
d4133b2227 GPencil: Fix compiler warning, unused variable 2020-12-19 12:00:35 +08:00
dce2506392 GPencil: Merge GSoC curve edit mode
Differential Revision: https://developer.blender.org/D8660

This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes
Using Curves" project. It adds a submode to greasepencil edit mode that
allows for the transformation of greasepencil strokes using bezier
curves. More information about the project can be found
here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
2020-12-19 12:00:35 +08:00
53e1e6a98f Cleanup: Make panel type flag names more clear
The overlap with the `Panel` flags that start with "PNL" was quite
confusing because wasn't clear which enum a flag was from. The
new names are a bit longer, but the clarity is worth it.
2020-12-19 12:00:35 +08:00
9e42403aa6 Cleanup: Move PanelType flag from DNA to BKE header
Since this flag isn't saved in files and PanelType itself is defined in
BKE, the flag makes more sense there.
2020-12-19 12:00:35 +08:00
f4bbc84197 GPencil: Remove ID from operators to fix T82597
Instead to use the ID of the object, now the parameter is an Enum with Selected object or New.

If use selected mode, the first grease pencil object selected is used. If none of the selected objects is a grease pencil object, a new object is created.

Small cleanup changes to the original patch.

Differential Revision: https://developer.blender.org/D9529
2020-12-19 12:00:35 +08:00
cdd182d09d LibOverride: Adjust PointCache operators to properly handle overrides.
LibOverrides only support a small sub-set of PointCache features for now
(one cannot add new caches, baking in memory is not supported...).

Part of first step of T82503: support disk cache in liboverrides.
2020-12-19 12:00:35 +08:00
1703e652a0 LibOverride: Do not tag overrides for complete recalc.
This was done as some sort of safety, but should not actually be needed,
and including tags like `ID_RECALC_POINT_CACHE` e.g. makes usage of
point caches impossible with liboverrides (since it would systematically
invalidate all cache on file load).

In theory we should not have to tag anything here in fact, RNA accessors
are supposed to take care of it, but for now we keep the
`ID_RECALC_COPY_ON_WRITE` one.

Part of first step of T82503: support disk cache in liboverrides.
2020-12-19 12:00:35 +08:00
2b838a96b2 LibOverride: Make PointCache RNA properties overridable.
Note that due to convoluted layout of point caches in RNA (active one
also storing list of all available ones), we'll often have the
pointcache overrides rules twice. Should not be a huge problem,
practically speaking.

Part of first step of T82503: support disk cache in liboverrides.
2020-12-19 12:00:35 +08:00
640b732959 Ceres: Update to upstream version 2.0.0
We already were using one of earlier RC of the library, so there is no
expected big changes. Just making the update official, using official
version and stating it in the readme file.
2020-12-19 12:00:35 +08:00
904a2a620a CMake: Extend strict flags cancellation flags
Becomes rather annoying to duplicate them across C/C++ GCC/Clang sets,
almost as if the test should test both C and C++, and to do it for all
compilers.

Solves strict warning in the upstream of Ceres library.
2020-12-19 12:00:35 +08:00
adda1d2b23 Revert "Codesign: Versioning code to support older branches"
This reverts commit 9d172f007e.

Got a second thought and remembered why it was not done in the first place.
The issue here is that the server needs to communicate codesign result back
and that must happen within the new protocol. So if the client talks old
protocol it is possible to receieve data from it, but is not possible to
communicate result back to it.
2020-12-19 12:00:35 +08:00
8f3a7d7f3e Cleanup: use IMB_FTYPE_NONE instead of 0 for imbuf format comparison
Image format code checked the file type against an enum except for
zero which is used when the format can't be detected.

Also add doc-strings to some of the image file type callbacks.
2020-12-19 12:00:35 +08:00
eca13099de Fix building after 2e53b646f6f02ab112e0823b9577ff2e1920faaeq 2020-12-19 12:00:35 +08:00
61f1b9f559 GPencil: Remove "angle_split" from Multiply modifier. 2020-12-19 12:00:35 +08:00
df598a9a5d Object: show preview plane for add-object tool
The orientation & depth settings are used to show the preview plane
that is used when adding the object.
2020-12-19 11:59:52 +08:00
4b1fe6616d Codesign: Versioning code to support older branches
Turns out it is easier to have suboptimal versioning code on the server
side than to deal with branches where changes are to be merged into.
2020-12-19 11:59:52 +08:00
79f94f66cf refactor vec_roll_to_mat3_normalized() for clarity
the function vec_roll_to_mat3_normalized() has a bug as described in T82455. This Differential is only for refactoring the code such that it becomes more clear what the function does and how the bug can be fixed. This differential is supposed to not introduce any functional changes.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D9410
2020-12-19 11:59:52 +08:00
Ivan Perevala
b46a90e9a1 UI: Adaptive HDRI preview resolution
HDRI preview should have resolution dependent on dpi, viewport scale and HDRI gizmo size.
This patch uses a LOD to render a more round sphere.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9382
2020-12-19 11:59:52 +08:00
YimingWu
cfca5dcb39 Adding 3D_POLYLINE_UNIFORM_COLOR to PyGPU shader API
This would allow python script to access `lineWidth` uniform when drawing lines
without using `glLineWidth`.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D9518
2020-12-19 11:59:52 +08:00
Manuel Castilla
a7307edbe1 Fix CalculateStandardDeviationOperation incorrect results for R G B channels
Standard deviation formula wasn't being applied correctly when selecting
R G B cases. Issue is there since Blender 2.64 as it was incorrectly
ported over from the previous compositor.

Reviewed By: Sergey Sharybin, Jeroen Bakker

Differential Revision: https://developer.blender.org/D9384
2020-12-19 11:59:52 +08:00
Jun Mizutani
283aa33605 Add An Opacity Slider to Overlay Wireframe
This patch adds an opacity slider to the wireframe overlay. The previous
wireframe in dense geometry scenes could be too dark and sometimes the
user just wants an impression of the geometry during modelling.

Reviewed By: Jeroen Bakker

Differential Revision: https://developer.blender.org/D7622
2020-12-19 11:59:52 +08:00
798749ac71 UI: make add object tool experimental
Some changes here are planned which need feedback from users before
declaring this ready for the next release.
2020-12-19 11:59:52 +08:00
8cc87c4946 BLI_math: add floor_power_of_10, ceil_power_of_10
Add utility functions to get the floor/ceiling of a float value
to the next power of 10.
2020-12-19 11:59:52 +08:00
e7fc0965d6 Cleanup: Remove unecessary logic in panel code
Also use short for panel flag arguments to functions since it matches
the type in DNA, and remove a comment that isn't helpful.
2020-12-19 11:59:52 +08:00
d9b1e6a8c9 Cleanup: Simplify panel activate state function
This commit moves some of the logic around so that the logic in
panel_activate_state is clearly separated by the state being activated.
There are fewer nested and redundant checks, and it's easier to see
the progression of interaction with the panel handler.
2020-12-19 11:59:52 +08:00
282d12663f LineArt: Ris for New APIs 2020-11-15 12:24:23 +08:00
0c0686bd1a Merge branch 'master' into lanpr-under-gp
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	source/blender/blenloader/intern/versioning_290.c
#	source/blender/makesdna/DNA_gpencil_modifier_types.h
#	source/tools
2020-11-15 11:07:21 +08:00
02dd1f110c LineArt: removed unreferenced scene from object_add.c 2020-11-13 16:50:30 +08:00
0c1003c7c8 Merge branch 'lanpr-under-gp' into temp-lineart-contained 2020-11-13 10:43:31 +08:00
87636e93f2 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-13 10:42:44 +08:00
eb2b85de6c LineArt: Revert accidental changes 2020-11-13 10:37:16 +08:00
3dbdf69b58 LineArt: cleanup unnecessary includes. 2020-11-13 10:33:54 +08:00
dba084a659 LineArt: "collection flags"->"Restrictions" 2020-11-13 10:23:17 +08:00
1870205455 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-12 17:34:00 +08:00
dfa4a80e9a LineArt: Remove lineart_share 2020-11-12 17:28:28 +08:00
733c707b16 Merge branch 'lanpr-under-gp' into temp_lineart_contained 2020-11-12 16:13:13 +08:00
3ef840fa2d Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-12 16:12:43 +08:00
7acf84a011 LinrArt: Running line art modifier. 2020-11-12 15:05:08 +08:00
64218999ef LineArt: Cmake stuff migration. 2020-11-12 13:30:34 +08:00
ddd10dbc1b LineArt: Remove modifiers access. 2020-11-12 11:28:17 +08:00
4fffd9273f LineArt: Remove SceneLineArt. 2020-11-12 11:00:14 +08:00
257742dd5d LineArt: Move files to gpencil modifier folder. 2020-11-12 10:38:09 +08:00
72f0947c12 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-11 12:26:56 +08:00
64f573c8b5 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-10 10:50:26 +08:00
351cf10bf2 LineArt: reduce chaining_image_threshold to 0.001 to prevent errorous chaining. 2020-11-10 10:47:41 +08:00
50ff559544 LineArt: Reduce geometry threshold default to 0.01 2020-11-10 10:37:20 +08:00
6b6052713c Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-09 16:27:21 +08:00
a60b3071b5 LineArt: Fix transparency mask lost in angle splitting process 2020-11-09 16:20:47 +08:00
0bed1158e0 LineArt: "Match" checkbox put on top of mask bits. 2020-11-09 16:01:13 +08:00
85899dd8ae Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-07 20:22:34 +08:00
e5310101fa LineArt: Vertex weight transfer index error now fixed. 2020-11-07 20:20:44 +08:00
67852caf0b Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	CMakeLists.txt
#	source/blender/blenloader/intern/readfile.c
#	source/blender/blenloader/intern/writefile.c
2020-11-07 15:07:01 +08:00
22875e3ab0 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-05 10:43:51 +08:00
eade6d3ae5 LineArt: Added scene line art option. 2020-11-05 10:43:18 +08:00
ac90022760 LineArt: do not restrict GP object selectable 2020-11-05 10:10:36 +08:00
6d3ce4cf07 LineArt: chaining occlusion info assignment to last possible vert. 2020-11-05 10:09:10 +08:00
05089352b8 LineArt: Use array for lineart_push/append_points. 2020-11-05 09:00:41 +08:00
51f07e1652 LineArt: Use ICON_OUTLINER_COLLECTION for collection icon 2020-11-05 08:39:51 +08:00
2c35b091bf LineArt: Cleanup warnings 2020-11-04 19:02:53 +08:00
96ef8ed07f LineArt: rna info updated 2020-11-04 18:07:05 +08:00
d1dee06e5e Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-04 17:58:30 +08:00
24a97e07ee LineArt: default value assignments. 2020-11-04 17:57:24 +08:00
3da9bee809 LineArt: compiler error fixes. 2020-11-04 16:20:10 +08:00
4d382591ff LineArt: naming and description fixes. 2020-11-04 16:07:23 +08:00
418d99d2c7 LineArt: code format changes. 2020-11-04 15:26:25 +08:00
bd9a8de00c LineArt: LISTBASE_FOREACH modifications. 2020-11-04 15:02:50 +08:00
2700d8509f LineArt: UI and property name changes 2020-11-04 14:49:58 +08:00
e5c3317527 LineArt: Collection panel UI fixex 2020-11-04 14:44:36 +08:00
2f953ef6e9 LineArt: Flag sync for "no camera" to "has camera" situation. 2020-11-04 09:38:31 +08:00
f475abdad2 LineArt: Main panel UI logic for no active camera scenario. 2020-11-04 09:26:23 +08:00
de02909d02 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-04 09:09:31 +08:00
31f13c2ae7 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-03 14:56:51 +08:00
2ff102e651 LineArt: reduce chaining_geometry_threshold to 0.01 to reduce small bleedings in a typical scene. 2020-11-02 16:40:51 +08:00
dc96fdda01 LineArt: Support line preview in edit mode. 2020-11-02 09:46:04 +08:00
6f8ebd5e50 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-11-02 09:21:09 +08:00
5efc132c2c Merge remote-tracking branch 'origin/lanpr-under-gp' into lanpr-under-gp 2020-10-31 18:29:56 +08:00
bb80b1278c LineArt: Further value tweaks for the UI. 2020-10-31 17:00:48 +08:00
ee4069e460 LineArt: Default values and description clean up. 2020-10-31 16:48:39 +08:00
abbe7c9e6a LineArt: Modifier UI cleanup. 2020-10-31 16:48:23 +08:00
dfe08487a4 LineArt: UI logic fixe for object line art panel. 2020-10-31 16:13:28 +08:00
00e7a89f81 LineArt: Main panel UI optimizations. 2020-10-31 16:06:04 +08:00
bd46b40756 LineArt: COLLECTION_HAS_OBJECT_CACHE_INSTANCED flag clear 2020-10-31 15:58:43 +08:00
603dfdcc9d Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-31 15:25:58 +08:00
cba8012cd9 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/blenloader/intern/readfile.c
#	source/blender/blenloader/intern/writefile.c
2020-10-30 12:47:09 +08:00
c4304b3e0f Lineart: Remove cursor progress call to avoid BadCursor error. 2020-10-29 12:33:15 +08:00
009314d417 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-29 12:14:56 +08:00
dd9fce0ba0 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-28 18:11:14 +08:00
18a6508505 LineArt: comment fixes. 2020-10-28 14:44:51 +08:00
7354580f5d Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-28 11:39:43 +08:00
35d16ff452 LineArt: Python formatting fix. 2020-10-28 11:24:36 +08:00
bea6d5ebd4 LineArt: Formatting. 2020-10-28 10:59:22 +08:00
8732277b8c LineArt: Move OP exec functions into lineart_ops.c 2020-10-28 10:52:25 +08:00
dbdd026fb3 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-28 10:37:25 +08:00
8ff66f0183 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	release/scripts/startup/bl_ui/properties_material_gpencil.py
2020-10-27 20:24:52 +08:00
88eb5b43c3 LineArt: Cancel running calculation when unchecked auto update. 2020-10-27 20:12:25 +08:00
1c35405ec4 LineArt: stage info updated 2020-10-24 22:27:10 +08:00
c99754dabc Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-24 22:26:12 +08:00
e1800eb8e5 LineArt: handle eval_ob == NULL case when rl->object_ref is removed. 2020-10-23 16:27:42 +08:00
34d7559ffe LineArt: Discard outside lines 2020-10-23 09:17:48 +08:00
661fa309f1 LineArt: Use separate adjacent info for clipping 2020-10-23 08:57:23 +08:00
097bb6065c Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-23 07:51:16 +08:00
d1152b069a LineArt: type compatible with MSVC 2020-10-23 07:51:11 +08:00
d58c2568bb LineArt: Reduced vert intersecting data size. 2020-10-22 17:19:51 +08:00
8adb6b3595 LineArt: Reduced triangle intersecting data size. 2020-10-22 17:19:33 +08:00
4775d79df5 LineArt: Intersection vert data now allocated in extended way. 2020-10-22 16:45:49 +08:00
257f620f75 LineArt: Use global vert index to detect share_edge 2020-10-22 13:07:14 +08:00
b985019186 LineArt: Fix vertex group name induced early return in modifier. 2020-10-22 13:01:06 +08:00
67f28300c0 LineArt: Hacked culling adjacent data 2020-10-22 11:29:18 +08:00
fb52b3b69d Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	release/scripts/addons
#	release/scripts/addons_contrib
2020-10-22 11:08:53 +08:00
78a6c9cfb0 LineArt: Fixing cull adjacent 2020-10-21 21:20:56 +08:00
aecceb7b1e LineArt: Line iterator fixed 2020-10-21 19:28:36 +08:00
8d9c76f43a LineArt: Culling function updated to new structure. 2020-10-21 18:08:39 +08:00
bbcc73607c LineArt: Change RenderLine to a single-way link list. 2020-10-21 17:11:42 +08:00
9ec833266c LineArt: Removed rt->rl. 2020-10-21 15:38:32 +08:00
626ab18f18 Lineart: Prior to removing rt->rl. 2020-10-21 14:45:02 +08:00
4ca8357baf LineArt: Compute contour before culling. 2020-10-21 12:57:04 +08:00
b35611632f LineArt: Remove duplicated canceling 2020-10-21 12:20:22 +08:00
ba4a481c91 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-21 11:46:44 +08:00
50578422f4 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-19 20:39:03 +08:00
6c54cdaab5 LineArt: Limit near-by bounding area look up to only one level. 2020-10-19 20:38:27 +08:00
d142b5605e LineArt: Chaning lookup in near by bounding areas. 2020-10-19 20:25:40 +08:00
624bb6c9e2 LineArt: Fuzzy logic fix. 2020-10-19 20:22:44 +08:00
77030d813e LineArt: Use "Show Clipping Boundaries" for clarity 2020-10-19 17:33:11 +08:00
70867ff74e LineArt: Vertex group input will select all when filter is empty 2020-10-19 15:12:20 +08:00
3a00152fe7 LineArt: Option for remove doubles when loading mesh. 2020-10-19 14:34:17 +08:00
d244a66175 LineArt: make format 2020-10-19 12:56:11 +08:00
ed0341ca4c LineArt: Ortho camera clipping bug fixed. 2020-10-19 12:52:20 +08:00
bb25a7a59a LineArt: Remove unused default value in multiple stroke modifier. 2020-10-19 11:43:19 +08:00
2d8d86359c Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-19 11:26:37 +08:00
40ba7e7392 LineArt: Clipped crease line does not show. Fixed. 2020-10-15 19:50:21 +08:00
717c9f0682 LineArt: apply camera scale before matrix 2020-10-15 19:38:53 +08:00
8bfaf0152b Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-15 18:39:09 +08:00
d6eb20701a Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-14 22:43:51 +08:00
fe8800eaae LineArt: Memory debug info. 2020-10-14 22:42:21 +08:00
f4c22820f0 LineArt: Line cut reduction 2020-10-14 20:53:14 +08:00
970d4ad696 LineArt: default crease value changes to degrees. 2020-10-14 19:04:50 +08:00
fe578d7c7d Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-14 18:39:10 +08:00
4f52220fbf Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-05 21:24:40 +08:00
d2e86c49aa Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-05 15:39:06 +08:00
bc7af55b7a LineArt: Fix compiler warnings for windows. 2020-10-04 15:45:11 +08:00
ff71b67f75 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/makesrna/intern/rna_gpencil_modifier.c
2020-10-04 12:41:33 +08:00
43770adf13 LineArt: Use max weight among groups for selection. 2020-10-03 13:33:44 +08:00
9eefbdfc51 LineArt: Smooth weight option. 2020-10-03 12:15:30 +08:00
bb231515e5 LineArt: Fix uncaught memory leak in stroke generation. 2020-10-03 11:38:21 +08:00
c28f0e55c1 LineArt: Option for matching input/output vertex group names. 2020-10-03 11:34:35 +08:00
6d53c218de Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-03 10:57:52 +08:00
0c15f1ed3e LineArt: CD_MDEFORMVERT flag in viewport evaluation. 2020-10-02 16:58:16 +08:00
97656f68e1 LineArt: Fixed render vert linking in intersection stage. 2020-10-02 15:08:05 +08:00
ecb734cd02 LineArt: vertex group data matching. 2020-10-02 14:46:13 +08:00
52ef81f848 LineArt: data copying and mofifier UI for vgroup. 2020-10-02 13:38:32 +08:00
6b8b0024db LineArt: Vertex group data structure changes. 2020-10-02 12:47:56 +08:00
cfb867fdaf LineArt: GPencil modifier API changes. 2020-10-02 12:03:06 +08:00
945222740f Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-10-02 11:49:48 +08:00
8b2694a005 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/python/mathutils/mathutils_Matrix.c
2020-10-01 21:38:54 +08:00
Ivan Perevala
36c273b68c UI: Motion Tracking: Fix description of K2 coefficient
Fixed description of K2 coefficient. It is second coefficient

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D9050
2020-10-01 21:37:15 +08:00
91b0bfc809 Cleanup: spelling 2020-10-01 21:37:15 +08:00
691183242b Cleanup: remove full-stop from description 2020-10-01 21:37:15 +08:00
162277f050 Cleanup: use angle-brackets for email addresses
This is already the most widely used convention.

Use this so `make check_spelling_c` will ignore all email addresses.
2020-10-01 21:37:15 +08:00
49b3691c23 Cleanup: sort cmake file lists 2020-10-01 21:37:15 +08:00
5796c1455f Cleanup: sort struct declarations 2020-10-01 21:37:15 +08:00
da87ee1d05 Cleanup: Make function private
The "UI_panel_set_expand_from_list_data" doesn't need to be in the
public API since it's just called every time an instanced panel is added.
This commit just sets the expansion automatically and adjusts some
naming to account for the moved function.
2020-10-01 21:37:15 +08:00
a8e7d15fa0 Fix use after free deleting object with modifier panels visible
It's necessary to check if the panels are active before accessing their
data. Thanks to @ankitm for reporting this.
2020-10-01 21:37:15 +08:00
a319af986a Cleanup: Use LISTBASE_FOREACH macro in outliner code 2020-10-01 21:37:15 +08:00
81ad816441 UI: Remove second person in warning message
This phrasing can feel like an accusation, and a simpler phrase
gets across the idea just as well.
2020-10-01 21:37:15 +08:00
Pablo Dobarro
c95015bf96 Sculpt: Preserve Mesh visibility from edit mode using the Face Sets
Before this change, when users switch from edit mode to sculpt mode, the
entire mesh would be visible. Even if in the edit mesh mode part of it was
set to invisible.

With this change the visibility is preserved, by creating a separate face set
for the visible and invisible parts of the mesh and setting their initial visibility.

Implementation details: This adds a function to initialize a new Face Set
 datalayer taking the current mesh visibility into account which is stored
in the ME_HIDE flag of the vertices.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8901
2020-10-01 21:37:15 +08:00
f0b5fceac2 Sculpt: Line Project Gesture tool
This tool projects all vertices to the right of the plane defined by the
line gesture towards the plane. By doing this, this tool can create cuts
and plane surfaces in the mesh without modifying the geometry or using
boolean operations, so it is much faster than bisecting the mesh for
cases where the geometry was going to be remeshed afterwards.

Added as experimental as it does not have icon.

Reviewed By: sergey, Severin

Differential Revision: https://developer.blender.org/D9021
2020-10-01 21:37:15 +08:00
310d85678e API Docs: Correct syntax for bpy.utils.register_class 2020-10-01 21:37:15 +08:00
nutti
bcaed55995 API Docs: Fix corrupted document of gpu.select.load_id
The Python API document of gpu.select.load_id does not follow rst format.
c.f. https://docs.blender.org/api/current/gpu.select.html

This patch fixes it.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D8547
2020-10-01 21:37:15 +08:00
62c8f77395 API docs: Fix sytax error for delaunay_2d_cd
Alternative solution to https://developer.blender.org/D8546
2020-10-01 21:37:15 +08:00
Ankit Meel
0a87fd4b92 Fix T81100: ccl::Node: ASan SEGV due to bad pointer
`SOCKET_OFFSETOF` was added in the initial commit {rBec51175f1fd6c91d5}
when `offsetof` [1] was not supported well enough. GCC and LLVM
support it since C++17.

Other two changes: type and size check can be done without creating
an invalid address too.

[1] https://cppreference.com/w/cpp/types/offsetof

Reviewed By: campbellbarton, brecht

Maniphest Tasks: T81100

Differential Revision: https://developer.blender.org/D9042
2020-10-01 21:37:15 +08:00
fe0b6b564b API Docs: Use raises field list syntax
See 
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists
2020-10-01 21:37:15 +08:00
89565e0631 Fix unreported Eisenbug leading to a crash when reading a blend file.
This took more than a day to fully investigate and understand, one of
the reasons being that the probability of the issue to show up was
extremely low, and subjected to very specific random factors.

Root of the issue is that, in some very rare cases, a newly read ID
might get the exact same memory address as the one it had when the blend
file was saved.

In that case, `BKE_workspace_active_set` would return immediately, since
the pointer to the active workspace would remain unchanged. But that
lead to having an unset NULL active layout pointer, which would crash
when attempting to get e.g. the active screen.

For the record, I ran into this when running a specific build (master
with one flag added to the `LIB_ID_CREATE` ones, with value `1 << 3`),
using a specific set of options (`--background --factory-startup -noaudio`),
and passing the .blend file from T80090 as argument.
2020-10-01 21:37:15 +08:00
d704c293c2 Fix (unrepported) utterly broken logic in readfile for Workspaces.
Remove the attempt to update the active layout pointers of each window
from whithin `direct_link_workspace`.

This piece of code was a nonsense for at least to critical reasons:
* Do not, never, ever, access data from another datablock within the
  direct_link_... functions. Just don't. Don't try to be smart.
* Since it was trying (and failing) to update the active layout of every
  window for every workspace, it was effectively setting those
  `act_layout` pointers to NULL (remapping can only ever happen once,
  trying to remap and already remapped new pointer is bound to fail in
  any case).

Luckily (and funnily), this piece of code was actually harmless, since
setting the active layout would be overridden/redone later, in
`lib_link_windowmanager`, when updating their `workspace_hook` in
`lib_link_workspace_instance_hook`.

Note that the similar horror with `WorkSpaceDataRelation->parent` (which
points at a window) is kept for now, because that one is needed. Hope to
refactor it soon though.
2020-10-01 21:37:15 +08:00
cc13cac397 Property Search: Set expansion properly for child panels
Although I haven't seen this cause any visible errors, there is some
incorrect handling for setting panel expansion during search:
 - Properly check if child panel is active first
 - Don't stop traversal at headerless panels that could theoretically
   have children
2020-10-01 21:37:15 +08:00
179d94e407 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-29 22:16:36 +08:00
82422c8d1f LineArt: 2d Intersection function ratio check improvements. 2020-09-27 19:15:31 +08:00
6fb70a29de LineArt: Deg representation of crease threashold. 2020-09-27 15:13:14 +08:00
b9d063ab59 LineArt: Reliable line type determination. 2020-09-27 12:58:17 +08:00
7cc23f317b LineArt: Better logic for usage flags. 2020-09-27 11:38:25 +08:00
2ed35a9f93 LineArt: Collection "no intersection" flag 2020-09-27 11:02:53 +08:00
cb39e2800f LineArt: Object "No Intersection" flag. 2020-09-27 10:45:52 +08:00
94c0d3a4cc Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-27 07:56:10 +08:00
33aef1b100 LineArt: Fix rna_lineart_auto_update_set() error 2020-09-25 21:33:04 +08:00
157f4f37ad LineArt: Fixed viewport auto update. 2020-09-25 20:38:57 +08:00
7b38f90bd1 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-25 20:08:45 +08:00
f3fd29d609 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-24 08:31:17 +08:00
03853fb303 LineArt: Capability of rendering in "lock interface" mode. 2020-09-23 18:40:25 +08:00
bb936cfb6a LineArt: Clearing flag guard before framebuffer creation. 2020-09-23 17:28:14 +08:00
0bcf788c61 LineArt: Baking keyframes only. 2020-09-23 11:30:45 +08:00
78dc814112 LineArt: Preview ranges and skipping in baking. 2020-09-23 10:32:35 +08:00
03d50cddb3 LineArt: Compiler warning 2020-09-23 10:03:19 +08:00
d7fe06b35b Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-23 09:19:09 +08:00
4b51eb5743 LineArt: revert to original object relation linking in modifier depsgraph. 2020-09-23 00:10:05 +08:00
ce55b10522 LineArt: Vector 2D intersection typo fix. 2020-09-22 20:37:10 +08:00
24ab978a67 LineArt: Vertical camera FOV improper scale. 2020-09-22 20:30:21 +08:00
0a42b85fc4 Lineart: fixing Bounding area issues. 2020-09-22 14:15:14 +08:00
992735589d LineArt: No double caching during one update, even with multiple modifiers. 2020-09-22 12:20:07 +08:00
6b91c61a4f Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-22 10:50:14 +08:00
69e46f11dd LineArt: Debug print in modifier. 2020-09-22 10:48:18 +08:00
a603f3ad53 LineArt: Instanced collection child function bug. 2020-09-21 23:52:35 +08:00
11c94ad244 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/blenkernel/intern/scene.c
2020-09-21 23:02:43 +08:00
ca7838d76a Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-20 22:45:34 +08:00
42e710b87a Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-18 23:30:17 +08:00
c5302b95de LineArt: Strict thread sync. 2020-09-18 23:17:50 +08:00
416ca93300 LineArt: Draw freestyle marks in viewport as well. 2020-09-18 21:02:58 +08:00
639d92f1ed LineArt: Temp fix for using in motion blur situation. (Doubles render time) 2020-09-18 20:16:35 +08:00
3f76836e72 LineArt: Mac compatibility. 2020-09-18 14:00:09 +08:00
12e07cf9de LineArt: Supplimental debug information. 2020-09-18 13:22:28 +08:00
a7d6caf94e Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/editors/object/CMakeLists.txt
2020-09-18 13:13:26 +08:00
92104a822d Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/makesdna/DNA_collection_types.h
#	source/blender/makesrna/intern/rna_collection.c
2020-09-16 18:19:44 +08:00
1a5106c0d1 Merge branch 'master' into lanpr-under-gp 2020-09-15 15:27:32 +02:00
dc6cdfb8d5 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-15 13:34:20 +08:00
7567d8959e Merge branch 'master' into lanpr-under-gp 2020-09-14 15:30:41 +02:00
175d684470 LineArt: Fix Depth comparason error in intersection line occlusion stage. 2020-09-13 22:36:12 +08:00
08503a9062 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/gpencil_modifiers/CMakeLists.txt
#	source/blender/makesrna/intern/CMakeLists.txt
2020-09-13 22:07:57 +08:00
a75700a775 LineArt: Fix merge problem 2020-09-11 17:08:42 +02:00
46dc226b23 Merge branch 'master' into lanpr-under-gp
Conflicts:
	source/blender/blenloader/intern/writefile.c
2020-09-11 17:06:04 +02:00
62d3a0d1ec LineArt: Clipped line switch. 2020-09-11 17:16:41 +08:00
bbba3c7e72 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-11 15:16:35 +08:00
2ac3613084 LineArt: Fixed clipping line data link for new iteration path in contour detection. 2020-09-11 11:37:51 +08:00
a78e132bf4 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-11 11:23:13 +08:00
5130c9e7a6 LineArt: Far clipping 2020-09-11 00:11:47 +08:00
617a60f8b7 LineArt: Typo 2020-09-10 23:27:03 +08:00
c50483f548 LineArt: Update viewport when changing ObjectLineArt settings. 2020-09-10 21:22:37 +08:00
90e05b47cd LineArt: Own crease setting for Object. 2020-09-10 21:12:58 +08:00
d8d0ae39a3 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-09-10 19:54:47 +08:00
fdfd5dcdf1 LineArt: Fix UI ptr code. 2020-09-10 19:54:01 +08:00
5eaa709063 LineArt: API fixes. 2020-09-10 11:58:22 +08:00
df558cb605 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/editors/include/ED_geometry.h
#	source/blender/editors/lineart/lineart_ops.c
#	source/blender/editors/mesh/editmesh_intersect.c
#	source/blender/editors/object/object_facemap_ops.c
#	source/blender/gpu/CMakeLists.txt
#	source/blender/gpu/intern/gpu_batch.cc
#	source/blender/gpu/intern/gpu_context_private.hh
#	source/blender/gpu/intern/gpu_immediate.cc
#	source/blender/gpu/intern/gpu_immediate_private.hh
#	source/blender/gpu/intern/gpu_platform_private.hh
#	source/blender/gpu/intern/gpu_primitive_private.h
#	source/blender/gpu/intern/gpu_query.cc
#	source/blender/gpu/opengl/gl_batch.cc
#	source/blender/gpu/opengl/gl_context.cc
#	source/blender/gpu/opengl/gl_drawlist.cc
#	source/blender/gpu/opengl/gl_immediate.cc
#	source/blender/python/intern/bpy_rna_ui.h
2020-09-10 09:56:05 +08:00
501d064ee9 Cleanup: GPU: Remove unused attr_binding and primitive code 2020-08-31 22:23:21 +08:00
a47a64d9e4 GPUImmediate: GL backend isolation
This is part of the Vulkan backend task T68990.

This is mostly a cleanup, however, there is a small change:
We don't use a special Vertex Array binding function for Immediate
anymore and just reuse the one for batches.
This might create a bit more state changes but this could be fixed
easily if it causes perf regression.

# Conflicts:
#	source/blender/gpu/intern/gpu_context.cc
2020-08-31 22:23:21 +08:00
bfe222561c GLContext: Fix framebuffer deletion to GPUContext
This has more meaning as it's the base class who holds the pointer.

# Conflicts:
#	source/blender/gpu/opengl/gl_context.cc
2020-08-31 22:23:21 +08:00
a823597548 Cleanup: GPU_immediate: Change assert to BLI_assert 2020-08-31 22:23:21 +08:00
Germano Cavalcante
adfa705804 Fix T79973: Re-ordering face maps messes up the names of other face maps
Use a remap function instead a swap.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D8739
2020-08-31 22:23:21 +08:00
2604bade6c Cleanup: reduce variable scope 2020-08-31 22:23:21 +08:00
d0e2ce54ac Cleanup: reduce variable scope and use LISTBASE_FOREACH 2020-08-31 22:23:21 +08:00
6d5794e6bc Fix T80126: Alembic Import dialogue has overwrite protection UI
Use `FILE_OPENFILE` when importing, rather than `FILE_SAVE`.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D8715
2020-08-31 22:23:21 +08:00
7c0068c10f Linux: 2.90 release information in appdata 2020-08-31 22:23:21 +08:00
964071403a Cleanup: Resolve unused variable warning in lite build 2020-08-31 22:23:21 +08:00
9282b3b936 LineArt: Enable vector line intersection code (isect_v2_v2) 2020-08-31 22:23:21 +08:00
383c9717b5 LineArt: Better line intersection function and handling. 2020-08-31 22:23:21 +08:00
7efa3cec8b LineArt: CMake clean up. 2020-08-31 22:23:21 +08:00
f18f6d5354 LineArt: DNA/RNA cleanup. 2020-08-31 15:07:19 +08:00
0e1dd86c5b LineArt: Names clean up. 2020-08-31 15:03:27 +08:00
10f8a79f6a Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-31 10:49:49 +08:00
b45728bbc0 LineArt: added ratio() after interp() functions in math lib. 2020-08-30 10:43:52 +08:00
f14bb97cbf Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-30 10:23:51 +08:00
00eee5090d Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	build_files/cmake/config/blender_full.cmake
#	build_files/cmake/config/blender_lite.cmake
#	build_files/cmake/config/blender_release.cmake
2020-08-29 12:26:18 +08:00
5f4be7f48e LineArt: Better desctiption for enable linked objects 2020-08-29 12:24:57 +08:00
60881cf8d9 Cleanup 'make vertex parent' operator code.
More localized variables, avoid ugly 'offset by one' index usage in
favor of explicit `INDEX_UNSET` define, etc.

No behavior change expected from this commit.
2020-08-29 12:24:57 +08:00
954c79fe51 Fix T80135: Duplicate doesn't preserve active spline
Checks to preserve the active spline on duplication
required an active vertex too.

Now having no active vertex doesn't prevent duplicate
from keeping the spline active.

Reviewed by: @mano-wii

Ref D8729
2020-08-29 12:24:57 +08:00
a55c383752 Cleanup: use doxy sections in interface_panels.c 2020-08-29 12:24:57 +08:00
b51ebc6785 Cleanup: spelling 2020-08-29 12:24:57 +08:00
64438d679f LineArt: Slope throw away threshold in lineart_LineIntersectTest2d() 2020-08-29 11:29:13 +08:00
b8cf5b7215 LineArt: More fluent viewport manipulation (canceling sequence optimization) 2020-08-28 13:06:14 +08:00
27307a2be6 LineArt: Better manuverability with quick cancel. 2020-08-28 12:41:29 +08:00
328b28cf06 LineArt: Feature line compatible clipping. 2020-08-28 11:34:28 +08:00
bba9a70c00 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-28 10:10:28 +08:00
7e063e00ac Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-27 21:19:21 +08:00
7b6e6ef977 LineArt: Splitting limit for dense triangle situations. 2020-08-27 21:13:33 +08:00
64362a1c13 LineArt: Prompt on baking finish. 2020-08-27 11:39:16 +08:00
1fa0102959 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-27 09:59:28 +08:00
450f3498ca LineArt: Basic background task canceling. 2020-08-26 22:54:26 +08:00
ccef1c234a LineArt: Back-transform strokes to allow gp to sit at other positions. 2020-08-26 20:58:09 +08:00
59c47ac6d1 LineArt: Disable line art object viewport selection by default. 2020-08-26 20:36:51 +08:00
54a7adbe79 LineArt: Prevent crash when using any sort of moving operators. 2020-08-26 20:31:34 +08:00
856265b0d8 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-26 20:18:08 +08:00
6a02e9186b Merge branch 'master' into lanpr-under-gp 2020-08-26 10:11:28 +02:00
1198a68f25 Merge branch 'master' into lanpr-under-gp 2020-08-25 10:37:48 +02:00
8f611fd0bb Merge branch 'master' into lanpr-under-gp 2020-08-23 16:24:35 +02:00
19b5f837b1 Merge branch 'master' into lanpr-under-gp 2020-08-22 13:11:05 +02:00
0c95f4f774 LineArt: "Intersection Only" flag for objects/collections 2020-08-21 21:32:44 +08:00
b3decec480 Merge branch 'master' into lanpr-under-gp 2020-08-21 09:49:21 +02:00
15ca1f8823 LineArt: Remove debug print. 2020-08-20 21:45:14 +08:00
aa07f958fa LineArt: GPencil modifier flag change to mode (wrong use of variable). 2020-08-20 18:11:56 +08:00
a8703111c4 LineArt: guard for no camera situations. 2020-08-20 17:30:50 +08:00
9dfff48b99 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-20 15:07:11 +08:00
6b255bd9bb LineArt: Support for edge split. 2020-08-20 15:03:02 +08:00
d81206066d LineArt: Camera shifting aspect ratio fix. 2020-08-20 14:15:22 +08:00
02cdabddcb LineArt: BKE_scene_graph_update_for_newframe() new api. 2020-08-20 13:34:11 +08:00
ac04fdb1d9 Merge branch 'master' into lanpr-under-gp 2020-08-19 19:53:38 +02:00
886c2936b0 Merge branch 'master' into lanpr-under-gp 2020-08-19 07:52:12 +02:00
b5c8596096 Merge branch 'master' into lanpr-under-gp
Conflicts:
	source/blender/editors/space_buttons/CMakeLists.txt
2020-08-18 16:14:11 +02:00
9061c6919f Merge branch 'master' into lanpr-under-gp 2020-08-18 11:04:02 +02:00
518b8a469d Merge branch 'master' into lanpr-under-gp 2020-08-17 11:30:52 +02:00
fded457fcb LineArt: The line art panel in material is for mesh not for grease pencil. 2020-08-17 10:50:59 +08:00
cc7a57c34e LineArt: Move Linea Art mask panel as subpanel
Also moved to properties_material_gpencil.py
2020-08-16 18:35:23 +02:00
15855dcbcd LineArt: Fix compiler warnings and clang format 2020-08-16 18:19:31 +02:00
c3735cc332 LineArt: "Match" option in modifier settings. 2020-08-16 21:52:44 +08:00
09b2374ac0 LineArt: Transparency mask selection in modifier. 2020-08-16 16:49:18 +08:00
a326688c69 LineArt: Transparency mask data in Material. 2020-08-16 12:05:45 +08:00
9a9b7c3213 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-16 11:01:16 +08:00
f79dea97df Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/blenloader/intern/versioning_280.c
2020-08-15 13:13:42 +08:00
2eaf5ec228 LineArt: Prevent lines showing inside text object surface, disable crease. 2020-08-14 19:10:07 +08:00
d1ca1b1338 LineArt: metaballs/texts/curves/surfaces support. 2020-08-14 16:17:33 +08:00
3d1ea081cf LineArt: enable/disable duplicated objects in line art. 2020-08-14 15:36:39 +08:00
33f24a5db2 Line Art: file r/w pointer clean-up for collection->object_cache_instanced. 2020-08-14 14:57:48 +08:00
e25fb868d7 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-14 13:59:43 +08:00
1e7a51daa6 LineArt: Linked files now support collection-in-collection type of linking. 2020-08-13 23:10:56 +08:00
b76ffc6e04 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-13 21:55:43 +08:00
6ea694ceb8 Merge branch 'master' into lanpr-under-gp 2020-08-13 10:01:39 +02:00
5ca4e75d95 Merge branch 'master' into lanpr-under-gp 2020-08-12 22:59:09 +02:00
2103a1d145 Merge branch 'master' into lanpr-under-gp 2020-08-11 15:34:55 +02:00
30dfe126a6 Merge branch 'master' into lanpr-under-gp 2020-08-11 08:21:11 +02:00
b132cba50a Merge branch 'master' into lanpr-under-gp 2020-08-10 15:36:08 +02:00
c3d1e690cf Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-10 20:32:03 +08:00
64ea607ce4 LineArt: Memory sync fixes for animation rendering. 2020-08-09 21:56:35 +08:00
3e42356af1 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/blenkernel/intern/scene.c
#	source/blender/makesdna/DNA_gpencil_modifier_types.h
2020-08-09 19:48:41 +08:00
b99a5e70a1 LineArt: Guard more for very short cut situations. 2020-08-06 22:24:38 +08:00
2fec1a99c2 LineArt: Intersection lines can now be selected by different collections if fully contained. 2020-08-06 14:46:41 +08:00
0e9ebfe053 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-06 09:51:03 +08:00
77971dc662 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/tools
2020-08-05 19:51:28 +08:00
716a772d1a LineArt: use LISTBASE_FOREACH in lineart_chain.c 2020-08-03 22:59:34 +08:00
ac220268c8 LineArt: cleanup function names. 2020-08-03 21:41:15 +08:00
77e2f9629d LineArt: Cleanup extra modifications caused by merging and stuff. 2020-08-03 21:26:49 +08:00
5c660f0ff4 LineArt: Remove obsolete BKE_scene_ functions. 2020-08-03 20:17:37 +08:00
100d1c395c Merge branch 'master' into lanpr-under-gp 2020-08-03 12:35:49 +02:00
c52aab8b72 Merge branch 'master' into lanpr-under-gp 2020-08-01 12:13:29 +02:00
a3044f4733 Merge branch 'master' into lanpr-under-gp 2020-08-01 11:21:45 +02:00
0de0b8f335 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-08-01 10:45:46 +08:00
d84ba71149 LineArt: Memory utility changed to size_t instead of int. 2020-07-31 23:43:41 +08:00
31b9fa4e9a Merge branch 'master' into lanpr-under-gp 2020-07-31 12:44:41 +02:00
d842334b24 Merge branch 'master' into lanpr-under-gp 2020-07-31 12:06:11 +02:00
7ecfb0bca8 Merge branch 'master' into lanpr-under-gp 2020-07-30 16:24:14 +02:00
3402f6dec0 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-30 21:33:08 +08:00
d44a93f411 LineArt: Memory optimizations by removing obsolete variables. 2020-07-29 23:48:02 +08:00
9a04768b8b LineArt: Removing more fields in render data structure to save memory. 2020-07-29 23:32:14 +08:00
59714f2a00 LineArt: Remove RenderTriangle::gc. This variable was never really used. 2020-07-29 22:58:13 +08:00
3d33971422 LineArt: Don't call angle splitting when threshold is minimal. 2020-07-29 22:51:09 +08:00
cd9317e74e LineArt: Near clipping intersection hack. 2020-07-29 22:51:09 +08:00
653c6819d4 LineArt: Fix baking crash. 2020-07-29 22:51:09 +08:00
56e6cccefb LineArt: Fix compiler warnings 2020-07-29 13:34:03 +02:00
b33dc98893 LineArt: Remove angle splitting properties in multiply modifier. 2020-07-29 18:24:44 +08:00
d84ec55cff LineArt: Fix typo errors in tooltips 2020-07-29 12:00:27 +02:00
a7bdfd86e9 LineArt: Angle splitting using deg instead of rad. 2020-07-29 17:56:30 +08:00
2a4e6aaf48 LineArt: Allow applying of the modifier. 2020-07-29 16:54:19 +08:00
c7b0368803 Merge branch 'master' into lanpr-under-gp 2020-07-29 10:39:22 +02:00
b82d1cc4c7 LineArt: Internal angle splitting function. 2020-07-29 16:01:42 +08:00
77b00ef498 LineArt: Fix long line not registering bug. 2020-07-29 15:09:05 +08:00
9f4d79d02a LineArt: Adjacent triangle hack. 2020-07-29 14:29:51 +08:00
c760d3069c LineArt: Do not offset near-clip in culling stage. 2020-07-29 13:43:16 +08:00
73747311d5 LineArt: Obsolete functions clean up. 2020-07-29 12:11:30 +08:00
1f9d955faf LineArt: Use linear W for back-transform. 2020-07-29 12:11:18 +08:00
3abb56792d Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/editors/space_buttons/buttons_context.c
2020-07-29 11:18:58 +08:00
474e2aef72 Fix small typo in the lineart clipping calculations 2020-07-28 18:25:21 +02:00
ef01d800ec LineArt: NDC to Viewport z depth optimization and near clipping decision change. 2020-07-28 23:11:21 +08:00
839fba88b9 GPencil: Cleanup comments 2020-07-28 16:59:25 +02:00
a4f3f5cec3 LineArt: Fix compiler warnings 2020-07-28 16:40:29 +02:00
a416b3e210 LineArt: Cleanup enum callback for quick line art. 2020-07-28 17:40:28 +08:00
3817355e88 LineArt: Conditinal showing of quick line art options. 2020-07-28 17:26:58 +08:00
77aa5edffd LineArt: (missedd a new file). 2020-07-28 16:40:38 +08:00
91767d7e88 LineArt: Quick line art set-up in add objects menu. 2020-07-28 16:39:51 +08:00
153815a856 Merge branch 'master' into lanpr-under-gp 2020-07-28 09:14:11 +02:00
ab3b1aa3bf LineArt: Don't retain line art buffer result after modifier evaluation. 2020-07-28 13:44:10 +08:00
20b39e4bd6 LineArt: Memory allocation now dynamically stretch each pool for better efficiency and large model handling. 2020-07-28 12:14:42 +08:00
29f160a7a8 LineArt: Don't allow frame number 0 to be baked. 2020-07-28 11:53:29 +08:00
5fc69361be LineArt: Ensure notification of line art gpencil objects when enable/disableing line art. 2020-07-28 11:49:15 +08:00
5222521bc7 LineArt: Don't retain strokes when disabled auto_update. Also prevent render dead-lock. 2020-07-28 11:05:49 +08:00
03f56a9fd6 LineArt: Fix frame cleaning at the wrong time. 2020-07-28 10:34:41 +08:00
a7ed36c803 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-28 09:21:44 +08:00
7afee455b1 LineArt: Fix compiler warnings 2020-07-27 16:53:23 +02:00
0dd6a7647c Merge branch 'master' into lanpr-under-gp 2020-07-27 16:49:01 +02:00
aaa2da3e6d Merge branch 'master' into lanpr-under-gp 2020-07-27 10:50:24 +02:00
1652026cb7 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-27 11:22:00 +08:00
c53504a5b5 LineArt: Performance improvements. 2020-07-26 21:52:28 +08:00
0c96ae6724 LineArt: Pre-sample in the modifier. 2020-07-26 12:07:24 +08:00
56cfae9ef0 LineArt: Remove duplicated "Calculate Intersections" switch. 2020-07-26 11:38:50 +08:00
c89742c5b1 LineArt: Global line type flags. 2020-07-26 11:33:52 +08:00
b29749af5f LineArt: Fix force line type when connecting to intersection lines, 2020-07-26 11:12:25 +08:00
56183da948 LineArt: Global line type selection. 2020-07-26 11:07:06 +08:00
7a489cd639 LineArt: Force line types for situations in fuzzy chaining. 2020-07-26 10:48:10 +08:00
0ef3f6760f Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-26 10:10:40 +08:00
7f57b9f2c1 LineArt: Restore collection and object panels for usage flag settings. 2020-07-26 00:20:32 +08:00
cbbc9e69c5 Merge branch 'master' into lanpr-under-gp 2020-07-25 16:25:11 +02:00
cf365828d8 LineArt: double point chaining algorithm 2020-07-25 17:56:54 +08:00
9b7b93b206 LineArt: Optimization for avoiding loops in chaining 2020-07-25 16:21:46 +08:00
15a012de17 Revert "Merge remote-tracking branch 'DarkdefenderRepo/npr_tess_2_90' into lanpr-under-gp"
This reverts commit ceb3b7098c, reversing
changes made to ef2189542d.
2020-07-25 12:27:36 +08:00
ceb3b7098c Merge remote-tracking branch 'DarkdefenderRepo/npr_tess_2_90' into lanpr-under-gp 2020-07-24 23:57:16 +08:00
ef2189542d LineArt: Use separate function for getting closest end point in chain. 2020-07-24 22:48:25 +08:00
7fea51be5a Merge branch 'master' into lanpr-under-gp 2020-07-24 16:24:38 +02:00
ce3447c064 LineArt: Random color debug for generated strokes. 2020-07-24 21:41:47 +08:00
8c0845eb7e Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/makesrna/intern/rna_space.c
2020-07-24 18:13:02 +08:00
5753786bae Merge branch 'master' into lanpr-under-gp 2020-07-23 13:17:16 +02:00
173d690149 LineArt: Optimize details in chaining code. 2020-07-22 19:55:56 +08:00
9784c5021b Merge remote-tracking branch 'origin/lanpr-under-gp' into lanpr-under-gp 2020-07-22 18:49:02 +08:00
4503af102d LineArt: Fuzzy chaining option and UI. 2020-07-22 18:48:56 +08:00
d5d73554c0 Merge branch 'master' into lanpr-under-gp 2020-07-22 11:18:36 +02:00
494b75c654 LineArt: Remove duplicated "use" phrase in modifier UI. 2020-07-22 14:08:40 +08:00
b08d72d2c8 LineArt: Optimize chaining code for better handling for organic features. 2020-07-22 13:19:53 +08:00
e586101619 Merge branch 'master' into lanpr-under-gp 2020-07-21 15:54:59 +02:00
24bce50e58 LineArt: Guard early in the modifier for stopping calculation when there's no active keyframe present. 2020-07-21 19:32:21 +08:00
3cd09680a0 LineArt: Revert accidental changes in constraint.c 2020-07-21 18:31:56 +08:00
18754b54b1 LineArt: Completely remove now obsolete LineLayer structure. 2020-07-21 17:35:37 +08:00
e22c86cbc3 LineArt: Cleanup function names into _lineart_category_operation() format. 2020-07-21 17:10:47 +08:00
f58c3f94c9 Merge remote-tracking branch 'origin/lanpr-under-gp' into lanpr-under-gp 2020-07-21 16:03:44 +08:00
c4a4f6ebce Merge branch 'master' into lanpr-under-gp 2020-07-20 20:22:12 +02:00
9971dcc073 Merge branch 'master' into lanpr-under-gp 2020-07-20 11:12:12 +02:00
338cef6158 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-19 19:26:58 +08:00
8cdcc3703b Merge branch 'master' into lanpr-under-gp 2020-07-18 10:35:12 +02:00
61aad4f0ab Merge branch 'master' into lanpr-under-gp 2020-07-17 16:46:42 +02:00
5927aaafb7 Merge branch 'master' into lanpr-under-gp 2020-07-16 17:45:48 +02:00
c7d0ad77b0 Merge branch 'master' into lanpr-under-gp 2020-07-16 08:17:11 +02:00
38a66b5f1a LineArt: Fix isDisabled function
* The layer is not a pointer, but a name.
* Don't execute if it's disabled.
2020-07-15 23:35:24 +02:00
501489c55e LineArt: Disable modifier when source/target isn't properly set 2020-07-15 23:21:23 +08:00
7316aeb433 LineArt: Do not block the process when applying modifier with auto update turned off. 2020-07-15 22:49:17 +08:00
47985f0ea0 LineArt: Fix multiple calls to clearing frame when have multiple modifier on baking. 2020-07-15 18:58:26 +08:00
bd7308e951 LineArt: use DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN to support instanced collections and view layer flag. 2020-07-15 18:30:13 +08:00
f8ad9f1f8a LineArt: Remove LRT_ENABLED flag. 2020-07-15 18:23:38 +08:00
1250e862e3 LineArt: UI fixes. 2020-07-15 17:42:26 +08:00
5c74c712a9 LineArt: Thickness and strength moved into the modifier. 2020-07-15 17:30:06 +08:00
6fc5b82375 LineArt: use G.debug_value==4000 for line art logs. 2020-07-15 17:07:26 +08:00
ef8ee6b2fd LineArt: Precise and fast cutting point back-transform. 2020-07-15 15:03:45 +08:00
7675d3e6e2 LineArt: Overwrite frame flag now supported for baking. 2020-07-15 13:40:35 +08:00
c4057a0e86 LineArt: Restore original frame after baking is done. 2020-07-15 13:31:02 +08:00
3d13c7ebbc LineArt: Take account of hidden modifiers in render and viewport. 2020-07-15 13:27:33 +08:00
0fd17d27ed LineArt: Property in main panel will trigger auto update in the viewport. 2020-07-15 13:15:23 +08:00
2696d9b293 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-15 11:29:36 +08:00
695ad46107 LineArt: Cleanup some texts 2020-07-14 19:28:33 +02:00
a045a2dac6 LineArt: Fix compiler errors in Windows 2020-07-14 17:35:05 +02:00
98ce3d23a9 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-14 23:09:14 +08:00
8fabcb8372 LineArt: Use orig_id for all object filtering. 2020-07-14 22:49:50 +08:00
07153475ab LineArt: Cleanup code. 2020-07-14 21:32:30 +08:00
4de6902afe Merge branch 'master' into lanpr-under-gp 2020-07-14 10:44:11 +02:00
24c9b37e4b LineArt: Cleanup format 2020-07-13 22:58:43 +02:00
4139347532 Merge branch 'master' into lanpr-under-gp 2020-07-13 10:39:28 +02:00
8c01374ed6 Merge branch 'master' into lanpr-under-gp 2020-07-11 20:30:50 +02:00
023e4a5935 Merge branch 'master' into lanpr-under-gp 2020-07-10 17:11:21 +02:00
cce663421e Merge branch 'master' into lanpr-under-gp 2020-07-09 15:47:29 +02:00
6cbb2ffb0c LineArt: Use LISTBASE_FOREACH 2020-07-07 23:30:41 +08:00
19d73bd6b2 LineArt: Null handling when gpencil target is an empty object. 2020-07-07 23:06:30 +08:00
49ebb8095c Merge remote-tracking branch 'origin/lanpr-under-gp' into lanpr-under-gp 2020-07-07 23:01:32 +08:00
7b96cd604a LineArt: Fix conflict on evaluation when baking. 2020-07-07 23:01:26 +08:00
9f6c0715ec LineArt: Replace Loop by LISTBASE_FOREACH 2020-07-07 16:37:56 +02:00
3be3892d85 Merge branch 'master' into lanpr-under-gp 2020-07-07 16:21:17 +02:00
a4d3e6bd47 Merge branch 'master' into lanpr-under-gp 2020-07-07 16:20:11 +02:00
1699d79b42 LineArt: Fix compiler errors and warnings in Windows 2020-07-07 16:19:54 +02:00
25de3e5294 LineArt: Handle accidental scene->master_collection == NULL situation. 2020-07-07 21:21:05 +08:00
7f6efc6769 LineArt: Bake button in render panel. 2020-07-07 20:51:14 +08:00
84e504dd3b LineArt: Obsolete operators cleaned up. 2020-07-07 20:04:39 +08:00
342a51c38c Cleanup: naming conventions in lineart_cpu.c 2020-07-07 19:17:42 +08:00
214a2c637f LineArt: Continue last commit. (git GUI problem) 2020-07-07 18:16:13 +08:00
bbb32cf494 LineArt: Continue last commit. 2020-07-07 18:15:33 +08:00
3f273fbc96 LineArt: Update calculation progress on progress bar and cursor. 2020-07-07 18:05:35 +08:00
302d9b38a7 LineArt: No need to use DEG_SCENE_PARAMETERS now because we have good object relations. 2020-07-07 16:40:23 +08:00
d4f9a1c134 LineArt: Include Depsgraph mode to grease pencil modifiers callback 2020-07-07 10:12:48 +02:00
afc0b5875e LineArt: Making settings panel visible in all engines. 2020-07-07 14:08:54 +08:00
6b216909c7 LineArt: Don't create frames in gpencil modifier. 2020-07-07 14:02:53 +08:00
5186330893 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-07 13:41:55 +08:00
4679d1857f Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-07-06 14:39:23 +08:00
fac0a317cb Port smooth countour modifier to 2.90 2020-07-06 03:05:16 +02:00
c80318c84c LineArt: Fix compiler warnings 2020-07-04 16:25:00 +02:00
6f262f79ff Cleanup: Continue last commit 2020-07-04 19:41:07 +08:00
05ffc6fbcb LANPR: Master thickness and strength added. 2020-07-04 19:40:35 +08:00
4bea9c0d2b LANPR: Add related object relationship with modifier when using collection source. 2020-07-04 19:18:44 +08:00
7d28cbf05f LANPR: Remove obsolete UI in render panel. 2020-07-04 18:56:43 +08:00
365df4b5aa LANPR: Removed excessive scene relationship in updateDepsgraph. 2020-07-04 17:22:02 +08:00
0bf58275f6 LANPR: show strokes when rendering. 2020-07-04 17:17:02 +08:00
49152c98a5 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/blenkernel/intern/gpencil.c
2020-07-04 13:56:23 +08:00
248585b3cc LANPR: Contour/Freestyle mark distinguish. 2020-07-03 18:32:52 +08:00
cde5978cf7 LANPR: Suspected memory issue when generating gp strokes fixed. 2020-07-03 16:27:02 +08:00
928da5b65a LANPR: Modifier property now updates viewport. 2020-07-03 15:15:28 +08:00
ee0a9a26da LANPR: Viewport now redraws when grease pencil update is finished in the background. 2020-07-03 14:59:19 +08:00
44ba7b7e1e LANPR: Collection usage flag now effective. 2020-07-03 14:41:12 +08:00
6e64a8d900 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
2020-07-03 14:22:53 +08:00
152d2c5184 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/makesrna/intern/rna_object.c
2020-07-02 12:52:08 +08:00
53b1c2c278 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-29 19:30:43 +08:00
a945849f66 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-29 12:20:41 +08:00
ec9ec3b134 Cleanup: Pointer assignment cast and modifier iteration. 2020-06-28 23:06:39 +08:00
f19ed441b8 Cleanup: Remove target settings in CollectionLineart. 2020-06-28 22:37:39 +08:00
fcec150c50 Cleanup: lanpr RNA name fixes. 2020-06-28 21:52:14 +08:00
da7964ea49 LANPR: Modifier apply now works for all line types. 2020-06-28 21:45:45 +08:00
3e39b45fa4 LANPR: Modifier apply now partially working. 2020-06-28 21:29:32 +08:00
c6fd4b97d0 LANPR: Modifier code cleanup. 2020-06-28 21:02:44 +08:00
35430988c1 LANPR: Fix Append segfault by removing BLO_expand() for a wrong pointer. 2020-06-28 20:53:36 +08:00
624994718d LANPR: Clear picked flags for modifier line picking use. 2020-06-28 19:51:01 +08:00
705a77765d LANPR: Collection mode depsgraph relationship with scene added. 2020-06-28 17:37:56 +08:00
09f72c5dba LANPR: Auto update for modifier now works in dg. 2020-06-28 17:26:43 +08:00
f2873a2f03 LANPR: Modifier stroke generation code now funcional. 2020-06-28 14:58:45 +08:00
74dd526809 Merge remote-tracking branch 'origin/lanpr-under-gp' into lanpr-under-gp 2020-06-28 14:20:45 +08:00
f2c5b7ea86 LANPR: generateStrokes functions added. 2020-06-28 14:18:51 +08:00
c963898200 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-28 12:40:04 +08:00
8f1d640a6f LANPR: GP Lineart modifier file r/w now working. 2020-06-27 21:54:44 +08:00
5b16ae068b LANPR: GP modifier basic UI complete. 2020-06-27 21:24:24 +08:00
dea7176dba LANPR: Modifier properties added. 2020-06-27 20:38:46 +08:00
77115c8832 LANPR: Main panel should also show in Workbench. 2020-06-27 19:02:47 +08:00
141fa711e4 LANPR: Added back chaining threshold values. 2020-06-27 18:06:46 +08:00
e09d0b1330 LANPR: Object LANPR panel name change to Lineart. 2020-06-27 16:21:54 +08:00
554ae0bd05 LANPR: UI name fixes. 2020-06-27 16:11:52 +08:00
cc2a1954d9 Refactor: LANPR file names changed to lineart. 2020-06-27 16:08:38 +08:00
cb676fa7da Refactor: All struct names changed to Lineart 2020-06-27 15:58:01 +08:00
ef33474ed2 Refactor: DNA names and python references for LANPR. 2020-06-27 15:27:41 +08:00
0abac43019 Refactor: Rename LANPR to LineArt in DNA and compiler options 2020-06-27 14:50:53 +08:00
ac56bf75c0 Refactor: (Continue files for last commit) 2020-06-27 14:32:47 +08:00
dad2db3bc9 Refactor: ED_lanpr functions renamed to ED_lineart 2020-06-27 14:32:04 +08:00
b6f390f6a9 Refactor: some struct names for LANPR in editor module changed to eLineArt. 2020-06-27 14:15:27 +08:00
0aed42f8a7 Refactor: Keep up with readfiles.c API changes for LANPR 2020-06-27 12:14:59 +08:00
39419bf99f Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-27 11:52:29 +08:00
bf9680f0b4 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-26 21:26:24 +08:00
44f66c3808 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-26 14:14:21 +08:00
19ba395d99 LANPR: Added placeholder modifier in GP. 2020-06-25 17:50:47 +08:00
c8f3e4cc6c LANPR: Use only (0,1) for crease threshold. 2020-06-25 17:29:27 +08:00
db211c8edd LANPR: Version bumper moved to latest. 2020-06-25 17:26:49 +08:00
26609e2639 LANPR: Fixed occlusion level detection. 2020-06-25 17:20:15 +08:00
1b7ea80690 LANPR: Fix ambiguous occlusion level when having overlapping points on chaining . 2020-06-25 16:18:55 +08:00
941ed655a8 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	CMakeLists.txt
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/editors/space_buttons/CMakeLists.txt
2020-06-25 14:09:03 +08:00
a3dc4a472d Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	release/scripts/addons_contrib
#	source/blender/blenloader/intern/readfile.c
2020-06-21 16:29:31 +08:00
a180717911 Fix Wrong struct reference. 2020-06-11 18:23:07 +08:00
1b856226f7 LANPR: object_foreach_id() now takes care of target reference too. 2020-06-11 18:02:51 +08:00
29d02c7c30 LANPR: Fix baking finish flag. 2020-06-11 12:55:23 +08:00
78490a7837 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/blenkernel/intern/scene.c
2020-06-11 12:37:54 +08:00
80011e847d LANPR: Baking in frame range is now working. 2020-06-10 22:56:23 +08:00
4273836cdc LANPR: Fix deleting GP cause UI crash problem. 2020-06-10 21:58:21 +08:00
26e91f4f1e LANPR: Thread monitoring memory leak fixed. 2020-06-10 21:04:55 +08:00
231bfe46a4 LANPR: Fix undo memory conflict in threaded calculations 2020-06-10 19:49:53 +08:00
e9ad44e368 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-10 18:34:10 +08:00
497633df39 LANPR: Background calculation now doesn't block user input. (Messy code for now) 2020-06-08 15:51:00 +08:00
9803f4502d Cleanup: Compiler debug flags. 2020-06-08 14:24:51 +08:00
b0dda64a95 LANPR: Fixed crashes during duplicate point removal in chain connecting. 2020-06-08 14:20:54 +08:00
56ebc769a6 LANPR: Fix readfile.c node tree linking error from merge. 2020-06-08 12:11:38 +08:00
cbe77c9110 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-08 12:03:03 +08:00
48a7fcdf75 LANPR: Duplicating points in chaining stage is taken care of. 2020-06-07 22:03:44 +08:00
46cd0a12d4 LANPR: ob->imat now untouched by LANPR geometry loading. Normal flipping bug solved. 2020-06-07 21:06:26 +08:00
b211885d0f LANPR: Remove chaining flag. 2020-06-07 20:50:27 +08:00
43df7f9f6a LANPR: GP Target now recalculate geometry (using DEG_id_tag thing) automatically. 2020-06-07 20:30:04 +08:00
050e6bdea7 Merge remote-tracking branch 'origin/master' into lanpr-under-gp
# Conflicts:
#	source/blender/blenloader/intern/readfile.c
#	source/blender/blenloader/intern/writefile.c
#	source/blender/makesrna/intern/rna_collection.c
2020-06-07 20:09:56 +08:00
35d83ade04 Merge remote-tracking branch 'origin/master' into lanpr-under-gp 2020-06-04 22:28:23 +08:00
117c0c18a3 LANPR: Memory copy/deleting implemented into depsgrapgh callback. No leaks now. 2020-06-04 22:27:54 +08:00
c2ce9fdee9 LANPR: Chaininng panel is re-configured and shown. 2020-06-04 21:47:05 +08:00
fc3f80d1bb LANPR: Init and deinit triggers in ed_utils.c 2020-06-04 21:42:53 +08:00
0ae685b584 Removed LANPR engine and made LANPR working under Pure GP. 2020-06-04 21:20:35 +08:00
bfbf0bb7f7 Merge remote-tracking branch 'origin/master' into temp-lanpr-review
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
2020-06-04 18:57:28 +08:00
3b52dfe549 Merge remote-tracking branch 'origin/master' into temp-lanpr-review
# Conflicts:
#	release/datafiles/locale
#	release/scripts/addons
#	source/blender/blenkernel/intern/lib_query.c
2020-05-30 16:34:11 +08:00
cd54abd2c1 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2020-05-16 23:08:40 +08:00
f7770cb97b Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2020-02-01 10:35:40 +08:00
b47883a990 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2020-02-01 10:25:32 +08:00
b5abbc40a0 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-12-13 13:42:27 +08:00
c2c6447229 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-12-10 22:13:06 +08:00
191b890883 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-12-09 14:04:57 +08:00
f83f168c92 LANPR: Typo "identity". 2019-12-04 20:47:39 +08:00
7804323e33 LANPR: CPU mode win_mat fix attempt. 2019-12-04 20:15:45 +08:00
89e01395a8 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-12-04 20:15:33 +08:00
781c9f5206 LANPR: Grease pencil mode init code fix. 2019-12-03 20:23:43 +08:00
6f7f80775d LANPR: Warning messages for gpu cache overflow. 2019-12-03 13:48:48 +08:00
8b041081c3 LANPR: chaining vertex count fixed. 2019-12-03 13:44:05 +08:00
7f81bb4931 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-12-03 13:30:50 +08:00
2243de9a90 LANPR: Don't use background intersection calculation for GPU mode. 2019-11-29 23:17:00 +08:00
798e93b634 Cleanup: Missing bracket. 2019-11-28 18:44:32 +08:00
ca43179932 LANPR: Camera shift value assign. 2019-11-28 14:50:46 +08:00
6967d60c4b Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-11-28 14:50:40 +08:00
1c2b864155 LANPR: Remove debug print in triangle clipping 2019-11-28 13:29:49 +08:00
cb47cc14cd LANPR: Removed camera references in RenderBuffer. Safe for thread ops. 2019-11-28 13:27:13 +08:00
352eb65a57 LANPR: Locking parent thread when loading scenes into lanpr. 2019-11-28 12:38:33 +08:00
8eb44bfb81 LANPR: Renderbuffer creation changed to re-init. 2019-11-28 11:48:59 +08:00
acd8fae2d8 LANPR: Const qualifiers for some of the functions 2019-11-28 11:39:21 +08:00
Julian Eisel
541fb672ec Always write LANPR data if set
Gerneral rule of thumb: Don't delete user data without permission.
Data-blocks are a whole different and difficult story. Users may have
disabled just for a render, reloading the file shouldn't make their
settings go lost.
2019-11-27 17:19:41 +01:00
Julian Eisel
6ccd672fee Fix crash on disabling collection LANPR
Also:
* Avoid duplicated copy code (copy code performed already and wouldn't actually run)
* Cleanup freeing
2019-11-27 17:10:27 +01:00
Julian Eisel
cf38c4d49f Fix NULL-ptr mem-copy 2019-11-27 16:03:21 +01:00
12bf6ee36c LANPR: Build option CMakeLists add LANPR. 2019-11-27 22:51:35 +08:00
Julian Eisel
4227b81826 Fix wrong dereferences 2019-11-27 15:38:31 +01:00
Julian Eisel
cf623d8e7b Address some minor warnings 2019-11-27 15:36:36 +01:00
Julian Eisel
692f20604c Run clang-format on all changed files 2019-11-27 15:35:17 +01:00
9f35ef219f LANPR: Collection visibility flags should be visible in all engines. 2019-11-27 22:21:31 +08:00
aa4ff9e5d3 LANPR: Fixing CollectionLANRP file r/w. 2019-11-27 22:09:35 +08:00
1e801df3ef LANPR: Use pointer to save collection LANPR config. 2019-11-27 21:10:38 +08:00
f8384c0d2d Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-11-27 19:41:17 +08:00
5aa70ac589 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-11-27 10:18:09 +08:00
c2fbf7668d LANPR: Remove LANPR_LineLayerComponent struct as it's no more used. 2019-11-24 22:02:29 +08:00
365faddd79 LANPR: Fix chain point count error. 2019-11-24 20:55:16 +08:00
c508138e95 LANPR: CMake option in the RNA. 2019-11-24 20:48:47 +08:00
0476090983 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-11-24 20:43:53 +08:00
7da7d97aff Cleanup: LANPR compilder flags, missing registers, and some other fixes. 2019-11-22 19:17:54 +08:00
9b27248c64 LANPR: Some comments on the occlusion function 2019-11-22 18:27:03 +08:00
b95f15862e Cleanup: Get rid of real/tmat/tnsvector stuff in LANPR internal code. 2019-11-22 18:10:20 +08:00
232e13d4cb Cleanup: variable capitalizations. 2019-11-22 18:02:25 +08:00
96d470c0e2 LANPR: Versioning code move to the latest. 2019-11-22 17:37:15 +08:00
7e577c4857 Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-11-22 17:29:36 +08:00
66aa0a2181 LANPR: dpix_shader_error type and rna definition fixes. 2019-11-20 21:32:54 +08:00
ba5c4414b0 Cleanup: Function logic and unused variables. 2019-11-20 21:30:13 +08:00
ec9cdd6e51 LANPR: Fix multisample texture functions and engine registering functions. 2019-11-20 20:56:56 +08:00
b3d226ffdb CLeanup: fix property context item descriptions. 2019-11-20 20:25:57 +08:00
bdd96da5eb Merge remote-tracking branch 'origin/master' into temp-lanpr-review 2019-11-20 20:20:38 +08:00
43419e4c32 LANPR: Removed unused DRW_texture_create_2d_multisample function. 2019-11-20 17:20:42 +08:00
dc9f9faff7 Merge remote-tracking branch 'origin/master' into arcpatch-D5442 2019-11-20 16:11:51 +08:00
f2f2f5f6c7 Cleanup: Code style and dead code stuff. 2019-11-20 16:11:10 +08:00
9c7f536251 LANPR: Fix cmake option in render to allow lanpr callback for gp updates. 2019-11-20 16:02:29 +08:00
a921c5f239 Cleanup: dead codes and commentaries. 2019-11-20 15:44:33 +08:00
bb38766ba6 LANPR: Clipping topology data error fixed.
Also cleaned up some dead code inside.
2019-11-20 15:01:04 +08:00
45eb04adc8 Merge remote-tracking branch 'origin/master' into arcpatch-D5442 2019-11-20 13:21:35 +08:00
ee7785510b Cleanup: TNS_THREAD_LINE_COUNT commenting. 2019-11-18 22:14:32 +08:00
db12505f51 Cleanup: Fix compiler warnings. 2019-11-18 22:08:48 +08:00
314439e652 Cleanup: Remove snake mode structures in ED_lanpr.h 2019-11-18 21:48:34 +08:00
9a9fa3a206 Merge remote-tracking branch 'origin/master' into arcpatch-D5442 2019-11-18 21:46:25 +08:00
c3799f1c31 LANPR: Fix various code issues. 2019-11-17 20:29:17 +08:00
ef1cd34e8d Merge remote-tracking branch 'origin/master' into arcpatch-D5442 2019-11-17 20:10:38 +08:00
dba890910d LANPR: Still enable auto update checkbox when no active camera is persent. 2019-11-15 20:37:20 +08:00
3bcdf06a54 Merge branch 'master' into arcpatch-D5442 2019-11-15 20:30:19 +08:00
1924e96f7d LANPR: Fix asset errors and material marking errors. 2019-11-15 20:06:36 +08:00
YimingWu
e9df7caf19 LANPR line rendering (summer of code)
LANPR Patch

This is the patch for soc-2019-npr branch. Now modified as containing only LANPR changes

This patch **doesn't include** the following:

- GPencil modifiers.
- Smooth contour modifier.
- SVG.
- Affected UI scripts.
- Freestyle changes.

Those above will be submitted in other diffs.

Differential Revision: https://developer.blender.org/D5442
2019-11-15 11:46:33 +08:00
14 changed files with 774 additions and 112 deletions

View File

@@ -304,6 +304,11 @@ class MATERIAL_PT_lineart(MaterialButtonsPanel, Panel):
sub.active = lineart.use_mat_occlusion
sub.prop(lineart, "mat_occlusion", slider=True, text="Levels")
row = layout.row(align=True, heading="Custom occlusion effectiveness")
row.active = lineart.use_occlusion_effectiveness
row.prop(lineart, "use_occlusion_effectiveness", text="")
row.prop(lineart, "occlusion_effectiveness", slider=True)
classes = (
MATERIAL_MT_context_menu,

View File

@@ -1439,10 +1439,7 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op)
id_us_plus(&md->target_material->id);
}
if (use_lights) {
ob->dtx |= OB_USE_GPENCIL_LIGHTS;
}
else {
if (!use_lights) {
ob->dtx &= ~OB_USE_GPENCIL_LIGHTS;
}

View File

@@ -59,6 +59,7 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "MOD_gpencil_lineart.h"
#include "MOD_gpencil_modifiertypes.h"
#include "MOD_gpencil_ui_common.h"
@@ -160,12 +161,14 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec
LineartCache *local_lc = gpd->runtime.lineart_cache;
if (!gpd->runtime.lineart_cache) {
MOD_lineart_compute_feature_lines(depsgraph, lmd, &gpd->runtime.lineart_cache);
MOD_lineart_compute_feature_lines(
depsgraph, lmd, &gpd->runtime.lineart_cache, (!(ob->dtx & OB_DRAW_IN_FRONT)));
MOD_lineart_destroy_render_data(lmd);
}
else {
if (!(lmd->flags & LRT_GPENCIL_USE_CACHE)) {
MOD_lineart_compute_feature_lines(depsgraph, lmd, &local_lc);
MOD_lineart_compute_feature_lines(
depsgraph, lmd, &local_lc, (!(ob->dtx & OB_DRAW_IN_FRONT)));
MOD_lineart_destroy_render_data(lmd);
}
MOD_lineart_chain_clear_picked_flag(local_lc);
@@ -205,7 +208,8 @@ static void bakeModifier(Main *UNUSED(bmain),
}
if (!gpd->runtime.lineart_cache) {
MOD_lineart_compute_feature_lines(depsgraph, lmd, &gpd->runtime.lineart_cache);
MOD_lineart_compute_feature_lines(
depsgraph, lmd, &gpd->runtime.lineart_cache, (!(ob->dtx & OB_DRAW_IN_FRONT)));
MOD_lineart_destroy_render_data(lmd);
}
@@ -254,6 +258,7 @@ static void updateDepsgraph(GpencilModifierData *md,
else {
add_this_collection(ctx->scene->master_collection, ctx, mode);
}
DEG_add_object_relation(
ctx->node, ctx->scene->camera, DEG_OB_COMP_TRANSFORM, "Line Art Modifier");
DEG_add_object_relation(
@@ -268,6 +273,8 @@ static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk,
walk(userData, ob, (ID **)&lmd->source_collection, IDWALK_CB_NOP);
walk(userData, ob, (ID **)&lmd->source_object, IDWALK_CB_NOP);
walk(userData, ob, (ID **)&lmd->source_camera, IDWALK_CB_NOP);
walk(userData, ob, (ID **)&lmd->light_contour_object, IDWALK_CB_NOP);
}
static void panel_draw(const bContext *UNUSED(C), Panel *panel)
@@ -404,14 +411,23 @@ static void style_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void occlusion_panel_draw(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
PointerRNA ob_ptr;
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
const bool use_multiple_levels = RNA_boolean_get(ptr, "use_multiple_levels");
const bool show_in_front = RNA_boolean_get(&ob_ptr, "show_in_front");
uiLayoutSetPropSep(layout, true);
uiLayoutSetEnabled(layout, !is_baked);
const bool use_multiple_levels = RNA_boolean_get(ptr, "use_multiple_levels");
if (!show_in_front) {
uiItemL(layout, IFACE_("Object is not in front"), ICON_INFO);
}
layout = uiLayoutColumn(layout, false);
uiLayoutSetActive(layout, show_in_front);
uiItemR(layout, ptr, "use_multiple_levels", 0, IFACE_("Range"), ICON_NONE);
@@ -439,10 +455,14 @@ static void material_mask_panel_draw_header(const bContext *UNUSED(C), Panel *pa
static void material_mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
PointerRNA ob_ptr;
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
const bool show_in_front = RNA_boolean_get(&ob_ptr, "show_in_front");
uiLayoutSetEnabled(layout, !is_baked);
uiLayoutSetActive(layout, show_in_front);
uiLayoutSetPropSep(layout, true);
@@ -463,17 +483,33 @@ static void material_mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(col, ptr, "use_material_mask_match", 0, IFACE_("Match All Masks"), ICON_NONE);
}
static void intersection_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
PointerRNA ob_ptr;
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
const bool use_isec = RNA_boolean_get(ptr, "use_intersection");
uiLayoutSetEnabled(layout, !is_baked);
uiLayoutSetActive(layout, use_isec);
uiItemR(layout, ptr, "use_intersection_filter", 0, IFACE_("Filter Intersection"), ICON_NONE);
}
static void intersection_panel_draw(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
const bool use_isec = RNA_boolean_get(ptr, "use_intersection");
const bool use_isec_filter = RNA_boolean_get(ptr, "use_intersection_filter");
uiLayoutSetEnabled(layout, !is_baked);
uiLayoutSetPropSep(layout, true);
uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_intersection"));
uiLayoutSetActive(layout, use_isec && use_isec_filter);
uiLayout *row = uiLayoutRow(layout, true);
uiLayoutSetPropDecorate(row, false);
@@ -489,6 +525,7 @@ static void intersection_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayout *col = uiLayoutColumn(layout, true);
uiItemR(col, ptr, "use_intersection_match", 0, IFACE_("Match All Masks"), ICON_NONE);
}
static void face_mark_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
@@ -496,16 +533,13 @@ static void face_mark_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
const bool use_cache = RNA_boolean_get(ptr, "use_cache");
const bool is_first = BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data);
const bool use_cache = RNA_boolean_get(ptr, "use_cached_result");
if (!use_cache || is_first) {
uiLayoutSetEnabled(layout, !is_baked);
uiItemR(layout, ptr, "use_face_mark", 0, IFACE_("Face Mark Filtering"), ICON_NONE);
}
else {
uiItemL(layout, IFACE_("Face Mark Filtering"), ICON_NONE);
}
uiLayoutSetEnabled(
layout,
!is_baked && (!use_cache || BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data)));
uiItemR(layout, ptr, "use_face_mark", 0, IFACE_("Filter Face Mark"), ICON_NONE);
}
static void face_mark_panel_draw(const bContext *UNUSED(C), Panel *panel)
@@ -516,15 +550,11 @@ static void face_mark_panel_draw(const bContext *UNUSED(C), Panel *panel)
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
const bool use_mark = RNA_boolean_get(ptr, "use_face_mark");
const bool use_cache = RNA_boolean_get(ptr, "use_cache");
const bool is_first = BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data);
const bool use_cache = RNA_boolean_get(ptr, "use_cached_result");
uiLayoutSetEnabled(layout, !is_baked);
if (use_cache && !is_first) {
uiItemL(layout, "Cached from the first line art modifier.", ICON_INFO);
return;
}
uiLayoutSetEnabled(
layout,
!is_baked && (!use_cache || BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data)));
uiLayoutSetPropSep(layout, true);
@@ -542,7 +572,7 @@ static void chaining_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayout *layout = panel->layout;
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
const bool use_cache = RNA_boolean_get(ptr, "use_cache");
const bool use_cache = RNA_boolean_get(ptr, "use_cached_result");
const bool is_first = BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data);
const bool is_geom = RNA_boolean_get(ptr, "use_geometry_space_chain");
@@ -568,6 +598,7 @@ static void chaining_panel_draw(const bContext *UNUSED(C), Panel *panel)
is_geom ? IFACE_("Geometry Threshold") : NULL,
ICON_NONE);
uiItemR(layout, ptr, "smooth_tolerance", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(layout, ptr, "split_angle", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
}
@@ -583,7 +614,9 @@ static void vgroup_panel_draw(const bContext *UNUSED(C), Panel *panel)
const bool is_first = BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data);
uiLayoutSetPropSep(layout, true);
uiLayoutSetEnabled(layout, !is_baked);
uiLayoutSetEnabled(
layout,
!is_baked && (!use_cache || BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data)));
if (use_cache && !is_first) {
uiItemL(layout, "Cached from the first line art modifier.", ICON_INFO);
@@ -634,6 +667,28 @@ static void baking_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemO(col, NULL, ICON_NONE, "OBJECT_OT_lineart_clear_all");
}
static void composition_panel_draw(const bContext *UNUSED(C), Panel *panel)
{
PointerRNA ob_ptr;
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
uiLayout *layout = panel->layout;
const bool show_in_front = RNA_boolean_get(&ob_ptr, "show_in_front");
uiLayoutSetPropSep(layout, true);
if (show_in_front) {
uiItemL(layout, IFACE_("Object is shown in front"), ICON_ERROR);
}
uiLayout *col = uiLayoutColumn(layout, false);
uiLayoutSetActive(col, !show_in_front);
uiItemR(col, ptr, "stroke_offset", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(col, ptr, "offset_towards_custom_camera", 0, IFACE_("Towards Custom Camera"), ICON_NONE);
}
static void panelRegister(ARegionType *region_type)
{
PanelType *panel_type = gpencil_modifier_panel_register(
@@ -653,6 +708,14 @@ static void panelRegister(ARegionType *region_type)
material_mask_panel_draw_header,
material_mask_panel_draw,
occlusion_panel);
gpencil_modifier_subpanel_register(region_type,
"intersection",
"",
intersection_panel_draw_header,
intersection_panel_draw,
panel_type);
gpencil_modifier_subpanel_register(
region_type, "face_mark", "", face_mark_panel_draw_header, face_mark_panel_draw, panel_type);
gpencil_modifier_subpanel_register(
region_type, "intersection", "Intersection", NULL, intersection_panel_draw, panel_type);
gpencil_modifier_subpanel_register(
@@ -661,6 +724,8 @@ static void panelRegister(ARegionType *region_type)
region_type, "chaining", "Chaining", NULL, chaining_panel_draw, panel_type);
gpencil_modifier_subpanel_register(
region_type, "vgroup", "Vertex Weight Transfer", NULL, vgroup_panel_draw, panel_type);
gpencil_modifier_subpanel_register(
region_type, "composition", "Composition", NULL, composition_panel_draw, panel_type);
gpencil_modifier_subpanel_register(
region_type, "baking", "Baking", NULL, baking_panel_draw, panel_type);
}

View File

@@ -216,6 +216,14 @@ enum eLineArtTileRecursiveLimit {
#define LRT_TILE_SPLITTING_TRIANGLE_LIMIT 100
#define LRT_TILE_EDGE_COUNT_INITIAL 32
struct BVHTree;
typedef struct LineartTriangleBufferIndexer {
int start_index; /* The first one. */
int end_index; /* Not include the last one. */
LineartElementLinkNode *eln;
} LineartTriangleBufferIndexer;
typedef struct LineartRenderBuffer {
struct LineartRenderBuffer *prev, *next;
@@ -228,17 +236,26 @@ typedef struct LineartRenderBuffer {
double view_projection[4][4];
double view[4][4];
float overscan;
struct LineartBoundingArea *initial_bounding_areas;
unsigned int bounding_area_count;
/* When splitting bounding areas, if there's an ortho camera placed at a straight angle, there
* will be a lot of triangles aligned in line which can not be separated by continue subdividing
* the tile. So we set a strict limit when using ortho camera. See eLineArtTileRecursiveLimit. */
struct BVHTree *bvh_main;
int bvh_face_count;
struct LineartTriangleBufferIndexer *bvh_triangle_indexer;
int bvh_inderxer_count;
/* When splitting bounding areas, if there's an ortho camera placed at a straight angle,
* there will be a lot of triangles aligned in line which can not be separated by continue
* subdividing the tile. So we set a strict limit when using ortho camera. See
* eLineArtTileRecursiveLimit. */
int tile_recursive_level;
ListBase vertex_buffer_pointers;
ListBase line_buffer_pointers;
ListBase triangle_buffer_pointers;
LineartTriangle **triangle_lookup;
/** This one's memory is not from main pool and is free()ed after culling stage. */
ListBase triangle_adjacent_pointers;
@@ -288,6 +305,7 @@ typedef struct LineartRenderBuffer {
bool use_edge_marks;
bool use_intersections;
bool use_loose;
bool use_light_contour;
bool fuzzy_intersections;
bool fuzzy_everything;
bool allow_boundaries;
@@ -306,11 +324,17 @@ typedef struct LineartRenderBuffer {
bool cam_is_persp;
float cam_obmat[4][4];
double camera_pos[3];
double active_camera_pos[3]; /* Stroke offset calculation may use active or selected camera. */
double near_clip, far_clip;
float shift_x, shift_y;
float crease_threshold;
float chaining_image_threshold;
float angle_splitting_threshold;
float chain_smooth_tolerance;
/* Could be direction or position, depends on light_is_sun. */
double light_vector[3];
bool light_is_sun;
/* FIXME(Yiming): Temporary solution for speeding up calculation by not including lines that
* are not in the selected source. This will not be needed after we have a proper scene-wise
@@ -320,6 +344,8 @@ typedef struct LineartRenderBuffer {
struct Collection *_source_collection;
struct Object *_source_object;
int debug_triangle_isec_test_count;
} LineartRenderBuffer;
typedef struct LineartCache {
@@ -368,6 +394,7 @@ typedef struct LineartRenderTaskInfo {
ListBase material;
ListBase edge_mark;
ListBase floating;
ListBase light_contour;
} LineartRenderTaskInfo;
@@ -393,6 +420,7 @@ typedef struct LineartObjectInfo {
ListBase material;
ListBase edge_mark;
ListBase floating;
ListBase light_contour;
} LineartObjectInfo;
@@ -402,7 +430,7 @@ typedef struct LineartObjectLoadTaskInfo {
/* LinkNode styled list */
LineartObjectInfo *pending;
/* Used to spread the load across several threads. This can not overflow. */
long unsigned int total_faces;
uint64_t total_faces;
} LineartObjectLoadTaskInfo;
/**
@@ -586,13 +614,18 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb);
void MOD_lineart_chain_connect(LineartRenderBuffer *rb);
void MOD_lineart_chain_discard_short(LineartRenderBuffer *rb, const float threshold);
void MOD_lineart_chain_split_angle(LineartRenderBuffer *rb, float angle_threshold_rad);
void MOD_lineart_smooth_chains(LineartRenderBuffer *rb, float tolerance);
void MOD_lineart_chain_offset_towards_camera(LineartRenderBuffer *rb,
float dist,
bool use_custom_camera);
int MOD_lineart_chain_count(const LineartEdgeChain *ec);
void MOD_lineart_chain_clear_picked_flag(LineartCache *lc);
bool MOD_lineart_compute_feature_lines(struct Depsgraph *depsgraph,
struct LineartGpencilModifierData *lmd,
LineartCache **cached_result);
struct LineartCache **cached_result,
bool enable_stroke_offset);
struct Scene;

View File

@@ -520,7 +520,7 @@ static void lineart_bounding_area_link_point_recursive(LineartRenderBuffer *rb,
{
if (root->child == NULL) {
LineartChainRegisterEntry *cre = lineart_list_append_pointer_pool_sized(
&root->linked_chains, &rb->render_data_pool, ec, sizeof(LineartChainRegisterEntry));
&root->linked_chains, rb->chain_data_pool, ec, sizeof(LineartChainRegisterEntry));
cre->eci = eci;
@@ -924,6 +924,34 @@ void MOD_lineart_chain_clear_picked_flag(LineartCache *lc)
}
}
void MOD_lineart_smooth_chains(LineartRenderBuffer *rb, float tolerance)
{
LISTBASE_FOREACH (LineartEdgeChain *, ec, &rb->chains) {
LineartEdgeChainItem *next_eci;
for (LineartEdgeChainItem *eci = ec->chain.first; eci; eci = next_eci) {
next_eci = eci->next;
LineartEdgeChainItem *eci2, *eci3, *eci4;
/* Not enough point to do simplify. */
if ((!(eci2 = eci->next)) || (!(eci3 = eci2->next))) {
continue;
}
/* No need to care for different line types/occlusion and so on, because at this stage they
* are all the same within a chain. */
/* If p3 is within the p1-p2 segment of a width of "tolerance" */
if (dist_to_line_segment_v2(eci3->pos, eci->pos, eci2->pos) < tolerance) {
/* And if p4 is on the extension of p1-p2 , we remove p3. */
if ((eci4 = eci3->next) && (dist_to_line_v2(eci4->pos, eci->pos, eci2->pos) < tolerance)) {
BLI_remlink(&ec->chain, eci3);
next_eci = eci;
}
}
}
}
}
/**
* This should always be the last stage!, see the end of
* #MOD_lineart_chain_split_for_fixed_occlusion().
@@ -980,3 +1008,26 @@ void MOD_lineart_chain_split_angle(LineartRenderBuffer *rb, float angle_threshol
}
}
}
void MOD_lineart_chain_offset_towards_camera(LineartRenderBuffer *rb,
float dist,
bool use_custom_camera)
{
float dir[3];
float cam[3];
if (use_custom_camera) {
copy_v3fl_v3db(cam, rb->camera_pos);
}
else {
copy_v3fl_v3db(cam, rb->active_camera_pos);
}
LISTBASE_FOREACH (LineartEdgeChain *, ec, &rb->chains) {
LISTBASE_FOREACH (LineartEdgeChainItem *, eci, &ec->chain) {
sub_v3_v3v3(dir, cam, eci->gpos);
normalize_v3_length(dir, dist);
add_v3_v3(eci->gpos, dir);
}
}
}

View File

@@ -24,6 +24,7 @@
#include "MOD_gpencil_lineart.h"
#include "MOD_lineart.h"
#include "BLI_kdopbvh.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
@@ -50,6 +51,7 @@
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_light_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -63,6 +65,10 @@
#include "lineart_intern.h"
//#define LINEART_WITH_BVH
#define LINEART_WITH_BVH_THREAD
#define LINEART_BVH_OWN_ISEC
static LineartBoundingArea *lineart_edge_first_bounding_area(LineartRenderBuffer *rb,
LineartEdge *e);
@@ -340,7 +346,7 @@ static void lineart_bounding_area_triangle_add(LineartRenderBuffer *rb,
static void lineart_bounding_area_line_add(LineartRenderBuffer *rb,
LineartBoundingArea *ba,
LineartEdge *e)
LineartEdge *edge)
{
if (ba->line_count >= ba->max_line_count) {
LineartEdge **new_array = lineart_mem_acquire(&rb->render_data_pool,
@@ -349,7 +355,7 @@ static void lineart_bounding_area_line_add(LineartRenderBuffer *rb,
ba->max_line_count *= 2;
ba->linked_lines = new_array;
}
ba->linked_lines[ba->line_count] = e;
ba->linked_lines[ba->line_count] = edge;
ba->line_count++;
}
@@ -787,7 +793,7 @@ static void lineart_triangle_cull_single(LineartRenderBuffer *rb,
int e_count = *r_e_count;
int t_count = *r_t_count;
int v1_obi, v2_obi;
char new_flag = 0;
uint16_t new_flag = 0;
LineartEdge *new_e, *e, *old_e;
LineartEdgeSegment *es;
@@ -1319,6 +1325,8 @@ static void lineart_main_cull_triangles(LineartRenderBuffer *rb, bool clip_far)
/* Then go through all the other triangles. */
LISTBASE_FOREACH (LineartElementLinkNode *, eln, &rb->triangle_buffer_pointers) {
rb->bvh_face_count += eln->element_count;
rb->bvh_inderxer_count++;
if (eln->flags & LRT_ELEMENT_IS_ADDITIONAL) {
continue;
}
@@ -1621,31 +1629,32 @@ static void lineart_finalize_object_edge_list(LineartRenderBuffer *rb, LineartOb
}
static void lineart_triangle_adjacent_assign(LineartTriangle *tri,
LineartTriangleAdjacent *ta,
LineartTriangleAdjacent *rta,
LineartEdge *e)
{
if (lineart_edge_match(tri, e, 0, 1)) {
ta->e[0] = e;
rta->e[0] = e;
}
else if (lineart_edge_match(tri, e, 1, 2)) {
ta->e[1] = e;
rta->e[1] = e;
}
else if (lineart_edge_match(tri, e, 2, 0)) {
ta->e[2] = e;
rta->e[2] = e;
}
}
static int lineart_edge_type_duplication_count(char eflag)
static int lineart_edge_type_duplication_count(uint8_t eflag)
{
int count = 0;
/* See eLineartEdgeFlag for details. */
for (int i = 0; i < 6; i++) {
for (int i = 0; i < LRT_EDGE_FLAG_TYPE_MAX_BITS; i++) {
if (eflag & (1 << i)) {
count++;
}
}
return count;
}
static void lineart_geometry_object_load(LineartObjectInfo *obi, LineartRenderBuffer *rb)
{
BMesh *bm;
@@ -1781,8 +1790,8 @@ static void lineart_geometry_object_load(LineartObjectInfo *obi, LineartRenderBu
orv[i].index = i;
}
/* Register a global index increment. See #lineart_triangle_share_edge() and
* #lineart_main_load_geometries() for detailed. It's okay that global_vindex might eventually
* overflow, in such large scene it's virtually impossible for two vertex of the same numeric
* #lineart_main_load_geometries() for details. It's okay that global_vindex might eventually
* overflow, in such large scene it's virtually impossible for two vertices of the same numeric
* index to come close together. */
obi->global_i_offset = bm->totvert;
@@ -1851,7 +1860,8 @@ static void lineart_geometry_object_load(LineartObjectInfo *obi, LineartRenderBu
/* Here we just use bm's flag for when loading actual lines, then we don't need to call
* lineart_identify_feature_line() again, e->head.hflag deleted after loading anyway. Always
* set the flag, so hflag stays 0 for lines that are not feature lines. */
e->head.hflag = eflag;
e->head.hflag = 0;
e->head.hflag |= eflag;
}
o_la_e = lineart_mem_acquire_thread(&rb->render_data_pool, sizeof(LineartEdge) * allocate_la_e);
@@ -2003,7 +2013,7 @@ static void lineart_geometry_load_assign_thread(LineartObjectLoadTaskInfo *olti_
int this_face_count)
{
LineartObjectLoadTaskInfo *use_olti = olti_list;
long unsigned int min_face = use_olti->total_faces;
uint64_t min_face = use_olti->total_faces;
for (int i = 0; i < thread_count; i++) {
if (olti_list[i].total_faces < min_face) {
min_face = olti_list[i].total_faces;
@@ -2064,11 +2074,6 @@ static void lineart_main_load_geometries(
int fit = BKE_camera_sensor_fit(cam->sensor_fit, rb->w, rb->h);
double asp = ((double)rb->w / (double)rb->h);
double t_start;
if (G.debug_value == 4000) {
t_start = PIL_check_seconds_timer();
}
int bound_box_discard_count = 0;
if (cam->type == CAM_PERSP) {
@@ -2078,7 +2083,7 @@ static void lineart_main_load_geometries(
if (fit == CAMERA_SENSOR_FIT_HOR && asp < 1) {
sensor /= asp;
}
double fov = focallength_to_fov(cam->lens, sensor);
double fov = focallength_to_fov(cam->lens / (1 + rb->overscan), sensor);
lineart_matrix_perspective_44d(proj, fov, asp, cam->clip_start, cam->clip_end);
}
else if (cam->type == CAM_ORTHO) {
@@ -2086,6 +2091,12 @@ static void lineart_main_load_geometries(
lineart_matrix_ortho_44d(proj, -w, w, -w / asp, w / asp, cam->clip_start, cam->clip_end);
}
double t_start;
if (G.debug_value == 4000) {
t_start = PIL_check_seconds_timer();
}
invert_m4_m4(inv, rb->cam_obmat);
mul_m4db_m4db_m4fl_uniq(result, proj, inv);
copy_m4_m4_db(proj, result);
@@ -2107,7 +2118,8 @@ static void lineart_main_load_geometries(
int thread_count = rb->thread_count;
/* This memory is in render buffer memory pool. so we don't need to free those after loading. */
/* This memory is in render buffer memory pool. So we don't need to free those after loading.
*/
LineartObjectLoadTaskInfo *olti = lineart_mem_acquire(
&rb->render_data_pool, sizeof(LineartObjectLoadTaskInfo) * thread_count);
@@ -2196,6 +2208,23 @@ static void lineart_main_load_geometries(
}
}
int tri_count = 0;
int global_tri_i = 0;
LineartTriangle *tri;
LISTBASE_FOREACH (LineartElementLinkNode *, eln, &rb->triangle_buffer_pointers) {
tri_count += eln->element_count;
}
rb->triangle_lookup = lineart_mem_acquire(&rb->render_data_pool, sizeof(void *) * tri_count);
LISTBASE_FOREACH (LineartElementLinkNode *, eln, &rb->triangle_buffer_pointers) {
for (int i = 0; i < eln->element_count; i++) {
tri = (void *)(((uchar *)eln->pointer) + rb->triangle_size * i);
rb->triangle_lookup[global_tri_i] = tri;
global_tri_i++;
}
}
if (G.debug_value == 4000) {
double t_elapsed = PIL_check_seconds_timer() - t_start;
printf("Line art loading time: %lf\n", t_elapsed);
@@ -2898,6 +2927,8 @@ static void lineart_triangle_intersect_in_bounding_area(LineartRenderBuffer *rb,
continue;
}
rb->debug_triangle_isec_test_count++;
/* If we do need to compute intersection, then finally do it. */
lineart_triangle_intersect(rb, tri, testing_triangle);
}
@@ -2968,7 +2999,7 @@ void MOD_lineart_destroy_render_data(LineartGpencilModifierData *lmd)
}
}
static LineartCache *lineart_init_cache()
static LineartCache *lineart_init_cache(void)
{
LineartCache *lc = MEM_callocN(sizeof(LineartCache), "Lineart Cache");
return lc;
@@ -2986,18 +3017,20 @@ void MOD_lineart_clear_cache(struct LineartCache **lc)
static LineartRenderBuffer *lineart_create_render_buffer(Scene *scene,
LineartGpencilModifierData *lmd,
Object *camera,
Object *active_camera,
LineartCache *lc)
{
LineartRenderBuffer *rb = MEM_callocN(sizeof(LineartRenderBuffer), "Line Art render buffer");
lmd->cache = lc;
lmd->render_buffer_ptr = rb;
lc->rb_edge_types = lmd->edge_types_override;
lc->rb_edge_types = LRT_EDGE_FLAG_ALL_TYPE;
if (!scene || !scene->camera || !lc) {
if (!scene || !camera || !lc) {
return NULL;
}
Camera *c = scene->camera->data;
Camera *c = camera->data;
double clipping_offset = 0;
if (lmd->calculation_flags & LRT_ALLOW_CLIPPING_BOUNDARIES) {
@@ -3005,8 +3038,11 @@ static LineartRenderBuffer *lineart_create_render_buffer(Scene *scene,
clipping_offset = 0.0001;
}
copy_v3db_v3fl(rb->camera_pos, scene->camera->obmat[3]);
copy_m4_m4(rb->cam_obmat, scene->camera->obmat);
copy_v3db_v3fl(rb->camera_pos, camera->obmat[3]);
if (active_camera) {
copy_v3db_v3fl(rb->active_camera_pos, active_camera->obmat[3]);
}
copy_m4_m4(rb->cam_obmat, camera->obmat);
rb->cam_is_persp = (c->type == CAM_PERSP);
rb->near_clip = c->clip_start + clipping_offset;
rb->far_clip = c->clip_end - clipping_offset;
@@ -3025,9 +3061,27 @@ static LineartRenderBuffer *lineart_create_render_buffer(Scene *scene,
rb->shift_x = fit == CAMERA_SENSOR_FIT_HOR ? c->shiftx : c->shiftx / asp;
rb->shift_y = fit == CAMERA_SENSOR_FIT_VERT ? c->shifty : c->shifty * asp;
rb->overscan = lmd->overscan;
rb->shift_x /= (1 + rb->overscan);
rb->shift_y /= (1 + rb->overscan);
if (lmd->light_contour_object) {
Object *lo = lmd->light_contour_object;
if (lo->type == OB_LAMP && ((Light *)lo->data)->type == LA_SUN) {
rb->light_is_sun = true;
float vec[3] = {0.0f, 0.0f, 1.0f};
mul_mat3_m4_v3(lo->obmat, vec);
copy_v3db_v3fl(rb->light_vector, vec);
}
else {
copy_v3db_v3fl(rb->light_vector, lmd->light_contour_object->obmat[3]);
}
}
rb->crease_threshold = cos(M_PI - lmd->crease_threshold);
rb->angle_splitting_threshold = lmd->angle_splitting_threshold;
rb->chaining_image_threshold = lmd->chaining_image_threshold;
rb->angle_splitting_threshold = lmd->angle_splitting_threshold;
rb->fuzzy_intersections = (lmd->calculation_flags & LRT_INTERSECTION_AS_CONTOUR) != 0;
rb->fuzzy_everything = (lmd->calculation_flags & LRT_EVERYTHING_AS_CONTOUR) != 0;
@@ -3450,6 +3504,16 @@ static bool lineart_bounding_area_triangle_intersect(LineartRenderBuffer *fb,
return false;
}
static void lineart_triangle_bbox(LineartTriangle *tri, float *result)
{
result[0] = MIN3(tri->v[0]->gloc[0], tri->v[1]->gloc[0], tri->v[2]->gloc[0]);
result[1] = MIN3(tri->v[0]->gloc[1], tri->v[1]->gloc[1], tri->v[2]->gloc[1]);
result[2] = MIN3(tri->v[0]->gloc[2], tri->v[1]->gloc[2], tri->v[2]->gloc[2]);
result[3] = MAX3(tri->v[0]->gloc[0], tri->v[1]->gloc[0], tri->v[2]->gloc[0]);
result[4] = MAX3(tri->v[0]->gloc[1], tri->v[1]->gloc[1], tri->v[2]->gloc[1]);
result[5] = MAX3(tri->v[0]->gloc[2], tri->v[1]->gloc[2], tri->v[2]->gloc[2]);
}
/**
* 1) Link triangles with bounding areas for later occlusion test.
* 2) Test triangles with existing(added previously) triangles for intersection lines.
@@ -3475,9 +3539,11 @@ static void lineart_bounding_area_link_triangle(LineartRenderBuffer *rb,
recursive_level < rb->tile_recursive_level) {
lineart_bounding_area_split(rb, root_ba, recursive_level);
}
#ifndef LINEART_WITH_BVH
if (recursive && do_intersection && rb->use_intersections) {
lineart_triangle_intersect_in_bounding_area(rb, tri, root_ba);
}
#endif
}
else {
LineartBoundingArea *ba = root_ba->child;
@@ -3744,15 +3810,41 @@ static void lineart_main_add_triangles(LineartRenderBuffer *rb)
int i, lim;
int x1, x2, y1, y2;
int r, co;
int i_indexer = 0, i_triangle = 0;
#ifdef LINEART_WITH_BVH
if (rb->use_intersections) {
rb->bvh_main = BLI_bvhtree_new(rb->bvh_face_count, 0, 8, 6);
rb->bvh_triangle_indexer = lineart_mem_acquire(
&rb->render_data_pool, sizeof(LineartTriangleBufferIndexer) * rb->bvh_inderxer_count);
}
#endif
LISTBASE_FOREACH (LineartElementLinkNode *, eln, &rb->triangle_buffer_pointers) {
tri = eln->pointer;
lim = eln->element_count;
#ifdef LINEART_WITH_BVH
if (rb->use_intersections) {
rb->bvh_triangle_indexer[i_indexer].eln = eln;
rb->bvh_triangle_indexer[i_indexer].start_index = i_triangle;
rb->bvh_triangle_indexer[i_indexer].end_index = i_triangle + lim;
}
i_indexer++;
#endif
for (i = 0; i < lim; i++) {
if ((tri->flags & LRT_CULL_USED) || (tri->flags & LRT_CULL_DISCARD)) {
tri = (void *)(((uchar *)tri) + rb->triangle_size);
continue;
}
#ifdef LINEART_WITH_BVH
float bounding[6];
lineart_triangle_bbox(tri, bounding);
if (!(tri->flags & LRT_TRIANGLE_NO_INTERSECTION)) {
BLI_bvhtree_insert(rb->bvh_main, i_triangle + i, bounding, 2);
}
#endif
if (lineart_get_triangle_bounding_areas(rb, tri, &y1, &y2, &x1, &x2)) {
for (co = x1; co <= x2; co++) {
for (r = y1; r <= y2; r++) {
@@ -3768,9 +3860,376 @@ static void lineart_main_add_triangles(LineartRenderBuffer *rb)
} /* Else throw away. */
tri = (void *)(((uchar *)tri) + rb->triangle_size);
}
i_triangle += lim;
}
}
static LineartTriangle *lineart_get_triangle_from_index(LineartRenderBuffer *rb, int index)
{
return rb->triangle_lookup[index];
int left = 0;
int right = rb->bvh_inderxer_count - 1;
while (left <= right) {
int mid = (left + right) / 2;
LineartTriangleBufferIndexer *tbi = &rb->bvh_triangle_indexer[mid];
if (tbi->end_index <= index) {
left = mid + 1;
}
else if (tbi->start_index > index) {
right = mid - 1;
}
else {
return (LineartTriangle *)(((uint8_t *)tbi->eln->pointer) +
(rb->triangle_size * (index - tbi->start_index)));
}
}
return NULL;
}
static bool lineart_triangle_2v_intersection_math(LineartVert *v1,
LineartVert *v2,
LineartTriangle *tri,
LineartTriangle *t2,
float *last,
float *rv)
{
double Lv[3];
double Rv[3];
double dot_l, dot_r;
LineartVert *result;
double gloc[3];
LineartVert *l = v1, *r = v2;
sub_v3_v3v3_db(Lv, l->gloc, t2->v[0]->gloc);
sub_v3_v3v3_db(Rv, r->gloc, t2->v[0]->gloc);
dot_l = dot_v3v3_db(Lv, t2->gn);
dot_r = dot_v3v3_db(Rv, t2->gn);
if (dot_l * dot_r > 0 || (!dot_l && !dot_r)) {
return false;
}
dot_l = fabs(dot_l);
dot_r = fabs(dot_r);
interp_v3_v3v3_db(gloc, l->gloc, r->gloc, dot_l / (dot_l + dot_r));
/* Due to precision issue, we might end up with the same point as the one we already detected.
*/
if (last && LRT_DOUBLE_CLOSE_ENOUGH(last[0], gloc[0]) &&
LRT_DOUBLE_CLOSE_ENOUGH(last[1], gloc[1]) && LRT_DOUBLE_CLOSE_ENOUGH(last[2], gloc[2])) {
return false;
}
if (!(lineart_point_inside_triangle3d(gloc, t2->v[0]->gloc, t2->v[1]->gloc, t2->v[2]->gloc))) {
return false;
}
copy_v3fl_v3db(rv, gloc);
return true;
}
static bool lineart_triangle_intersect_math(LineartTriangle *tri,
LineartTriangle *t2,
float *v1,
float *v2)
{
float *next = v1, *last = NULL;
LineartVert *sv1, *sv2;
double cl[3];
LineartVert *share = lineart_triangle_share_point(t2, tri);
if (share) {
/* If triangles have sharing points like `abc` and `acd`, then we only need to detect `bc`
* against `acd` or `cd` against `abc`. */
LineartVert *new_share;
lineart_triangle_get_other_verts(tri, share, &sv1, &sv2);
copy_v3fl_v3db(v1, share->gloc);
if (!lineart_triangle_2v_intersection_math(sv1, sv2, tri, t2, 0, v2)) {
lineart_triangle_get_other_verts(t2, share, &sv1, &sv2);
if (lineart_triangle_2v_intersection_math(sv1, sv2, t2, tri, 0, v2)) {
return true;
}
}
}
else {
/* If not sharing any points, then we need to try all the possibilities. */
if (lineart_triangle_2v_intersection_math(tri->v[0], tri->v[1], tri, t2, 0, v1)) {
next = v2;
last = v1;
}
if (lineart_triangle_2v_intersection_math(tri->v[1], tri->v[2], tri, t2, last, next)) {
if (last) {
return true;
}
next = v2;
last = v1;
}
if (lineart_triangle_2v_intersection_math(tri->v[2], tri->v[0], tri, t2, last, next)) {
if (last) {
return true;
}
next = v2;
last = v1;
}
if (lineart_triangle_2v_intersection_math(t2->v[0], t2->v[1], t2, tri, last, next)) {
if (last) {
return true;
}
next = v2;
last = v1;
}
if (lineart_triangle_2v_intersection_math(t2->v[1], t2->v[2], t2, tri, last, next)) {
if (last) {
return true;
}
next = v2;
last = v1;
}
if (lineart_triangle_2v_intersection_math(t2->v[2], t2->v[0], t2, tri, last, next)) {
if (last) {
return true;
}
next = v2;
last = v1;
}
}
return false;
}
typedef struct LineartIsecSingle {
float v1[3], v2[3];
LineartTriangle *tri1, *tri2;
} LineartIsecSingle;
typedef struct LineartIsecThread {
LineartIsecSingle *array;
int current;
int max;
int count_test;
} LineartIsecThread;
typedef struct LineartIsecData {
LineartRenderBuffer *rb;
LineartIsecThread *threads;
int thread_count;
} LineartIsecData;
static void lineart_add_isec_thread(LineartIsecData *data,
const int thread,
const float *v1,
const float *v2,
LineartTriangle *tri1,
LineartTriangle *tri2)
{
LineartIsecThread *th = &data->threads[thread];
if (th->current == th->max) {
LineartIsecSingle *new_array = MEM_mallocN(sizeof(LineartIsecSingle) * th->max * 2,
"LineartIsecSingle");
memcpy(new_array, th->array, sizeof(LineartIsecSingle) * th->max);
th->max *= 2;
MEM_freeN(th->array);
th->array = new_array;
}
LineartIsecSingle *is = &th->array[th->current];
copy_v3_v3(is->v1, v1);
copy_v3_v3(is->v2, v2);
is->tri1 = tri1;
is->tri2 = tri2;
th->current++;
}
static void lineart_init_isec_thread(LineartIsecData *d, LineartRenderBuffer *rb, int thread_count)
{
d->threads = MEM_callocN(sizeof(LineartIsecThread) * thread_count, "LineartIsecThread arr");
d->rb = rb;
d->thread_count = thread_count;
for (int i = 0; i < thread_count; i++) {
LineartIsecThread *it = &d->threads[i];
it->array = MEM_mallocN(sizeof(LineartIsecSingle) * 100, "LineartIsecSingle arr");
it->max = 100;
it->current = 0;
}
}
static void lineart_destroy_isec_thread(LineartIsecData *d)
{
for (int i = 0; i < d->thread_count; i++) {
LineartIsecThread *it = &d->threads[i];
MEM_freeN(it->array);
}
MEM_freeN(d->threads);
}
static bool lineart_bvh_isec_callback(void *userdata, int index_a, int index_b, int thread)
{
LineartIsecData *d = (LineartIsecData *)userdata;
LineartRenderBuffer *rb = d->rb;
LineartTriangle *tri1 = lineart_get_triangle_from_index(rb, index_a);
LineartTriangle *tri2 = lineart_get_triangle_from_index(rb, index_b);
if (!tri1 || !tri2) {
return false;
}
if ((tri2->flags & LRT_TRIANGLE_INTERSECTION_ONLY) &&
(tri1->flags & LRT_TRIANGLE_INTERSECTION_ONLY)) {
return false;
}
/* Bounding box not overlapping or triangles share edges, not potential of intersecting. */
if (lineart_triangle_share_edge(tri1, tri2)) {
return false;
}
d->threads[thread].count_test++;
#ifdef LINEART_BVH_OWN_ISEC
float e1[3], e2[3];
if (lineart_triangle_intersect_math(tri1, tri2, e1, e2)) {
lineart_add_isec_thread(d, thread, e1, e2, tri1, tri2);
}
#else
float t_a0[3], t_a1[3], t_a2[3], t_b0[3], t_b1[3], t_b2[3], e1[3], e2[3];
copy_v3fl_v3db(t_a0, tri1->v[0]->gloc);
copy_v3fl_v3db(t_a1, tri1->v[1]->gloc);
copy_v3fl_v3db(t_a2, tri1->v[2]->gloc);
copy_v3fl_v3db(t_b0, tri2->v[0]->gloc);
copy_v3fl_v3db(t_b1, tri2->v[1]->gloc);
copy_v3fl_v3db(t_b2, tri2->v[2]->gloc);
if (isect_tri_tri_v3(t_a0, t_a1, t_a2, t_b0, t_b1, t_b2, e1, e2)) {
lineart_add_isec_thread(d, thread, e1, e2, tri1, tri2);
};
#endif
return true;
}
static void lineart_create_edges_from_isec_data(LineartIsecData *d)
{
LineartRenderBuffer *rb = d->rb;
double ZMax = rb->far_clip;
double ZMin = rb->near_clip;
for (int i = 0; i < d->thread_count; i++) {
LineartIsecThread *th = &d->threads[i];
if (!th->current) {
continue;
}
/* We don't care about removing duplicated vert in this method, chaning can handle that, and it
* saves us from using locks and look up tables. */
LineartVert *v = lineart_mem_acquire(&rb->render_data_pool,
sizeof(LineartVert) * th->current * 2);
LineartEdge *e = lineart_mem_acquire(&rb->render_data_pool, sizeof(LineartEdge) * th->current);
LineartEdgeSegment *es = lineart_mem_acquire(&rb->render_data_pool,
sizeof(LineartEdgeSegment) * th->current);
for (int j = 0; j < th->current; j++) {
LineartVert *v1 = v;
LineartVert *v2 = v + 1;
LineartIsecSingle *is = &th->array[j];
copy_v3db_v3fl(v1->gloc, is->v1);
copy_v3db_v3fl(v2->gloc, is->v2);
/* The intersection line has been generated only in geometry space, so we need to transform
* them as well. */
mul_v4_m4v3_db(v1->fbcoord, rb->view_projection, v1->gloc);
mul_v4_m4v3_db(v2->fbcoord, rb->view_projection, v2->gloc);
mul_v3db_db(v1->fbcoord, (1 / v1->fbcoord[3]));
mul_v3db_db(v2->fbcoord, (1 / v2->fbcoord[3]));
v1->fbcoord[0] -= rb->shift_x * 2;
v1->fbcoord[1] -= rb->shift_y * 2;
v2->fbcoord[0] -= rb->shift_x * 2;
v2->fbcoord[1] -= rb->shift_y * 2;
/* This z transformation is not the same as the rest of the part, because the data don't go
* through normal perspective division calls in the pipeline, but this way the 3D result and
* occlusion on the generated line is correct, and we don't really use 2D for viewport stroke
* generation anyway. */
v1->fbcoord[2] = ZMin * ZMax / (ZMax - fabs(v1->fbcoord[2]) * (ZMax - ZMin));
v2->fbcoord[2] = ZMin * ZMax / (ZMax - fabs(v2->fbcoord[2]) * (ZMax - ZMin));
e->v1 = v1;
e->v2 = v2;
e->t1 = is->tri1;
e->t2 = is->tri2;
e->flags = LRT_EDGE_FLAG_INTERSECTION;
e->intersection_mask = (is->tri1->intersection_mask | is->tri2->intersection_mask);
BLI_addtail(&e->segments, es);
lineart_prepend_edge_direct(&rb->intersection.first, e);
v += 2;
e++;
es++;
}
}
}
static void lineart_do_intersections(LineartRenderBuffer *rb)
{
BLI_bvhtree_balance(rb->bvh_main);
unsigned int overlap_tot;
#ifdef LINEART_WITH_BVH_THREAD
LineartIsecData d;
lineart_init_isec_thread(&d, rb, rb->thread_count);
BVHTreeOverlap *overlap = BLI_bvhtree_overlap(
rb->bvh_main, rb->bvh_main, &overlap_tot, lineart_bvh_isec_callback, &d);
if (G.debug_value == 4000) {
int total_test_count = 0;
for (int i = 0; i < rb->thread_count; i++) {
total_test_count += d.threads[i].count_test;
}
printf("BVH has done %d pairs.\n", total_test_count);
}
lineart_create_edges_from_isec_data(&d);
lineart_destroy_isec_thread(&d);
#else
BVHTreeOverlap *overlap = BLI_bvhtree_overlap(
rb->bvh_main, rb->bvh_main, &overlap_tot, NULL, NULL);
for (unsigned int i = 0; i < overlap_tot; i++) {
BVHTreeOverlap *ov = &overlap[i];
LineartTriangle *tri1 = lineart_get_triangle_from_index(rb, ov->indexA);
LineartTriangle *tri2 = lineart_get_triangle_from_index(rb, ov->indexB);
if (!tri1 || !tri2) {
continue;
}
if ((tri2->flags & LRT_TRIANGLE_INTERSECTION_ONLY) &&
(tri1->flags & LRT_TRIANGLE_INTERSECTION_ONLY)) {
continue;
}
/* Bounding box not overlapping or triangles share edges, not potential of intersecting. */
if (lineart_triangle_share_edge(tri1, tri2)) {
continue;
}
/* If we do need to compute intersection, then finally do it. */
lineart_triangle_intersect(rb, tri1, tri2);
}
#endif
MEM_freeN(overlap);
BLI_bvhtree_free(rb->bvh_main);
}
/**
* This function gets the tile for the point `e->v1`, and later use #lineart_bounding_area_next()
* to get next along the way.
@@ -4037,11 +4496,13 @@ static LineartBoundingArea *lineart_bounding_area_next(LineartBoundingArea *this
*/
bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
LineartGpencilModifierData *lmd,
LineartCache **cached_result)
LineartCache **cached_result,
bool enable_stroke_offset)
{
LineartRenderBuffer *rb;
Scene *scene = DEG_get_evaluated_scene(depsgraph);
int intersections_only = 0; /* Not used right now, but preserve for future. */
Object *use_camera;
double t_start;
@@ -4054,11 +4515,12 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
if (!scene->camera) {
return false;
}
use_camera = scene->camera;
LineartCache *lc = lineart_init_cache();
*cached_result = lc;
(*cached_result) = lc;
rb = lineart_create_render_buffer(scene, lmd, lc);
rb = lineart_create_render_buffer(scene, lmd, use_camera, scene->camera, lc);
/* Triangle thread testing data size varies depending on the thread count.
* See definition of LineartTriangleThread for details. */
@@ -4066,9 +4528,7 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
/* This is used to limit calculation to a certain level to save time, lines who have higher
* occlusion levels will get ignored. */
rb->max_occlusion_level = (lmd->flags & LRT_GPENCIL_USE_CACHE) ?
lmd->level_end_override :
(lmd->use_multiple_levels ? lmd->level_end : lmd->level_start);
rb->max_occlusion_level = lmd->level_end_override;
/* FIXME(Yiming): See definition of int #LineartRenderBuffer::_source_type for detailed. */
rb->_source_type = lmd->source_type;
@@ -4078,7 +4538,7 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
/* Get view vector before loading geometries, because we detect feature lines there. */
lineart_main_get_view_vector(rb);
lineart_main_load_geometries(
depsgraph, scene, scene->camera, rb, lmd->calculation_flags & LRT_ALLOW_DUPLI_OBJECTS);
depsgraph, scene, use_camera, rb, lmd->calculation_flags & LRT_ALLOW_DUPLI_OBJECTS);
if (!rb->vertex_buffer_pointers.first) {
/* No geometry loaded, return early. */
@@ -4108,6 +4568,14 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
* can do its job. */
lineart_main_add_triangles(rb);
#ifdef LINEART_WITH_BVH
lineart_do_intersections(rb);
#else
if (G.debug_value == 4000) {
printf("Legacy triangle isec pairs: %d\n", rb->debug_triangle_isec_test_count);
}
#endif
/* Link lines to acceleration structure, this can only be done after perspective division, if
* we do it after triangles being added, the acceleration structure has already been
* subdivided, this way we do less list manipulations. */
@@ -4139,10 +4607,22 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph,
/* This configuration ensures there won't be accidental lost of short unchained segments. */
MOD_lineart_chain_discard_short(rb, MIN2(*t_image, 0.001f) - FLT_EPSILON);
if (rb->chain_smooth_tolerance > FLT_EPSILON) {
/* Keeping UI range of 0-1 for ease of read while scaling down the actual value for best
* effective range in image-space (Coordinate only goes from -1 to 1). This value is
* somewhat arbitrary, but works best for the moment. */
MOD_lineart_smooth_chains(rb, rb->chain_smooth_tolerance / 50);
}
if (rb->angle_splitting_threshold > FLT_EPSILON) {
MOD_lineart_chain_split_angle(rb, rb->angle_splitting_threshold);
}
if (enable_stroke_offset && lmd->stroke_offset > FLT_EPSILON) {
MOD_lineart_chain_offset_towards_camera(
rb, lmd->stroke_offset, lmd->flags & LRT_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA);
}
/* Finally transfer the result list into cache. */
memcpy(&lc->chains, &rb->chains, sizeof(ListBase));
@@ -4234,7 +4714,7 @@ static void lineart_gpencil_generate(LineartCache *cache,
if (ec->level > level_end || ec->level < level_start) {
continue;
}
if (orig_ob && orig_ob != ec->object_ref) {
if (orig_ob && orig_ob != ec->object_ref && ec->type != LRT_EDGE_FLAG_INTERSECTION) {
continue;
}
if (orig_col && ec->object_ref) {
@@ -4266,6 +4746,19 @@ static void lineart_gpencil_generate(LineartCache *cache,
}
}
}
if (ec->type == LRT_EDGE_FLAG_INTERSECTION &&
(mask_switches & LRT_GPENCIL_INTERSECTION_FILTER)) {
if (mask_switches & LRT_GPENCIL_INTERSECTION_MATCH) {
if (ec->intersection_mask != intersection_mask) {
continue;
}
}
else {
if (!(ec->intersection_mask & intersection_mask)) {
continue;
}
}
}
/* Preserved: If we ever do asynchronous generation, this picked flag should be set here. */
// ec->picked = 1;
@@ -4376,26 +4869,20 @@ void MOD_lineart_gpencil_generate(LineartCache *cache,
Object *source_object = NULL;
Collection *source_collection = NULL;
short use_types = 0;
short use_types = edge_types;
if (source_type == LRT_SOURCE_OBJECT) {
if (!source_reference) {
return;
}
source_object = (Object *)source_reference;
/* Note that intersection lines will only be in collection. */
use_types = edge_types & (~LRT_EDGE_FLAG_INTERSECTION);
}
else if (source_type == LRT_SOURCE_COLLECTION) {
if (!source_reference) {
return;
}
source_collection = (Collection *)source_reference;
use_types = edge_types;
}
else {
/* Whole scene. */
use_types = edge_types;
}
float gp_obmat_inverse[4][4];
invert_m4_m4(gp_obmat_inverse, ob->obmat);
lineart_gpencil_generate(cache,

View File

@@ -38,26 +38,28 @@ struct LineartStaticMemPoolNode;
struct LineartEdge;
struct LineartRenderBuffer;
void *lineart_list_append_pointer_pool(ListBase *h, struct LineartStaticMemPool *smp, void *data);
void *lineart_list_append_pointer_pool_sized(ListBase *h,
void *lineart_list_append_pointer_pool(ListBase *list,
struct LineartStaticMemPool *smp,
void *data);
void *lineart_list_append_pointer_pool_sized(ListBase *list,
struct LineartStaticMemPool *smp,
void *data,
int size);
void *lineart_list_append_pointer_pool_thread(ListBase *h,
void *lineart_list_append_pointer_pool_thread(ListBase *list,
struct LineartStaticMemPool *smp,
void *data);
void *lineart_list_append_pointer_pool_sized_thread(ListBase *h,
void *lineart_list_append_pointer_pool_sized_thread(ListBase *list,
LineartStaticMemPool *smp,
void *data,
int size);
void *list_push_pointer_static(ListBase *h, struct LineartStaticMemPool *smp, void *p);
void *list_push_pointer_static_sized(ListBase *h,
void *list_push_pointer_static(ListBase *list, struct LineartStaticMemPool *smp, void *p);
void *list_push_pointer_static_sized(ListBase *list,
struct LineartStaticMemPool *smp,
void *p,
int size);
void *lineart_list_pop_pointer_no_free(ListBase *h);
void lineart_list_remove_pointer_item_no_free(ListBase *h, LinkData *lip);
void *lineart_list_pop_pointer_no_free(ListBase *list);
void lineart_list_remove_pointer_item_no_free(ListBase *list, LinkData *lip);
struct LineartStaticMemPoolNode *lineart_mem_new_static_pool(struct LineartStaticMemPool *smp,
size_t size);

View File

@@ -118,12 +118,12 @@ static bool bake_strokes(Object *ob,
}
LineartCache *local_lc = *lc;
if (!(*lc)) {
MOD_lineart_compute_feature_lines(dg, lmd, lc);
MOD_lineart_compute_feature_lines(dg, lmd, lc, (!(ob->dtx & OB_DRAW_IN_FRONT)));
MOD_lineart_destroy_render_data(lmd);
}
else {
if (is_first || (!(lmd->flags & LRT_GPENCIL_USE_CACHE))) {
MOD_lineart_compute_feature_lines(dg, lmd, &local_lc);
MOD_lineart_compute_feature_lines(dg, lmd, &local_lc, (!(ob->dtx & OB_DRAW_IN_FRONT)));
MOD_lineart_destroy_render_data(lmd);
}
MOD_lineart_chain_clear_picked_flag(local_lc);

View File

@@ -37,71 +37,73 @@
/* Line art memory and list helper */
void *lineart_list_append_pointer_pool(ListBase *h, LineartStaticMemPool *smp, void *data)
void *lineart_list_append_pointer_pool(ListBase *list, LineartStaticMemPool *smp, void *data)
{
LinkData *lip;
if (h == NULL) {
if (list == NULL) {
return 0;
}
lip = lineart_mem_acquire(smp, sizeof(LinkData));
lip->data = data;
BLI_addtail(h, lip);
BLI_addtail(list, lip);
return lip;
}
void *lineart_list_append_pointer_pool_sized(ListBase *h,
void *lineart_list_append_pointer_pool_sized(ListBase *list,
LineartStaticMemPool *smp,
void *data,
int size)
{
LinkData *lip;
if (h == NULL) {
if (list == NULL) {
return 0;
}
lip = lineart_mem_acquire(smp, size);
lip->data = data;
BLI_addtail(h, lip);
BLI_addtail(list, lip);
return lip;
}
void *lineart_list_append_pointer_pool_thread(ListBase *h, LineartStaticMemPool *smp, void *data)
void *lineart_list_append_pointer_pool_thread(ListBase *list,
LineartStaticMemPool *smp,
void *data)
{
LinkData *lip;
if (h == NULL) {
if (list == NULL) {
return 0;
}
lip = lineart_mem_acquire_thread(smp, sizeof(LinkData));
lip->data = data;
BLI_addtail(h, lip);
BLI_addtail(list, lip);
return lip;
}
void *lineart_list_append_pointer_pool_sized_thread(ListBase *h,
void *lineart_list_append_pointer_pool_sized_thread(ListBase *list,
LineartStaticMemPool *smp,
void *data,
int size)
{
LinkData *lip;
if (h == NULL) {
if (list == NULL) {
return 0;
}
lip = lineart_mem_acquire_thread(smp, size);
lip->data = data;
BLI_addtail(h, lip);
BLI_addtail(list, lip);
return lip;
}
void *lineart_list_pop_pointer_no_free(ListBase *h)
void *lineart_list_pop_pointer_no_free(ListBase *list)
{
LinkData *lip;
void *rev = 0;
if (h == NULL) {
if (list == NULL) {
return 0;
}
lip = BLI_pophead(h);
lip = BLI_pophead(list);
rev = lip ? lip->data : 0;
return rev;
}
void lineart_list_remove_pointer_item_no_free(ListBase *h, LinkData *lip)
void lineart_list_remove_pointer_item_no_free(ListBase *list, LinkData *lip)
{
BLI_remlink(h, (void *)lip);
BLI_remlink(list, (void *)lip);
}
LineartStaticMemPoolNode *lineart_mem_new_static_pool(LineartStaticMemPool *smp, size_t size)

View File

@@ -307,6 +307,8 @@
.calculation_flags = LRT_ALLOW_DUPLI_OBJECTS | LRT_ALLOW_CLIPPING_BOUNDARIES, \
.angle_splitting_threshold = DEG2RAD(60.0f), \
.chaining_image_threshold = 0.001f, \
.stroke_offset = 0.05,\
.overscan = 0.1f,\
}
#define _DNA_DEFAULT_LengthGpencilModifierData \

View File

@@ -926,13 +926,15 @@ typedef enum eLineArtGPencilModifierFlags {
LRT_GPENCIL_BINARY_WEIGHTS = (1 << 2) /* Deprecated, this is removed for lack of use case. */,
LRT_GPENCIL_IS_BAKED = (1 << 3),
LRT_GPENCIL_USE_CACHE = (1 << 4),
LRT_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA = (1 << 5),
} eLineArtGPencilModifierFlags;
typedef enum eLineartGpencilMaskSwitches {
LRT_GPENCIL_MATERIAL_MASK_ENABLE = (1 << 0),
/** When set, material mask bit comparisons are done with bit wise "AND" instead of "OR". */
/** Set to true means using "and" instead of "or" logic on mask bits. */
LRT_GPENCIL_MATERIAL_MASK_MATCH = (1 << 1),
LRT_GPENCIL_INTERSECTION_MATCH = (1 << 2),
LRT_GPENCIL_INTERSECTION_FILTER = (1 << 2),
LRT_GPENCIL_INTERSECTION_MATCH = (1 << 3),
} eLineartGpencilMaskSwitches;
struct LineartCache;
@@ -942,7 +944,7 @@ struct LineartCache;
typedef struct LineartGpencilModifierData {
GpencilModifierData modifier;
short edge_types; /* line type enable flags, bits in eLineartEdgeFlag */
uint16_t edge_types; /* line type enable flags, bits in eLineartEdgeFlag */
char source_type; /* Object or Collection, from eLineartGpencilModifierSource */
@@ -950,6 +952,9 @@ typedef struct LineartGpencilModifierData {
short level_start;
short level_end;
struct Object *source_camera;
struct Object *light_contour_object;
struct Object *source_object;
struct Collection *source_collection;
@@ -963,6 +968,12 @@ typedef struct LineartGpencilModifierData {
char source_vertex_group[64];
char vgname[64];
/* Camera focal length is divided by (1 + overscan), before caluclation, which give a wider FOV,
* this doesn't change coordinates range internally (-1, 1), but makes the caluclated frame
* bigger than actual output. This is for the easier shifting calculation. A value of 0.5 means
* the "internal" focal length become 2/3 of the actual camera. */
float overscan;
float opacity;
short thickness;
@@ -987,6 +998,9 @@ typedef struct LineartGpencilModifierData {
/* eLineArtGPencilModifierFlags, modifier internal state. */
int flags;
/* Move strokes towards camera to avoid clipping while preserve depth for the viewport. */
float stroke_offset;
/* Runtime data. */
/* Because we can potentially only compute features lines once per modifier stack (Use Cache), we

View File

@@ -70,6 +70,7 @@ typedef enum eLineartEdgeFlag {
/** Limited to 8 bits, DON'T ADD ANYMORE until improvements on the data structure. */
} eLineartEdgeFlag;
#define LRT_EDGE_FLAG_ALL_TYPE 0x3f
#define LRT_EDGE_FLAG_ALL_TYPE 0x7f
#define LRT_EDGE_FLAG_TYPE_MAX_BITS 7
#endif

View File

@@ -163,6 +163,10 @@ typedef enum eMaterialLineArtFlags {
LRT_MATERIAL_CUSTOM_OCCLUSION_EFFECTIVENESS = (1 << 1),
} eMaterialLineArtFlags;
#define LRT_TRANSPARENCY_BITS_DNA 0x3f /* Bits 1<<0 to 1<<6. */
#define LRT_TRANSPARENCY_BITS 0xfc /* Bits 1<<2 to 1<<7. */
#define LRT_OCCLUSION_EFFECTIVE_BITS 0x03 /* Bits 1<<0 to 1<<1. */
typedef struct Material {
ID id;
/** Animation data (must be immediately after id for utilities to use it). */

View File

@@ -2885,7 +2885,6 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
srna, "Line Art Modifier", "Generate line art strokes from selected source");
RNA_def_struct_sdna(srna, "LineartGpencilModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT);
RNA_define_lib_overridable(true);
prop = RNA_def_property(srna, "use_fuzzy_intersections", PROP_BOOLEAN, PROP_NONE);